MeshKit  1.0
MKGraph Class Reference

Class encapsulating manipulations of the meshing operation graph. More...

#include <meshkit/MKGraph.hpp>

Inheritance diagram for MKGraph:

List of all members.

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.
GraphNoderoot_node () const
 Get root node.
GraphNodeleaf_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.
MeshOpget_meshop (lemon::ListDigraph::Node node) const
 Get the MeshOp corresponding to a graph node.
GraphNodeget_node (lemon::ListDigraph::Node node) const
 Get the GraphNode corresponding to a graph node.
GraphNodesource (lemon::ListDigraph::Arc arc) const
 Get the GraphNode corresponding to the source node of this arc.
GraphNodetarget (lemon::ListDigraph::Arc arc) const
 Get the GraphNode corresponding to the target node of this arc.
GraphNodeother_node (lemon::ListDigraph::Arc arc, GraphNode *node) const
 Get the GraphNode at the other end of an arc from that specified.
GraphNodefind_node (std::string op_name) const
 Find an existing GraphNode in the graph, starting from the root.
MeshOpfind_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.
GraphNoderootNode
 Root and leaf nodes of graph.
GraphNodeleafNode
lemon::ListDigraph::NodeMap
< GraphNode * > 
nodeMap
 Map from graph nodes to GraphNodes.

Private Member Functions

 MKGraph (const MKGraph &)
 Copy constructor, not implemented.

Detailed Description

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.


Constructor & Destructor Documentation

MKGraph ( )

Bare constructor.

Definition at line 12 of file MKGraph.cpp.

~MKGraph ( ) [virtual]

virtual destructor

Definition at line 17 of file MKGraph.cpp.

MKGraph ( const MKGraph ) [private]

Copy constructor, not implemented.

Lemon does not allow copy construction of graphs, so disallow it in MK too


Member Function Documentation

void add_arc ( GraphNode source,
GraphNode target 
)

add a graph edge from one node to another

Parameters:
sourceSource node
targetTarget node

Definition at line 208 of file MKGraph.cpp.

void execute ( ) [virtual]

Run execute on the graph.

Examples:
example_basic.cpp, example_edgemesher.cpp, example_graph.cpp, example_meshoptemplate.cpp, and example_tfimapping.cpp.

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.

Parameters:
op_nameGraphNode name being requested
Returns:
Pointer to MeshOp found, NULL if not found

Definition at line 126 of file MKGraph.cpp.

GraphNode * find_node ( std::string  op_name) const

Find an existing GraphNode in the graph, starting from the root.

Parameters:
op_nameGraphNode name being requested
Returns:
Pointer to GraphNode found, NULL if not found

Definition at line 132 of file MKGraph.cpp.

lemon::ListDigraph & get_graph ( ) [inline]

Get the graph.

Get graph.

Examples:
example_copygeom.cpp, example_extrudemesh.cpp, and example_tfimapping.cpp.

Definition at line 149 of file MKGraph.hpp.

const lemon::ListDigraph & get_graph ( ) const [inline]

Get the (const) graph.

Get (const) graph.

Definition at line 143 of file MKGraph.hpp.

MeshOp * get_meshop ( lemon::ListDigraph::Node  node) const

Get the MeshOp corresponding to a graph node.

Definition at line 114 of file MKGraph.cpp.

GraphNode * get_node ( lemon::ListDigraph::Node  node) const [inline]

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.

Parameters:
insertedNode being inserted
beforeNode before which new node is inserted
afterNode after which new node is inserted (default: NULL)
Examples:
example_graph.cpp, and example_setpnt2quad.cpp.

Definition at line 146 of file MKGraph.cpp.

GraphNode * leaf_node ( ) const [inline]

Get leaf node.

Examples:
example_copygeom.cpp, example_extrudemesh.cpp, and example_setpnt2quad.cpp.

Definition at line 161 of file MKGraph.hpp.

lemon::ListDigraph::NodeMap< GraphNode * > & node_map ( ) [inline]

Get access to the node map.

Definition at line 173 of file MKGraph.hpp.

const lemon::ListDigraph::NodeMap< GraphNode * > & node_map ( ) const [inline]

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.

Parameters:
arcThe graph arc being queried
nodeThe other node
Returns:
The node on the other end of the specified arc

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)

print the graph

Examples:
example_graph.cpp.

Definition at line 42 of file MKGraph.cpp.

GraphNode * root_node ( ) const [inline]

Get root node.

Examples:
example_copygeom.cpp, and example_extrudemesh.cpp.

Definition at line 155 of file MKGraph.hpp.

void setup ( bool  reset = true) [virtual]

setup of the graph

Run setup on the graph.

Parameters:
reset: if true (default), force setup of the whole graph if false, setup only newly added nodes, that were not setup yet
Examples:
example_basic.cpp, example_edgemesher.cpp, example_graph.cpp, example_meshoptemplate.cpp, and example_tfimapping.cpp.

Definition at line 228 of file MKGraph.cpp.

GraphNode * source ( lemon::ListDigraph::Arc  arc) const [inline]

Get the GraphNode corresponding to the source node of this arc.

Definition at line 184 of file MKGraph.hpp.

GraphNode * target ( lemon::ListDigraph::Arc  arc) const [inline]

Get the GraphNode corresponding to the target node of this arc.

Definition at line 189 of file MKGraph.hpp.


Member Data Documentation

GraphNode * leafNode [protected]

Definition at line 127 of file MKGraph.hpp.

lemon::ListDigraph mkGraph [protected]

The GraphNode graph.

Definition at line 124 of file MKGraph.hpp.

lemon::ListDigraph::NodeMap<GraphNode*> nodeMap [protected]

Map from graph nodes to GraphNodes.

Definition at line 130 of file MKGraph.hpp.

GraphNode* rootNode [protected]

Root and leaf nodes of graph.

Definition at line 127 of file MKGraph.hpp.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines