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

VCF::Rect Class Reference

#include <Rect.h>

Inheritance diagram for VCF::Rect:

VCF::Object VCF::Persistable List of all members.

Public Member Functions

 Rect (const double &left, const double &top, const double &right, const double &bottom)
 Rect (const Rect &rect)
 Rect ()
double getLeft () const
void setLeft (const double &left)
double getTop () const
void setTop (const double &top)
double getRight () const
void setRight (const double &right)
double getBottom () const
void setBottom (const double &bottom)
double getWidth () const
 the width of the rectangle, or the value returned from abs(right - left)
double getHeight () const
 the height of the rectangle, or the value returned from abs(bottom - top)
void setRect (const double &left, const double &top, const double &right, const double &bottom)
 sets the left, top, right, and bottom all at once
void setRect (const Rect &rect)
void setRect (const Point &topleft, const Point &bottomright)
 sets the left, top, right, and bottom all at once using the two opposite corners
RectgetRect (void)
 gets a reference to this Rect instance itself.
void setOrigin (const double &left, const double &top)
 changes the origin of a rectangle, i.e.
void setOrigin (const Point &topleft)
void setSize (const double &width, const double &height)
 changes the size of a rectangle, i.e.
void setWidth (const double &width)
void setHeight (const double &height)
void normalize ()
 normalizes the rectangles coordinates so that
bool isNormalized () const
 tells if the rect is mormalized, i.e.
bool isEmpty () const
 tells if the rect is mormalized, i.e.
void setEmpty ()
bool isNull () const
void setNull ()
void offset (const double &dx, const double &dy)
void offset (const Point &_offsetPt)
void inflate (const double &x, const double &y)
 inflates the rectangle
void inflate (const double &left, const double &top, const double &right, const double &bottom)
 inflates the rectangle
void inflate (const Rect &rect)
 inflates the rectangle
void add (const Rect *rect)
void subtract (const Rect *rect)
Rect makeIntersection (const Rect *rect)
 creates the Rect intersection of this instance with another rectangle
Rect makeUnion (const Rect *rect)
 not implemented yet
Point getTopLeft (void) const
Point getTopRight (void) const
Point getBottomLeft (void) const
Point getBottomRight (void) const
Point getCenter (void) const
Point getCenterLeft (void) const
Point getCenterTop (void) const
Point getCenterRight (void) const
Point getCenterBottom (void) const
bool containsPt (Point *point) const
 tells if the point lay within this rectangle's coordinates Any point on the top or on the left border of the rectangle is considered inside the rectangle.
bool containsPtCloseTo (Point *point, const double &tolerance) const
 tells if the point lay within this rectangle's coordinates a given tolerance is admitted in order to consider the point inside the rectangle.
bool containsPtOpen (Point *point) const
 tells if the point lay within this rectangle's coordinates Any point on the border of the rectangle is not considered inside the rectangle.
bool containsPtClose (Point *point) const
 tells if the point lay within this rectangle's coordinates Any point on the border of the rectangle is considered inside the rectangle.
bool containsRect (Rect *rect) const
 tells if the specified rectangle fall inside the bound of this Rect instance.
bool containsRectOpen (Rect *rect) const
 tells if the specified rectangle fall inside the bound of this Rect instance.
bool containsRectClose (Rect *rect) const
 tells if the specified rectangle fall inside the bound of this Rect instance.
Rectoperator= (const Rect &rect)
bool operator== (const Rect &rectToCompare) const
bool operator!= (const Rect &rectToCompare) const
Rect operator+ () const
Rect operator- () const
Rectoperator+= (const Rect &rc)
Rectoperator-= (const Rect &rc)
Rectoperator *= (const Rect &rc)
Rectoperator/= (const Rect &rc)
Rect operator+ (const Rect &rc) const
Rect operator- (const Rect &rc) const
Rect operator * (const Rect &rc) const
Rect operator/ (const Rect &rc) const
Rectoperator+= (const double d)
Rectoperator-= (const double d)
Rectoperator *= (const double d)
Rectoperator/= (const double d)
Rect operator+ (const double d) const
Rect operator- (const double d) const
Rect operator * (const double d) const
Rect operator/ (const double d) const
virtual String toString () const
 returns a String giving the infos about this Rect instance.
virtual void saveToStream (OutputStream *stream)
 writes the object to the specified output stream
virtual void loadFromStream (InputStream *stream)
 reads the object from the specified input stream
double _getLeft ()
 This is only here because the RTTI functions are not "const safe" - kind of stupid - will fix later.
double _getTop ()
double _getRight ()
double _getBottom ()
double _getWidth ()
double _getHeight ()

Public Attributes

double bottom_
double right_
double top_
double left_

Constructor & Destructor Documentation

VCF::Rect::Rect const double &  left,
const double &  top,
const double &  right,
const double &  bottom
[inline]
 

VCF::Rect::Rect const Rect rect  ) 
 

VCF::Rect::Rect  )  [inline]
 


Member Function Documentation

double VCF::Rect::_getBottom  )  [inline]
 

double VCF::Rect::_getHeight  )  [inline]
 

double VCF::Rect::_getLeft  )  [inline]
 

This is only here because the RTTI functions are not "const safe" - kind of stupid - will fix later.

double VCF::Rect::_getRight  )  [inline]
 

double VCF::Rect::_getTop  )  [inline]
 

double VCF::Rect::_getWidth  )  [inline]
 

void VCF::Rect::add const Rect rect  ) 
 

bool VCF::Rect::containsPt Point point  )  const
 

tells if the point lay within this rectangle's coordinates Any point on the top or on the left border of the rectangle is considered inside the rectangle.

Returns:
bool, true if the point is within the rectangle's coordinates, otherwise false

bool VCF::Rect::containsPtClose Point point  )  const
 

tells if the point lay within this rectangle's coordinates Any point on the border of the rectangle is considered inside the rectangle.

bool VCF::Rect::containsPtCloseTo Point point,
const double &  tolerance
const
 

tells if the point lay within this rectangle's coordinates a given tolerance is admitted in order to consider the point inside the rectangle.

Again any point on the top or on the left border of the rectangle within the given tolerance is considered inside the rectangle.

bool VCF::Rect::containsPtOpen Point point  )  const
 

tells if the point lay within this rectangle's coordinates Any point on the border of the rectangle is not considered inside the rectangle.

bool VCF::Rect::containsRect Rect rect  )  const
 

tells if the specified rectangle fall inside the bound of this Rect instance.

bool VCF::Rect::containsRectClose Rect rect  )  const
 

tells if the specified rectangle fall inside the bound of this Rect instance.

This is true even if a border of one rectangle is part of a border of the other rectangle.

bool VCF::Rect::containsRectOpen Rect rect  )  const
 

tells if the specified rectangle fall inside the bound of this Rect instance.

This is always false though if a border of one rectangle is part of a border of the other rectangle.

double VCF::Rect::getBottom  )  const [inline]
 

Point VCF::Rect::getBottomLeft void   )  const [inline]
 

Point VCF::Rect::getBottomRight void   )  const [inline]
 

Point VCF::Rect::getCenter void   )  const [inline]
 

Point VCF::Rect::getCenterBottom void   )  const [inline]
 

Point VCF::Rect::getCenterLeft void   )  const [inline]
 

Point VCF::Rect::getCenterRight void   )  const [inline]
 

Point VCF::Rect::getCenterTop void   )  const [inline]
 

double VCF::Rect::getHeight  )  const [inline]
 

the height of the rectangle, or the value returned from abs(bottom - top)

double VCF::Rect::getLeft  )  const [inline]
 

Rect & VCF::Rect::getRect void   )  [inline]
 

gets a reference to this Rect instance itself.

to be used as conversion operator without introducing ambiguity between operators

double VCF::Rect::getRight  )  const [inline]
 

double VCF::Rect::getTop  )  const [inline]
 

Point VCF::Rect::getTopLeft void   )  const [inline]
 

Point VCF::Rect::getTopRight void   )  const [inline]
 

double VCF::Rect::getWidth  )  const [inline]
 

the width of the rectangle, or the value returned from abs(right - left)

void VCF::Rect::inflate const Rect rect  )  [inline]
 

inflates the rectangle

Parameters:
double the amount to increase (or decrease if the value is negative) for all the four edges as given by a rectangle

