Diagram for .NET > User's Guide > Document Object Model > Models > Shapes > Primitive Shapes |
Primitive shapes are shapes, which aggregate a single primitive model. All types of primitive shapes derive from the base NPrimitiveShape abstract class. The major purpose of primitive shapes is to expose a single primitive model as a shape, so that it can be interactively edited, connected with other shapes etc.
Primitive shapes use the following class hierarchy:
As you can see the hierarchy of the primitive shapes closely follows the hierarchy of the implemented primitive models.
As there currently are two major types of primitive models - paths and texts - natively there are also two major types of primitive shapes - primitive path shapes and primitive text shapes.
Primitive shapes share the following set of common features:
All primitive shapes aggregate a single primitive model, which can be obtained from the Primitive property of the NPrimitiveShape class.
The aggregate primitive influences much of the primitive shape behavior. The following model aspects of a shape are actually inherited from the aggregate primitive model:
The base class for all primitive shapes, which aggregate a single path primitive is the NPathShape abstract class. The NPathShape class implements the INPoints interface and by default delegate the implementation to the contained path primitive (note that all path primitives implement the INPoints interface).
The base class for all path shapes, which aggregate a single polypath primitive is the NPolyPathShape abstract class. The NPolyPathShape class implements the INPolyPoints and INSegments interfaces and by default delegate the implementation to the contained poly path primitive (note that all poly path primitives implement these interfaces).
The following table summarizes the currently available instancable path shapes:
Path shape class | Description | Shape type | Bridgeable | Routable | Reflexive |
---|---|---|---|---|---|
Simple primitive shapes | |||||
NLineShape | Represents a shape, which aggregates a single line path. | 1D | yes | no | no |
NBezierCurveShape | Represents a shape, which aggregates a single bezier curve path. It has two control points, which modifies the control points of the contained bezier path. | 1D | no | no | yes |
NRectanglePath | Represents a shape, which aggregates a single rectangle path (actually a quadrangle) | 2D | no | no | no |
NEllipsePath | Represents a shape, which aggregates a single ellipse path | 2D | no | no | no |
NCircularArcShape | Represents a shape, which aggregates a single circular arc path. It has one control point, which modifies the control point of the contained circular arc. | 1D | no | no | no |
NEllipticalArcShape | Represents a shape, which aggregates a single elliptical arc path.It has one control point, which modifies the control point of the contained elliptical arc. | 1D | no | no | no |
NArrowShape | Represents a shape, which aggregates a single arrow path. | 1D | no | no | no |
NCurveShape | Represents a shape, which aggregates a single curve path. | 1D | no | no | yes |
NPolylineShape | Represents a shape, which aggregates a single polyline path. | 1D | yes | no | yes |
NClosedCurveShape | Represents a shape, which aggregates a single closed curve path. | 2D | no | no | no |
NPolygonShape | Represents a shape, which aggregates a single polygon path. | 2D | no | no | no |
More sophisticated shapes | |||||
NStep2Connector | Represents a connector, which connects its start and end points in two orthogonal steps (L-shaped connector). The first step can either be vertical or horizontal, that is why it is often called HV or VH connector. Aggregates a single NHVPolylinePath primitive. | 1D | yes | no | no |
NStep3Connector | Represents a connector, which connects its start and end points in three orthogonal steps. The first step can either be vertical or horizontal, that is why it is often called HVH or VHV connector. Aggregates a single NHVPolylinePath primitive. It has one control point, which modifies the middle segment position. | 1D | yes | no | no |
NRoutableConnector | Represents a connector, which can automatically avoid obstacles in its path. It can mutate (change the type of the aggregated path). The type of the aggregated path determines the type of routing the connector uses - Mesh or Grid. | 1D | yes | yes | yes |