#include <eng_graph_maker.hh>
Public Member Functions | |
| GraphMaker (void) | |
| ~GraphMaker () | |
| SharedPtr< Graph > | Commit (void) |
| SharedPtr< Partition > | GetPartition (void) |
| void | SelectPartition (SharedPtr< Partition > partition) |
| SharedPtr< Partition > | MakeChildPartition (SharedPtr< Partition > parentPartition, const string &name) |
| SharedPtr< Partition > | MakeSiblingPartition (SharedPtr< Partition > prevSiblingPartition, const string &name) |
| ModesNode::Ptr | AttachNode (const ModesNode::Value &nodeValue, const NodePredecessors &nodePredecessors) |
| MaterialNode::Ptr | AttachNode (const MaterialNode::Value &nodeValue, const NodePredecessors &nodePredecessors) |
| TextureNode::Ptr | AttachNode (const TextureNode::Value &nodeValue, const NodePredecessors &nodePredecessors) |
| ColorsNode::Ptr | AttachNode (const ColorsNode::Value &nodeValue, const NodePredecessors &nodePredecessors) |
| PolygonNode::Ptr | AttachNode (const PolygonNode::Value &nodeValue, const NodePredecessors &nodePredecessors) |
| PolygonNode_Tex::Ptr | AttachNode (const PolygonNode_Tex::Value &nodeValue, const NodePredecessors &nodePredecessors) |
| void | SetConstantNormals (SharedPtr< NormalVertexs > polygonNormals, SharedPtr< NormalVertexs > vertexNormals) |
Private Member Functions | |
| template<typename POLYGON_NODE> | |
| POLYGON_NODE::Ptr | AttachPolygonNode2 (const typename POLYGON_NODE::Value &nodeValue, const NodePredecessors &nodePredecessors) |
| template<typename POLYGON_NODE, typename POLYGON_NODE_TRI_COLOR1, typename POLYGON_NODE_QUAD_COLOR1, typename POLYGON_NODE_TRI_COLOR3, typename POLYGON_NODE_QUAD_COLOR4> | |
| POLYGON_NODE::Ptr | AttachPolygonNode (const typename POLYGON_NODE::Value &nodeValue, const NodePredecessors &nodePredecessors) |
Private Attributes | |
| shptr< Graph > | mGraph |
| shptr< Partition > | mPartition |
Classes | |
| class | NodePredecessors |
| Specifies the nodes that a new node should be placed underneath. More... | |
| class | Partition |
| Defines a subtree of a Graph being made (opaque to clients). More... | |
/// /// Overview: /// GraphMaker is a facade over Graph to help build an optimized Graph. /// It provides methods to allocate, find, and optimize the order of Nodes. /// When a client is finished making a Graph, it should call GraphMaker::Commit(). /// An instance of GraphMaker is one-shot: it cannot be reused to make more Graphs. /// /// 3D models often have polygons with the same attributes. /// In those cases, in terms of a graph, similar polygons need to be placed /// under the same set of "predecessor" nodes. /// GraphMaker provides the method GraphMaker::Assign() to specify a set of predecessors. /// GraphMaker determines the optimal order, and automatically allocates /// and attaches any predecessors if necessary. GraphMaker and NodePredecessors /// form a Facade to insulate clients from knowing the optimal order of nodes. /// Clients can expect a new node to be underneath one of the predecessors /// but without knowing exactly which one. /// /// GraphMaker tolerates clients that specify predecessor nodes in any order. /// /// SelectPartition() can be thought of as a cursor or current position. /// It tells GraphMaker which partition of a Graph to affect. /// /// Usage notes: /// ------------ /// - Client should use GraphMaker interface to manipulate Nodes. /// Client shouldn't circumvent GraphMaker. /// GraphMaker needs to track changes to Nodes. /// /// Examples: /// --------- /// /// GraphMaker graphMaker; /// ModesNode::Value modesValue = modes; /// ColorsNode::Value colorsValue = colors; /// GraphMaker::NodePredecessors nodePredecessors; /// nodePredecessors.Assign( modesValue ); /// nodePredecessors.Assign( colorsValue ); /// graphMaker.AttachNode( polygonValue, nodePredecessors ); /// shptr<Graph> graph = graphMaker.Commit(); // get completed Graph /// /// Implementation notes: /// GraphMaker creates a new Graph and hides it to prevent the client /// circumventing GraphMaker and directly attaching nodes to Graph. /// The reason is that GraphMaker needs to intercept and cache nodes /// to speed retrieval of predecessors. ///
| eng::GraphMaker::GraphMaker | ( | void | ) |
| eng::GraphMaker::~GraphMaker | ( | void | ) |
| SharedPtr< GraphMaker::Partition > eng::GraphMaker::GetPartition | ( | void | ) |
Get current partition.
| void eng::GraphMaker::SelectPartition | ( | SharedPtr< Partition > | partition | ) |
| SharedPtr<Partition> eng::GraphMaker::MakeChildPartition | ( | SharedPtr< Partition > | parentPartition, | |
| const string & | name | |||
| ) |
| SharedPtr<Partition> eng::GraphMaker::MakeSiblingPartition | ( | SharedPtr< Partition > | prevSiblingPartition, | |
| const string & | name | |||
| ) |
| PolygonNode_Tex::Ptr eng::GraphMaker::AttachNode | ( | const ModesNode::Value & | nodeValue, | |
| const NodePredecessors & | nodePredecessors | |||
| ) |
Attach a ModesNode.
Attach a MaterialNode as a descendant of a set of predecessors.
Attach a TextureNode as a descendant of a set of predecessors.
Attach a ColorsNode as a descendant of a set of predecessors.
Attach a PolygonNode as a descendant of a set of predecessors. Applies to all non-textured variants of PolygonNode.
Attach a PolygonNode_Tex as a descendant of a set of predecessors. Applies to all variants of PolygonNode_Tex.
| MaterialNode::Ptr eng::GraphMaker::AttachNode | ( | const MaterialNode::Value & | nodeValue, | |
| const NodePredecessors & | nodePredecessors | |||
| ) |
| TextureNode::Ptr eng::GraphMaker::AttachNode | ( | const TextureNode::Value & | nodeValue, | |
| const NodePredecessors & | nodePredecessors | |||
| ) |
| ColorsNode::Ptr eng::GraphMaker::AttachNode | ( | const ColorsNode::Value & | nodeValue, | |
| const NodePredecessors & | nodePredecessors | |||
| ) |
| PolygonNode::Ptr eng::GraphMaker::AttachNode | ( | const PolygonNode::Value & | nodeValue, | |
| const NodePredecessors & | nodePredecessors | |||
| ) |
| PolygonNode_Tex::Ptr eng::GraphMaker::AttachNode | ( | const PolygonNode_Tex::Value & | nodeValue, | |
| const NodePredecessors & | nodePredecessors | |||
| ) |
| void eng::GraphMaker::SetConstantNormals | ( | SharedPtr< NormalVertexs > | polygonNormals, | |
| SharedPtr< NormalVertexs > | vertexNormals | |||
| ) |
| POLYGON_NODE::Ptr eng::GraphMaker::AttachPolygonNode2 | ( | const typename POLYGON_NODE::Value & | nodeValue, | |
| const NodePredecessors & | nodePredecessors | |||
| ) | [inline, private] |
Template functions to attach an optimal species of PolygonNode.
| POLYGON_NODE::Ptr eng::GraphMaker::AttachPolygonNode | ( | const typename POLYGON_NODE::Value & | nodeValue, | |
| const NodePredecessors & | nodePredecessors | |||
| ) | [inline, private] |
shptr<Graph> eng::GraphMaker::mGraph [private] |
shptr<Partition> eng::GraphMaker::mPartition [private] |
Palomino 3D Engine documents generated by doxygen 1.5.3 on Fri Nov 23 11:26:22 2007