LSSTApplications
10.0+286,10.0+36,10.0+46,10.0-2-g4f67435,10.1+152,10.1+37,11.0,11.0+1,11.0-1-g47edd16,11.0-1-g60db491,11.0-1-g7418c06,11.0-2-g04d2804,11.0-2-g68503cd,11.0-2-g818369d,11.0-2-gb8b8ce7
LSSTDataManagementBasePackage
|
#include <TransformMap.h>
Public Types | |
typedef std::map< CoordSysT, boost::shared_ptr< XYTransform const > > | Transforms |
typedef CoordSysT | CoordSys |
Public Member Functions | |
TransformMap (CoordSysT const &nativeCoordSys, Transforms const &transforms) | |
TransformMap () | |
null implementation to make SWIG willing to wrap a map that contains these More... | |
Point2D | transform (Point2D const &fromPoint, CoordSysT const &fromSys, CoordSysT const &toCoordSys) const |
std::vector< Point2D > | transform (std::vector< Point2D > const &pointList, CoordSysT const &fromCoordSys, CoordSysT const &toCoordSys) const |
CoordSysT | getNativeCoordSys () const |
std::vector< CoordSysT > | getCoordSysList () const |
bool | contains (CoordSysT const &coordSys) const |
boost::shared_ptr< XYTransform const > | operator[] (CoordSysT const &coordSys) const |
Transforms::const_iterator | begin () const |
Transforms::const_iterator | end () const |
size_t | size () const |
Private Attributes | |
CoordSysT | _nativeCoordSys |
native coordinate system More... | |
Transforms | _transforms |
map of coordSys: XYTransform More... | |
A registry of 2-dimensional coordinate transforms, templated on a coordinate system type
Contains a native CoordSysT and a map of CoordSysT:XYTransform (including an identity transform entry for native CoordSysT). Each map entry is an XYTransform whose forwardTransform method converts from the native system to CoordSysT.
TransformMap supports transforming between any two supported CoordSysT using the transform method. It also allows iteration over the map of CoordSysT: XYTransform:
If CoordSysT is not a plain old data type or std::string then:
At some point we will switch to using std::unordered_map (once we switch to C++11 and a SWIG that supports its collection classes). At that point instead of requiring CoordSysT.operator<, it will be necessary to specialize std::hash<CoordSysT>(CoordSysT const &).
Definition at line 65 of file TransformMap.h.
typedef CoordSysT lsst::afw::geom::TransformMap< CoordSysT >::CoordSys |
Definition at line 68 of file TransformMap.h.
typedef std::map<CoordSysT, boost::shared_ptr< XYTransform const> > lsst::afw::geom::TransformMap< CoordSysT >::Transforms |
Definition at line 67 of file TransformMap.h.
|
explicit |
Construct a TransformMap
pexExcept::InvalidParameterError | if you specify the same coordSys more than once, or a transform is specified where coordSys == nativeCoordSys |
nativeCoordSys | Native coordinate system for this registry |
transforms | a map of coordSys:xyTransform, where xyTransform.forward transforms coordSys to nativeCoordSys |
Definition at line 38 of file TransformMapImpl.h.
|
explicit |
null implementation to make SWIG willing to wrap a map that contains these
Definition at line 66 of file TransformMapImpl.h.
|
inline |
Definition at line 142 of file TransformMap.h.
bool lsst::afw::geom::TransformMap< CoordSysT >::contains | ( | CoordSysT const & | coordSys | ) | const |
Return true if the coordinate system is supported
In Python this is renamed to contains; use as follows: coordSys in transformMap
coordSys | coordinate system |
Definition at line 146 of file TransformMapImpl.h.
|
inline |
Definition at line 144 of file TransformMap.h.
std::vector< CoordSysT > lsst::afw::geom::TransformMap< CoordSysT >::getCoordSysList | ( | ) | const |
Get a list of supported coordinate systems
Definition at line 123 of file TransformMapImpl.h.
|
inline |
Definition at line 112 of file TransformMap.h.
boost::shared_ptr< XYTransform const > lsst::afw::geom::TransformMap< CoordSysT >::operator[] | ( | CoordSysT const & | coordSys | ) | const |
Get an XYTransform that transforms from coordSys to nativeCoordSys in the forward direction
pexExcept::InvalidParameterError | if coordSys is unknown |
coordSys | coordinate system whose XYTransform is wanted |
Definition at line 133 of file TransformMapImpl.h.
|
inline |
Definition at line 146 of file TransformMap.h.
Point2D lsst::afw::geom::TransformMap< CoordSysT >::transform | ( | Point2D const & | fromPoint, |
CoordSysT const & | fromSys, | ||
CoordSysT const & | toCoordSys | ||
) | const |
Convert a point from one coordinate system to another
pexExcept::InvalidParameterError | if toCoordSys is unknown |
fromPoint | point from which to transform |
fromSys | coordinate system from which to transform |
toCoordSys | coordinate system to which to transform |
Definition at line 70 of file TransformMapImpl.h.
std::vector< Point2D > lsst::afw::geom::TransformMap< CoordSysT >::transform | ( | std::vector< Point2D > const & | pointList, |
CoordSysT const & | fromCoordSys, | ||
CoordSysT const & | toCoordSys | ||
) | const |
Convert a list of Point2D from one coordinate system to another
pexExcept::InvalidParameterError | if fromCoordSys or toCoordSys is unknown |
pointList | list of points to transform |
fromCoordSys | from coordinate system |
toCoordSys | to coordinate system |
Definition at line 86 of file TransformMapImpl.h.
|
private |
native coordinate system
Definition at line 149 of file TransformMap.h.
|
private |
map of coordSys: XYTransform
Definition at line 150 of file TransformMap.h.