|
lsst.afw
14.0
|
A registry of 2-dimensional coordinate transforms, templated on a coordinate system type. More...
#include <TransformMap.h>
Public Types | |
| typedef std::map< CoordSysT, std::shared_ptr< XYTransform const > > | Transforms |
| typedef CoordSysT | CoordSys |
Public Member Functions | |
| TransformMap (CoordSysT const &nativeCoordSys, Transforms const &transforms) | |
| Construct a TransformMap. More... | |
| 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 |
| Convert a point from one coordinate system to another. More... | |
| std::vector< Point2D > | transform (std::vector< Point2D > const &pointList, CoordSysT const &fromCoordSys, CoordSysT const &toCoordSys) const |
| Convert a list of Point2D from one coordinate system to another. More... | |
| CoordSysT | getNativeCoordSys () const |
| std::vector< CoordSysT > | getCoordSysList () const |
| Get a list of supported coordinate systems. More... | |
| bool | contains (CoordSysT const &coordSys) const |
| Return true if the coordinate system is supported. More... | |
| std::shared_ptr< XYTransform const > | operator[] (CoordSysT const &coordSys) const |
| Get an XYTransform that transforms from coordSys to nativeCoordSys in the forward direction. More... | |
| Transforms::const_iterator | begin () const |
| Transforms::const_iterator | end () const |
| size_t | size () const |
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, std::shared_ptr<XYTransform const> > lsst::afw::geom::TransformMap< CoordSysT >::Transforms |
Definition at line 67 of file TransformMap.h.
|
explicit |
Construct a TransformMap.
| pex::exceptions::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 36 of file TransformMapImpl.h.
|
explicit |
null implementation to make SWIG willing to wrap a map that contains these
Definition at line 59 of file TransformMapImpl.h.
|
inline |
Definition at line 138 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 131 of file TransformMapImpl.h.
|
inline |
Definition at line 140 of file TransformMap.h.
| std::vector< CoordSysT > lsst::afw::geom::TransformMap< CoordSysT >::getCoordSysList | ( | ) | const |
Get a list of supported coordinate systems.
Definition at line 110 of file TransformMapImpl.h.
|
inline |
Definition at line 109 of file TransformMap.h.
| std::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.
| pex::exceptions::InvalidParameterError | if coordSys is unknown |
| coordSys | coordinate system whose XYTransform is wanted |
Definition at line 120 of file TransformMapImpl.h.
|
inline |
Definition at line 142 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.
| pex::exceptions::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 62 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.
| pex::exceptions::InvalidParameterError | if fromCoordSys or toCoordSys is unknown |
| pointList | list of points to transform |
| fromCoordSys | from coordinate system |
| toCoordSys | to coordinate system |
Definition at line 75 of file TransformMapImpl.h.
1.8.5