Table of Contents

Class vdEntities

Namespace
VectorDraw.Professional.vdCollections
Assembly
VectorDraw.Professional.dll

Represents a collection of vdFigure objects and provides management, rendering and serialization services for those entities.

public sealed class vdEntities : vdBaseObject, IDisposable, IVDSerialise, IEnumerable, IBaseObject
Inheritance
vdEntities
Implements
Inherited Members

Examples

Typical usage:

// Add and enumerate entities of document model collection
var entities = document.Model.Entities;
entities.AddItem(new vdLine(...));
entities.AddItem(new vdCircle(...));

// Iterate
foreach (vdFigure f in entities) { /* ... */ }

Remarks

The vdEntities class is the primary container used by a vdDocument (for example, the document model, layouts or block definitions) to store drawable figures.

Key behaviors:

  • Ownership: When entities are added to a registered document collection, their Owner and document references are set accordingly. Removing an entity will clear its owner (when appropriate).
  • Document registration: If the collection is part of a document register, events such as OnAddItem and OnAfterAddItem may be raised.

This collection exposes methods for typical collection operations (add/remove/insert/sort/replace/find)

Constructors

vdEntities()

Initializes the vdEntities collection object.

vdEntities(vdFigure[])

Initializes a new instance of the object and adds the passed items to this collection.

Properties

ArrayItems

Return a readonly internally used collection.

Count

Get the item's count of the collection.

this[int]

Get an object from the collection at a specified index.

ItemType

Returns the Type of Items in the collection

Last

Returns the last item in the collection.

Methods

Add(object)

Adds an object to the end of the collection.

AddBoxToExtents(Box)

Add the parameter box to this Entities Bounding Box.

AddItem(object)

Adds an item to the collection.

AddItem(vdFigure)

Adds a vdFigure object to the collection.

AddItemClone(vdFigure, bool)

Internally used only. Adds the clone of passed object using the same handle.If passed object exists in the handle table, remove it.

AddItems(vdFigure[])

Adds each item in the passed collection to this collection using AddItem(vdFigure)

ChangeOrder(vdFigure, bool)

Changes the position of a vdFigure object to the front or the end of the collection.

ClearIndexDictionary()

Clears the Index of the Dictionary. Internally used to speed up Swap method.

Clone()

Creates a clone of this object.

DeSerialize(DeSerializer, string, object)

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

Dispose()

Releases all resources used by this object.

Draw(vdRender, vdSectionClips, vdLights, bool)

Draw all visible items of this collection to the passed render drawing context.

DrawScene(vdDocument, vdSectionClips, vdLights, vdEntities, vdRender, bool)

Internally used only.

EnsureCapacity(int)

Changes the capacity of the collection to the given value if the existing capacity is less than this value.

EraseAll()

Sets the Deleted property to true to all vdFigure objects of the collection.

FindFromId(int)

Gets an object that belongs to collection passing through its ID number.

FindItem(object)

Searches the collection for a specified object.

FindItem(vdFigure)

Checks if an object exists in the collection.

GetBoundingBox(bool, bool)

Gets the Bounding Box of all vdFigure objects of the collection.

GetBoundingBox(bool, bool, bool)

Gets the Bounding Box of all vdFigure objects of the collection.

GetCompareHashCode()

Returns a 32-bit signed integer hash code for this object instance.

GetEnumerator()

Implements the "foreach" expression for the collection.

GetNotDeletedItems()

Get all non deleted objects of the collection.

GetObjectRealPosition(object)

Find the index where a specified object is located in the list.

GetTableDependecies(vdTableDependeciesArgs)

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

InsertAt(int, object)

Insert an object at a specified index.

InsertAt(int, vdFigure)

Insert a vdFigure object to a specified index of the collection.

InternalGetBoundingBox()

Internally used.

InternalSetOwner(vdBaseObject)

Internally used only.

Set the object owner

IsTableObjectDependOn(vdPrimary)

Check if the table object is depend on this figure

MakeIndexDictionary()

Creates an Index of the Dictionary. Internally used to speed up Swap method.

ModifyExtents(gPoint, gPoint)

Change the extents of the object in WCS.

RemoveAll()

Removes all objects from the collection.

RemoveAt(int)

Removes an object from the specified index of the collection.

RemoveItem(object)

Removes the specified item from the collection.

RemoveItem(vdFigure)

Removes a specific vdFigure object from the collection.

RemoveLast()

Removes the last object of the collection.

ReplaceItem(int, vdFigure)

Fast replace an entity in passed position of this collection with a new one

Serialize(Serializer)

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

Sort(IComparer<vdFigure>)

Sorts the elements in a range of elements in the entire collection using the specified IComparer<T> generic interface.

SortByKeys(Int32Array)

Sorts the elements of the collection based on the keys using the integer compare implementation of each key.

SortByKeys(StringArray)

Sorts the elements of the collection based on the keys using the StringComparer implementation of each key.

ToString()

Gets a System.String that represents the count of the vdEntities collection Object.

Transformby(Matrix)

Transforms all the geometrical properties of the entities in the collection with the specific Matrix mat.

Update()

Updates the object after change of properties.

Update(bool)

Updates all items in collection.

UpdateBounds()

Mark the Bounding rectangle to be recalcalated during a GetBoundingBox(bool, bool) method call.

getSortedZorder(vdRender, vdArray<vdFigure>)

Sort input transparentlists collection depend of their Bounding Box in render view, from nearest to farest

swap(vdFigure, vdFigure)

Swaps the position between two different vdFigure objects existing in the collection.

See Also