Table of Contents

Class vdFigure

Namespace
VectorDraw.Professional.vdPrimaries
Assembly
VectorDraw.Professional.dll

This is a Base object that all Drawable objects (like vdLine, vdCircle, etc.) inherit from.

public abstract class vdFigure : vdPrimary, IDisposable, IVDSerialise, IBaseObject
Inheritance
vdFigure
Implements
Derived
Inherited Members

Remarks

The vdFigure class serves as the base class for all drawable entities in the VectorDraw Professional library. It provides fundamental properties and methods for managing visual attributes, rendering, and interaction with drawing objects.

Key Responsibilities:

  • Manages visual properties such as color, line type, line weight, and transparency.
  • Handles layer assignment and visibility control.
  • Provides grip point management for object selection and editing.
  • Manages drawing and rendering through the vdRender system.
  • Raises events for object modification, drawing, and user interaction.
  • Supports serialization and deserialization of object state.
  • Manages bounding box calculations and coordinate transformations.

Common Usage:

This class is not instantiated directly but serves as a base for concrete figure types such as vdLine, vdCircle, vdPolyline, etc.

Important Properties:

PropertyPurpose
LayerGets or sets the vdLayer object that this figure belongs to.
PenColorGets or sets the color used to draw this figure.
LineTypeGets or sets the line type (solid, dashed, etc.) for this figure.
PenWidthGets or sets the width of the pen in drawing units.
visibilityGets or sets the visibility state of the figure.
BoundingBoxGets the bounding box of the figure in world coordinates.
ECSMatrixGets the transformation matrix from object to world coordinate system.

Events Raised:

Constructors

vdFigure()

The constructor of the vdFigure object where the default initialization is commited.

Fields

mBoundBox

This field is used to store the Bounding Box of the object.

mEcsMatrix

This field is used to store the ECSMatrix of the object.

mGipPoints

This field is used to store the calculated grip points of the object.

mLayer

This field is used to store the Layer of the object.

mLineType

Internally used for the object's linetype.It is recommended to use the LineType property instead.

mPenColor

This field is used to store the PenColor of the object.

Properties

BoundingBox

Gets the Bounding Box of the object in WorldCoordinate System.

Deleted

Get/Set a property that marks the object as Deleted or not.

Draw3DFlag

Get/Set a property value used when drawing an object in 3d.

DrawingList

Internally used to store the List's pointer of the object.

ECSMatrix

Gets the transformation Matrix that converts coordinates from the object's local coordinate system (object coordinate system, OCS) to the World Coordinate System (WCS).

FadeEffect

Get/Set the color Fading effect percentage close to the background color of output rendering.

HighLight

Get/Set the value indicating if the lines of the object will be drawn as dashed.

IsUpdated

returns true if the object is updated and false if the object needs to be updated. An object needs to be updated when it's Bounding Box is empty and not calculated.

Layer

Get/Set the vdLayer object of the vdFigure.

LineType

Get/Set the vdLinetype object that the vdFigure will be drawn with.

LineTypeScale

Get/Set The Linetype scale of the object.

LineWeight

Get/Set The LineWeight of the object.

PenColor

Get/Set the vdColor object that the vdFigure will be drawn with.

PenWidth

Get/Set the PenWidth in Drawing Units of the object.

PixelIDFlag

Returns an integer flag that used when an object is pixelized on the screen Currently valid range is between 0 to 255. It can be used by GetIdAtPixel(int, int) method The default flag currently used is the Lock property of the Layer that this object is belong to. 1 if the Layer is Lock and 0 if not. You can override this property and return additional application specific bit values (ex.compination of : 2 , 4, 8, 16 ,32, 64 ,128)

ShowGrips

Get/Set a boolean value indicating that when the object is drawn if the object's grips will be drawn too.

ToolTip

Get/Set a string representing the Tooltip of the object.

TransparencyMethod

Get/Set a value that represents from where the transparency of the object will be taken.

URL

Get/Set a string representing the URL of the object.

visibility

Get/Set the visibility of the object.

Methods

AddToSelection(vdSelection, bool, AddItemCheck)

Called when this object is going to be added to a selection and before any other event

AfterDraw(vdRender)

Should be only overriden in Custom objects.

DeSerialize(DeSerializer, string, object)

This Function is called foreach field name of the vdFigure object when opening in vdml format.

Dispose()

Releases all resources used by this object.

Draw(vdRender)

Called in order to draw the object in a specified vdRender object.

DrawGrip(int, Box, vdRender)

Called by DrawGrips(vdRender) method.Draws the specified index grip as the passed GripBox to the passed vdRender object.

DrawGrips(vdRender)

Draws the grips of the object in the specified vdRender object.

Explode()

Explode an entity in sub entities.

~vdFigure()

