Class GraphTree
A Graph data structure representation of the SystemGraph
Namespace: Mechatronics.SystemGraph
Syntax
public class GraphTree
Fields
bounds
The bounds
Declaration
public Rect bounds
Field Value
| Type | Description |
|---|---|
| Rect |
curLeftRank
The current left rank
Declaration
public int[] curLeftRank
Field Value
| Type | Description |
|---|---|
| Int32[] |
curRightRank
The current right rank
Declaration
public int[] curRightRank
Field Value
| Type | Description |
|---|---|
| Int32[] |
gridLayout
The grid layout
Declaration
public GraphTree.GridDescriptor[, ] gridLayout
Field Value
| Type | Description |
|---|---|
| GraphTree.GridDescriptor[,] |
kMaxLevel
The default constant maximum level
Declaration
public static int kMaxLevel
Field Value
| Type | Description |
|---|---|
| Int32 |
kMaxRank
The default constant maximum rank
Declaration
public static int kMaxRank
Field Value
| Type | Description |
|---|---|
| Int32 |
levelBound
The level bound
Declaration
public Rect[] levelBound
Field Value
| Type | Description |
|---|---|
| Rect[] |
maxLevel
The maximum level
Declaration
public int maxLevel
Field Value
| Type | Description |
|---|---|
| Int32 |
maxRank
The maximum rank
Declaration
public int maxRank
Field Value
| Type | Description |
|---|---|
| Int32 |
minLevel
The minimum level
Declaration
public int minLevel
Field Value
| Type | Description |
|---|---|
| Int32 |
minRank
The minimum rank
Declaration
public int minRank
Field Value
| Type | Description |
|---|---|
| Int32 |
root
The root TreeNode
Declaration
public GraphTree.TreeNode root
Field Value
| Type | Description |
|---|---|
| GraphTree.TreeNode |
Methods
AddNodeDescriptor(GraphDescriptor, NodeDescriptor, GraphTree.TreeNode, PortDirection, PortDirection)
Adds the node descriptor.
Declaration
protected GraphTree.TreeNode AddNodeDescriptor(GraphDescriptor desc, NodeDescriptor node, GraphTree.TreeNode parent, PortDirection parentSide, PortDirection selfSide)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphDescriptor | desc | The graph descriptor. |
| NodeDescriptor | node | The node descriptor to add. |
| GraphTree.TreeNode | parent | The parent TreeNode. |
| PortDirection | parentSide | The parent side. |
| PortDirection | selfSide | Add to the side of this node descriptor. |
Returns
| Type | Description |
|---|---|
| GraphTree.TreeNode | TreeNode that was created. |
AddRootNodeDescriptor(GraphDescriptor, NodeDescriptor, GraphTree)
Adds the root node descriptor.
Declaration
public void AddRootNodeDescriptor(GraphDescriptor desc, NodeDescriptor node, GraphTree tree)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphDescriptor | desc | The graph descriptor. |
| NodeDescriptor | node | The root node descriptor to add. |
| GraphTree | tree | The graph tree descriptor. |
GetAllNodes()
Gets all nodes.
Declaration
public Dictionary<NodeDescriptor, GraphTree.TreeNode> GetAllNodes()
Returns
| Type | Description |
|---|---|
| Dictionary<NodeDescriptor, GraphTree.TreeNode> | Dictionary<NodeDescriptor, TreeNode>. |
GetMaxLevelsInBetween(PortDirection, GraphTree.TreeNode, HashSet<GraphTree.TreeNode>, Int32, GraphTree.Visitor)
Gets the maximum levels going to the specified side from the specified caller tree node.
Declaration
public int GetMaxLevelsInBetween(PortDirection side, GraphTree.TreeNode callerNode, HashSet<GraphTree.TreeNode> lst, int recurseLevel = 0, GraphTree.Visitor visitor = null)
Parameters
| Type | Name | Description |
|---|---|---|
| PortDirection | side | The side to scan. |
| GraphTree.TreeNode | callerNode | The caller node. |
| HashSet<GraphTree.TreeNode> | lst | The list of tree nodes to scan. |
| Int32 | recurseLevel | The recursive level which represent the current maximum level. |
| GraphTree.Visitor | visitor | The visitor descriptor. |
Returns
| Type | Description |
|---|---|
| Int32 | Maximum levels in between caller node in the side direction. |
GetTreeNode(NodeDescriptor)
Gets the tree node for a given node descriptor.
Declaration
public GraphTree.TreeNode GetTreeNode(NodeDescriptor node)
Parameters
| Type | Name | Description |
|---|---|---|
| NodeDescriptor | node | The node descriptor. |
Returns
| Type | Description |
|---|---|
| GraphTree.TreeNode | TreeNode attached to this node descriptor. |
InsertTreeNode(GraphDescriptor, GraphTree.TreeNode)
Inserts the tree node.
Declaration
protected void InsertTreeNode(GraphDescriptor desc, GraphTree.TreeNode tNode)
Parameters
| Type | Name | Description |
|---|---|---|
| GraphDescriptor | desc | The graph descriptor. |
| GraphTree.TreeNode | tNode | The TreeNode to insert. |
Traverse(PortDirection, GraphTree.TreeNode, HashSet<GraphTree.TreeNode>, GraphTree.TraverseDelegate, GraphTree.Visitor)
Traverses the specified side.
Declaration
public void Traverse(PortDirection side, GraphTree.TreeNode srcNode, HashSet<GraphTree.TreeNode> lst, GraphTree.TraverseDelegate fnc, GraphTree.Visitor visitor = null)
Parameters
| Type | Name | Description |
|---|---|---|
| PortDirection | side | The side to traverse. |
| GraphTree.TreeNode | srcNode | The source node. |
| HashSet<GraphTree.TreeNode> | lst | The list of TreeNodes. |
| GraphTree.TraverseDelegate | fnc | The traverse delegate to be called when visiting a node. |
| GraphTree.Visitor | visitor | The visitor descriptor. |