MeshKit
1.0
|
Class encapsulating manipulations of the meshing operation graph. More...
#include <meshkit/MKGraph.hpp>
Public Member Functions | |
MKGraph () | |
Bare constructor. | |
virtual | ~MKGraph () |
virtual destructor | |
void | clear_graph () |
clear GraphNode's/MeshOp's in graph | |
void | print_graph (const char *filename=NULL) |
print the graph | |
void | print_bfs_graph () |
print the bfs graph | |
lemon::ListDigraph & | get_graph () |
Get the graph. | |
const lemon::ListDigraph & | get_graph () const |
Get the (const) graph. | |
GraphNode * | root_node () const |
Get root node. | |
GraphNode * | leaf_node () const |
Get leaf node. | |
lemon::ListDigraph::NodeMap < GraphNode * > & | node_map () |
Get access to the node map. | |
const lemon::ListDigraph::NodeMap < GraphNode * > & | node_map () const |
Get access to the (const) node map. | |
MeshOp * | get_meshop (lemon::ListDigraph::Node node) const |
Get the MeshOp corresponding to a graph node. | |
GraphNode * | get_node (lemon::ListDigraph::Node node) const |
Get the GraphNode corresponding to a graph node. | |
GraphNode * | source (lemon::ListDigraph::Arc arc) const |
Get the GraphNode corresponding to the source node of this arc. | |
GraphNode * | target (lemon::ListDigraph::Arc arc) const |
Get the GraphNode corresponding to the target node of this arc. | |
GraphNode * | other_node (lemon::ListDigraph::Arc arc, GraphNode *node) const |
Get the GraphNode at the other end of an arc from that specified. | |
GraphNode * | find_node (std::string op_name) const |
Find an existing GraphNode in the graph, starting from the root. | |
MeshOp * | find_meshop (std::string op_name) const |
Find an existing MeshOp in the graph, starting from the root. | |
void | insert_node (GraphNode *inserted, GraphNode *before, GraphNode *after=NULL) |
Insert a node in the graph just before the specified node. | |
void | add_arc (GraphNode *source, GraphNode *target) |
add a graph edge from one node to another | |
virtual void | setup (bool reset=true) |
setup of the graph | |
virtual void | execute () |
Run execute on the graph. | |
virtual void | setup_and_execute () |
Run both setup and execute on the graph. | |
virtual void | execute_before (GraphNode *upto) |
Protected Attributes | |
lemon::ListDigraph | mkGraph |
The GraphNode graph. | |
GraphNode * | rootNode |
Root and leaf nodes of graph. | |
GraphNode * | leafNode |
lemon::ListDigraph::NodeMap < GraphNode * > | nodeMap |
Map from graph nodes to GraphNodes. | |
Private Member Functions | |
MKGraph (const MKGraph &) | |
Copy constructor, not implemented. |
Class encapsulating manipulations of the meshing operation graph.
Mesh generation can be phrased as a graph of operations, where each node in the graph is a distinct operation (some of them generating mesh, others just operating on mesh) and each arc a dependency between one operation and another. The graph in MeshKit has single root and leaf node, just as a convenience for starting up forward and reverse traversals of the graph. This class also defines the typedefs used for certain graph data structures like nodes and arcs.
Definition at line 24 of file MKGraph.hpp.
MKGraph | ( | ) |
Bare constructor.
Definition at line 12 of file MKGraph.cpp.
~MKGraph | ( | ) | [virtual] |
virtual destructor
Definition at line 17 of file MKGraph.cpp.
Copy constructor, not implemented.
Lemon does not allow copy construction of graphs, so disallow it in MK too
add a graph edge from one node to another
source | Source node |
target | Target node |
Definition at line 208 of file MKGraph.cpp.
void clear_graph | ( | ) |
clear GraphNode's/MeshOp's in graph
Definition at line 21 of file MKGraph.cpp.
void execute | ( | ) | [virtual] |
Run execute on the graph.
Definition at line 263 of file MKGraph.cpp.
void execute_before | ( | GraphNode * | upto | ) | [virtual] |
Definition at line 295 of file MKGraph.cpp.
MeshOp * find_meshop | ( | std::string | op_name | ) | const |
Find an existing MeshOp in the graph, starting from the root.
op_name | GraphNode name being requested |
Definition at line 126 of file MKGraph.cpp.
Find an existing GraphNode in the graph, starting from the root.
op_name | GraphNode name being requested |
Definition at line 132 of file MKGraph.cpp.
lemon::ListDigraph & get_graph | ( | ) | [inline] |
Get the graph.
Get graph.
Definition at line 149 of file MKGraph.hpp.
const lemon::ListDigraph & get_graph | ( | ) | const [inline] |
MeshOp * get_meshop | ( | lemon::ListDigraph::Node | node | ) | const |
Get the MeshOp corresponding to a graph node.
Definition at line 114 of file MKGraph.cpp.
Get the GraphNode corresponding to a graph node.
Definition at line 179 of file MKGraph.hpp.
void insert_node | ( | GraphNode * | inserted, |
GraphNode * | before, | ||
GraphNode * | after = NULL |
||
) |
Insert a node in the graph just before the specified node.
inserted | Node being inserted |
before | Node before which new node is inserted |
after | Node after which new node is inserted (default: NULL) |
Definition at line 146 of file MKGraph.cpp.
Get leaf node.
Definition at line 161 of file MKGraph.hpp.
Get access to the node map.
Definition at line 173 of file MKGraph.hpp.
Get access to the (const) node map.
Get access to the node map.
Definition at line 167 of file MKGraph.hpp.
GraphNode * other_node | ( | lemon::ListDigraph::Arc | arc, |
GraphNode * | node | ||
) | const |
Get the GraphNode at the other end of an arc from that specified.
arc | The graph arc being queried |
node | The other node |
Definition at line 119 of file MKGraph.cpp.
void print_bfs_graph | ( | ) |
print the bfs graph
Definition at line 96 of file MKGraph.cpp.
void print_graph | ( | const char * | filename = NULL | ) |
Get root node.
Definition at line 155 of file MKGraph.hpp.
void setup | ( | bool | reset = true | ) | [virtual] |
setup of the graph
Run setup on the graph.
reset | : if true (default), force setup of the whole graph if false, setup only newly added nodes, that were not setup yet |
Definition at line 228 of file MKGraph.cpp.
void setup_and_execute | ( | ) | [inline, virtual] |
Run both setup and execute on the graph.
Definition at line 195 of file MKGraph.hpp.
Get the GraphNode corresponding to the source node of this arc.
Definition at line 184 of file MKGraph.hpp.
Get the GraphNode corresponding to the target node of this arc.
Definition at line 189 of file MKGraph.hpp.
Definition at line 127 of file MKGraph.hpp.
lemon::ListDigraph mkGraph [protected] |
The GraphNode graph.
Definition at line 124 of file MKGraph.hpp.
Map from graph nodes to GraphNodes.
Definition at line 130 of file MKGraph.hpp.
Root and leaf nodes of graph.
Definition at line 127 of file MKGraph.hpp.