#include <eng_graph.hh>
Public Member Functions | |
| Graph (void) | |
| ~Graph () | |
| void | AttachRootNode (Node::Ptr rootNode) |
| LIMITED-USE. | |
| Node::Ptr | GetRootNode (void) |
| LIMITED-USE. | |
| SharedPtr< Graph > | Fork (void) |
| void | CloneNode (Node::Ptr node) |
| void | Traverse (Visitor &visitor) |
| void | Draw (SharedPtr< Object > object) |
| void | SetLod (const ObjectLod objectLod) |
| bool | IfMinimal (void) |
| bool | IfCloneNode (const Node &node) const |
| bool | Check (void) |
Static Public Member Functions | |
| static shptr< Graph > | MakeMinimalGraph (void) |
| static SharedPtr< Graph > | MakeMinimalGraph (SharedPtr< Matrix > matrix) |
Static Public Attributes | |
| static bool | msDrawWorldBoxVolume |
Private Member Functions | |
| Graph (const Graph &src) | |
| Forks graph (not for clients). | |
| void | RecursiveDetach (Node::Ptr node) |
Private Attributes | |
| Node::Ptr | mRootNode |
| initially points to NULL_NODE | |
| NodeClones | mNodeClones |
| every Graph has clone of the first transform | |
| bool | mMinimal |
| necessary to produce an tiny Object BoxVolume for acceptance by BSP | |
Friends | |
| class | Node |
| class | GraphMaker |
| class | VisitorCloner |
See design and implementation.
| eng::Graph::Graph | ( | void | ) |
ctor. Constructing an empty Graph is normal in certain cases (Eye), but rendering shouldn't encounter them.
| eng::Graph::Graph | ( | const Graph & | src | ) | [private] |
Forks graph (not for clients).
Copy ctor forks a Graph. See Graph::Fork(). Copying is done simply by making another reference to the parent's root node. Yet, a cloned Graph isn't exactly a verbatim copy. Clone Nodes (private Nodes) is where they will diverge.
| eng::Graph::~Graph | ( | ) |
dtor.
A Graph is freed in an orderly fashion: bottom-up leaf-by-leaf. Eventually every node will become a leaf and will be detached. Deleting Nodes is done implicitly by nullifying SharedPtr<Node> links so that SharedPtr will auto-delete Nodes.
Make a minimal-but-usable Graph for use with an Object. Object construction depends on a TransformNode being present.
| static SharedPtr<Graph> eng::Graph::MakeMinimalGraph | ( | SharedPtr< Matrix > | matrix | ) | [static] |
| void eng::Graph::RecursiveDetach | ( | Node::Ptr | node | ) | [private] |
| void eng::Graph::AttachRootNode | ( | Node::Ptr | rootNode | ) |
LIMITED-USE.
| Node::Ptr eng::Graph::GetRootNode | ( | void | ) |
LIMITED-USE.
Get root node.
Fork a Graph.
Forking a Graph is similar to forking a UNIX process. Most nodes will be shared while a few become private to every Graph.
For each node:
A "clone node" is a node passed to Graph::CloneNode(Node::Ptr) which turns a shared node into a private node. The clone attribute is sticky.
| void eng::Graph::CloneNode | ( | Node::Ptr | node | ) |
| void eng::Graph::Traverse | ( | Visitor & | visitor | ) |
Traverse a Graph using a Visitor. A guide is at Traversing Graphs.
* 1. Visit node. * 2. If child and younger sibling exist, push younger sibling. * 3. If child exists, traverse to it, recurse. * 4. If younger sibling exists, traverse to it, recurse. * 5. If stack isn't empty: pop node, traverse to it. * Else stop. *
| void eng::Graph::Draw | ( | SharedPtr< Object > | object | ) |
| void eng::Graph::SetLod | ( | const ObjectLod | objectLod | ) |
| bool eng::Graph::IfMinimal | ( | void | ) | [inline] |
| bool eng::Graph::IfCloneNode | ( | const Node & | node | ) | const [inline] |
| bool eng::Graph::Check | ( | void | ) |
friend class Node [friend] |
friend class GraphMaker [friend] |
friend class VisitorCloner [friend] |
Node::Ptr eng::Graph::mRootNode [private] |
initially points to NULL_NODE
NodeClones eng::Graph::mNodeClones [private] |
every Graph has clone of the first transform
bool eng::Graph::mMinimal [private] |
bool eng::Graph::msDrawWorldBoxVolume [static] |
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:21 2007