class PPoint: public PObject

This class represents a coordinate pair used in the drawing environment.

Inheritance:


Public Methods

[more] PPoint ()
Create a point object with the initial x and y values of 0.
[more] PPoint ( PORDINATE nx, PORDINATE ny )
Create a point object with the initial x and y values.
[more] PPoint ( const PDim & pt )
Create a point the specified distance from the origin.
[more] PPoint ( const PPoint & pt )
Create a copy of the specified point.
[more]virtual PObject* Clone () const
Create a new copy of the specified point.
[more]virtual Comparison Compare ( const PObject & obj ) const
Determine the relative rank of the point objects.
[more]PORDINATE X () const
Get the the X ordinate of the point.
[more]PORDINATE Y () const
Get the the Y ordinate of the point.
[more]void SetX ( PORDINATE nx )
Set the the X ordinate of the point.
[more]void SetY ( PORDINATE ny )
Set the the Y ordinate of the point.
[more]void AddX ( PORDINATE dx )
Add value to the the X ordinate of the point.
[more]void AddY ( PORDINATE dy )
Add value to the the Y ordinate of the point.
[more]PPoint operator+ ( const PPoint & pt ) const
Calculate the cartesian sum of the points or point and dimensions.
[more]PPoint& operator+= ( const PPoint & pt )
Calculate the cartesian sum of the points or point and dimensions.
[more]PPoint operator- ( const PPoint & pt ) const
Calculate the cartesian difference of the points or point and dimensions.
[more]PPoint& operator-= ( const PPoint & pt )
Calculate the cartesian difference of the points or point and dimensions.
[more]PPoint operator* ( const PPoint & pt ) const
Calculate the cartesian product of the points or point and dimensions.
[more]PPoint& operator*= ( const PPoint & pt )
Calculate the cartesian product of the points or point and dimensions.
[more]PPoint operator/ ( const PPoint & pt ) const
Calculate the cartesian division of the points or point and dimensions.
[more]PPoint& operator/= ( const PPoint & pt )
Calculate the cartesian division of the points or point and dimensions.
[more]BOOL InRect ( const PRect & rect ) const
Determine if the point is contained within the specified rectangle.

Public

[more] Overrides from class PObject
[more] New function for class


Inherited from PObject:

Public

Run Time Type functions

Comparison functions

I/O functions

Miscellaneous functions


Documentation

This class represents a coordinate pair used in the drawing environment. It represents a specific point in the drawing plane.
o PPoint()
Create a point object with the initial x and y values of 0.

o PPoint( PORDINATE nx, PORDINATE ny )
Create a point object with the initial x and y values.
Parameters:
nx - New x value.
ny - New y value

o PPoint( const PDim & pt )
Create a point the specified distance from the origin.
Parameters:
pt - Dimensions of distance from origin.

o PPoint( const PPoint & pt )
Create a copy of the specified point.
Parameters:
pt - Point to make a copy of.

o Overrides from class PObject

ovirtual PObject* Clone() const
Create a new copy of the specified point. It is the users responsibility to delete the returned object.

Returns:
pointer to new copy of point.

ovirtual Comparison Compare( const PObject & obj ) const
Determine the relative rank of the point objects. Points are ranked according to the sum of the two ordinates. However they can only be equal if the two ordinates are equal, an equal sum is regarded as GreaterThan.

Returns:
EqualTo if the two points are the same, LessThan and GreaterThan according to sum of ordinates.
Parameters:
obj - Point object to compare against.

o New function for class

oPORDINATE X() const
Get the the X ordinate of the point.

Returns:
x ordinate.

oPORDINATE Y() const
Get the the Y ordinate of the point.

Returns:
y ordinate.

ovoid SetX( PORDINATE nx )
Set the the X ordinate of the point.
Parameters:
nx - New x value for point.

ovoid SetY( PORDINATE ny )
Set the the Y ordinate of the point.
Parameters:
ny - New y value for point.

ovoid AddX( PORDINATE dx )
Add value to the the X ordinate of the point.
Parameters:
dx - Value to add to point.

ovoid AddY( PORDINATE dy )
Add value to the the Y ordinate of the point.
Parameters:
dy - Value to add to point.

oPPoint operator+( const PPoint & pt ) const
Calculate the cartesian sum of the points or point and dimensions. The sum of a point is the sum of each ordinate independent of the other.

Returns:
new point containing the sum.
Parameters:
pt - Point to add.

oPPoint& operator+=( const PPoint & pt )
Calculate the cartesian sum of the points or point and dimensions. The sum of a point is the sum of each ordinate independent of the other.

Returns:
reference to the current object instance.
Parameters:
pt - Point to add.

oPPoint operator-( const PPoint & pt ) const
Calculate the cartesian difference of the points or point and dimensions. The difference of a point is the difference of each ordinate independent of the other.

Returns:
new point containing the difference.
Parameters:
pt - Point to subtract.

oPPoint& operator-=( const PPoint & pt )
Calculate the cartesian difference of the points or point and dimensions. The difference of a point is the difference of each ordinate independent of the other.

Returns:
reference to the current object instance.
Parameters:
pt - Point to subtract.

oPPoint operator*( const PPoint & pt ) const
Calculate the cartesian product of the points or point and dimensions. The product of a point is the product of each ordinate independent of the other.

The scale parameter is applied to each ordinate equally.

Returns:
new point containing the product.
Parameters:
pt - Point to multiply.

oPPoint& operator*=( const PPoint & pt )
Calculate the cartesian product of the points or point and dimensions. The product of a point is the product of each ordinate independent of the other.

The scale parameter is applied to each ordinate equally.

Returns:
reference to the current object instance.
Parameters:
pt - Point to multiply.

oPPoint operator/( const PPoint & pt ) const
Calculate the cartesian division of the points or point and dimensions. The division of a point is the division of each ordinate independent of the other.

The scale parameter is applied to each ordinate equally.

Returns:
new point containing the divided point.
Parameters:
pt - Point to divide.

oPPoint& operator/=( const PPoint & pt )
Calculate the cartesian division of the points or point and dimensions. The division of a point is the division of each ordinate independent of the other.

The scale parameter is applied to each ordinate equally.

Returns:
reference to the current object instance.
Parameters:
pt - Point to divide.

oBOOL InRect( const PRect & rect ) const
Determine if the point is contained within the specified rectangle.

Returns:
TRUE if point is "inside" the rectangle.
Parameters:
rect - Rectangle to check for being "inside".


This class has no child classes.

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.