25 #ifndef LSST_AFW_GEOM_ELLIPSES_BaseCore_h_INCLUDED
26 #define LSST_AFW_GEOM_ELLIPSES_BaseCore_h_INCLUDED
35 #include "boost/shared_ptr.hpp"
36 #include "boost/make_shared.hpp"
43 namespace lsst {
namespace afw {
namespace geom {
namespace ellipses {
63 typedef boost::shared_ptr<BaseCore>
Ptr;
64 typedef boost::shared_ptr<BaseCore const>
ConstPtr;
73 static Ptr make(std::string
const &
name,
double v1,
double v2,
double v3);
84 virtual std::string
getName()
const = 0;
96 void grow(
double buffer);
99 void scale(
double factor);
187 template <
typename Output> Converter<Output>
as()
const;
197 template <
typename T>
205 double ixx,
double iyy,
double ixy,
206 double & a,
double &
b,
double & theta
210 double ixx,
double iyy,
double ixy,
211 double & a,
double &
b,
double & theta
215 double a,
double b,
double theta,
216 double & ixx,
double & iyy,
double & ixy
220 double a,
double b,
double theta,
221 double & ixx,
double & iyy,
double & ixy
227 virtual void _assignToAxes(
double & a,
double &
b,
double & theta)
const = 0;
240 template <
typename Output>
241 struct BaseCore::Converter {
246 operator Output()
const {
return Output(
input); }
247 boost::shared_ptr<Output>
copy()
const {
return boost::shared_ptr<Output>(
new Output(
input)); }
250 template <
typename Output>
259 #endif // !LSST_AFW_GEOM_ELLIPSES_BaseCore_h_INCLUDED
boost::shared_ptr< BaseCore > Ptr
virtual void _assignToAxes(double &a, double &b, double &theta) const =0
ParameterVector const getParameterVector() const
Return the core parameters as a vector.
boost::shared_ptr< Output > copy() const
virtual void _assignToQuadrupole(double &ixx, double &iyy, double &ixy) const =0
table::Key< std::string > name
bool operator!=(BaseCore const &other) const
Compare two ellipse cores for inequality.
static void _assignAxesToQuadrupole(double a, double b, double theta, double &ixx, double &iyy, double &ixy)
GridTransform const getGridTransform() const
Return the transform that maps the ellipse to the unit circle.
double getArea() const
Return the area of the ellipse core.
void scale(double factor)
Scale the size of the ellipse core by the given factor.
Ptr clone() const
Deep-copy the Core.
virtual Jacobian _dAssignFromAxes(double a, double b, double theta)=0
virtual Jacobian _dAssignFromQuadrupole(double ixx, double iyy, double ixy)=0
Jacobian dAssign(BaseCore const &other)
Assign other to this and return the derivative of the conversion, d(this)/d(other).
static void registerSubclass(Ptr const &example)
boost::shared_ptr< BaseCore const > ConstPtr
static void _assignQuadrupoleToAxes(double ixx, double iyy, double ixy, double &a, double &b, double &theta)
Eigen::Vector3d ParameterVector
Parameter vector type.
virtual void _assignFromAxes(double a, double b, double theta)=0
virtual void _assignFromQuadrupole(double ixx, double iyy, double ixy)=0
Converter< Output > as() const
Convert this to the core type specified as a template parameter.
Convolution convolve(BaseCore const &other)
static Ptr make(std::string const &name)
double getTraceRadius() const
Return the radius defined as the square root of one half the trace of the quadrupole matrix...
double getDeterminantRadius() const
Return the radius defined as the 4th root of the determinant of the quadrupole matrix.
BaseCore & operator=(BaseCore const &other)
Set the parameters of this ellipse core from another.
virtual void normalize()=0
Put the parameters into a "standard form", and throw InvalidParameterError if they cannot be normaliz...
virtual std::string getName() const =0
Return a string that identifies this parametrization.
virtual void writeParameters(double *iter) const =0
static Jacobian _dAssignAxesToQuadrupole(double a, double b, double theta, double &ixx, double &iyy, double &ixy)
Transformer transform(LinearTransform const &transform)
A base class for parametrizations of the "core" of an ellipse - the ellipticity and size...
void grow(double buffer)
Increase the major and minor radii of the ellipse core by the given buffer.
virtual void readParameters(double const *iter)=0
static Jacobian _dAssignQuadrupoleToAxes(double ixx, double iyy, double ixy, double &a, double &b, double &theta)
A functor that returns points on the boundary of the ellipse as a function of a parameter that runs b...
bool operator==(BaseCore const &other) const
Compare two ellipse cores for equality.
Eigen::Matrix3d Jacobian
Parameter Jacobian matrix type.
afw::table::Key< double > b
virtual BaseCore::Ptr _clone() const =0
virtual Jacobian _dAssignToAxes(double &a, double &b, double &theta) const =0
void setParameterVector(ParameterVector const &vector)
Set the core parameters from a vector.
A temporary-only expression object for ellipse core convolution.
Extent2D computeDimensions() const
Return the size of the bounding box for the ellipse core.
virtual Jacobian _dAssignToQuadrupole(double &ixx, double &iyy, double &ixy) const =0
Include files required for standard LSST Exception handling.
Converter(BaseCore const &input_)