pCon.planner Plugin SDK  Version 8.9
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Properties Events
Public Member Functions | Static Public Member Functions | Package Functions | Properties | Events | List of all members
X3g::Plugin::DbEntity Class Reference

Base class for all database objects having a graphical representation. More...

Inheritance diagram for X3g::Plugin::DbEntity:
Inheritance graph
[legend]

Public Member Functions

GeMatrixGetTextureMatrix ()
 The texture matrix determines how to map the material texture to the entity. More...
 
void SetTextureMatrix (GeMatrix^ pMatrix)
 Sets the texture matrix. More...
 
bool TransformBy (GeMatrix^ pTransform)
 Transforms the entity. More...
 
GeMatrixGetTransientTransform ()
 Returns transient transformation of this entity. More...
 
void SetTransientTransform (GeMatrix^ pTransform)
 Sets the transient transformation of this entity. More...
 
void UpdateGeometry ()
 Updates the geometry of the entity. More...
 
void Delete ()
 Deletes the entity from the document. More...
 
GeBoundingBox3dGetBoundingBox (GeMatrix^ pTransform)
 Returns bounding box of entity within the owning blocks local coordinate system. More...
 
IPropertyProvider^ GetPropertyProvider ()
 Returns property provider of the entity. More...
 
DbEntityClone (Block^ pOwner)
 Creates a clone of the entity. More...
 
DbEntityCut2 (DbEntity^ pEntity)
 Subtracts pEntity from this object. More...
 
DbEntityCut2 (DbEntity^ pEntity, Block^ pToOwner)
 Subtracts pEntity from this object. More...
 
DbEntityCommon2 (DbEntity^ pEntity)
 Computes an object which represents all common geometry of this entity and pEntity. More...
 
DbEntityCommon2 (DbEntity^ pEntity, Block^ pToOwner)
 Computes an object which represents all common geometry of this entity and pEntity. More...
 
DbEntityFuse2 (DbEntity^ pEntity)
 Computes an object by merging all geometry of this entity and pEntity. More...
 
DbEntityFuse2 (DbEntity^ pEntity, Block^ pToOwner)
 Computes an object by merging all geometry of this entity and pEntity. More...
 
List< DbEntity^ >^ Slice (GePlane^ pPlane, bool pKeepBothHalves)
 Slice the DbEntity with the plane. More...
 
DbEntityPartialMove (GePlane^ pPlane, double pLength)
 Strech or shrink the DbEntity at the given plane. More...
 
void AddCallbacks (DbEntityCallbacks^ pCallbacks)
 Add callbacks to the entity. More...
 
void RemoveCallbacks (DbEntityCallbacks^ pCallbacks)
 Remove callbacks from entity. More...
 

Static Public Member Functions

static DbEntityFromId (String^ pEntityId)
 Creates DbEntity to given entity id. More...
 

Package Functions

 DbEntity (Block^ pOwner, EntityImpl *pImpl)
 This constructor is used to create new OdDbEntities and add to a block. More...
 
 DbEntity (Layout::Page^ pPage, EntityImpl *pImpl)
 This constructor is used to create new OdDbEntities and add to a page. More...
 

Properties

String^  Id [get]
 The unqiue id of the entity. More...
 
String^  Name [get, set]
 User-defined name of the entity. More...
 
String^  Material [get, set]
 Material of this entity. More...
 
EntityColor Color [get, set]
 Color of this entity. More...
 
String^  Layer [get, set]
 Layer name of this entity. More...
 
String^  OwningBlock [get]
 Name of the block that owns this entity. More...
 
bool TopLevel [get]
 Returns if entity is owned by modelspace. More...
 
bool Valid [get]
 Returns if entity is valid and not erased. More...
 
DbTextureProjection TextureProjection [get, set]
 The AutoCAD texture projection. More...
 
bool IsModelingSupported [get]
 If true the entity can be used with modeling functions. More...
 
bool Locked [get, set]
 Lock status of this entity. More...
 
GeVec2d LayoutPosition [get, set]
 Position the Entity in Layout. More...
 
DbDictionary^  CustomData [get]
 Allows to attach custom data to the entity. More...
 
String^  CustomType [get, set]
 Allows plugins to identify their entities. More...
 