Clears unmanaged resources before the object is reclaimed by garbage collection.

GetCompareHash()

Called when this object is going to be compare with an other object by Compare(vdDocument)

GetGripPoints()

A function returning the grip points of the object.

GetOutLine()

Calculates the outline of this figure projected in World coordinate system. In case of vdCurve the projection is in plane of the Extrusion Vector.

GetRenderColor(vdRender)

Returns the System.Drawing.Color of this entity in connection with passed render

GetRenderPenStyle(vdRender)

Returns the vdGdiPenStyle of this entity in connection with passed render

GetTableDependecies(vdTableDependeciesArgs)

Fills the passed vdTableDependeciesArgs args with all the table references of this object (vdLayer, vdBlock, vdDimstyle, vdLineType, vdTextstyle, vdImageDef, vdHatchPattern etc).

GetValidGripPointsItems()

Returns the number of valid grip points of the object. Must return the same number of points as the GetGripPoints() method.

GripIndexProjection(int, out Vector)

Returns the movement direction for the specific grip point index in the world coordinate system.

InGroup()

Get a boolean value that represents if a figure belongs to a vdGroup or not

InitializeProperties()

Resets the properties of the vdFigure object to the Default values.

InternalSetOwner(vdBaseObject)

Internally used only.

Set the object owner

IntersectWith(vdFigure, VdConstInters, gPoints)

Finds the intersection points of an object with another object.

Invalidate()

Invalidates the object's Bounding Box and causes the control to be redrawn in this region.

Is3dSectionVisible(Matrix)

Indicates if at least a segment of the object is visible after applying the SectionClips in 3dRender mode.

IsVisible()

Indicates if the object can be drawn.

ListEnd(vdRender)

This method should be called in customobjects at the end of the Draw method. Check our samples with custom objects to see proper use.

ListStart(vdRender)

This method should be called in customobjects at the beginning of the Draw method. Check our samples with custom objects to see proper use.

MatchGroupObjects(vdFigure)

Adds the passed vdFigure object to the Groups of this object.

MatchProperties(vdPrimary, vdDocument)

Matches all the common properties from an object and sets them to this object.

MatchProperties_base(vdPrimary, vdDocument)

Matches all the common properties from an object of this type and derived types and sets them to thisobject properties and derived properties

MoveGripPointsAt(Int32Array, double, double, double)

This function is intended to be called during a grip edit of the object.

OnBeforeDrawGrips(vdRender)

Called before DrawGrips(vdRender) method. Can be used to draw additional primitives when grips of an entity drawn .By default does nothing.

OnDocumentSelected(vdDocument)

This method is called when the object is inserted in a Document for the first time.

OnDrawOpenGLPrimitives(IvdOpenGLRender)

Represents the event fired in order to draw the object using OpenGL list commands.

OnOwnerChanged()

This method is called when the object's owner is changed.

PrepareBeforeDraw(vdRender)

Prepare the render penstyle and raises the OnDrawFigure event.

RaiseOnDraw(vdRender)

Raises the OnDrawFigure Event of vdDocument object.

RaiseOnDrawAfter(vdRender)

Raises the OnDrawAfterFigure Event of vdDocument object.

RaiseOnGetGripPoints(gPoints)

Raises the OnGetGripPoints Event of vdDocument object.

RaiseOnMoveGripPointsAt(Int32Array, double, double, double)

Raises the OnMoveGripPointsAt Event of vdDocument object.

Serialize(Serializer)

This Function is called when saving the vdFigure object to vdml format.

SupportOpenGLPrimitives(IvdOpenGLRender)

A boolean value that represents if the user will use the OnDrawOpenGLPrimitives(IvdOpenGLRender) event to draw the object using his own Opengl commands.

ToString()

Gets a System.String that represents the type of the vdFigure Object.

Transformby(Matrix)

Applies the supplied transformation mat to all geometric properties maintained by this figure. This base implementation updates properties that are common to all figures:

  • scales the figure's PenWidth by the matrix XY scale,
  • delegates the matrix to any extended properties collection (mXProperties),
  • and calls Update() to invalidate cached geometry (bounding box, grip points, rendering lists) so they will be recalculated.

Derived classes that override Transformby(Matrix) should perform any type-specific geometric transformations and must call the base implementation (typically at the end) to preserve the common behaviour documented above.

Update()

Updates the object after change of properties.

VisibleOnScreen()

Specifies if the drawing object is visible on screen

getClosestPointTo(gPoint)

Get The closest point belonging to the curve.

getOsnapNearest(gPoint, OsnapMode)

Get The closest osnap point to the givenPoint.

getOsnapPoints(Matrix, OsnapMode, gPoint, gPoint, int, OsnapPoints)

Calculates object snap points for a specific cursor position and fills the provided OsnapPoints collection with the found snap points.

See Also