Represents a 2.5D point. More...
#include <Point2.h>
Public Member Functions | |
| Point2 () | |
| Default constructor. More... | |
| Point2 (const double x_, const double y_, const double z_) | |
| Constructor. More... | |
| Point2 (const Point2 &p_) | |
| Copy constructor. More... | |
| ~Point2 () | |
| Destructor. | |
| int | getCustomIndex () const |
| Retrieves the custom index of the Point2. More... | |
| double | getMaxAbs () const |
| Get the larger of the absolute values of x and y. More... | |
| bool | operator!= (const Point2 &p) const |
| Compares if the current Point2 is different from another one. More... | |
| Point2 | operator+ (const Vector2 &vec) const |
| Add a Vector2 to the Point2. More... | |
| Vector2 | operator- (const Point2 &other) const |
| Create a Vector2 by subtracing another Point2 from the current one. More... | |
| Point2 | operator- (const Vector2 &vec) const |
| Subtract a Vector2 from the Point2. More... | |
| bool | operator< (const Point2 &p) const |
| Compare if the current Point2 is less than another one. More... | |
| Point2 & | operator= (const Point2 &other) |
| Assignment operator. More... | |
| bool | operator== (const Point2 &p) const |
| Compares if the current Point2 is equal to another one. More... | |
| bool | operator> (const Point2 &p) const |
| Compare if the current Point2 is greater than another one. More... | |
| bool | samePoint (const Point2 &p) const |
| Compares if the current Point2 is equal to another one, based on x,y and z. More... | |
| void | setCustomIndex (int customIndex_) |
| Sets a custom index for the Point2. More... | |
| void | setHeight (double z) |
| Set the z-coordinate of the current Point2. More... | |
| double | x () const |
| Get the x-coordinate of the Point2. More... | |
| void | xy (double &x_, double &y_) const |
| Get the x- and y- coordinates of the Point2. More... | |
| void | xyz (double &x_, double &y_, double &z_) const |
| Get all three coordinates (x, y, z) of the Point2. More... | |
| double | y () const |
| Get the y-coordinate of the Point2. More... | |
| double | z () const |
| Get the z-coordinate of the Point2. More... | |
Protected Attributes | |
| double | coordX |
| x-coordinate | |
| double | coordY |
| y-coordinate | |
| double | coordZ |
| z-coordinate | |
| int | customIndex |
| User-defined index. | |
Friends | |
| class | Dt2 |
| std::ostream & | operator<< (std::ostream &stream, const Point2 &pnt) |
| Print to output stream. More... | |
| std::istream & | operator>> (std::istream &stream, Point2 &pnt) |
| Read coordinates from an input stream into a Point2. More... | |
The Point2 class represents the a 2.5D point with x-, y-, and z-coordinates.
|
inline |
Constructor
| [in] | x_,y_,z_ | x-, y- and z-coordinates |
|
inline |
Default constructor
Initializes the coordinates to -DBL_MAX, the associated Triangle2 to NULL, and the customIndex to -1.
|
inline |
Copy constructor. Copies the coordinates and the custom index from p.
| [in] | p_ | The point to be copied. |
|
inline |
-1. It is not related to the point's index in the triangulation (since such an index does not exist), but rather an arbitrary value that can be assigned by the user for associating the Point2 with their own data structures.
|
inline |
Get the maximum of the absolute values of the x- and y-coordinates.
|
inline |
This function checks if the current Point2 and p are different, based on the x and y coordinates.
| p | The point to compare with. |
true if the points are different, false otherwisez coordinate is not compared! As a result, two points with identical x and y coordinates are always considered equal, even with different z coordinates.
|
inline |
Less-than comparison, based on x and y coordinates.
| p | The Point2 to compare with |
true if the current point is less, false otherwise
|
inline |
This function compares the current Point2 with another one based on the x and y coordinates.
| p | The point to compare with. |
true if the points are equal (same x and y), false otherwise.z coordinate is not compared! As a result, two points with identical x and y coordinates but different z coordinates will be considered equal.
|
inline |
|
inline |
Compares if the current Point2 is equal to another one, based on the the x, y, and z coordinates. Unlike the operator==(), which only compares the x and y coordinates, this function takes the z coordinate into account as well.
| p | The point to compare with. |
true if the x, y, and z coordinates are identical, false otherwise.
|
inline |
This method allows you to assign an arbitrary index to the Point2, which can be used to associate it with custom data structures in your software. To retrieve the index later, you can use the getCustomIndex() method.
| customIndex_ | The custom index to be assigned to the Point2. |
Point2 with their own data structures. It is not related to the internal data structures of Fade 2D, and its usage is optional. By default, the customIndex is set to -1.
|
inline |
Sets the z-coordinate of the current Point2.
| z | The z-coordinate value to be assigned. |
|
inline |
Get the x-coordinate of the current Point2.
|
inline |
Retrieves the x- and y- coordinates of the current Point2.
| x_,y_ | Used to return the coordinate values. |
|
inline |
Retrieves all three coordinates (x, y, z) of the current Point2.
| x_,y_,z_ | Used to return the coordinate values. |
|
inline |
Get the y-coordinate of the current Point2.
|
inline |
Get the z-coordinate of the current Point2.
|
friend |
|
friend |