VGServer::RTree::Rect Class Reference

a two dimensional rectangle class with sufficient caluclation methods More...

#include <RTree.h>

List of all members.

Public Member Functions

void combineRect (const Rect &r)
 enlarge this rectangle to encompass Rect r.
void combineRects (const Rect &a, const Rect &b)
 set this rectangle to the minimum rectangle enclosing both a and b.
bool containsRect (const Rect &r) const
 checks if the other rectangle is contained within this one
AreaType getArea () const
 calculate the enclosed area
Point getCenter () const
 returns the center point of the rectangle
AreaType getIntersectingArea (const Rect &a) const
 calculate the intersecting area of this rectangle with a.
AreaType getMargin () const
 calculate the margin of the rectangle, i.e. the 2*sum of both sides
void intersectRect (const Rect &a)
 intersect this rectangle with a.
void intersectRects (const Rect &a, const Rect &b)
 set this rectangle to the minimum rectangle contained by both a and b.
bool intersectsRect (const Rect &r) const
 checks if the other rectangle intersects this one.
bool operator== (const Rect &o) const
 equality comparison operator
 Rect (CoordType _x1, CoordType _y1, CoordType _x2, CoordType _y2)
 initializing constructor
 Rect ()
 noop constructor
void setInfinite ()
 sets the coordinates to the minimum and maximum of the data range, thus creating an invalid rect on which to start combining others.
bool touchesRect (const Rect &r) const
 checks if the other rectangle touches this one. means if it shares a border.
bool valid () const
 check that it is a valid rectangle

Public Attributes

CoordType x1
CoordType x2
CoordType y1
CoordType y2


Detailed Description

a two dimensional rectangle class with sufficient caluclation methods

Definition at line 122 of file RTree.h.


Constructor & Destructor Documentation

VGServer::RTree::Rect::Rect (  )  [inline]

noop constructor

Definition at line 128 of file RTree.h.

VGServer::RTree::Rect::Rect ( CoordType  _x1,
CoordType  _y1,
CoordType  _x2,
CoordType  _y2 
) [inline]

initializing constructor

Definition at line 132 of file RTree.h.

References x1, x2, y1, and y2.


Member Function Documentation

void VGServer::RTree::Rect::combineRect ( const Rect r  )  [inline]

enlarge this rectangle to encompass Rect r.

Definition at line 160 of file RTree.h.

