Hide menu
Loading...
Searching...
No Matches
Layer

Provides logical grouping of Element objects.

Layers are commonly used to group objects in the drawing by function (e.g. walls, furniture, etc.), but in principle they can represent any type of virtual grouping. All objects in a layer share appearance, can be shown and hidden together. A drawing element can only belong to one layer.

The drawing layer holds an isVisible attribute, which is true by default.

Extends

Constructors

Constructor

new Layer(name?): Layer

Parameters

name?

string

Added name.

Returns

Layer

Overrides

BaseObject.constructor

Properties

isVisible

isVisible: boolean = true

Indicates whether the drawing layer is visible or not.

Accessors

id

Get Signature

get id(): bigint

Returns object id.

Returns

bigint

Inherited from

BaseObject.id


name

Get Signature

get name(): string | null

Returns name of the drawing layer. null if the drawing layer has no name (by default).

Returns

string | null

Set Signature

set name(name): void

Sets name of the drawing layer.

Parameters

name

Name of the drawing layer.

string | null

Returns

void


uuid

Get Signature

get uuid(): `${string}-${string}-${string}-${string}-${string}` | null

Returns uuid of the drawing layer. null if the drawing layer has no assigned uuid (by default).

Returns

`${string}-${string}-${string}-${string}-${string}` | null

Set Signature

set uuid(uuid): void

Sets uuid of the drawing layer.

Parameters

uuid

Uuid of the drawing layer.

`${string}-${string}-${string}-${string}-${string}` | null

Returns

void

Methods

accept()

accept(visitor): void

Applies a visitor for drawing elements.

Parameters

visitor

ElementVisitor

Applied drawing element visitor.

Returns

void


add()

add(element): void

Adds element to the drawing layer.

Parameters

element

Element

Added drawing element.

Returns

void


contains()

contains(element): boolean

Returns true if element has already been added to the drawing layer.

Parameters

element

Element

Drawing element.

Returns

boolean


remove()

remove(element): boolean

Removes element from the drawing layer.

Parameters

element

Element

Removed drawing element.

Returns

boolean