NShape Reference
ShapeBase Class

<< Click to Display Table of Contents >>

Navigation:  Class Reference > Namespace Dataweb.NShape.Advanced >

NShape Reference
ShapeBase Class

Previous pageReturn to chapter overviewNext page

Base class for most of the shapes in the standard libraries and custom libraries.

Syntax

public abstract class ShapeBase: ShapeIShapeCollectionIReadOnlyShapeCollection

Description

ShapeBase can but need not be used as a base class for custom shapes. It provides support for the following areas:

Control point management

Child shape management

Model change processing

Public Properties

Name

Description

Children

Provides access to the child shapes.

ControlPointCount

Returns the number of control points.

Diagram

Indicates the diagram this shape is part of.

DisplayService

Specifies the display service for the shape.

Layers

A bitwise combination of all layers the shape is part of.

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.

Tag

Specifies a user-defined transient general purpose property.

Template

Indicates the shape's template.

Type

Indicates the shape's type.

X

Gets or sets the x coordinate of the shape's location.

Y

Gets or sets the y coordinate of the shape's location.

Public Methods

Name

Description

CalculateAbsolutePosition

CalculateConnectionFoot

Calculates the intersection point of the shape's outline with the line between the given coordinates and the shape's balance point.

CalculateNormalVector

Calculates a vector perpendicular to the shape's outline.

CalculateRelativePosition

Returns a ReplativePosition structure that representing the position of the given point relative to the shape.

The RelativePosition structure can only be used for shapes of the same type as the calculation method for the relative/absolute varies from shape to shape.

CanConnect

Returns true if a connection between the given connection points of this shape and the other shape is possible.

Clone

Creates a clone, which owns clones of all composite objects in 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.

FindNearestControlPoint

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

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.

GetMenuItemDefs

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

GetPropertyDefinitions

Implementation of the IEntity.GetPropertyDefinitions pseudo member.

HasControlPointCapability

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

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.

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.

Protected Properties and Fields

Name

Description

ChildrenCollection

Internal shape collection containing the children.

connectionInfos

A list of current connections between this shape and other shapes.

drawCacheIsInvalid

Specifies if the objects and buffers needed for drawing this shape should be recalculated.

IdCore

Specifies the IEntity.Id of this shape.

InternalTag

Specifies a user-defined transient general purpose property for internal use.

Matrix

A System.Drawing.Matrix object used for transforming the draw cache.

Owner

The shape collection owning 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.

CalcGluePoint

Calculates the position of a glue point with the help of another shape.

CalcGluePointFromPosition

Calculates the position of a glue point.

CalculateBoundingRectangle

Calculates the axis aligned bounding rectangle of the shape and its children.

CalculateCells

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

ChildrenContainPoint

Tests wether any of the children contains the given point.

Constructor

Constructs a new shape instance.

ControlPointsHaveMoved

Notifies all connected shapes that control points of this shape have moved.

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.

GetControlPointId

Returns the ControlPointId for the indicated control point.

GetControlPointIndex

Returns the index of the given control point.

InitializeToDefault

Initializes this shape with default values.

IntersectsWithChildren

Tests if the given rectangle intersects with any of this shape's children.

IntersectsWithCore

Implementation of Shape.IntersectsWith.

InvalidateDrawCache

Clears all objects and buffers needed for drawing the shape so that they will be recalculated the next time.

IsConnectionPointEnabled

Checks if the indicated control point is a mapped connection point (if this shape has a model object).

IsStyleAffected

Tests if the given style is affected by the changes made to  another style.

LoadFieldsCore

Implementation of IEntity.LoadFields.

LoadInnerObjectsCore

Implementation of IEntity.LoadInnerObjects.

MoveByCore

Implementation of Shape.MoveBy.

MovePointByCore

Implementation of Shape.MoveControlPointBy.

ProcessExecModelPropertyChange

Implementation of reacting to model property changes.

RecalcDrawCache

Recalculates all objects and buffers needed to draw this shape.

RotateCore

Implementation of Shape.Rotate.

SaveFieldsCore

Implementation of IEntity.SaveFields.

SaveInnerObjectsCore

Implementation of IEntity.SaveInnerObjects.

TransformDrawCache

Transforms all objects and buffers to the current position and angle.

UpdateDrawCache

Checks if any objects and buffers needed to draw the shape are invalid and calls RecalcDrawCache in this case.

Derived Classes

Derived classes are:

PathBasedPlanarShape

LineShapeBase

ImageBasedShape

Requirements

Namespace: Dataweb.NShape

Assembly: Dataweb.NShape