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
Classes | Public Types | Public Member Functions | Private Attributes | List of all members
lsst::afw::geom::ellipses::Ellipse Class Reference

An ellipse defined by an arbitrary BaseCore and a center point. More...

#include <Ellipse.h>

Classes

class  Convolution
 A temporary-only expression object for ellipse convolution. More...
 
class  GridTransform
 A temporary-only expression object representing an AffineTransform that maps the Ellipse to a unit circle at the origin. More...
 
class  Transformer
 A temporary-only expression object for ellipse transformations. More...
 

Public Types

enum  ParameterEnum { X =3, Y =4 }
 
typedef Eigen::Matrix< double, 5, 1 > ParameterVector
 Proxy return type for Ellipse::convolve(). More...
 
typedef boost::shared_ptr
< Ellipse
Ptr
 
typedef boost::shared_ptr
< Ellipse const > 
ConstPtr
 

Public Member Functions

Point2D const & getCenter () const
 Return the center point. More...
 
Point2DgetCenter ()
 Return the center point. More...
 
void setCenter (Point2D const &center)
 Set the center point. More...
 
BaseCore const & getCore () const
 Return the ellipse core. More...
 
BaseCoregetCore ()
 Return the ellipse core. More...
 
BaseCore::ConstPtr getCorePtr () const
 Return the ellipse core. More...
 
BaseCore::Ptr getCorePtr ()
 Return the ellipse core. More...
 
void setCore (BaseCore const &core)
 Set the ellipse core; the type of the core is not changed. More...
 
void normalize ()
 Put the parameters in a standard form. More...
 
void grow (double buffer)
 Increase the major and minor radii of the ellipse by the given buffer. More...
 
void scale (double factor)
 Scale the size of the ellipse by the given factor. More...
 
void shift (Extent2D const &offset)
 Move the ellipse center by the given offset. More...
 
ParameterVector const getParameterVector () const
 Return the ellipse parameters as a vector. More...
 
void setParameterVector (ParameterVector const &vector)
 Set the ellipse parameters from a vector. More...
 
void readParameters (double const *iter)
 
void writeParameters (double *iter) const
 
GridTransform const getGridTransform () const
 Return the transform that maps the ellipse to the unit circle. More...
 
Box2D computeBBox () const
 Return the bounding box of the ellipse. More...
 
Ellipseoperator= (Ellipse const &other)
 Set the parameters of this ellipse from another. More...
 
bool operator== (Ellipse const &other) const
 Compare two ellipses for equality. More...
 
bool operator!= (Ellipse const &other) const
 Compare two ellipses for inequality. More...
 
virtual ~Ellipse ()
 
 Ellipse (BaseCore const &core, Point2D const &center=Point2D())
 
 Ellipse (BaseCore::ConstPtr const &core, Point2D const &center=Point2D())
 
 Ellipse (Transformer const &other)
 
 Ellipse (Convolution const &other)
 
 Ellipse (Ellipse const &other)
 
Coordinate transforms

These member functions transform the ellipse by the given AffineTransform. The transform can be done in-place by calling inPlace() on the returned expression object, or returned as a new shared_ptr by calling copy().

Transformer transform (AffineTransform const &transform)
 
Transformer const transform (AffineTransform const &transform) const
 
Convolve two bivariate Gaussians defined by their 1-sigma ellipses.
Convolution convolve (Ellipse const &other)
 
Convolution const convolve (Ellipse const &other) const
 

Private Attributes

BaseCore::Ptr _core
 
Point2D _center
 

Detailed Description

An ellipse defined by an arbitrary BaseCore and a center point.

An ellipse is composed of its center coordinate and its Core - a parametrization of the ellipticity and size of the ellipse. Setting the core of an ellipse never changes the type of the contained core, it merely sets the parameters of that core by converting the parameters.

Definition at line 50 of file Ellipse.h.

Member Typedef Documentation

typedef boost::shared_ptr<Ellipse const> lsst::afw::geom::ellipses::Ellipse::ConstPtr

Definition at line 61 of file Ellipse.h.

