Point. More...
#include <Point2.h>
Public Member Functions | |
Point2 () | |
Default constructor. | |
Point2 (const double x_, const double y_, const double z_) | |
Constructor. More... | |
Point2 (const Point2 &p_) | |
Copy constructor. More... | |
int | getCustomIndex () const |
Get the custom index. More... | |
Triangle2 * | getIncidentTriangle () const |
Get the associated triangle. More... | |
double | getMaxAbs () const |
Get max(abs(x),abs(y)) | |
bool | operator!= (const Point2 &p) const |
Inequality operator. More... | |
Point2 | operator+ (const Vector2 &vec) const |
Add vector and point. | |
Vector2 | operator- (const Point2 &other) const |
Returns a vector from other to *this. | |
Point2 | operator- (const Vector2 &vec) const |
Subtract vector from point. | |
bool | operator< (const Point2 &p) const |
Less than operator. More... | |
Point2 & | operator= (const Point2 &other) |
bool | operator== (const Point2 &p) const |
Equality operator. More... | |
bool | operator> (const Point2 &p) const |
Greater than operator. More... | |
bool | samePoint (const Point2 &p) const |
Equality operator. More... | |
void | set (const double x_, const double y_, const double z_, int customIndex_) |
Set the coordinates. More... | |
void | set (const Point2 &pnt) |
Set the coordiantes. More... | |
void | setCoords (const double x_, const double y_, const double z_) |
Set the coordinates. More... | |
void | setCustomIndex (int customIndex_) |
Set a custom index. More... | |
void | setHeight (double z) |
Set the z-coordinate. More... | |
void | setIncidentTriangle (Triangle2 *pT) |
Associate a triangle with the point. More... | |
double | x () const |
Get the x-coordinate. More... | |
void | xy (double &x_, double &y_) const |
Get the x- and y-coordinate. More... | |
void | xyz (double &x_, double &y_, double &z_) const |
Get the x-, y- and z-coordinate. More... | |
double | y () const |
Get the y-coordinate. More... | |
double | z () const |
Get the z-coordinate. More... | |
Protected Attributes | |
double | coordX |
double | coordY |
double | coordZ |
int | customIndex |
Triangle2 * | pAssociatedTriangle |
Friends | |
class | Dt2 |
std::ostream & | operator<< (std::ostream &stream, const Point2 &pnt) |
Print to stream. | |
std::istream & | operator>> (std::istream &stream, Point2 &pnt) |
Stream-to-Point. | |
Point.
This class represents a point in 2D with x- and y-coordinates and an additional pointer to an associated triangle.
|
inline |
Constructor.
x_ | x-coordinate |
y_ | y-coordinate |
z_ | z-coordinate |
|
inline |
Copy constructor.
Create a point as a copy of p_. The associated triangle pointer is initialized to NULL
|
inline |
Get the custom index.
|
inline |
Get the associated triangle.
|
inline |
Inequality operator.
Compares the x and y coordinates
|
inline |
Less than operator.
Compares the x and y coordinates
|
inline |
Equality operator.
Compares the x and y coordinates
|
inline |
Greater than operator.
Compares the x and y coordinates
|
inline |
Equality operator.
Compares the x,y,z coordinates while operator==() compares only x,y
|
inline |
Set the coordinates.
Internal method
x_ | x-coordinate |
y_ | y-coordinate |
z_ | z-coordinate |
customIndex_ | Arbitrary index, use -1 if not required |
|
inline |
Set the coordiantes.
pnt | is the point whose coordinates are assigned to the current point |
|
inline |
Set the coordinates.
Internal method
x_ | x-coordinate |
y_ | y-coordinate |
z_ | z-coordinate |
|
inline |
Set a custom index.
An arbitrary index can be assigned to a point. Use getCustomIndex() to retrieve it later.
|
inline |
Set the z-coordinate.
Allows to exchange the z-coordinate
|
inline |
Associate a triangle with the point.
pT | will be associated with the triangle |
|
inline |
Get the x-coordinate.
|
inline |
Get the x- and y-coordinate.
x_ | x-coordinate |
y_ | y-coordinate |
|
inline |
Get the x-, y- and z-coordinate.
x_ | x-coordinate |
y_ | y-coordinate |
z_ | z-coordinate |
|
inline |
Get the y-coordinate.
|
inline |
Get the z-coordinate.