STIRA  0.1
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
stira::common::Point< T > Class Template Reference

A class to represent a 2D point. More...

#include <Point.h>

Public Member Functions

 Point ()
 Constructor.
 
 Point (T xNew, T yNew, coordinateMode mode=COORDINATES_CARTESIAN, pointType myType=TYPE_DEFAULT)
 Constructor.
 
 ~Point ()
 destructor.
 
GetRadius () const
 gets radial coordinate of point, in case of polar coordinates
 
GetTheta () const
 gets angular coordinate of point, in case of polar coordinates
 
pointType GetType () const
 gets radial coordinate of point, in case of polar coordinates
 
void SetType (pointType type)
 gets angular coordinate of point, in case of polar coordinates
 
coordinateMode GetMode () const
 
void SetXAndY (T xNew, T yNew)
 sets new cartesian coordinates for point More...
 
void SetRadiusAndTheta (T radius, T theta)
 sets new coordinates for point
 
double GetDistance (Point other=Point< T >(0, 0))
 gets Euclidian distance to other point More...
 
void ToPolar (T xCenter=0, T yCenter=0)
 transforms current point coordinates to polar coordinates
 
void ToCartesian ()
 transforms current point coordinates to cartesian coordinates
 
void MirrorOrigin ()
 mirrors current point towards the origin
 
void MirrorXaxis ()
 mirrors current point towards X axis
 
void MirrorYaxis ()
 mirrors current point towards Y axis
 
Point< double > ToDouble ()
 
Point< int > ToInt ()
 
bool operator== (Point< T > otherPoint)
 overloaded operator to compare two Points More...
 
bool operator!= (Point< T > otherPoint)
 overloaded operator to compare two Points More...
 
Point< T > operator+ (Point< T > otherPoint)
 overloaded operator to add two Points More...
 
Point< T > operator- (Point< T > otherPoint)
 overloaded operator to subtract two Points More...
 
operator* (Point< T > otherPoint)
 overloaded operator to compute the dot product of two segments (0,0)-thisPoint and (0,0)-otherPoint Source http://www.topcoder.com/tc?d1=tutorials&d2=geometry1&module=Static More...
 
operator^ (Point< T > otherPoint)
 overloaded operator to compute the norm of the cross product of two segments (0,0)-thisPoint and (0,0)-otherPoint Remark: this just computes the NORM; the real result of an actual cross product would be a vector perpendicular to the plane Source http://www.topcoder.com/tc?d1=tutorials&d2=geometry1&module=Static More...
 

Static Public Member Functions

static Point< double > GetCentroid (std::vector< Point< T > > vPoints)
 

Public Attributes

x
 x coordinate of the point
 
y
 y coordinate of the point
 

Detailed Description

template<class T>
class stira::common::Point< T >

A class to represent a 2D point.

Member Function Documentation

template<class T >
double stira::common::Point< T >::GetDistance ( Point< T >  other = Point<T>(0,0))

gets Euclidian distance to other point

Parameters
otherother point to compute distance to

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

Referenced by stira::common::Curve::ConnectToCurve(), and stira::common::Curve::GetClosestEndPoints().

template<class T>
bool stira::common::Point< T >::operator!= ( Point< T >  otherPoint)

overloaded operator to compare two Points

Parameters
otherPointother point to check inequality
template<class T>
T stira::common::Point< T >::operator* ( Point< T >  otherPoint)

overloaded operator to compute the dot product of two segments (0,0)-thisPoint and (0,0)-otherPoint Source http://www.topcoder.com/tc?d1=tutorials&d2=geometry1&module=Static

Parameters
otherPointother point to compute dot product with

References stira::common::Point< T >::GetType(), stira::common::Point< T >::x, and stira::common::Point< T >::y.

template<class T>
Point< T > stira::common::Point< T >::operator+ ( Point< T >  otherPoint)

overloaded operator to add two Points

Parameters
otherPointother point to add

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

template<class T>
Point< T > stira::common::Point< T >::operator- ( Point< T >  otherPoint)

overloaded operator to subtract two Points

Parameters
otherPointother point to subtract

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

template<class T>
bool stira::common::Point< T >::operator== ( Point< T >  otherPoint)

overloaded operator to compare two Points

Parameters
otherPointother point to check equality

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

template<class T>
T stira::common::Point< T >::operator^ ( Point< T >  otherPoint)

overloaded operator to compute the norm of the cross product of two segments (0,0)-thisPoint and (0,0)-otherPoint Remark: this just computes the NORM; the real result of an actual cross product would be a vector perpendicular to the plane Source http://www.topcoder.com/tc?d1=tutorials&d2=geometry1&module=Static

Parameters
otherPointother point to compute cross product norm with

References stira::common::Point< T >::x, and stira::common::Point< T >::y.

template<class T>
void stira::common::Point< T >::SetXAndY ( xNew,
yNew 
)

sets new cartesian coordinates for point

Parameters
xNewnew x coordinate to set
yNewnew y coordinate to set

Referenced by stira::imageanalysis::WatershedMeyer< T >::CreateLabelsIntensitiesImage(), and stira::imageanalysis::CannyEdgeDetector::~CannyEdgeDetector().


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