HOG2
|
#include <LoadedBBAbstraction.h>
Classes | |
class | BoundingBox |
Public Member Functions | |
LoadedBBAbstraction (char *, char *) | |
Construct a new Graph hierarchy. More... | |
virtual | ~LoadedBBAbstraction () |
virtual void | VerifyHierarchy () |
verify that the hierarchy is consistent More... | |
double | h (node *a, node *b) |
heuristic cost between any two nodes More... | |
bool | Pathable (node *from, node *to) |
is there a legal path between these 2 nodes? More... | |
bool | Pathable (unsigned int from, unsigned int to) |
void | GetNumAbstractGraphs (node *from, node *to, std::vector< node * > &fromChain, std::vector< node * > &toChain) |
void | clearDisplayLists () |
void | OpenGLDraw () const |
void | ToggleDrawAbstraction (int which) |
void | DrawLevelConnections (node *n) const |
void | DrawGraph (Graph *g) const |
recVec | GetNodeLoc (node *n) const |
virtual void | AddNode (node *n) |
add node to abstraction More... | |
virtual void | AddEdge (edge *e, unsigned int absLevel) |
add edge to abstraction More... | |
node * | findNodeParent (node *n) |
edge * | findEdgeParent (edge *e, unsigned int absLevel) |
Public Member Functions inherited from GraphAbstraction | |
GraphAbstraction () | |
virtual | ~GraphAbstraction () |
void | GetNumAbstractGraphs (node *from, node *to, std::vector< node * > &fromChain, std::vector< node * > &toChain) |
given 2 nodes, find as much of their hierarchy that exists in the Graph More... | |
Graph * | GetAbstractGraph (int level) |
return the abstract Graph at the given level More... | |
unsigned int | getNumAbstractGraphs () |
return the total number of graphs in the hierarchy More... | |
double | distance (path *p) |
length in distance of a path More... | |
node * | GetNthParent (node *which, int n) |
return nth level parent of which or null if it doesn't exist More... | |
bool | IsParentOf (node *parent, node *child) |
return true if the first node is a parent of or is equal two the second node More... | |
node * | GetParent (node *which) |
long | GetNumChildren (node *which) |
node * | GetNthChild (node *which, int n) |
node * | GetRandomGroundNodeFromNode (node *n) |
long | GetAbstractionLevel (node *which) |
Graph * | GetAbstractGraph (node *which) |
void | ClearMarkedNodes () |
rebuild hierarchy from original domain */ More... | |
virtual int | MeasureRepairHits () |
void | MeasureAbstractionValues (int level, double &n, double &n_dev, double &c, double &c_dev) |
double | MeasureAverageNodeWidth (int level) |
Private Member Functions | |
Graph * | abstractGraph (Graph *g) |
void | cleanMemory () |
void | buildAbstractions (Graph *g) |
void | loadBoxes (char *boxFile) |
Graph * | loadGraph (char *fname) |
node * | createNewParent (Graph *, node *n) |
void | addNodeToParent (node *n, node *parent) |
void | addNeighborsInBox (Graph *g, node *n, int which, node *parent) |
int | findBoundingBox (node *n) |
virtual void | RemoveNode (node *) |
remove node from abstraction More... | |
virtual void | RemoveEdge (edge *, unsigned int) |
remove edge from abstraction More... | |
virtual void | RepairAbstraction () |
This must be called after any of the above add/remove operations. More... | |
Private Attributes | |
std::vector< BoundingBox > | boxes |
unsigned long | levelDraw |
Additional Inherited Members | |
Protected Attributes inherited from GraphAbstraction | |
std::vector< Graph * > | abstractions |
Definition at line 19 of file LoadedBBAbstraction.h.
LoadedBBAbstraction::LoadedBBAbstraction | ( | char * | fname, |
char * | boxFile | ||
) |
Construct a new Graph hierarchy.
Constructions a new Graph abstraction hierarchy from the Graph using the designated abstraction method.
Definition at line 71 of file LoadedBBAbstraction.cpp.
References buildAbstractions(), levelDraw, loadBoxes(), and loadGraph().
|
virtual |
Definition at line 80 of file LoadedBBAbstraction.cpp.
References cleanMemory().
Definition at line 447 of file LoadedBBAbstraction.cpp.
References Graph::AddEdge(), addNeighborsInBox(), addNodeToParent(), createNewParent(), Graph::edgeIterNext(), findBoundingBox(), Graph::FindEdge(), Graph::getEdgeIter(), edge::GetLabelL(), node::GetLabelL(), Graph::GetNode(), Graph::getNodeIter(), h(), GraphAbstractionConstants::kAbstractionLevel, GraphAbstractionConstants::kEdgeCapacity, GraphAbstractionConstants::kParent, Graph::nodeIterNext(), and edge::SetLabelL().
Referenced by buildAbstractions().
|
virtual |
add edge to abstraction
Implements GraphAbstraction.
Definition at line 580 of file LoadedBBAbstraction.cpp.
|
private |
Definition at line 514 of file LoadedBBAbstraction.cpp.
References addNodeToParent(), boxes, node::GetLabelF(), node::GetLabelL(), node::getNeighborIter(), Graph::GetNode(), GraphAbstractionConstants::kParent, GraphAbstractionConstants::kXCoordinate, GraphAbstractionConstants::kYCoordinate, GraphAbstractionConstants::kZCoordinate, and node::nodeNeighborNext().
Referenced by abstractGraph().
|
virtual |
add node to abstraction
Implements GraphAbstraction.
Definition at line 576 of file LoadedBBAbstraction.cpp.
Definition at line 531 of file LoadedBBAbstraction.cpp.
References node::GetLabelL(), node::GetNum(), GraphAbstractionConstants::kFirstData, GraphAbstractionConstants::kNumAbstractedNodes, GraphAbstractionConstants::kParent, and node::SetLabelL().
Referenced by abstractGraph(), and addNeighborsInBox().
|
private |
Definition at line 415 of file LoadedBBAbstraction.cpp.
References abstractGraph(), GraphAbstraction::abstractions, cleanMemory(), Graph::GetNumEdges(), Graph::GetNumNodes(), kMiscMessages, Graph::printStats(), and verbose.
Referenced by LoadedBBAbstraction().
|
private |
Definition at line 396 of file LoadedBBAbstraction.cpp.
References GraphAbstraction::abstractions.
Referenced by buildAbstractions(), and ~LoadedBBAbstraction().
void LoadedBBAbstraction::clearDisplayLists | ( | ) |
Definition at line 539 of file LoadedBBAbstraction.cpp.
References Graph::AddNode(), node::GetLabelL(), GraphAbstractionConstants::kAbstractionLevel, GraphAbstractionConstants::kNodeBlocked, GraphAbstractionConstants::kNumAbstractedNodes, GraphAbstractionConstants::kParent, GraphAbstractionConstants::kXCoordinate, node::SetLabelF(), node::SetLabelL(), and unknownPosition.
Referenced by abstractGraph().
void LoadedBBAbstraction::DrawGraph | ( | Graph * | g | ) | const |
Definition at line 143 of file LoadedBBAbstraction.cpp.
References DrawLevelConnections(), Graph::edgeIterNext(), Graph::getEdgeIter(), node::GetLabelL(), Graph::GetNode(), Graph::getNodeIter(), GetNodeLoc(), Graph::GetNumNodes(), GraphAbstractionConstants::kAbstractionLevel, GraphAbstractionConstants::kEdgeCapacity, Graph::nodeIterNext(), recVec::x, recVec::y, and recVec::z.
Referenced by OpenGLDraw().
void LoadedBBAbstraction::DrawLevelConnections | ( | node * | n | ) | const |
Definition at line 178 of file LoadedBBAbstraction.cpp.
References GraphAbstraction::abstractions, node::GetLabelL(), GetNodeLoc(), GraphAbstractionConstants::kAbstractionLevel, GraphAbstractionConstants::kFirstData, GraphAbstractionConstants::kNumAbstractedNodes, recVec::x, recVec::y, and recVec::z.
Referenced by DrawGraph().
|
private |
Definition at line 498 of file LoadedBBAbstraction.cpp.
References boxes, node::GetLabelF(), GraphAbstractionConstants::kXCoordinate, GraphAbstractionConstants::kYCoordinate, and GraphAbstractionConstants::kZCoordinate.
Referenced by abstractGraph().
Definition at line 592 of file LoadedBBAbstraction.cpp.
References GraphAbstraction::abstractions, node::GetLabelL(), GraphAbstractionConstants::kAbstractionLevel, and GraphAbstractionConstants::kParent.
Referenced by VerifyHierarchy().
Reimplemented from GraphAbstraction.
Definition at line 198 of file LoadedBBAbstraction.cpp.
References GraphAbstraction::abstractions, node::GetLabelF(), node::GetLabelL(), GraphAbstractionConstants::kAbstractionLevel, GraphAbstractionConstants::kFirstData, GraphAbstractionConstants::kNumAbstractedNodes, GraphAbstractionConstants::kXCoordinate, GraphAbstractionConstants::kYCoordinate, GraphAbstractionConstants::kZCoordinate, node::SetLabelF(), unknownPosition, recVec::x, recVec::y, and recVec::z.
Referenced by DrawGraph(), and DrawLevelConnections().
void LoadedBBAbstraction::GetNumAbstractGraphs | ( | node * | from, |
node * | to, | ||
std::vector< node * > & | fromChain, | ||
std::vector< node * > & | toChain | ||
) |
heuristic cost between any two nodes
Implements GraphAbstraction.
Definition at line 107 of file LoadedBBAbstraction.cpp.
References node::GetLabelF(), GraphAbstractionConstants::kXCoordinate, GraphAbstractionConstants::kYCoordinate, and GraphAbstractionConstants::kZCoordinate.
Referenced by abstractGraph(), and loadGraph().
|
private |
Definition at line 85 of file LoadedBBAbstraction.cpp.
References boxes, LoadedBBAbstraction::BoundingBox::x1, LoadedBBAbstraction::BoundingBox::x2, LoadedBBAbstraction::BoundingBox::y1, LoadedBBAbstraction::BoundingBox::y2, LoadedBBAbstraction::BoundingBox::z1, and LoadedBBAbstraction::BoundingBox::z2.
Referenced by LoadedBBAbstraction().
|
private |
Definition at line 233 of file LoadedBBAbstraction.cpp.
References Graph::AddEdge(), Graph::AddNode(), Graph::GetNode(), h(), GraphAbstractionConstants::kAbstractionLevel, GraphAbstractionConstants::kNodeBlocked, GraphAbstractionConstants::kNumAbstractedNodes, GraphAbstractionConstants::kParent, GraphAbstractionConstants::kXCoordinate, GraphAbstractionConstants::kYCoordinate, GraphAbstractionConstants::kZCoordinate, node::SetLabelF(), node::SetLabelL(), and VERSION.
Referenced by LoadedBBAbstraction().
|
virtual |
Reimplemented from GraphAbstraction.
Definition at line 124 of file LoadedBBAbstraction.cpp.
References GraphAbstraction::abstractions, boxes, DrawGraph(), and levelDraw.
is there a legal path between these 2 nodes?
Implements GraphAbstraction.
Definition at line 557 of file LoadedBBAbstraction.cpp.
References GraphAbstraction::abstractions, node::GetLabelL(), GraphAbstractionConstants::kAbstractionLevel, and GraphAbstractionConstants::kParent.
Referenced by Pathable().
bool LoadedBBAbstraction::Pathable | ( | unsigned int | from, |
unsigned int | to | ||
) |
Definition at line 552 of file LoadedBBAbstraction.cpp.
References GraphAbstraction::abstractions, and Pathable().
|
inlineprivatevirtual |
remove edge from abstraction
Implements GraphAbstraction.
Definition at line 74 of file LoadedBBAbstraction.h.
|
inlineprivatevirtual |
remove node from abstraction
Implements GraphAbstraction.
Definition at line 72 of file LoadedBBAbstraction.h.
|
inlineprivatevirtual |
This must be called after any of the above add/remove operations.
But the operations can be stacked followed by a single RepairAbstraction call.
Implements GraphAbstraction.
Definition at line 75 of file LoadedBBAbstraction.h.
void LoadedBBAbstraction::ToggleDrawAbstraction | ( | int | which | ) |
Definition at line 115 of file LoadedBBAbstraction.cpp.
References levelDraw.
|
virtual |
verify that the hierarchy is consistent
Implements GraphAbstraction.
Definition at line 293 of file LoadedBBAbstraction.cpp.
References GraphAbstraction::abstractions, findNodeParent(), node::GetLabelL(), Graph::GetNode(), node::GetNum(), GraphAbstractionConstants::kEdgeCapacity, GraphAbstractionConstants::kFirstData, GraphAbstractionConstants::kNumAbstractedNodes, and GraphAbstractionConstants::kParent.
|
private |
Definition at line 60 of file LoadedBBAbstraction.h.
Referenced by addNeighborsInBox(), findBoundingBox(), loadBoxes(), and OpenGLDraw().
|
private |
Definition at line 70 of file LoadedBBAbstraction.h.
Referenced by LoadedBBAbstraction(), OpenGLDraw(), and ToggleDrawAbstraction().