Adaptagrams
Public Member Functions | Public Attributes | List of all members
Avoid::Point Class Reference

The Point class defines a point in the plane. More...

#include <geomtypes.h>

Collaboration diagram for Avoid::Point:
Collaboration graph

Public Member Functions

 Point ()
 Default constructor.
 
 Point (const double xv, const double yv)
 Standard constructor. More...
 
bool operator== (const Point &rhs) const
 Comparison operator. Returns true if at same position. More...
 
bool equals (const Point &rhs, double epsilon=0.0001) const
 Comparison operator. Returns true if at same position, or at effectively the same position for a given value of epsilson. More...
 
bool operator!= (const Point &rhs) const
 Comparison operator. Returns true if at different positions. More...
 
bool operator< (const Point &rhs) const
 Comparison operator. Returns true if less-then rhs point. More...
 
double & operator[] (const size_t dimension)
 Returns the x or y value of the point, given the dimension. More...
 

Public Attributes

double x
 The x position.
 
double y
 The y position.
 
unsigned int id
 The ID associated with this point.
 
unsigned short vn
 The vertex number associated with this point.
 

Detailed Description

The Point class defines a point in the plane.

Points consist of an x and y value. They may also have an ID and vertex number associated with them.

Constructor & Destructor Documentation

◆ Point()

Avoid::Point::Point ( const double  xv,
const double  yv 
)

Standard constructor.

Parameters
[in]xvThe x position of the point.
[in]yvThe y position of the point.

Member Function Documentation

◆ equals()

bool Avoid::Point::equals ( const Point rhs,
double  epsilon = 0.0001 
) const

Comparison operator. Returns true if at same position, or at effectively the same position for a given value of epsilson.

Parameters
[in]rhsThe point to compare with this one.
[in]epsilonValue of epsilon to use during comparison.
Returns
The result of the comparison.
See also
operator==()

References x, and y.

◆ operator!=()

bool Avoid::Point::operator!= ( const Point rhs) const

Comparison operator. Returns true if at different positions.

Parameters
[in]rhsThe point to compare with this one.
Returns
The result of the comparison.

References x, and y.

◆ operator<()

bool Avoid::Point::operator< ( const Point rhs) const

Comparison operator. Returns true if less-then rhs point.

Note
This operator is not particularly useful, but is defined to allow std::set<Point>.
Parameters
[in]rhsThe point to compare with this one.
Returns
The result of the comparison.

References x, and y.

◆ operator==()

bool Avoid::Point::operator== ( const Point rhs) const

Comparison operator. Returns true if at same position.

Parameters
[in]rhsThe point to compare with this one.
Returns
The result of the comparison.
See also
equals()

References x, and y.

◆ operator[]()

double & Avoid::Point::operator[] ( const size_t  dimension)

Returns the x or y value of the point, given the dimension.

Parameters
[in]dimensionThe dimension: 0 for x, 1 for y.
Returns
The component of the point in that dimension.

References x, and y.


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