typedef Eigen::Matrix<double,5,1> lsst::afw::geom::ellipses::Ellipse::ParameterVector

Proxy return type for Ellipse::convolve().

Parameter vector type.

Definition at line 55 of file Ellipse.h.

Definition at line 60 of file Ellipse.h.

Member Enumeration Documentation

Enumerator
X 
Y 

Definition at line 63 of file Ellipse.h.

Constructor & Destructor Documentation

virtual lsst::afw::geom::ellipses::Ellipse::~Ellipse ( )
inlinevirtual

Definition at line 165 of file Ellipse.h.

165 {}
lsst::afw::geom::ellipses::Ellipse::Ellipse ( BaseCore const &  core,
Point2D const &  center = Point2D() 
)
inlineexplicit

Definition at line 167 of file Ellipse.h.

167  :
168  _core(core.clone()), _center(center) {}
lsst::afw::geom::ellipses::Ellipse::Ellipse ( BaseCore::ConstPtr const &  core,
Point2D const &  center = Point2D() 
)
inlineexplicit

Definition at line 170 of file Ellipse.h.

170  :
171  _core(core->clone()), _center(center) {}
lsst::afw::geom::ellipses::Ellipse::Ellipse ( Ellipse::Transformer const &  other)
inline

Definition at line 133 of file Transformer.h.

133  :
134  _core(other.input.getCore().transform(other.transform.getLinear()).copy()),
135  _center(other.transform(other.input.getCenter()))
136 {}
SelectEigenView< T >::Type copy(Eigen::EigenBase< T > const &other)
Copy an arbitrary Eigen expression into a new EigenView.
Definition: eigen.h:390
lsst::afw::geom::ellipses::Ellipse::Ellipse ( Convolution const &  other)
lsst::afw::geom::ellipses::Ellipse::Ellipse ( Ellipse const &  other)
inline

Definition at line 178 of file Ellipse.h.

178  :
179  _core(other.getCore().clone()), _center(other.getCenter()) {}

Member Function Documentation

Box2D lsst::afw::geom::ellipses::Ellipse::computeBBox ( ) const

Return the bounding box of the ellipse.

Ellipse::Convolution lsst::afw::geom::ellipses::Ellipse::convolve ( Ellipse const &  other)
inline

Definition at line 105 of file Convolution.h.

105  {
106  return Ellipse::Convolution(*this, other);
107 }
Ellipse::Convolution const lsst::afw::geom::ellipses::Ellipse::convolve ( Ellipse const &  other) const
inline

Definition at line 109 of file Convolution.h.

109  {
110  return Ellipse::Convolution(const_cast<Ellipse &>(*this), other);
111 }
Point2D const& lsst::afw::geom::ellipses::Ellipse::getCenter ( ) const
inline

Return the center point.

Definition at line 66 of file Ellipse.h.

66 { return _center; }
Point2D& lsst::afw::geom::ellipses::Ellipse::getCenter ( )
inline

Return the center point.

Definition at line 69 of file Ellipse.h.

69 { return _center; }
BaseCore const& lsst::afw::geom::ellipses::Ellipse::getCore ( ) const
inline

Return the ellipse core.

Definition at line 75 of file Ellipse.h.

75 { return *_core; }
BaseCore& lsst::afw::geom::ellipses::Ellipse::getCore ( )
inline

Return the ellipse core.

Definition at line 78 of file Ellipse.h.

78 { return *_core; }
BaseCore::ConstPtr lsst::afw::geom::ellipses::Ellipse::getCorePtr ( ) const
inline

Return the ellipse core.

Definition at line 81 of file Ellipse.h.

81 { return _core; }
BaseCore::Ptr lsst::afw::geom::ellipses::Ellipse::getCorePtr ( )
inline

Return the ellipse core.

Definition at line 84 of file Ellipse.h.

84 { return _core; }
Ellipse::GridTransform const lsst::afw::geom::ellipses::Ellipse::getGridTransform ( ) const
inline

Return the transform that maps the ellipse to the unit circle.

