In This Topic
Shape navigation refers to the built-in abilities in the NShape class to easily obtain the shapes, which are connected to a specific shape.
The methods that facilitate shape navigation can be classified into two categories:
-
1D Shapes Specific Navigation - these are properties and methods, which only make sense for 1D Shapes, since only glue the end-points of 1D Shapes.
-
Generic Shape Navigation - these are properties and methods, which are applicable for all types of shapes (1D and 2D shapes).
1D Shapes Specific Navigation
Each 1D shape can be treated as a directed connector, which connects two other shapes.
The shape to which begin-point of a 1D shape is glued to is called from shape. The from shape can be obtained from the FromShape property. You implicitly specify the FromShape by gluing the begin-point of a 1D shape to other shapes, ports, geometries etc.
Analogously the shape to which end-point of a 1D shape is glued to is called to shape. The to shape can be obtained from the ToShape property. You implicitly specify the ToShape by gluing the end-point of a 1D shape to other shapes, ports, geometries etc.
A 1D shape is said to be reflexive (i.e. is a self-loop), if its FromShape and ToShape shapes are the same shape. You can easily check whether a 1D shape is reflexive with the help of the IsReflexive property.
Generic Shape Navigation
Since you can glue the end-points of a 1D-shape to any other shape, be it 1D or 2D, the following shape navigation methods are applicable for all types of shapes.
- Incoming and Outgoing Shapes
An incoming shape is such 1D shape, whose ToShape property refers to that shape. You can get the incoming shapes with the help of the GetIncomingShapes method. Analogously an outgoing shape is such 1D shape, whose start plug is connected to a port of the shape. You can get the outgoing shapes with the help of the GetOutgoingShapes method.
|
|
incoming shapes |
outgoing shapes |
- Destination and Source Shapes
The to shape of an outgoing shape is said to be a destination shape. You can get the destination shapes with the help of the GetDestinationShapes method. Analogously the from shape of an incoming shape is said to be a source shape. You can get the source shapes with the help of the GetSourceShapes method.
|
|
destination shapes |
source shapes |
- Successor and Predecessor Shapes
A successor shape is such a shape, which is either a destination shape or a successor shape of a destination shape. The successor shapes can be obtained from the GetSuccessorShapes method. Analogously a predecessor shape is such a shape, which is either a source shape or a predecessor shape of a source shape. The predecessor shapes can be obtained from the GetPredecessorShapes method.
|
|
Successor Shapes |
Predecessor Shapes |
- Neighbour and Accessible Shapes
The union of the source and destination shapes forms the set of neighbour shapes. The neighbour shapes can be obtained from the GetNeighbourShapes method.
An accessible shape is such a shape, which is either a neighbour shape or an accessible shape of a neighbour shape. The accessible shapes can be obtained from the GetAccessibleShapes method.
|
|
neighbour shapes |
accessible shapes |
- Reflexive Shapes
You can get the shapes, which reflex a shape with the help of the GetReflexiveShapes method.
Related Examples
Windows Forms: Document Object Model - Shapes - Shape Translation Slaves