editor › Globals › MeshAnchor
Class: MeshAnchor
Hierarchy
↳ MeshAnchor
Implements
Index
Properties
Methods
- _adaptToChangedMesh
- _checkIfAnchorCanBeValid
- _onMeshChange
- _refindSelfAndEmit
- _setMesh
- clone
- destroy
- getChangeEventEmitter
- getInMeshTarget
- getIsValid
- getMesh
- getTargets
- initializeFromElement
Properties
Protected Readonly changeEventEmitter
• changeEventEmitter: EventEmitter‹IMeshAnchorChangeEvent› = new EventEmitter
Inherited from AbstractMeshAnchor.changeEventEmitter
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:33
Protected isDestroyed
• isDestroyed: boolean = false
Inherited from AbstractMeshAnchor.isDestroyed
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:24
Protected lastMeshAdaptionWasSuccessful
• lastMeshAdaptionWasSuccessful: boolean = false
Inherited from AbstractMeshAnchor.lastMeshAdaptionWasSuccessful
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:31
During initialization, subclasses need to take care of setting this value to true, if the anchor became valid before the first meshChangeEvent was fired. Else, the anchor will stay invalid until the first meshChangeEvent is fired.
Protected mesh
• mesh: Mesh | null
Inherited from AbstractMeshAnchor.mesh
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:23
Methods
Protected _adaptToChangedMesh
▸ _adaptToChangedMesh(event: MeshChangeEvent): object
Overrides AbstractMeshAnchor._adaptToChangedMesh
Defined in src/model/data/Concepts/Anchors/MeshAnchor.ts:32
Parameters:
| Name | Type |
|---|---|
event |
MeshChangeEvent |
Returns: object
-
event? : IMeshAnchorChangeEvent
-
invalid: boolean
Protected _checkIfAnchorCanBeValid
▸ _checkIfAnchorCanBeValid(): boolean
Inherited from AbstractMeshAnchor._checkIfAnchorCanBeValid
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:105
Override in subclasses: check if the anchor can be valid given the current (instance variable) state. For the overall validity check, the (cached) result of _adaptToChangedMesh is used as well, so it is not required to re-check concrete geometric constraints here.
Returns: boolean
Protected _onMeshChange
▸ _onMeshChange(meshEvent: MeshChangeEvent): void
Inherited from AbstractMeshAnchor._onMeshChange
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:127
Parameters:
| Name | Type |
|---|---|
meshEvent |
MeshChangeEvent |
Returns: void
Protected _refindSelfAndEmit
▸ _refindSelfAndEmit(meshEvent: MeshChangeEvent, requiresExactMatch: boolean): void
Inherited from AbstractMeshAnchor._refindSelfAndEmit
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:134
Parameters:
| Name | Type | Default |
|---|---|---|
meshEvent |
MeshChangeEvent | - |
requiresExactMatch |
boolean | false |
Returns: void
Protected _setMesh
▸ _setMesh(newMesh: Mesh | null): void
Inherited from AbstractMeshAnchor._setMesh
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:115
Updates the mesh reference and event bindings.
This is protected as you should only change the mesh during initialization or updates handled in child classes - users should not be able to arbitrarily change the mesh and thus corrupt state.
Parameters:
| Name | Type |
|---|---|
newMesh |
Mesh | null |
Returns: void
clone
▸ clone(): MeshAnchor
Implementation of IMeshAnchor
Overrides AbstractMeshAnchor.clone
Defined in src/model/data/Concepts/Anchors/MeshAnchor.ts:24
Returns: MeshAnchor
destroy
▸ destroy(): void
Implementation of IMeshAnchor
Inherited from AbstractMeshAnchor.destroy
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:70
Returns: void
getChangeEventEmitter
▸ getChangeEventEmitter(): IPublicEventEmitterInterface‹IMeshAnchorChangeEvent›
Implementation of IMeshAnchor
Inherited from AbstractMeshAnchor.getChangeEventEmitter
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:81
Returns: IPublicEventEmitterInterface‹IMeshAnchorChangeEvent›
getInMeshTarget
▸ getInMeshTarget(): MeshElement
Implementation of IMeshAnchor
Overrides AbstractMeshAnchor.getInMeshTarget
Defined in src/model/data/Concepts/Anchors/MeshAnchor.ts:20
Returns: MeshElement
getIsValid
▸ getIsValid(): boolean
Implementation of IMeshAnchor
Inherited from AbstractMeshAnchor.getIsValid
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:62
Returns: boolean
getMesh
▸ getMesh(): Mesh‹›
Implementation of IMeshAnchor
Overrides AbstractMeshAnchor.getMesh
Defined in src/model/data/Concepts/Anchors/MeshAnchor.ts:16
Returns: Mesh‹›
getTargets
▸ getTargets(): [Mesh] | []
Implementation of IMeshAnchor
Inherited from AbstractMeshAnchor.getTargets
Defined in src/model/data/Concepts/Anchors/AbstractMeshAnchor.ts:54
Returns: [Mesh] | []
the target mesh this anchor points to or an empty list if the mesh is not set
initializeFromElement
▸ initializeFromElement(mesh: Mesh): this
Defined in src/model/data/Concepts/Anchors/MeshAnchor.ts:8
Parameters:
| Name | Type |
|---|---|
mesh |
Mesh |
Returns: this