Skip to main content

Vision element base

The VisionElement class is the base class for all vision elements. All elements will have the functions defined in this class. All other vision elements inherit from this abstract class.

Constructors​

This class is not constructible, it is only used as a base class for other vision elements.

Methods​

getId()​

Returns a unique numeric identifier of this vision element.

getId(): number;

getType()​

Returns the type of the vision element.

getType(): EVisionElement;

allocatedSize()​

Returns the approximate size of data allocated by this vision element.

allocatedSize(): number;

clone()​

Method to clone the element. Returns it cast to the base class.

clone(): VisionElement;

getParentId()​

Returns the parent ID of this vision element, or 0 if there is no parent ID.

getParentId(): number;

setParentId()​

Sets the parent ID providing the parent ID number.

setParentId(parentId: number): void;

setParentId()​

Sets the parent ID providing the parent vision element.

setParentId(parentElement: VisionElement): void;

removeParentId()​

Returns true if the ID was removed, false if it was not present.

removeParentId(): boolean;

hasParent()​

Returns true if the parent ID is set.

hasParent(): boolean;

hasName()​

Returns true if the name of the vision element is set.

hasName(): boolean;

Properties​

name​

Optional name of the vision element. By default it is an empty string.

name: string;

description​

Optional description of the vision element. By default it is an empty string.

description: string;

type​

The element type identifier.

type: EVisionElement;