Interface that all of display objects need to implement.

interface AcGiEntity {
    childCount?: number;
    get layerName(): string;
    set layerName(value: string): void;
    get objectId(): string;
    set objectId(value: string): void;
    get ownerId(): string;
    set ownerId(value: string): void;
    get userData(): object;
    set userData(value: object): void;
    get visible(): boolean;
    set visible(value: boolean): void;
    addChild(child: AcGiEntity): void;
    applyMatrix(matrix: AcGeMatrix3d): void;
    compactForInstancing(): void;
    dispose(): void;
    fastDeepClone(shareGeometry?: boolean): AcGiEntity;
    highlight(): void;
    prepareCacheTemplate(): void;
    unhighlight(): void;
}

Properties

childCount?: number

Direct child count for group-like nodes.

Used as a cheap heuristic before compactForInstancing (skip compaction for tiny templates). Leaf entities may omit this; callers treat a missing value as unknown and favor compacting.

Accessors

  • get layerName(): string
  • The name of the layer referenced by this entity

    Returns string

  • set layerName(value: string): void
  • Parameters

    • value: string

    Returns void

  • get objectId(): string
  • Object id of the associated entity in drawing database. When adding this entity into scene, do remember setting the value of this property.

    Returns string

  • set objectId(value: string): void
  • Parameters

    • value: string

    Returns void

  • get ownerId(): string
  • The object Id of the owner of the object. When adding this entity into scene, do remember setting the value of this property.

    Returns string

  • set ownerId(value: string): void
  • Parameters

    • value: string

    Returns void

  • get userData(): object
  • An object that can be used to store custom data about the entity.

    Returns object

  • set userData(value: object): void
  • Parameters

    • value: object

    Returns void

  • get visible(): boolean
  • Object's visibility

    Returns boolean

  • set visible(value: boolean): void
  • Parameters

    • value: boolean

    Returns void

Methods

  • Apply the matrix transform to the object and updates the object's position, rotation and scale.

    Parameters

    Returns void

  • Optionally merges same-material drawable leaves so later fastDeepClone copies far fewer geometries.

    Used by block-reference template caching. Must be called before the INSERT transform is applied while the entity is still at identity. Implementations that do not support compaction may omit this method.

    Returns void

    Nothing.

  • Optionally releases GPU/CPU resources owned by this entity.

    Used when clearing the block rendering cache. Implementations that do not own disposable resources may omit this method. Shared materials from a style cache should not be disposed here unless the implementation owns them.

    Returns void

    Nothing.

  • Return a clone of this object and its direct children (not all descendants). So it means that you need to gurantee the object is flatten by call method 'flatten' before calling this function.

    Implementations may deep-clone geometry, or (for immutable block-template caches) alias leaf buffers and mark them so instance dispose skips them. Materials are reused and not deeply cloned.

    Parameters

    • OptionalshareGeometry: boolean

      When true, leaf drawables may alias source geometry buffers instead of deep-cloning them.

    Returns AcGiEntity

    Return a clone of this object and optionally all descendants.

  • Optionally prepares this entity as an immutable block-template cache entry.

    Typical implementations finalize deferred drawables and drop detached source-entity shells without merging leaves. Used by rendering cache miss paths before fastDeepClone for scene use.

    Returns void

    Nothing.

  • Unhighlight this entity

    Returns void