References x1, x2, y1, and y2.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::adjustTree(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::splitNode(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::splitNodeMakeGroups(), and VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::splitNodeMakeGroupsRStar().

void VGServer::RTree::Rect::combineRects ( const Rect a,
const Rect b 
) [inline]

set this rectangle to the minimum rectangle enclosing both a and b.

Definition at line 169 of file RTree.h.

References x1, x2, y1, and y2.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::findLeastEnlargement(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::findLeastOverlap(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::insertChild(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::pickSeedsQuadratic(), and VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::splitNodeMakeGroups().

bool VGServer::RTree::Rect::containsRect ( const Rect r  )  const [inline]

checks if the other rectangle is contained within this one

Definition at line 223 of file RTree.h.

References x1, x2, y1, and y2.

AreaType VGServer::RTree::Rect::getArea (  )  const [inline]

calculate the enclosed area

Definition at line 196 of file RTree.h.

References x1, x2, y1, and y2.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::findLeastEnlargement(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::findLeastOverlap(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::pickSeedsQuadratic(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::splitNodeMakeGroups(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::splitNodeMakeGroupsRStar(), and VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::writeFig().

Point VGServer::RTree::Rect::getCenter (  )  const [inline]

returns the center point of the rectangle

Definition at line 217 of file RTree.h.

References x1, x2, y1, and y2.

AreaType VGServer::RTree::Rect::getIntersectingArea ( const Rect a  )  const [inline]

calculate the intersecting area of this rectangle with a.

Definition at line 202 of file RTree.h.

References x1, x2, y1, and y2.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::findLeastOverlap(), and VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::splitNodeMakeGroupsRStar().

AreaType VGServer::RTree::Rect::getMargin (  )  const [inline]

calculate the margin of the rectangle, i.e. the 2*sum of both sides

Definition at line 211 of file RTree.h.

References x1, x2, y1, and y2.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::splitNodeMakeGroupsRStar().

void VGServer::RTree::Rect::intersectRect ( const Rect a  )  [inline]

intersect this rectangle with a.

Definition at line 178 of file RTree.h.

References x1, x2, y1, and y2.

void VGServer::RTree::Rect::intersectRects ( const Rect a,
const Rect b 
) [inline]

set this rectangle to the minimum rectangle contained by both a and b.

Definition at line 187 of file RTree.h.

References x1, x2, y1, and y2.

bool VGServer::RTree::Rect::intersectsRect ( const Rect r  )  const [inline]

checks if the other rectangle intersects this one.

means that their transection is not empty.

Definition at line 237 of file RTree.h.

References x1, and y1.

bool VGServer::RTree::Rect::operator== ( const Rect o  )  const [inline]

equality comparison operator

Definition at line 146 of file RTree.h.

References x1, x2, y1, and y2.

void VGServer::RTree::Rect::setInfinite (  )  [inline]

sets the coordinates to the minimum and maximum of the data range, thus creating an invalid rect on which to start combining others.

Definition at line 153 of file RTree.h.

References x1, x2, y1, and y2.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::adjustTreeReinsert(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::adjustTreeSplit(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::calcStats(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::calcWasteArea(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::NodeHead::initializeRoot(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::NodeHead::initializeSibling(), and VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::splitNodeMakeGroupsRStar().

bool VGServer::RTree::Rect::touchesRect ( const Rect r  )  const [inline]

checks if the other rectangle touches this one. means if it shares a border.

Definition at line 229 of file RTree.h.

References x1, x2, y1, and y2.

bool VGServer::RTree::Rect::valid (  )  const [inline]

check that it is a valid rectangle

Definition at line 140 of file RTree.h.

References x1, x2, y1, and y2.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::queryRange().


Member Data Documentation

CoordType VGServer::RTree::Rect::x1

Definition at line 125 of file RTree.h.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< _NodeData >::SplitDist::cmp_axis1_lower(), combineRect(), combineRects(), containsRect(), getArea(), getCenter(), getIntersectingArea(), getMargin(), intersectRect(), intersectRects(), intersectsRect(), operator==(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::pickSeedsLinear(), Rect(), setInfinite(), touchesRect(), valid(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::writeFig(), and VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::writeFig().

CoordType VGServer::RTree::Rect::x2

Definition at line 125 of file RTree.h.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< _NodeData >::SplitDist::cmp_axis1_upper(), combineRect(), combineRects(), containsRect(), getArea(), getCenter(), getIntersectingArea(), getMargin(), intersectRect(), intersectRects(), operator==(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::pickSeedsLinear(), Rect(), setInfinite(), touchesRect(), valid(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::writeFig(), and VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::writeFig().

CoordType VGServer::RTree::Rect::y1

Definition at line 125 of file RTree.h.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< _NodeData >::SplitDist::cmp_axis2_lower(), combineRect(), combineRects(), containsRect(), getArea(), getCenter(), getIntersectingArea(), getMargin(), intersectRect(), intersectRects(), intersectsRect(), operator==(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::pickSeedsLinear(), Rect(), setInfinite(), touchesRect(), valid(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::writeFig(), and VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::writeFig().

CoordType VGServer::RTree::Rect::y2

Definition at line 125 of file RTree.h.

Referenced by VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< _NodeData >::SplitDist::cmp_axis2_upper(), combineRect(), combineRects(), containsRect(), getArea(), getCenter(), getIntersectingArea(), getMargin(), intersectRect(), intersectRects(), operator==(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::pickSeedsLinear(), Rect(), setInfinite(), touchesRect(), valid(), VGServer::RTree::Tree< _DataType, _DataTypeCallback >::writeFig(), and VGServer::RTree::Tree< _DataType, _DataTypeCallback >::Node< VGServer::RTree::Tree::InnerNodeData >::writeFig().


The documentation for this class was generated from the following file:
Generated on Wed Sep 27 14:34:01 2006 for VGServer by  doxygen 1.4.7