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
Public Types | Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | List of all members
lsst::afw::geom::CoordinateBase< Derived, T, 2 > Class Template Reference

Specialization of CoordinateBase for 2 dimensions. More...

#include <CoordinateBase.h>

Public Types

typedef T Element
 
typedef Eigen::Matrix< T,
2, 1, Eigen::DontAlign > 
EigenVector
 

Public Member Functions

T & operator[] (int n)
 
T const & operator[] (int n) const
 
T & coeffRef (int n)
 
T const & coeffRef (int n) const
 
EigenVector const & asEigen () const
 Return a fixed-size Eigen representation of the coordinate object. More...
 
T const & getX () const
 
T const & getY () const
 
T & getX ()
 
T & getY ()
 
void setX (T x)
 
void setY (T y)
 
std::pair< T, T > asPair () const
 Return a std::pair representation of the coordinate object. More...
 
boost::tuple< T, T > asTuple () const
 Return a boost::tuple representation of the coordinate object. More...
 

Static Public Attributes

static int const dimensions = 2
 

Protected Member Functions

 CoordinateBase (T val=static_cast< T >(0))
 
template<typename Vector >
 CoordinateBase (Eigen::MatrixBase< Vector > const &vector)
 
void _swap (CoordinateBase &other)
 

Protected Attributes

EigenVector _vector
 

Detailed Description

template<typename Derived, typename T>
class lsst::afw::geom::CoordinateBase< Derived, T, 2 >

Specialization of CoordinateBase for 2 dimensions.

Definition at line 103 of file CoordinateBase.h.

Member Typedef Documentation

template<typename Derived , typename T >
typedef Eigen::Matrix<T,2,1,Eigen::DontAlign> lsst::afw::geom::CoordinateBase< Derived, T, 2 >::EigenVector

Definition at line 107 of file CoordinateBase.h.

template<typename Derived , typename T >
typedef T lsst::afw::geom::CoordinateBase< Derived, T, 2 >::Element

Definition at line 105 of file CoordinateBase.h.

Constructor & Destructor Documentation

template<typename Derived , typename T >
lsst::afw::geom::CoordinateBase< Derived, T, 2 >::CoordinateBase ( val = static_cast<T>(0))
inlineexplicitprotected

Definition at line 139 of file CoordinateBase.h.

139 : _vector(EigenVector::Constant(val)) {}
bool val
template<typename Derived , typename T >
template<typename Vector >
lsst::afw::geom::CoordinateBase< Derived, T, 2 >::CoordinateBase ( Eigen::MatrixBase< Vector > const &  vector)
inlineexplicitprotected

Definition at line 142 of file CoordinateBase.h.

Member Function Documentation

template<typename Derived , typename T >
void lsst::afw::geom::CoordinateBase< Derived, T, 2 >::_swap ( CoordinateBase< Derived, T, 2 > &  other)
inlineprotected

Definition at line 143 of file CoordinateBase.h.

143 {_vector.swap(other._vector);}
template<typename Derived , typename T >
EigenVector const& lsst::afw::geom::CoordinateBase< Derived, T, 2 >::asEigen ( ) const
inline

Return a fixed-size Eigen representation of the coordinate object.

The fact that this returns by const reference rather than by value should not be considered part of the API; this is merely an optimization enabled by the implementation.

Definition at line 121 of file CoordinateBase.h.

template<typename Derived , typename T >
std::pair<T,T> lsst::afw::geom::CoordinateBase< Derived, T, 2 >::asPair ( ) const
inline

Return a std::pair representation of the coordinate object.

Definition at line 132 of file CoordinateBase.h.

132 { return std::make_pair(_vector.x(),_vector.y()); }
template<typename Derived , typename T >
boost::tuple<T,T> lsst::afw::geom::CoordinateBase< Derived, T, 2 >::asTuple ( ) const
inline

Return a boost::tuple representation of the coordinate object.

Definition at line 135 of file CoordinateBase.h.

135 { return boost::make_tuple(_vector.x(),_vector.y()); }
template<typename Derived , typename T >
T& lsst::afw::geom::CoordinateBase< Derived, T, 2 >::coeffRef ( int  n)
inline

Definition at line 112 of file CoordinateBase.h.

112 { return _vector.coeffRef(n); }
template<typename Derived , typename T >
T const& lsst::afw::geom::CoordinateBase< Derived, T, 2 >::coeffRef ( int  n) const
inline

Definition at line 113 of file CoordinateBase.h.

template<typename Derived , typename T >
T const& lsst::afw::geom::CoordinateBase< Derived, T, 2 >::getX ( ) const
inline

Definition at line 124 of file CoordinateBase.h.

template<typename Derived , typename T >
T& lsst::afw::geom::CoordinateBase< Derived, T, 2 >::getX ( )
inline

Definition at line 126 of file CoordinateBase.h.

template<typename Derived , typename T >
T const& lsst::afw::geom::CoordinateBase< Derived, T, 2 >::getY ( ) const
inline

Definition at line 125 of file CoordinateBase.h.

template<typename Derived , typename T >
T& lsst::afw::geom::CoordinateBase< Derived, T, 2 >::getY ( )
inline

Definition at line 127 of file CoordinateBase.h.

template<typename Derived , typename T >
T& lsst::afw::geom::CoordinateBase< Derived, T, 2 >::operator[] ( int  n)
inline

Definition at line 110 of file CoordinateBase.h.

template<typename Derived , typename T >
T const& lsst::afw::geom::CoordinateBase< Derived, T, 2 >::operator[] ( int  n) const
inline

Definition at line 111 of file CoordinateBase.h.

111 { return const_cast<EigenVector&>(_vector)[n]; }
Eigen::Matrix< T, 2, 1, Eigen::DontAlign > EigenVector
template<typename Derived , typename T >
void lsst::afw::geom::CoordinateBase< Derived, T, 2 >::setX ( x)
inline

Definition at line 128 of file CoordinateBase.h.

template<typename Derived , typename T >
void lsst::afw::geom::CoordinateBase< Derived, T, 2 >::setY ( y)
inline

Definition at line 129 of file CoordinateBase.h.

Member Data Documentation

template<typename Derived , typename T >
EigenVector lsst::afw::geom::CoordinateBase< Derived, T, 2 >::_vector
protected

Definition at line 144 of file CoordinateBase.h.

template<typename Derived , typename T >
int const lsst::afw::geom::CoordinateBase< Derived, T, 2 >::dimensions = 2
static

Definition at line 106 of file CoordinateBase.h.


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