editor › Globals › MeshOperation
Class: MeshOperation
A MeshOperation performs some geometric modifications on one or more meshes. If the mesh changes during the operation, a MeshChange event will be emitted which is then used as a base for visualization/physics updates
Hierarchy
- MeshOperation
Index
Constructors
Properties
Methods
Constructors
constructor
+ new MeshOperation(): MeshOperation
Defined in src/model/data/Concepts/Mesh/MeshOperation.ts:18
Returns: MeshOperation
Properties
Private Readonly _id
• _id: string
Defined in src/model/data/Concepts/Mesh/MeshOperation.ts:18
Private workingPromise
• workingPromise: Promise‹any›
Defined in src/model/data/Concepts/Mesh/MeshOperation.ts:16
Methods
Protected Abstract _getAffectedMeshes
▸ _getAffectedMeshes(): Mesh[]
Defined in src/model/data/Concepts/Mesh/MeshOperation.ts:91
Before starting, the MeshOperation must define which meshes will be affected by it.
Returns: Mesh[]
Protected Abstract _performOperation
▸ _performOperation(meshes: MeshAndImplementation[]): IMeshOperationResult[] | Promise‹IMeshOperationResult[]›
Defined in src/model/data/Concepts/Mesh/MeshOperation.ts:102
Perform the actual operation. The operation should most likely work with the meshImplementation directly.
Parameters:
| Name | Type | Description |
|---|---|---|
meshes |
MeshAndImplementation[] | list of meshes and their implementations in the same order as _getAffectedMeshes() specified them |
Returns: IMeshOperationResult[] | Promise‹IMeshOperationResult[]›
Either an array (if operation is synchronous) or a Promise resolving to an array of IMeshOperationResult has to be returned - one IMeshOperationResult per mesh, as provided in the meshes paramter
Private _promisifyMeshModification
▸ _promisifyMeshModification(mesh: Mesh): object
Defined in src/model/data/Concepts/Mesh/MeshOperation.ts:114
Make sure that the mesh is not modified by anyone else by queuing into the modifyPromiseChain of the mesh.
Parameters:
| Name | Type | Description |
|---|---|---|
mesh |
Mesh | a by this operation affected mesh |
Returns: object
readyToModifyPromise readyToModifyPromise is resolved once there is no other operation queued before modificationFinishedResolve must be resolved once this meshOperation is done
-
modificationFinishedPromise: ExternalControlPromise‹IMeshOperationResult›
-
readyToModifyPromise: Promise‹MeshAndImplementation›
execute
▸ execute(): Promise‹IMeshOperationResult[]›
Defined in src/model/data/Concepts/Mesh/MeshOperation.ts:47
Performs the operation.
Returns: Promise‹IMeshOperationResult[]›
Promise that will resolve to an array of IMeshOperationResults, each result being related to one of the affected meshes.
getId
▸ getId(): string
Defined in src/model/data/Concepts/Mesh/MeshOperation.ts:30
this is used to identify for which operation a UI progress bar is being shown, collisions are unlikely and have no severe consequences.
Returns: string
a random string-identifier that should be unique across all MeshOperations
hasBeenStarted
▸ hasBeenStarted(): boolean
Defined in src/model/data/Concepts/Mesh/MeshOperation.ts:37
Returns: boolean
true, if this operation has been started execution