NShape Reference
Shape Class

<< Click to Display Table of Contents >>

Navigation:  Class Reference > Namespace Dataweb.NShape >

NShape Reference
Shape Class

Previous pageReturn to chapter overviewNext page

Base class for the graphical objects presented in a diagram.

public abstract class Shape : IEntityISecurityDomainObject, IDisposable, IEquatable<Shape>

Description

The shape is responsible for:

Drawing
Connecting
Moving and sizing
Loading and Saving

Every shape has a reference point, which is the point, which is moved in MoveTo. Every shape has control points that are used to resize or form the shape. Every shape can have connection points, which are used to connect to other shapes.

Public Properties

Name

Description

Children

Provides access to the child shapes.

Diagram

Indicates the diagram this shape is part of.

DisplayService

Specifies the display service for the shape.

HomeLayer

Specifies the id of the layer that should serve as home layer of the shape. Any layer can be used as home layer.
Available in versions newer than NShape 2.3.

Layers

Specifies the layer(s) this shape is part of.
Obsolete in versions newer than NShape 2.3.

LineStyle

Specifies the line style used for drawing.

ModelObject

Specifies the model object the shape represents.

Parent

Indicates the parent shape if this shape is part of an aggregation.

SecurityDomainName

Name of the security domain.

SupplementalLayers

Specifies the LayerIds flags of all combinable layers the shape is part of. Only combinable layers (the first 32 layers) can be used as supplemental layers.
Available in versions newer than NShape 2.3.

Tag

Specifies a user-defined transient general purpose property.

Template

Indicates the shape's template.

Type

Indicates the shape's type.

X

X coordinate of the shape.

Y

Y coordinate of the shape.

Public Methods

Name

Description

CalculateAbsolutePosition

Transforms a relative position to absolute coordinates.

CalculateConnectionFoot

Calculates the foot of a point-to-shape connection.

CalculateNormalVector

Calculates a vector perpendicular to the shape's outline.

CalculateRelativePosition

Transforms absolute coordinates to a relative position.

CanConnect

Returns true if a connection between the specified shapes and their connection points is feasible.

Clone

Creates a copy of the shape.

Connect

Connects a shape to another shape.

ContainsPoint

Determines whether the given point is inside the shape.

CopyFrom

Copies as many properties as possible from the source shape.

Disconnect

Disconnects a shape control point from another shape.

Dispose

Disposes the shape. All attached model objects will be notified that this shape will no longer exist.

Draw

Draws the shape.

DrawOutline

Draws the shape's outline.

DrawThumbnail

Draws a thumbnail picture of the shape.

Equals

 

FindNearestControlPoint

Finds the control point, with the least distance to the given coordinates fulfilling the ControlPointCapabilities constraints.

Fit

Resizes and moves the shape to fit into the given rectangle.

FollowConnectionPointWithGluePoint

Moves a connected glue point when the connection point has moved.

GetBoundingRectangle

Retrieves an axis-aligned bounding box for the shape.

GetConnectionInfo

Retrieves information about a specific connection of the shape.

GetConnectionInfos

Retrieves information about the connections of the shape.

GetControlPointIds

Returns a list of ControlPointIds that fulfill at least one of the requested ControlPointCapabilities.

GetControlPointPosition

Retrieves the position of the given control point.

GetMenuItemDefs

Retrieves the list of context menu item definitions of the shape.

HasControlPointCapability

Tests, whether a control point has at least one of a set of given capabilities.

HasStyle

Checks whether the given style is used by the shape.

HitTest

Tests whether the shape has a control point near the given coordinates.

IntersectOutlineWithLineSegment

Calculates the intersection points of the shape's outline with the given line segment.

IntersectsWith

Determines whether the given rectangle intersects with the shape.

Invalidate

Invalidates the shape.

IsConnected

Tests, whether the shape is connected to a given other shape.

MakePreview

Transforms the shape into a preview shape.

MoveBy

Moves the shape by a given distance.

MoveControlPointBy

Moves the control point by a given distance.

MoveControlPointTo

Moves the control point to a given position.

MoveTo

Moves the shape to a given position.

NotifyModelChanged

Notifies the shape that a property of its model object has changed.

NotifyStyleChanged

Notifies the shape that the given style has changed.

Rotate

Rotates the shape.

ToString

Returns the shape's shape type name.

Protected Properties

Name

Description

ChildrenCollection

Gets the collection that stores and manages the shape's child shapes.

IdCore

Specifies the IEntity.Id of this shape.

Protected Methods

Name

Description

AssignIdCore

Implementation of IEntity.AssignId.

AttachGluePointToConnectionPoint

Attaches a glue control point of this shape to a connection control point of another shape when creating a connection between shapes.

CalculateCells

Calculates the cells occupied by this shape in the diagram's spatial index.

DeleteCore

Implementation of IEntity.Delete.

DetachGluePointFromConnectionPoint

Detaches an attached glue control point of this shape from a connection control point of another shape when disconnecting connected shapes.

InitializeToDefault

Initializes a shape with default values.

LoadFieldsCore

Implementation of IEntity.LoadFields.

LoadInnerObjectsCore

Implementation of IEntity.LoadInnerObjects.

SaveFieldsCore

Implementation of IEntity.SaveFields.

SaveInnerObjectsCore

Implementation of IEntity.SaveInnerObjects.

Derived Classes

Derived classes are:

ShapeBase

ShapeGroup

Requirements

Namespace: Dataweb.NShape

Assembly: Dataweb.NShape