#include <CP2D.h>
Public Member Functions | |
CP2D () | |
CP2D (double rdX, double rdY) | |
CP2D (const CP2D &Point) | |
operator CP3D () const | |
const CP2D & | operator= (const CP2D &) |
int | operator== (const CP2D &) const |
int | operator!= (const CP2D &) const |
CP2D & | operator+= (const CV2D &) |
CP2D & | operator-= (const CV2D &) |
CP2D & | operator *= (const CV2D &) |
CP2D & | operator *= (double) |
CP2D & | operator/= (double) |
CP2D | operator+ (const CV2D &) const |
CP2D | operator+ (const CP2D &) const |
CP2D | operator- (const CV2D &) const |
CV2D | operator- (const CP2D &) const |
CP2D | operator * (const CV2D &) const |
CP2D | operator * (double) const |
CP2D | operator/ (const CV2D &) const |
CP2D | operator/ (double) const |
double & | operator[] (int i) |
double | operator[] (int i) const |
double | getMinComponent (void) const |
double | getAbsMinComponent (void) const |
double | getMaxComponent (void) const |
double | getAbsMaxComponent (void) const |
int | getMinComponentCoord (void) const |
int | getAbsMinComponentCoord (void) const |
int | getMaxComponentCoord (void) const |
int | getAbsMaxComponentCoord (void) const |
CV2D | getCV2D () const |
double | getX (void) const |
double | getY (void) const |
void | setX (double rdX) |
void | setY (double rdY) |
void | setCoord (double rdX, double rdY) |
void | print () const |
Static Public Attributes | |
static double | epsilon = DOUBLE_EPSILON |
Protected Attributes | |
double | m_ard [2] |
Friends | |
CP2D | AffinComb (const CP2D &, double, const CP2D &) |
CP2D | AffinComb2 (double r, const CP2D &R, double s, const CP2D &S) |
double | dist (const CP2D &, const CP2D &) |
double | quaddist (const CP2D &, const CP2D &) |
CP2D | Min (const CP2D &, const CP2D &) |
CP2D | Max (const CP2D &, const CP2D &) |
CP2D | operator * (double, const CP2D &) |
CP2D | MidPoint (const CP2D &, const CP2D &) |
ostream & | operator<< (ostream &, const CP2D &) |
istream & | operator>> (istream &, CP2D &) |
CP2D::CP2D | ( | ) | [inline] |
Default constructor. The default value of the instantiated point will be (0.0,0.0).
CP2D::CP2D | ( | double | rdX, | |
double | rdY | |||
) | [inline] |
Construct new point. The value of the point will be (rdX, rdY).
CP2D::CP2D | ( | const CP2D & | Point | ) | [inline] |
Copy constructor. The parameters will simply be copied.
double CP2D::getAbsMaxComponent | ( | void | ) | const [inline] |
Returns the value of the maximal point component.
int CP2D::getAbsMaxComponentCoord | ( | void | ) | const |
Returns the coordinate index of the maximum point component (using fabs).
double CP2D::getAbsMinComponent | ( | void | ) | const [inline] |
Returns the value of the minimal point component.
int CP2D::getAbsMinComponentCoord | ( | void | ) | const |
Returns the coordinate index of the minial point component (using fabs).
CV2D CP2D::getCV2D | ( | ) | const [inline] |
Converts a point to a vector. It's implemented as 'get'-method to prevent implicit casting by the compiler.
double CP2D::getMaxComponent | ( | void | ) | const [inline] |
Returns the value of the maximal point component.
int CP2D::getMaxComponentCoord | ( | void | ) | const |
Returns the coordinate index of the maximum point component.
double CP2D::getMinComponent | ( | void | ) | const [inline] |
Returns the value of the minimal point component.
int CP2D::getMinComponentCoord | ( | void | ) | const |
Returns the coordinate index of the minial point component.
double CP2D::getX | ( | void | ) | const [inline] |
Returns the x-coordinate of the point.
double CP2D::getY | ( | void | ) | const [inline] |
Returns the y-coordinate of the point.
CP2D CP2D::operator * | ( | double | ) | const |
Multiplies a point by a scalar.
CP2D & CP2D::operator *= | ( | double | ) |
Multiplies a point by a scalar.
CP2D::operator CP3D | ( | ) | const |
int CP2D::operator!= | ( | const CP2D & | ) | const |
Compares to points for not being equal. Same as operator== but inverted.
CP2D CP2D::operator/ | ( | double | ) | const |
Divides a point by a scalar.
CP2D & CP2D::operator/= | ( | double | ) |
Divides a point by a scalar.
int CP2D::operator== | ( | const CP2D & | ) | const |
Compares to points for being equal. The result will be 'true'(1) if the two point are indentically up to <= CP2D::epsilon for each component. Otherwise 'false'(0) will be returned.
double CP2D::operator[] | ( | int | i | ) | const [inline] |
Same as above but does not alter anything.
double& CP2D::operator[] | ( | int | i | ) | [inline] |
Returns the i-th component of the point. The index goes from 0 to 2, 0 stands for the x-coordinate, 1 for the y-coordinate and so on.
void CP2D::print | ( | ) | const |
Prints a point to the standard output.
void CP2D::setCoord | ( | double | rdX, | |
double | rdY | |||
) | [inline] |
Set the values of the point. The value of the point will be (rdX, rdY, rdZ).
void CP2D::setX | ( | double | rdX | ) | [inline] |
Sets the x-coordinate of the point to 'rdX'.
void CP2D::setY | ( | double | rdY | ) | [inline] |
Sets the y-coordinate of the point to 'rdX'.
Returns the affine combination of the points and vectors.
Returns the affine combination of the points and vectors.
Returns the maximum of all components of two points.
Returns the point in the middle between two points.
Returns the minimum of all components of two points.
Returns a point being the result of multiplying a scalar and a point.
ostream& operator<< | ( | ostream & | s, | |
const CP2D & | pnt | |||
) | [friend] |
Same as above. But more useful for streams.
istream& operator>> | ( | istream & | s, | |
CP2D & | pnt | |||
) | [friend] |
Reads a point from the given stream.
Returns the square of the distance between two points.
double CP2D::epsilon = DOUBLE_EPSILON [static] |
double CP2D::m_ard[2] [protected] |