void VCF::Rect::inflate const double &  left,
const double &  top,
const double &  right,
const double &  bottom
[inline]
 

inflates the rectangle

Parameters:
double the amount to increase (or decrease if the value is negative) for all the four edges

void VCF::Rect::inflate const double &  x,
const double &  y
[inline]
 

inflates the rectangle

Parameters:
double the amount to increase (or decrease if the value is negative) the left and right coordinates
double the amount to increase (or decrease if the value is negative) the top and bottom coordinates

bool VCF::Rect::isEmpty  )  const [inline]
 

tells if the rect is mormalized, i.e.

if the top is less than the bottom, and the left is less than the right.

bool VCF::Rect::isNormalized  )  const [inline]
 

tells if the rect is mormalized, i.e.

if the top is less than the bottom, and the left is less than the right.

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

virtual void VCF::Rect::loadFromStream InputStream stream  )  [virtual]
 

reads the object from the specified input stream

Implements VCF::Persistable.

Rect VCF::Rect::makeIntersection const Rect rect  ) 
 

creates the Rect intersection of this instance with another rectangle

Rect VCF::Rect::makeUnion const Rect rect  ) 
 

not implemented yet

void VCF::Rect::normalize  ) 
 

normalizes the rectangles coordinates so that

void VCF::Rect::offset const Point _offsetPt  )  [inline]
 

void VCF::Rect::offset const double &  dx,
const double &  dy
[inline]
 

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

Rect VCF::Rect::operator * const Rect rc  )  const [inline]
 

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

Rect & VCF::Rect::operator *= const Rect rc  )  [inline]
 

bool VCF::Rect::operator!= const Rect rectToCompare  )  const [inline]
 

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

Rect VCF::Rect::operator+ const Rect rc  )  const [inline]
 

Rect VCF::Rect::operator+  )  const [inline]
 

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

Rect & VCF::Rect::operator+= const Rect rc  )  [inline]
 

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

Rect VCF::Rect::operator- const Rect rc  )  const [inline]
 

Rect VCF::Rect::operator-  )  const [inline]
 

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

Rect & VCF::Rect::operator-= const Rect rc  )  [inline]
 

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

Rect VCF::Rect::operator/ const Rect rc  )  const [inline]
 

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

Rect & VCF::Rect::operator/= const Rect rc  )  [inline]
 

Rect & VCF::Rect::operator= const Rect rect  )  [inline]
 

bool VCF::Rect::operator== const Rect rectToCompare  )  const [inline]
 

virtual void VCF::Rect::saveToStream OutputStream stream  )  [virtual]
 

writes the object to the specified output stream

Implements VCF::Persistable.

void VCF::Rect::setBottom const double &  bottom  )  [inline]
 

void VCF::Rect::setEmpty  )  [inline]
 

void VCF::Rect::setHeight const double &  height  )  [inline]
 

void VCF::Rect::setLeft const double &  left  )  [inline]
 

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

void VCF::Rect::setOrigin const Point topleft  )  [inline]
 

void VCF::Rect::setOrigin const double &  left,
const double &  top
[inline]
 

changes the origin of a rectangle, i.e.

its top left corner, but not its size.

void VCF::Rect::setRect const Point topleft,
const Point bottomright
[inline]
 

sets the left, top, right, and bottom all at once using the two opposite corners

void VCF::Rect::setRect const Rect rect  )  [inline]
 

void VCF::Rect::setRect const double &  left,
const double &  top,
const double &  right,
const double &  bottom
[inline]
 

sets the left, top, right, and bottom all at once

void VCF::Rect::setRight const double &  right  )  [inline]
 

void VCF::Rect::setSize const double &  width,
const double &  height
[inline]
 

changes the size of a rectangle, i.e.

its width and its height, but not its origin.

void VCF::Rect::setTop const double &  top  )  [inline]
 

void VCF::Rect::setWidth const double &  width  )  [inline]
 

void VCF::Rect::subtract const Rect rect  ) 
 

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

returns a String giving the infos about this Rect instance.


Member Data Documentation

double VCF::Rect::bottom_
 

double VCF::Rect::left_
 

double VCF::Rect::right_
 

double VCF::Rect::top_
 


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