lsst.afw  16.0-51-gb4b4a8566+2
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
lsst::afw::cameraGeom::TransformMap Class Referencefinal

A registry of 2-dimensional coordinate transforms for a specific camera. More...

#include <TransformMap.h>

Classes

class  Builder
 Helper class used to incrementally construct TransformMap instances. More...
 

Public Types

using Transforms = std::unordered_map< CameraSys, std::shared_ptr< geom::TransformPoint2ToPoint2 > >
 
using CameraSysIterator = boost::transform_iterator< GetKey, CameraSysFrameIdMap::const_iterator >
 

Public Member Functions

 ~TransformMap () noexcept
 
lsst::geom::Point2D transform (lsst::geom::Point2D const &point, CameraSys const &fromSys, CameraSys const &toSys) const
 Convert a point from one camera coordinate system to another. More...
 
std::vector< lsst::geom::Point2D > transform (std::vector< lsst::geom::Point2D > const &pointList, CameraSys const &fromSys, CameraSys const &toSys) const
 Convert a list of points from one coordinate system to another. More...
 
CameraSysIterator begin () const
 
CameraSysIterator end () const
 
bool contains (CameraSys const &system) const noexcept
 Can this transform to and from the specified coordinate system? More...
 
std::shared_ptr< geom::TransformPoint2ToPoint2 > getTransform (CameraSys const &fromSys, CameraSys const &toSys) const
 Get a Transform from one camera coordinate system to another. More...
 
size_t size () const noexcept
 Get the number of supported coordinate systems. More...
 
 TransformMap (TransformMap const &other)=delete
 
 TransformMap (TransformMap &&other)=delete
 
TransformMap & operator= (TransformMap const &)=delete
 
TransformMap & operator= (TransformMap &&)=delete
 

Static Public Member Functions

static std::shared_ptr< TransformMap const > make (CameraSys const &reference, Transforms const &transforms)
 Construct a TransformMap with all transforms relative to a single reference CameraSys. More...
 

Detailed Description

A registry of 2-dimensional coordinate transforms for a specific camera.

Represents the interrelationships between camera coordinate systems for a particular camera. It can be seen as a mapping between a pair of CameraSys and a Transform between them (though it does not conform to either the C++ map or Python dictionary APIs).

TransformMap supports:

TransformMap is immutable and must always be held by shared_ptr; this is enforced by making all non-deleted constructors private. Simple TransformMaps in which all transforms are relative to a single CameraSys can be constructed via the make static member function, while more general construction is provided by the Builder class.

Exception Safety
Unless otherwise specified, all methods guarantee only basic exception safety.

Definition at line 63 of file TransformMap.h.

Member Typedef Documentation

◆ CameraSysIterator

using lsst::afw::cameraGeom::TransformMap::CameraSysIterator = boost::transform_iterator<GetKey, CameraSysFrameIdMap::const_iterator>

Definition at line 76 of file TransformMap.h.

◆ Transforms

Definition at line 75 of file TransformMap.h.

Constructor & Destructor Documentation

◆ TransformMap() [1/2]

lsst::afw::cameraGeom::TransformMap::TransformMap ( TransformMap const &  other)
delete

TransformMap is immutable, so both moving and copying are prohibited. It is also always held by shared_ptr, so there is no good reason to copy it.

◆ TransformMap() [2/2]

lsst::afw::cameraGeom::TransformMap::TransformMap ( TransformMap &&  other)
delete

TransformMap is immutable, so both moving and copying are prohibited. It is also always held by shared_ptr, so there is no good reason to copy it.

◆ ~TransformMap()

lsst::afw::cameraGeom::TransformMap::~TransformMap ( )
defaultnoexcept

Member Function Documentation

◆ begin()

CameraSysIterator lsst::afw::cameraGeom::TransformMap::begin ( void  ) const
inline

Definition at line 130 of file TransformMap.h.

◆ contains()

bool lsst::afw::cameraGeom::TransformMap::contains ( CameraSys const &  system) const
noexcept

Can this transform to and from the specified coordinate system?

Parameters
systemThe coordinate system to search for
Returns
true if system is supported, false otherwise
Exception Safety
Shall not throw exceptions.

Definition at line 63 of file TransformMap.cc.

◆ end()

CameraSysIterator lsst::afw::cameraGeom::TransformMap::end ( void  ) const
inline

Definition at line 132 of file TransformMap.h.

◆ getTransform()

std::shared_ptr< geom::TransformPoint2ToPoint2 > lsst::afw::cameraGeom::TransformMap::getTransform ( CameraSys const &  fromSys,
CameraSys const &  toSys 
) const

Get a Transform from one camera coordinate system to another.

Parameters
fromSys,toSysCamera coordinate systems between which to transform
Returns
a Transform that converts from fromSys to toSys in the forward direction. The Transform will be invertible.
Exceptions
lsst::pex::exceptions::InvalidParameterErrorThrown if either fromSys or toSys is not supported.

Definition at line 65 of file TransformMap.cc.

◆ make()

std::shared_ptr< TransformMap const > lsst::afw::cameraGeom::TransformMap::make ( CameraSys const &  reference,
Transforms const &  transforms 
)
static

Construct a TransformMap with all transforms relative to a single reference CameraSys.

Parameters
referenceCoordinate system from which each Transform in transforms converts.
transformsA map whose keys are camera coordinate systems, and whose values point to Transforms that convert from reference to the corresponding key. All Transforms must be invertible.
Exceptions
lsst::pex::exceptions::InvalidParameterErrorThrown if transforms contains the reference camera system as a key, or if any Transform is not invertible.

Definition at line 38 of file TransformMap.cc.

◆ operator=() [1/2]

TransformMap& lsst::afw::cameraGeom::TransformMap::operator= ( TransformMap const &  )
delete

TransformMap is immutable, so both moving and copying are prohibited. It is also always held by shared_ptr, so there is no good reason to copy it.

◆ operator=() [2/2]

TransformMap& lsst::afw::cameraGeom::TransformMap::operator= ( TransformMap &&  )
delete

TransformMap is immutable, so both moving and copying are prohibited. It is also always held by shared_ptr, so there is no good reason to copy it.

◆ size()

size_t lsst::afw::cameraGeom::TransformMap::size ( ) const
noexcept

Get the number of supported coordinate systems.

Exception Safety
Shall not throw exceptions.

Definition at line 85 of file TransformMap.cc.

◆ transform() [1/2]

lsst::geom::Point2D lsst::afw::cameraGeom::TransformMap::transform ( lsst::geom::Point2D const &  point,
CameraSys const &  fromSys,
CameraSys const &  toSys 
) const

Convert a point from one camera coordinate system to another.

Parameters
pointPoint from which to transform
fromSys,toSysCamera coordinate systems between which to transform
Returns
the transformed value. Equivalent to getTransform(fromSys, toSys).applyForward(point).
Exceptions
lsst::pex::exceptions::InvalidParameterErrorThrown if either fromSys or toSys is not supported.

Definition at line 50 of file TransformMap.cc.

◆ transform() [2/2]

std::vector< lsst::geom::Point2D > lsst::afw::cameraGeom::TransformMap::transform ( std::vector< lsst::geom::Point2D > const &  pointList,
CameraSys const &  fromSys,
CameraSys const &  toSys 
) const

Convert a list of points from one coordinate system to another.

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.

Definition at line 56 of file TransformMap.cc.


The documentation for this class was generated from the following files: