Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

CP2D Class Reference

#include <CP2D.h>

List of all members.

Public Member Functions

 CP2D ()
 CP2D (double rdX, double rdY)
 CP2D (const CP2D &Point)
 operator CP3D () const
const CP2Doperator= (const CP2D &)
int operator== (const CP2D &) const
int operator!= (const CP2D &) const
CP2Doperator+= (const CV2D &)
CP2Doperator-= (const CV2D &)
CP2Doperator *= (const CV2D &)
CP2Doperator *= (double)
CP2Doperator/= (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

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 &)


Detailed Description

This class provides a interface to 2D point

Author:
Michael Meissner


Constructor & Destructor Documentation

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.


Member Function Documentation

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 * const CV2D  )  const
 

Multiplies a point by a vector.

CP2D & CP2D::operator *= double   ) 
 

Multiplies a point by a scalar.

CP2D & CP2D::operator *= const CV2D  ) 
 

Multiplies a point by a vector.

CP2D::operator CP3D  )  const
 

Cast operator to convert CP2D points to CP3D points. The third component is set zero.

int CP2D::operator!= const CP2D  )  const
 

Compares to points for not being equal. Same as operator== but inverted.

See also:
operator==()

CP2D CP2D::operator+ const CP2D  )  const
 

Adds a point to a point.

CP2D CP2D::operator+ const CV2D  )  const
 

Adds a vector to a point.

CP2D & CP2D::operator+= const CV2D  ) 
 

Adds a vector to this point.

CV2D CP2D::operator- const CP2D  )  const
 

Substracts a point from a point.

CP2D CP2D::operator- const CV2D  )  const
 

Substracts a vector from a point.

CP2D & CP2D::operator-= const CV2D  ) 
 

Subtracts a vector from this point.

CP2D CP2D::operator/ double   )  const
 

Divides a point by a scalar.

CP2D CP2D::operator/ const CV2D  )  const
 

Divides a point by a vector.

CP2D & CP2D::operator/= double   ) 
 

Divides a point by a scalar.

const CP2D & CP2D::operator= const CP2D  )  [inline]
 

Assign one point to another.

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'.


Friends And Related Function Documentation

CP2D AffinComb const CP2D ,
double  ,
const CP2D
[friend]
 

Returns the affine combination of the points and vectors.

CP2D AffinComb2 double  r,
const CP2D R,
double  s,
const CP2D S
[friend]
 

Returns the affine combination of the points and vectors.

double dist const CP2D ,
const CP2D
[friend]
 

Returns the distance between two points.

CP2D Max const CP2D Point1,
const CP2D Point2
[friend]
 

Returns the maximum of all components of two points.

CP2D MidPoint const CP2D Point1,
const CP2D Point2
[friend]
 

Returns the point in the middle between two points.

CP2D Min const CP2D Point1,
const CP2D Point2
[friend]
 

Returns the minimum of all components of two points.

CP2D operator * double  ,
const CP2D
[friend]
 

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.

double quaddist const CP2D ,
const CP2D
[friend]
 

Returns the square of the distance between two points.


Member Data Documentation

double CP2D::epsilon = DOUBLE_EPSILON [static]
 

double CP2D::m_ard[2] [protected]
 


The documentation for this class was generated from the following files:
Generated on Sun May 16 12:02:02 2004 for QGLViewer by doxygen 1.3.7