basegfx::B3DHomPoint Class Reference

Basic homogen Point class with three double values and one homogen factor. More...

#include <b3dhompoint.hxx>

Collaboration diagram for basegfx::B3DHomPoint:

Collaboration graph
[legend]

List of all members.

Public Member Functions

 B3DHomPoint ()
 Create a homogen point.
 B3DHomPoint (double fX, double fY, double fZ)
 Create a homogen point.
 B3DHomPoint (const B3DPoint &rVec)
 Create a copy of a 3D Point.
 B3DHomPoint (const B3DHomPoint &rVec)
 Create a copy of a homogen point.
 ~B3DHomPoint ()
B3DPoint getB3DPoint () const
 get a 3D point from this homogenous point
double getX () const
 get X-coordinate
double getY () const
 get Y-coordinate
double getZ () const
 get Z-coordinate
void setX (double fX)
 Set X-coordinate of the homogen point.
void setY (double fY)
 Set Y-coordinate of the homogen point.
void setZ (double fZ)
 Set Z-coordinate of the homogen point.
B3DHomPointoperator+= (const B3DHomPoint &rPnt)
B3DHomPointoperator-= (const B3DHomPoint &rPnt)
B3DHomPointoperator*= (double t)
B3DHomPointoperator/= (double t)
B3DHomPointoperator- (void)
bool operator== (const B3DHomPoint &rPnt) const
bool operator!= (const B3DHomPoint &rPnt) const
B3DHomPointoperator= (const B3DHomPoint &rPnt)

Protected Member Functions

bool implIsHomogenized () const
 Test if this homogen point does have a homogenous part.
void implHomogenize ()
 Remove homogenous part of this Point.
void implTestAndHomogenize () const
 Test and on demand remove homogenous part.

Protected Attributes

::basegfx::B3DTuple maTuple
 This member contains the coordinate part of the point.
double mfW
 This Member holds the homogenous part of the point.


Detailed Description

Basic homogen Point class with three double values and one homogen factor.

This class provides access to homogen coordinates in 3D. For this purpose all the operators which need to do specific action due to their homogenity are implemented here. The only caveat are member methods which are declared as const but do change the content. These are documented for that reason. The class is designed to provide homogenous coordinates without direct access to the homogen part (mfW). This is also the reason for leaving out the [] operators which return references to members.

See also:
B3DTuple

Definition at line 48 of file b3dhompoint.hxx.


Constructor & Destructor Documentation

basegfx::B3DHomPoint::B3DHomPoint (  )  [inline]

Create a homogen point.

The point is initialized to (0.0, 0.0, 0.0)

Definition at line 96 of file b3dhompoint.hxx.

basegfx::B3DHomPoint::B3DHomPoint ( double  fX,
double  fY,
double  fZ 
) [inline]

Create a homogen point.

Parameters:
fX This parameter is used to initialize the X-coordinate of the Point. The homogenous part is initialized to 1.0.
fY This parameter is used to initialize the Y-coordinate of the Point. The homogenous part is initialized to 1.0.
fZ This parameter is used to initialize the Z-coordinate of the Point. The homogenous part is initialized to 1.0.

Definition at line 115 of file b3dhompoint.hxx.

basegfx::B3DHomPoint::B3DHomPoint ( const B3DPoint rVec  )  [inline]

Create a copy of a 3D Point.

Parameters:
rVec The 3D point which will be copied. The homogenous part is initialized to 1.0.

Definition at line 126 of file b3dhompoint.hxx.

basegfx::B3DHomPoint::B3DHomPoint ( const B3DHomPoint rVec  )  [inline]

Create a copy of a homogen point.

Parameters:
rVec The homogen point which will be copied. The homogenous part is copied, too.

Definition at line 137 of file b3dhompoint.hxx.

basegfx::B3DHomPoint::~B3DHomPoint (  )  [inline]

Definition at line 142 of file b3dhompoint.hxx.


Member Function Documentation

bool basegfx::B3DHomPoint::implIsHomogenized (  )  const [inline, protected]

Test if this homogen point does have a homogenous part.

Returns:
Returns true if this point has no homogenous part

Definition at line 61 of file b3dhompoint.hxx.

References basegfx::tools::equal(), and mfW.

Referenced by implTestAndHomogenize(), setX(), setY(), and setZ().

void basegfx::B3DHomPoint::implHomogenize (  )  [protected]

Remove homogenous part of this Point.

This method does necessary calculations to remove the evtl. homogenous part of this Point. This may change all members.

Definition at line 34 of file b3dhompoint.cxx.

References basegfx::B3DTuple::getX(), basegfx::B3DTuple::getY(), basegfx::B3DTuple::getZ(), maTuple, mfW, basegfx::B3DTuple::setX(), basegfx::B3DTuple::setY(), and basegfx::B3DTuple::setZ().

void basegfx::B3DHomPoint::implTestAndHomogenize (  )  const [inline, protected]

Test and on demand remove homogenous part.

This method tests if this Point does have a homogenous part and then evtl. takes actions to remove that part.

Attention:
Even when this method is const it may change all members of this instance. This is due to the fact that changing the homogenous part of a homogenous point does from a mathematical point of view not change the point at all.

Definition at line 85 of file b3dhompoint.hxx.

References implIsHomogenized().

Referenced by getB3DPoint(), getX(), getY(), getZ(), operator!=(), and operator==().

B3DPoint basegfx::B3DHomPoint::getB3DPoint (  )  const [inline]

get a 3D point from this homogenous point

This method normalizes this homogen point if necessary and returns the corresponding 3D point for this homogen point.

