#include <CP4D.h>
Public Member Functions | |
CP4D () | |
CP4D (double rdX, double rdY, double rdZ) | |
CP4D (double rdX, double rdY, double rdZ, double rdW) | |
CP4D (const CP4D &Point) | |
operator CP3D () const | |
const CP4D & | operator= (const CP4D &) |
int | operator== (const CP4D &) |
int | operator!= (const CP4D &) |
CP4D & | operator+= (const CV4D &) |
CP4D & | operator-= (const CV4D &) |
CV4D | operator- (const CP4D &) const |
CP4D | operator+ (const CV4D &) const |
CP4D | operator- (const CV4D &) const |
CP4D | operator- () const |
double & | operator[] (int i) |
double | operator[] (int i) const |
CV4D | getCV4D () const |
double | getX () const |
double | getY () const |
double | getZ () const |
double | getW () const |
void | setX (double rdX) |
void | setY (double rdY) |
void | setZ (double rdZ) |
void | setW (double rdW) |
void | setCoord (double rdX, double rdY, double rdZ, double rdW) |
void | print () const |
Static Public Attributes | |
static double | epsilon = DOUBLE_EPSILON |
Protected Attributes | |
double | m_ard [4] |
Friends | |
class | CP3D |
ostream & | operator<< (ostream &, const CP4D &) |
istream & | operator>> (istream &, CP4D &) |
CP4D | AffinComb3 (double, const CP4D &, double, const CP4D &, double, const CP4D &) |
CP4D::CP4D | ( | ) | [inline] |
Default constructor. The default value of the instantiated point will be (0.0,0.0,0.0,0.0).
CP4D::CP4D | ( | double | rdX, | |
double | rdY, | |||
double | rdZ | |||
) | [inline] |
Construct new point. The value of the point will be (rdX, rdY, rdZ, 1).
CP4D::CP4D | ( | double | rdX, | |
double | rdY, | |||
double | rdZ, | |||
double | rdW | |||
) | [inline] |
Construct new point. The value of the point will be (rdX, rdY, rdZ, rdW).
CP4D::CP4D | ( | const CP4D & | Point | ) | [inline] |
Copy constructor. The parameters will be simply copied.
CV4D CP4D::getCV4D | ( | ) | const [inline] |
Converts a point to a vector. It's implemented as 'get'-method to prevent implicit casting by the compiler.
double CP4D::getW | ( | ) | const [inline] |
Returns the w-coordinate of the point.
double CP4D::getX | ( | void | ) | const [inline] |
Returns the x-coordinate of the point.
double CP4D::getY | ( | void | ) | const [inline] |
Returns the y-coordinate of the point.
double CP4D::getZ | ( | void | ) | const [inline] |
Returns the z-coordinate of the point.
CP4D::operator CP3D | ( | ) | const |
int CP4D::operator!= | ( | const CP4D & | ) |
Compares to points for not being equal. Same as operator== but inverted.
CP4D CP4D::operator- | ( | ) | const |
Negates the point.
int CP4D::operator== | ( | const CP4D & | ) |
Compares to points for being equal. The result will be 'true'(1) if the two point are indentically up to <= CP4D::epsilon for each component. Otherwise 'false'(0) will be returned.
double CP4D::operator[] | ( | int | i | ) | const [inline] |
Same as above but does not alter anything.
double& CP4D::operator[] | ( | int | i | ) | [inline] |
Returns the i-th component of the point. The index goes from 0 to 3, 0 stands for the x-coordinate, 1 for the y-coordinate and so on.
void CP4D::print | ( | ) | const |
Prints a point to the standard output.
void CP4D::setCoord | ( | double | rdX, | |
double | rdY, | |||
double | rdZ, | |||
double | rdW | |||
) | [inline] |
Set the values of the point. The value of the point will be (rdX, rdY, rdZ, rdW).
void CP4D::setW | ( | double | rdW | ) | [inline] |
Sets the w-coordinate of the point to 'rdW'.
void CP4D::setX | ( | double | rdX | ) | [inline] |
Sets the x-coordinate of the point to 'rdX'.
void CP4D::setY | ( | double | rdY | ) | [inline] |
Sets the y-coordinate of the point to 'rdY'.
void CP4D::setZ | ( | double | rdZ | ) | [inline] |
Sets the z-coordinate of the point to 'rdZ'.
CP4D AffinComb3 | ( | double | r, | |
const CP4D & | R, | |||
double | s, | |||
const CP4D & | S, | |||
double | t, | |||
const CP4D & | T | |||
) | [friend] |
Returns the affine combination of the points and vectors.
friend class CP3D [friend] |
ostream& operator<< | ( | ostream & | s, | |
const CP4D & | v | |||
) | [friend] |
Same as above. But more useful for streams.
istream& operator>> | ( | istream & | s, | |
CP4D & | v | |||
) | [friend] |
Reads a point from the given stream.
double CP4D::epsilon = DOUBLE_EPSILON [static] |
double CP4D::m_ard[4] [protected] |