Main Page | Namespace List | Class Hierarchy | Compound List | File List | Namespace Members | Compound Members | File Members

Pl2BTree::BuildTreeRecord Class Reference

Collaboration diagram for Pl2BTree::BuildTreeRecord:

Collaboration graph
[legend]
List of all members.

Public Member Functions

bool operator< (const BuildTreeRecord &btr) const

Static Public Member Functions

double getDistance (const BuildTreeRecord &btr1, const BuildTreeRecord &btr2)

Public Attributes

int parent
int treeLocIndex
double distance
double yDistance
double xStart
double xEnd
double yStart
double yEnd
bool used

Static Public Attributes

double _epsilon = 0

Member Function Documentation

double Pl2BTree::BuildTreeRecord::getDistance const BuildTreeRecord btr1,
const BuildTreeRecord btr2
[static]
 

Definition at line 179 of file pltobtree.cxx.

References _epsilon, xEnd, xStart, yEnd, and yStart.

00181 {
00182    double tempDistance = btr1.xStart - btr2.xEnd;// tempXlocStart - currXlocEnd;
00183 
00184    if (btr1.yEnd < btr2.yStart + _epsilon || // only count if y-spans overlap
00185        btr2.yEnd < btr1.yStart + _epsilon)
00186       tempDistance = INFTY;
00187    
00188    else if (tempDistance < -1*_epsilon) // horizontal overlap? not necessary
00189    {
00190       if (btr2.xStart < btr1.xEnd - _epsilon) // horizontal overlap
00191       {
00192          if ((btr1.yEnd > btr2.yStart + _epsilon) &&
00193              (btr1.yStart < btr2.yEnd - _epsilon))
00194             tempDistance = 0;      // real overlap, push it horizontally
00195          else
00196             tempDistance = INFTY;  // no overlap, treat it as no-edge
00197       }
00198       else
00199          tempDistance = INFTY;
00200    }
00201    
00202    return max(tempDistance, 0.0);
00203 }

bool Pl2BTree::BuildTreeRecord::operator< const BuildTreeRecord btr  )  const
 

Definition at line 205 of file pltobtree.cxx.

References _epsilon, distance, xEnd, xStart, yEnd, and yStart.

00206 {
00207    double difference = distance - btr.distance;
00208    if (fabs(difference) < _epsilon)
00209    {
00210       if (xEnd < btr.xStart + _epsilon) // break ties by x-span (L > R)
00211          return true;
00212       else if (btr.xEnd < xStart + _epsilon)
00213          return false;
00214          
00215       if (yEnd < btr.yStart + _epsilon) // break ties by y-span (T > B)
00216          return true;
00217       else if (btr.yEnd < yStart + _epsilon)
00218          return false;
00219       else
00220          return false;                  // two blocks overlap, whatever
00221    }
00222    else
00223       return difference < 0;
00224 }


Member Data Documentation

double Pl2BTree::BuildTreeRecord::_epsilon = 0 [static]
 

Definition at line 50 of file pltobtree.cxx.

Referenced by getDistance(), and operator<().

double Pl2BTree::BuildTreeRecord::distance
 

Definition at line 83 of file pltobtree.h.

Referenced by operator<().

int Pl2BTree::BuildTreeRecord::parent
 

Definition at line 81 of file pltobtree.h.

Referenced by Pl2BTree::build_tree_add_block(), and Pl2BTree::ValidCriterion::operator()().

int Pl2BTree::BuildTreeRecord::treeLocIndex
 

Definition at line 82 of file pltobtree.h.

Referenced by Pl2BTree::build_tree_add_block().

bool Pl2BTree::BuildTreeRecord::used
 

Definition at line 90 of file pltobtree.h.

Referenced by Pl2BTree::ValidCriterion::operator()().

double Pl2BTree::BuildTreeRecord::xEnd
 

Definition at line 87 of file pltobtree.h.

Referenced by getDistance(), and operator<().

double Pl2BTree::BuildTreeRecord::xStart
 

Definition at line 86 of file pltobtree.h.

Referenced by getDistance(), and operator<().

double Pl2BTree::BuildTreeRecord::yDistance
 

Definition at line 84 of file pltobtree.h.

double Pl2BTree::BuildTreeRecord::yEnd
 

Definition at line 89 of file pltobtree.h.

Referenced by getDistance(), and operator<().

double Pl2BTree::BuildTreeRecord::yStart
 

Definition at line 88 of file pltobtree.h.

Referenced by getDistance(), and operator<().


The documentation for this class was generated from the following files:
Generated on Mon Apr 25 01:15:08 2005 for Parquete by doxygen 1.3.2