Attention:
Even when this method is const it may change all members of this instance.

Definition at line 153 of file b3dhompoint.hxx.

References basegfx::B3DTuple::getX(), basegfx::B3DTuple::getY(), basegfx::B3DTuple::getZ(), implTestAndHomogenize(), and maTuple.

double basegfx::B3DHomPoint::getX (  )  const [inline]

get X-coordinate

This method normalizes this homogen point if necessary and returns the corresponding X-coordinate for this homogen point.

Attention:
Even when this method is const it may change all members of this instance.

Definition at line 167 of file b3dhompoint.hxx.

References basegfx::B3DTuple::getX(), implTestAndHomogenize(), and maTuple.

Referenced by basegfx::absolute(), basegfx::average(), basegfx::interpolate(), basegfx::maximum(), basegfx::minimum(), operator+=(), and operator-=().

double basegfx::B3DHomPoint::getY (  )  const [inline]

get Y-coordinate

This method normalizes this homogen point if necessary and returns the corresponding Y-coordinate for this homogen point.

Attention:
Even when this method is const it may change all members of this instance.

Definition at line 181 of file b3dhompoint.hxx.

References basegfx::B3DTuple::getY(), implTestAndHomogenize(), and maTuple.

Referenced by basegfx::absolute(), basegfx::average(), basegfx::interpolate(), basegfx::maximum(), basegfx::minimum(), operator+=(), and operator-=().

double basegfx::B3DHomPoint::getZ (  )  const [inline]

get Z-coordinate

This method normalizes this homogen point if necessary and returns the corresponding Z-coordinate for this homogen point.

Attention:
Even when this method is const it may change all members of this instance.

Definition at line 195 of file b3dhompoint.hxx.

References basegfx::B3DTuple::getY(), implTestAndHomogenize(), and maTuple.

Referenced by basegfx::absolute(), basegfx::average(), basegfx::interpolate(), basegfx::maximum(), basegfx::minimum(), operator+=(), and operator-=().

void basegfx::B3DHomPoint::setX ( double  fX  )  [inline]

Set X-coordinate of the homogen point.

This method sets the X-coordinate of the homogen point. If the point does have a homogenous part this is taken into account.

Parameters:
fX The to-be-set X-coordinate without homogenous part.

Definition at line 209 of file b3dhompoint.hxx.

References implIsHomogenized(), maTuple, mfW, and basegfx::B3DTuple::setX().

void basegfx::B3DHomPoint::setY ( double  fY  )  [inline]

Set Y-coordinate of the homogen point.

This method sets the Y-coordinate of the homogen point. If the point does have a homogenous part this is taken into account.

Parameters:
fY The to-be-set Y-coordinate without homogenous part.

Definition at line 222 of file b3dhompoint.hxx.

References implIsHomogenized(), maTuple, mfW, and basegfx::B3DTuple::setY().

void basegfx::B3DHomPoint::setZ ( double  fZ  )  [inline]

Set Z-coordinate of the homogen point.

This method sets the Z-coordinate of the homogen point. If the point does have a homogenous part this is taken into account.

Parameters:
fZ The to-be-set Z-coordinate without homogenous part.

Definition at line 235 of file b3dhompoint.hxx.

References implIsHomogenized(), maTuple, mfW, and basegfx::B3DTuple::setZ().

B3DHomPoint& basegfx::B3DHomPoint::operator+= ( const B3DHomPoint rPnt  )  [inline]

B3DHomPoint& basegfx::B3DHomPoint::operator-= ( const B3DHomPoint rPnt  )  [inline]

B3DHomPoint& basegfx::B3DHomPoint::operator*= ( double  t  )  [inline]

Definition at line 263 of file b3dhompoint.hxx.

References basegfx::fTools::equalZero(), and mfW.

B3DHomPoint& basegfx::B3DHomPoint::operator/= ( double  t  )  [inline]

Definition at line 273 of file b3dhompoint.hxx.

References mfW.

B3DHomPoint& basegfx::B3DHomPoint::operator- ( void   )  [inline]

Definition at line 279 of file b3dhompoint.hxx.

References mfW.

bool basegfx::B3DHomPoint::operator== ( const B3DHomPoint rPnt  )  const [inline]

Definition at line 285 of file b3dhompoint.hxx.

References implTestAndHomogenize(), and maTuple.

bool basegfx::B3DHomPoint::operator!= ( const B3DHomPoint rPnt  )  const [inline]

Definition at line 291 of file b3dhompoint.hxx.

References implTestAndHomogenize(), and maTuple.

B3DHomPoint& basegfx::B3DHomPoint::operator= ( const B3DHomPoint rPnt  )  [inline]

Definition at line 297 of file b3dhompoint.hxx.

References maTuple, and mfW.


Member Data Documentation

This member contains the coordinate part of the point.

Definition at line 52 of file b3dhompoint.hxx.

Referenced by getB3DPoint(), getX(), getY(), getZ(), implHomogenize(), operator!=(), operator+=(), operator-=(), operator=(), operator==(), setX(), setY(), and setZ().

double basegfx::B3DHomPoint::mfW [protected]

This Member holds the homogenous part of the point.

Definition at line 55 of file b3dhompoint.hxx.

Referenced by implHomogenize(), implIsHomogenized(), operator*=(), operator+=(), operator-(), operator-=(), operator/=(), operator=(), setX(), setY(), and setZ().


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

Generated on Thu Apr 29 13:57:18 2010 for ooo-build Module basegfx (ooo/OOO320_m15) by  doxygen 1.5.6