Sourceforge.net - The VCF's Project Host
   The VCF Website Home   |   Online Discussion Forums   |   Sourceforge.net Project Page   

VCF::Point Class Reference

represents a 2 dimensional coordinate (x and y) and stores the data as doubles, for maximum precision. More...

#include <vcf/GraphicsKit/Point.h>

Inheritance diagram for VCF::Point:

VCF::Object List of all members.

Public Member Functions

 Point (const double &x, const double &y)
 Point ()
 Point (const Point &pt)
Pointoperator= (const Point &pt)
void init ()
 initializes the point to zero
PointgetPoint (void)
 gets a reference to this Rect instance itself.
void setPoint (const Point &point)
 sets the point value from another point
bool isNull () const
 tells if the point has both zero coordinates
void setNull ()
 initializes the point to zero coordinates
Pointoffset (const double &_offset)
 translates a point by a delta in x and and the same delta in y
Pointoffset (const double &offsetX, const double &offsetY)
 translates a point by a delta in x and and a delta in y
Pointoffset (const Point &offsetPt)
 translates a point by a delta in x and and a delta in y indicated as a point for clarity of use
bool closeTo (const double &x, const double &y, const double &tolerance=1.0) const
 determines if this Point instance has x and y coordinates within a given tolerance range.
bool closeTo (const Point &pt, const double &tolerance=1.0) const
 determines if this Point instance is close to a specified point within a given tolerance range.
bool isInBetween (const Point &pt1, const Point &pt2) const
 determines if this Point instance is in the rectangle having its opposite corners as specified by two given points.
bool isInBetweenOpen (const Point &pt1, const Point &pt2) const
 determines if this Point instance is in the rectangle having its opposite corners as specified by two given points.
bool isInBetweenClose (const Point &pt1, const Point &pt2) const
 determines if this Point instance is in the rectangle having its opposite corners as specified by two given points.
bool operator== (const Point &pointToCompare) const
bool operator!= (const Point &pointToCompare) const
bool operator<= (const Point &pointToCompare) const
bool operator< (const Point &pointToCompare) const
bool operator>= (const Point &pointToCompare) const
bool operator> (const Point &pointToCompare) const
Pointoperator+= (const Point &pt)
Pointoperator-= (const Point &pt)
Pointoperator *= (const Point &pt)
Pointoperator/= (const Point &pt)
Point operator+ (const Point &pt) const
Point operator- (const Point &pt) const
Point operator * (const Point &pt) const
Point operator/ (const Point &pt) const
Pointoperator+= (const double d)
Pointoperator-= (const double d)
Pointoperator *= (const double d)
Pointoperator/= (const double d)
Point operator+ (const double d) const
Point operator- (const double d) const
Point operator * (const double d) const
Point operator/ (const double d) const
virtual String toString () const
 returns a String giving the infos about this Point instance.

Public Attributes

double x_
 the x coordinate of the point - specifies horizontal values
double y_
 the y coordinate of the point - specifies vertical values

Detailed Description

represents a 2 dimensional coordinate (x and y) and stores the data as doubles, for maximum precision.


Constructor & Destructor Documentation

VCF::Point::Point const double &  x,
const double &  y
[inline]
 

VCF::Point::Point  )  [inline]
 

VCF::Point::Point const Point pt  )  [inline]
 


Member Function Documentation

bool VCF::Point::closeTo const Point pt,
const double &  tolerance = 1.0
const [inline]
 

determines if this Point instance is close to a specified point within a given tolerance range.

bool VCF::Point::closeTo const double &  x,
const double &  y,
const double &  tolerance = 1.0
const [inline]
 

determines if this Point instance has x and y coordinates within a given tolerance range.

Parameters:
double x coordinate
double y coordinate
double the tolerance to use
Returns:
true if the x and y coordinates are with the tolerance, otherwise false.

Point & VCF::Point::getPoint void   )  [inline]
 

gets a reference to this Rect instance itself.

to be used as conversion operator without introducing ambiguity between operators

void VCF::Point::init  )  [inline]
 

initializes the point to zero

Reimplemented from VCF::Object.

bool VCF::Point::isInBetween const Point pt1,
const Point pt2
const [inline]
 

determines if this Point instance is in the rectangle having its opposite corners as specified by two given points.

If this point is on the top or on the left border of the described rectangle, it is considered inside the rectangle.

bool VCF::Point::isInBetweenClose const Point pt1,
const Point pt2
const [inline]
 

determines if this Point instance is in the rectangle having its opposite corners as specified by two given points.

If this point is on the top or on the left border of the described rectangle, it is considered inside the rectangle.

bool VCF::Point::isInBetweenOpen const Point pt1,
const Point pt2
const [inline]
 

determines if this Point instance is in the rectangle having its opposite corners as specified by two given points.

If this point is on the top or on the left border of the described rectangle, it is not considered inside the rectangle.

bool VCF::Point::isNull  )  const [inline]
 

tells if the point has both zero coordinates

Point & VCF::Point::offset const Point offsetPt  )  [inline]
 

translates a point by a delta in x and and a delta in y indicated as a point for clarity of use

Point & VCF::Point::offset const double &  offsetX,
const double &  offsetY
[inline]
 

translates a point by a delta in x and and a delta in y

Point & VCF::Point::offset const double &  _offset  )  [inline]
 

translates a point by a delta in x and and the same delta in y

Point VCF::Point::operator * const double  d  )  const [inline]
 

Point VCF::Point::operator * const Point pt  )  const [inline]
 

Point & VCF::Point::operator *= const double  d  )  [inline]
 

Point & VCF::Point::operator *= const Point pt  )  [inline]
 

bool VCF::Point::operator!= const Point pointToCompare  )  const [inline]
 

Point VCF::Point::operator+ const double  d  )  const [inline]
 

Point VCF::Point::operator+ const Point pt  )  const [inline]
 

Point & VCF::Point::operator+= const double  d  )  [inline]
 

Point & VCF::Point::operator+= const Point pt  )  [inline]
 

Point VCF::Point::operator- const double  d  )  const [inline]
 

Point VCF::Point::operator- const Point pt  )  const [inline]
 

Point & VCF::Point::operator-= const double  d  )  [inline]
 

Point & VCF::Point::operator-= const Point pt  )  [inline]
 

Point VCF::Point::operator/ const double  d  )  const [inline]
 

Point VCF::Point::operator/ const Point pt  )  const [inline]
 

Point & VCF::Point::operator/= const double  d  )  [inline]
 

Point & VCF::Point::operator/= const Point pt  )  [inline]
 

bool VCF::Point::operator< const Point pointToCompare  )  const [inline]
 

bool VCF::Point::operator<= const Point pointToCompare  )  const [inline]
 

Point& VCF::Point::operator= const Point pt  )  [inline]
 

bool VCF::Point::operator== const Point pointToCompare  )  const [inline]
 

bool VCF::Point::operator> const Point pointToCompare  )  const [inline]
 

bool VCF::Point::operator>= const Point pointToCompare  )  const [inline]
 

void VCF::Point::setNull  )  [inline]
 

initializes the point to zero coordinates

void VCF::Point::setPoint const Point point  )  [inline]
 

sets the point value from another point

virtual String VCF::Point::toString  )  const [virtual]
 

returns a String giving the infos about this Point instance.


Member Data Documentation

double VCF::Point::x_
 

the x coordinate of the point - specifies horizontal values

double VCF::Point::y_
 

the y coordinate of the point - specifies vertical values


The documentation for this class was generated from the following file:
   Comments or Suggestions?    License Information