Object^  CustomObject
 Allows to attach an object which extents the entity (e.g. More...
 
bool IsVisible [get, set]
 Visibility of this entity. More...
 
Hyperlink Link [get, set]
 Get or Set the Hyperlink attached to the DbEntity. More...
 

Events

System::EventHandler^  VisibilityChanged
 Occurs when DbEntity::IsVisible changed. More...
 

Detailed Description

Base class for all database objects having a graphical representation.

Constructor & Destructor Documentation

X3g::Plugin::DbEntity::DbEntity ( Block pOwner,
EntityImpl *  pImpl 
)
package

This constructor is used to create new OdDbEntities and add to a block.

If pOwner is null, an exception is thorwn.

X3g::Plugin::DbEntity::DbEntity ( Layout::Page pPage,
EntityImpl *  pImpl 
)
package

This constructor is used to create new OdDbEntities and add to a page.

If pPage is null, an exception is thorwn.

Member Function Documentation

void X3g::Plugin::DbEntity::AddCallbacks ( DbEntityCallbacks pCallbacks)

Add callbacks to the entity.

DbEntity X3g::Plugin::DbEntity::Clone ( Block pOwner)

Creates a clone of the entity.

The owner of the clone can be defined with pOwner. If it is null the owner of the cloned entity will be used.

DbEntity X3g::Plugin::DbEntity::Common2 ( DbEntity pEntity)

Computes an object which represents all common geometry of this entity and pEntity.

On success a new entity added to the same block is returned.

Both entities have to return true on IsModelingSupported.

DbEntity X3g::Plugin::DbEntity::Common2 ( DbEntity pEntity,
Block pToOwner 
)

Computes an object which represents all common geometry of this entity and pEntity.

On success a new entity added to pToOwner is returned.

Both entities have to return true on IsModelingSupported.

DbEntity X3g::Plugin::DbEntity::Cut2 ( DbEntity pEntity)

Subtracts pEntity from this object.

On success a new entity added to the same block is returned.

Both entities have to return true on IsModelingSupported.

DbEntity X3g::Plugin::DbEntity::Cut2 ( DbEntity pEntity,
Block pToOwner 
)

Subtracts pEntity from this object.

On success a new entity added to pToOwner is returned.

Both entities have to return true on IsModelingSupported.

void X3g::Plugin::DbEntity::Delete ( )

Deletes the entity from the document.

This invalidates the entity and it must no longer be used.

DbEntity X3g::Plugin::DbEntity::FromId ( String pEntityId)
static

Creates DbEntity to given entity id.

Returns null if the entity doesn't exist in the current document or if it has been erased.

DbEntity X3g::Plugin::DbEntity::Fuse2 ( DbEntity pEntity)

Computes an object by merging all geometry of this entity and pEntity.

On success a new entity added to the same block is returned.

Both entities have to return true on IsModelingSupported.

DbEntity X3g::Plugin::DbEntity::Fuse2 ( DbEntity pEntity,
Block pToOwner 
)

Computes an object by merging all geometry of this entity and pEntity.

On success a new entity added to pToOwner is returned.

Both entities have to return true on IsModelingSupported.

GeBoundingBox3d X3g::Plugin::DbEntity::GetBoundingBox ( GeMatrix pTransform)

Returns bounding box of entity within the owning blocks local coordinate system.

Entity geometry may be transformed for bounds computation. Entity must be owned by a block.

Exceptions
System::NotSupportedExceptionThrows exception if entity is not owned by a block.
IPropertyProvider X3g::Plugin::DbEntity::GetPropertyProvider ( )

Returns property provider of the entity.

The entity must be part of the current document.

GeMatrix X3g::Plugin::DbEntity::GetTextureMatrix ( )

The texture matrix determines how to map the material texture to the entity.

If custom texture coordinates are used, this projection has no effect.

GeMatrix X3g::Plugin::DbEntity::GetTransientTransform ( )

Returns transient transformation of this entity.

Transient transforms are not propagated to the database. This fast transformation is used while user interaction is in progress. Otherwise it is always an identity matrix.

DbEntity X3g::Plugin::DbEntity::PartialMove ( GePlane pPlane,
double  pLength 
)

Strech or shrink the DbEntity at the given plane.

Parameters
pPlaneThe plane defines where to operate.
pLengthIf this value is positive strech the entity. If this value is negative shrinks the entity.
Returns
The modified DbEntity or null.
void X3g::Plugin::DbEntity::RemoveCallbacks ( DbEntityCallbacks pCallbacks)

Remove callbacks from entity.

void X3g::Plugin::DbEntity::SetTextureMatrix ( GeMatrix pMatrix)

Sets the texture matrix.

void X3g::Plugin::DbEntity::SetTransientTransform ( GeMatrix pTransform)

Sets the transient transformation of this entity.

Transient transforms are not propagated to the database. This fast transformation is used while user interaction is in progress. Otherwise it is always an identity matrix.

List< DbEntity^ > X3g::Plugin::DbEntity::Slice ( GePlane pPlane,
bool  pKeepBothHalves 
)

Slice the DbEntity with the plane.

Either returns the half to which the plane is facing or return both halves.

Parameters
pPlaneThe plane to slice with.
pKeepBothHalvesKeep the half to which the plane is facing only or keep both halves.
Returns
A list of sliced entities. In case of an error, this list might be empty.
bool X3g::Plugin::DbEntity::TransformBy ( GeMatrix pTransform)

Transforms the entity.

Returns false if the transformation is not applicable.

void X3g::Plugin::DbEntity::UpdateGeometry ( )

Updates the geometry of the entity.

Property Documentation

EntityColor X3g::Plugin::DbEntity::Color
getset

Color of this entity.

DbDictionary^ X3g::Plugin::DbEntity::CustomData
get

Allows to attach custom data to the entity.

Object^ X3g::Plugin::DbEntity::CustomObject

Allows to attach an object which extents the entity (e.g.

adds properties).

The concrete type of the custom object should depend on DbEntity::CustomType. Plugins are responsible to create and set the custom object when an entity with a particular custom type is added or loaded. This also means that the custom object is not persistent.

String^ X3g::Plugin::DbEntity::CustomType
getset

Allows plugins to identify their entities.

The type name should be set once when the entity is created. It's strongly recommended to use plugin name as prefix to prevent naming conflicts between different plugins. Returns an empty string if no custom type was set.

String^ X3g::Plugin::DbEntity::Id
get

The unqiue id of the entity.

Returns an empty string if the entity is not valid.

bool X3g::Plugin::DbEntity::IsModelingSupported
get

If true the entity can be used with modeling functions.

bool X3g::Plugin::DbEntity::IsVisible
getset

Visibility of this entity.

Attention: This property is not persistent

String^ X3g::Plugin::DbEntity::Layer
getset

Layer name of this entity.

GeVec2d X3g::Plugin::DbEntity::LayoutPosition
getset

Position the Entity in Layout.

The Coordinates origin is the upper left corner of the paper. So point GeVec2d(0, 0) means the upper left corner of the Layout Item is in the upper left corner of the page.

Throws if DbEntity is not a Layout Item. Should be called after changing DbEntity because it abstracts away various ways to place items based on their shape.

Hyperlink X3g::Plugin::DbEntity::Link
getset

Get or Set the Hyperlink attached to the DbEntity.

bool X3g::Plugin::DbEntity::Locked
getset

Lock status of this entity.

String^ X3g::Plugin::DbEntity::Material
getset

Material of this entity.

String^ X3g::Plugin::DbEntity::Name
getset

User-defined name of the entity.

Name is not unique. Empty by default.

String^ X3g::Plugin::DbEntity::OwningBlock
get

Name of the block that owns this entity.

DbTextureProjection X3g::Plugin::DbEntity::TextureProjection
getset

The AutoCAD texture projection.

This projection determines (together with the TextureMatrix) how texture coordinates are generated for this entity. If custom texture coordinates are used, this projection has no effect.

bool X3g::Plugin::DbEntity::TopLevel
get

Returns if entity is owned by modelspace.

bool X3g::Plugin::DbEntity::Valid
get

Returns if entity is valid and not erased.

Event Documentation

System:: EventHandler^ X3g::Plugin::DbEntity::VisibilityChanged

Occurs when DbEntity::IsVisible changed.