The returned proxy object is implicitly convertible to AffineTransform and also supports differentiation.

Definition at line 114 of file GridTransform.h.

114  {
115  return Ellipse::GridTransform(*this);
116 }
ParameterVector const lsst::afw::geom::ellipses::Ellipse::getParameterVector ( ) const

Return the ellipse parameters as a vector.

void lsst::afw::geom::ellipses::Ellipse::grow ( double  buffer)
inline

Increase the major and minor radii of the ellipse by the given buffer.

Definition at line 93 of file Ellipse.h.

93 { _core->grow(buffer); }
void lsst::afw::geom::ellipses::Ellipse::normalize ( )
inline

Put the parameters in a standard form.

Definition at line 90 of file Ellipse.h.

90 { _core->normalize(); }
bool lsst::afw::geom::ellipses::Ellipse::operator!= ( Ellipse const &  other) const
inline

Compare two ellipses for inequality.

Ellipses are only equal if they have the same Core types.

Definition at line 163 of file Ellipse.h.

163 { return !operator==(other); }
bool operator==(Ellipse const &other) const
Compare two ellipses for equality.
Definition: Ellipse.h:154
Ellipse& lsst::afw::geom::ellipses::Ellipse::operator= ( Ellipse const &  other)

Set the parameters of this ellipse from another.

This does not change the parametrization of the ellipse.

bool lsst::afw::geom::ellipses::Ellipse::operator== ( Ellipse const &  other) const
inline

Compare two ellipses for equality.

Ellipses are only equal if they have the same Core types.

Definition at line 154 of file Ellipse.h.

154  {
155  return getCenter() == other.getCenter() && getCore() == other.getCore();
156  }
Point2D const & getCenter() const
Return the center point.
Definition: Ellipse.h:66
BaseCore const & getCore() const
Return the ellipse core.
Definition: Ellipse.h:75
void lsst::afw::geom::ellipses::Ellipse::readParameters ( double const *  iter)
void lsst::afw::geom::ellipses::Ellipse::scale ( double  factor)
inline

Scale the size of the ellipse by the given factor.

Definition at line 96 of file Ellipse.h.

96 { _core->scale(factor); }
void lsst::afw::geom::ellipses::Ellipse::setCenter ( Point2D const &  center)
inline

Set the center point.

Definition at line 72 of file Ellipse.h.

72 { _center = center; }
void lsst::afw::geom::ellipses::Ellipse::setCore ( BaseCore const &  core)
inline

Set the ellipse core; the type of the core is not changed.

Definition at line 87 of file Ellipse.h.

87 { *_core = core; }
void lsst::afw::geom::ellipses::Ellipse::setParameterVector ( ParameterVector const &  vector)

Set the ellipse parameters from a vector.

void lsst::afw::geom::ellipses::Ellipse::shift ( Extent2D const &  offset)
inline

Move the ellipse center by the given offset.

Definition at line 99 of file Ellipse.h.

99 { _center += offset; }
Ellipse::Transformer lsst::afw::geom::ellipses::Ellipse::transform ( AffineTransform const &  transform)
inline

Definition at line 125 of file Transformer.h.

125  {
126  return Ellipse::Transformer(*this,transform);
127 }
Transformer transform(AffineTransform const &transform)
Definition: Transformer.h:125
Ellipse::Transformer const lsst::afw::geom::ellipses::Ellipse::transform ( AffineTransform const &  transform) const
inline

Definition at line 129 of file Transformer.h.

129  {
130  return Ellipse::Transformer(const_cast<Ellipse &>(*this),transform);
131 }
Transformer transform(AffineTransform const &transform)
Definition: Transformer.h:125
void lsst::afw::geom::ellipses::Ellipse::writeParameters ( double *  iter) const

Member Data Documentation

Point2D lsst::afw::geom::ellipses::Ellipse::_center
private

Definition at line 183 of file Ellipse.h.

BaseCore::Ptr lsst::afw::geom::ellipses::Ellipse::_core
private

Definition at line 182 of file Ellipse.h.


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