Fade2.5D Documentation pages v1.85
Delaunay Features
Point2 Class Reference

Point. More...

#include <Point2.h>

Public Member Functions

 Point2 (const double x_, const double y_)
 Constructor. More...
 
 Point2 ()
 Default constructor. More...
 
 Point2 (const Point2 &p_)
 Copy constructor. More...
 
Point2operator= (const Point2 &other)
 
double x () const
 Get the x-coordinate. More...
 
double y () const
 Get the y-coordinate. More...
 
void xy (double &x_, double &y_) const
 Get the x- and y-coordinate. More...
 
double getMaxAbs () const
 Get max(abs(x),abs(y)) More...
 
bool operator< (const Point2 &p) const
 Less than operator. More...
 
bool operator> (const Point2 &p) const
 Greater than operator. More...
 
bool operator== (const Point2 &p) const
 Equality operator. More...
 
bool operator!= (const Point2 &p) const
 Inequality operator. More...
 
Triangle2getIncidentTriangle () const
 Get the associated triangle. More...
 
void set (const double x_, const double y_, int customIndex_)
 Set the coordinates and customIndex. More...
 
void change (const double x_, const double y_)
 
void set (const Point2 &pnt)
 Set the coordiantes. More...
 
void setCustomIndex (int customIndex_)
 Set a custom index. More...
 
int getCustomIndex () const
 Get the custom index. More...
 
void setIncidentTriangle (Triangle2 *pT)
 Associate a triangle with the point. More...
 
Vector2 operator- (const Point2 &other) const
 Returns a vector from other to *this.
 
Point2 operator+ (const Vector2 &vec) const
 Add vector and point.
 
Point2 operator- (const Vector2 &vec) const
 Subtract vector from point.
 

Protected Attributes

double coordX
 
double coordY
 
Triangle2pAssociatedTriangle
 
int customIndex
 

Friends

class Dt2
 
std::ostream & operator<< (std::ostream &stream, const Point2 &pnt)
 
std::istream & operator>> (std::istream &stream, Point2 &pnt)
 

Detailed Description

Point.

This class represents a point in 2D with x- and y-coordinates and an additional pointer to an associated triangle.

Constructor & Destructor Documentation

◆ Point2() [1/3]

Point2::Point2 ( const double  x_,
const double  y_ 
)
inline

Constructor.

Parameters
x_x-coordinate
y_y-coordinate

◆ Point2() [2/3]

Point2::Point2 ( )
inline

Default constructor.

The coordinates are initialized to -DBL_MAX

◆ Point2() [3/3]

Point2::Point2 ( const Point2 p_)
inline

Copy constructor.

Create a point as a copy of p_. The associated triangle pointer is initialized to NULL

Member Function Documentation

◆ getCustomIndex()

int Point2::getCustomIndex ( ) const
inline

Get the custom index.

Returns
the custom index.
Note
The custom index defaults to -1. It is not the index of the point in the triangulation (such an index does not exist) but an arbitrary value which can be set by the user.
See also
void setCustomIndex(int customIndex_)
A best practices example that deals with indices: http://www.geom.at/runtime/

◆ getIncidentTriangle()

Triangle2* Point2::getIncidentTriangle ( ) const
inline

Get the associated triangle.

Returns
the associated triangle

◆ getMaxAbs()

double Point2::getMaxAbs ( ) const
inline

Get max(abs(x),abs(y))

◆ operator!=()

bool Point2::operator!= ( const Point2 p) const
inline

Inequality operator.

Compares the x and y coordinates

Note
Although a point has a z-coordinate in the 2.5D version only x and y a compared by this method

◆ operator<()

bool Point2::operator< ( const Point2 p) const
inline

Less than operator.

Compares the x and y coordinates

Note
Although a point has a z-coordinate in the 2.5D version only x and y a compared by this method

◆ operator==()

bool Point2::operator== ( const Point2 p) const
inline

Equality operator.

Compares the x and y coordinates

Note
Although a point has a z-coordinate in the 2.5D version only x and y a compared by this method

◆ operator>()

bool Point2::operator> ( const Point2 p) const
inline

Greater than operator.

Compares the x and y coordinates

Note
Although a point has a z-coordinate in the 2.5D version only x and y a compared by this method

◆ set() [1/2]

void Point2::set ( const double  x_,
const double  y_,
int  customIndex_ 
)
inline

Set the coordinates and customIndex.

Internal method

Parameters
x_x-coordinate
y_y-coordinate
customIndex_Arbitrary index, use -1 if not required

◆ set() [2/2]

void Point2::set ( const Point2 pnt)
inline

Set the coordiantes.

Parameters
pntis the point whose coordinates are assigned to the current point

◆ setCustomIndex()

void Point2::setCustomIndex ( int  customIndex_)
inline

Set a custom index.

An arbitrary index can be assigned to a point. Use getCustomIndex() to retrieve it later.

Note
This method is provided for the users' convenience. It has nothing to do with the internal data structures of Fade 2D and using this method is optional. By default this index is -1.
See also
int getCustomIndex()
A best practices example that deals with indices: http://www.geom.at/runtime/

◆ setIncidentTriangle()

void Point2::setIncidentTriangle ( Triangle2 pT)
inline

Associate a triangle with the point.

Parameters
pTwill be associated with the triangle

◆ x()

double Point2::x ( ) const
inline

Get the x-coordinate.

Returns
the x-coordinate

◆ xy()

void Point2::xy ( double &  x_,
double &  y_ 
) const
inline

Get the x- and y-coordinate.

Parameters
x_x-coordinate
y_y-coordinate

◆ y()

double Point2::y ( ) const
inline

Get the y-coordinate.

Returns
the y-coordinate

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