Export (0) Print
Expand All

ShapeGeometry Class

Represents the geometry for a shape or connector.

Namespace:  Microsoft.VisualStudio.Modeling.Diagrams
Assembly:  Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0 (in Microsoft.VisualStudio.Modeling.Sdk.Diagrams.12.0.dll)

public abstract class ShapeGeometry : IDisposable

The ShapeGeometry type exposes the following members.

  NameDescription
Protected methodShapeGeometryInitializes a new instance of the ShapeGeometry class.
Top

  NameDescription
Public propertyStatic memberMaximumShadowOffsetGets the maximum offset allowed between a shape outline and the outer edge of its shadow.
Public propertyShadowOffsetGets the offset between the shape outline and the outer edge of the shadow.
Protected propertyUninitializedPathGets the path around the shape geometry.
Top

  NameDescription
Protected methodStatic memberCreateDiagramItemCreates a shape geometry host.
Public methodDispose()Releases all resources used by the current instance of the ShapeGeometry class.
Protected methodDispose(Boolean)
Public methodDoFoldToShapeCalculates the point where a connector crosses the outline of the shape geometry. It is used to compute where connectors should terminate.
Public methodDoHitTest(IGeometryHost, PointD, DiagramHitTestInfo)Determines whether a point is inside a shape.
Public methodDoHitTest(IGeometryHost, PointD, DiagramHitTestInfo, Boolean)Determines whether a point is inside a shape.
Public methodDoHitTestSelectionDetermines whether a point is inside the selection highlight of a shape.
Public methodDoPaintDraws the shape geometry, and its shadow if it has one.
Public methodDoPaintEmphasisDraws emphasis on the shape.
Protected methodDoPaintGeometryPaints the boundary and background of the shape.
Public methodDoPaintResizeFeedbackDraws the resize feedback for the shape geometry. Called repeatedly as the user moves the mouse to resize the shape.
Public methodDoPaintSelectionDraws the selection highlighting, which typically surrounds the shape boundary.
Protected methodDoPaintShadowDraws the shadow for the shape.
Public methodEqualsDetermines whether the specified object is equal to the current object. (Inherited from Object.)
Protected methodFinalizeAllows an object to try to free resources and perform other cleanup operations before it is reclaimed by garbage collection. (Inherited from Object.)
Public methodGetBackgroundBrushIdGets the ID that is assigned to the brush that paints the background of the shape geometry.
Public methodGetExtraPenWidthGets the width of the outline pen that is outside the boundary of the shape.
Public methodGetHashCodeServes as the default hash function. (Inherited from Object.)
Protected methodStatic memberGetHitTestToleranceGets the tolerance around the shape geometry to use when a hit test is performed.
Public methodGetOutlinePenIdGets the ID that is assigned to the brush that paints the outline of the shape geometry.
Public methodGetPath(IGeometryHost)Gets the path around the shape geometry. Use the returned path before applying GetPath() to any other shape. Use GetPathCopy() if you want to retain a path.
Protected methodGetPath(RectangleD)Gets the path around the shape geometry.
Public methodGetPathCopyGets a copy of the path around the shape geometry. Dispose the path when you have finished with it.
Public methodGetPerimeterGets the path of the perimeter around the shape, including the width of the pen that draws the boundary. Make a copy of this path if you want to retain it.
Protected methodGetPerimeterBoundingBoxGets the bounding box around the perimeter of the shape, including the thickness of the pen that draws the boundary.
Public methodStatic memberGetSelectionBorderThickness(Graphics)Gets the width of the border for a selection in the current view.
Public methodStatic memberGetSelectionBorderThickness(DiagramClientView)Gets the width of the border for a selection in the specified view.
Public methodGetSelectionLineOffsetGets the distance between the selection and the outside of the shape geometry.
Public methodGetSelectionLineWidthGets the width of the line that indicates that a shape is selected.
Public methodGetTypeGets the Type of the current instance. (Inherited from Object.)
Protected methodHasFilledBackgroundTrue if this type of geometry has a filled background.
Protected methodHasOutlineTrue if this type of geometry has a visible border.
Protected methodHasShadowTrue if this type of geometry has a shadow.
Protected methodMemberwiseCloneCreates a shallow copy of the current Object. (Inherited from Object.)
Public methodStatic memberRotateRotate an array of points around a specified center.
Public methodStatic memberSnapToCircleSnaps a potential point from the bounding box around the shape geometry to the perimeter of the circle.
Public methodToStringReturns a string that represents the current object. (Inherited from Object.)
Public methodStatic memberTranslateMoves an array of points by a specified vector.
Top

This class and its derivatives deal with operations and calculations associated with the outline of the shape. There is a subclass for each of the major kinds of shape, such as ImageShapeGeometry, CompartmentShapeGeometry, and LinkShapeGeometry. By default, your shape or connector class is associated with one of these standard geometry classes.

To override functions of ShapeGeometry:

  • Create your own class derived from one of the standard subclasses of ShapeGeometry. Do not add state variables to this class.

  • In your shape class, override the ShapeGeometry property to return an instance of your ShapeGeometry subclass.

ShapeGeometry is a lightweight class – it has no state, so that you can share an instance between all the instances of a shape class.

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.
Show:
© 2014 Microsoft