Public Member Functions | Protected Member Functions | List of all members
mirtk::Plane Class Reference

#include <Plane.h>

Inheritance diagram for mirtk::Plane:
Inheritance graph
Collaboration diagram for mirtk::Plane:
Collaboration graph

Public Member Functions

double Distance (const Point &p) const
 
double Distance (const double p[3]) const
 
double Distance (double x, double y, double z) const
 
double Evaluate (const Point &p) const
 
double Evaluate (const double p[3]) const
 
double Evaluate (double x, double y, double z) const
 
double Fit (const PointSet &points)
 
void Normal (const Vector3 &n)
 Set normal vector.
 
void Normal (double n[3])
 
void Normal (double nx, double ny, double nz)
 
Planeoperator= (const Plane &)
 Assignment operator.
 
 Plane ()
 Default constructor.
 
 Plane (const Vector3 &n, double b)
 
 Plane (double n[3], double b)
 
 Plane (double nx, double ny, double nz, double b)
 
 Plane (const Plane &)
 Copy constructor.
 
ostream & Print (ostream &os, Indent=0) const
 Print plane equation.
 
void Print (Indent=0) const
 Print plane equation to standard output stream.
 
void Project (const Point &p, double &u, double &v) const
 
void Project (const double p[3], double &u, double &v) const
 
void Project (double x, double y, double z, double &u, double &v) const
 
virtual ~Plane ()
 Destructor.
 
- Public Member Functions inherited from mirtk::Object
virtual const char * NameOfClass () const =0
 Get name of class, which this object is an instance of.
 
virtual ParameterList Parameter () const
 Get parameter name/value pairs.
 
bool Parameter (const ParameterList &)
 Set parameters from name/value pairs.
 
virtual bool Set (const char *name, const char *value)
 
virtual ~Object ()
 Destructor.
 

Protected Member Functions

void UpdateOrigin ()
 Update origin after change of plane normal.
 
void UpdateTangents ()
 Update tangent vectors after change of plane normal.
 
- Protected Member Functions inherited from mirtk::Object
template<typename... Args>
void Throw (ErrorType err, const char *func, Args... args) const
 

Additional Inherited Members

- Static Public Member Functions inherited from mirtk::Object
static const char * NameOfType ()
 Get name of this class type.
 
- Static Protected Member Functions inherited from mirtk::Object
template<typename... Args>
static void ThrowStatic (ErrorType err, const char *cls, const char *func, Args... args)
 

Detailed Description

Plane in 3D space.

The plane is stored in Hessian normal form. Additionally, the two orthonormal tangent vectors to the plane normal are stored which are used for projecting points onto the plane and expressing these as 2D (u, v) coordinates along these in-plane axes. The vectors Plane::Tangent1, Plane::Tangent2, and Plane::Normal form a right-handed coordinate system.

Definition at line 42 of file Plane.h.

Constructor & Destructor Documentation

§ Plane() [1/3]

mirtk::Plane::Plane ( const Vector3 n,
double  b 
)
inline

Construct plane given its Hessian normal form parameters

Parameters
[in]nNormal vector.
[in]bDistance of plane to origin.

Definition at line 248 of file Plane.h.

§ Plane() [2/3]

mirtk::Plane::Plane ( double  n[3],
double  b 
)
inline

Construct plane given its Hessian normal form parameters

Parameters
[in]nNormal vector.
[in]bDistance of plane to origin.

Definition at line 258 of file Plane.h.

§ Plane() [3/3]

mirtk::Plane::Plane ( double  nx,
double  ny,
double  nz,
double  b 
)
inline

Construct plane given its Hessian normal form parameters

Parameters
[in]nxFirst component of normal vector.
[in]nySecond component of normal vector.
[in]nzThird component of normal vector.
[in]bDistance of plane to origin.

Definition at line 268 of file Plane.h.

Member Function Documentation

§ Distance() [1/3]

double mirtk::Plane::Distance ( const Point p) const
inline

Evaluates plane equation for a given point

Parameters
[in]pPoint.
Returns
Signed distance of point to plane.

Definition at line 359 of file Plane.h.

§ Distance() [2/3]

double mirtk::Plane::Distance ( const double  p[3]) const
inline

Evaluates plane equation for a given point

Parameters
[in]pPoint.
Returns
Signed distance of point to plane.

Definition at line 365 of file Plane.h.

§ Distance() [3/3]

double mirtk::Plane::Distance ( double  x,
double  y,
double  z 
) const
inline

Evaluates plane equation for a given point

Parameters
[in]xFirst coordinate of point.
[in]ySecond coordinate of point.
[in]zThird coordinate of point.
Returns
Signed distance of point to plane.

Definition at line 371 of file Plane.h.

§ Evaluate() [1/3]

double mirtk::Plane::Evaluate ( const Point p) const
inline

Evaluates plane equation for a given point

Parameters
[in]pPoint.
Returns
Signed distance of point to plane.

Definition at line 341 of file Plane.h.

§ Evaluate() [2/3]

double mirtk::Plane::Evaluate ( const double  p[3]) const
inline

Evaluates plane equation for a given point

Parameters
[in]pPoint.
Returns
Signed distance of point to plane.

Definition at line 347 of file Plane.h.

§ Evaluate() [3/3]

double mirtk::Plane::Evaluate ( double  x,
double  y,
double  z 
) const
inline

Evaluates plane equation for a given point

Parameters
[in]xFirst coordinate of point.
[in]ySecond coordinate of point.
[in]zThird coordinate of point.
Returns
Signed distance of point to plane.

Definition at line 353 of file Plane.h.

§ Fit()

double mirtk::Plane::Fit ( const PointSet points)

Fit plane to a set of points

Parameters
[in]pointsPoint cloud.
Returns
RMS error of the regression.

§ Normal() [1/2]

void mirtk::Plane::Normal ( double  n[3])
inline

Set normal vector

Parameters
[in]nNormal vector.

Definition at line 317 of file Plane.h.

§ Normal() [2/2]

void mirtk::Plane::Normal ( double  nx,
double  ny,
double  nz 
)
inline

Set normal vector

Parameters
[in]nxFirst component of normal vector.
[in]nySecond component of normal vector.
[in]nzThird component of normal vector.

Definition at line 327 of file Plane.h.

§ Project() [1/3]

void mirtk::Plane::Project ( const Point p,
double &  u,
double &  v 
) const
inline

Project point onto plane

Parameters
[in]pPoint.
[out]uCoordinate of projected point along Tangent1.
[out]vCoordinate of projected point along Tangent2.

Definition at line 381 of file Plane.h.

§ Project() [2/3]

void mirtk::Plane::Project ( const double  p[3],
double &  u,
double &  v 
) const
inline

Project point onto plane

Parameters
[in]pPoint.
[out]uCoordinate of projected point along Tangent1.
[out]vCoordinate of projected point along Tangent2.

Definition at line 389 of file Plane.h.

§ Project() [3/3]

void mirtk::Plane::Project ( double  x,
double  y,
double  z,
double &  u,
double &  v 
) const
inline

Project point onto plane

Parameters
[in]xFirst coordinate of point.
[in]ySecond coordinate of point.
[in]zThird coordinate of point.
[out]uCoordinate of projected point along Tangent1.
[out]vCoordinate of projected point along Tangent2.

Definition at line 397 of file Plane.h.


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