Skip to content

editor › Globals › CellDescriptor

Class: CellDescriptor

A CellDescriptor is the blueprint for CellMembranes on a mesh: It defines where the different cell- membranes cuts will happen on the surface, and coordinates what happens when the mesh is changed.

The Representation for the User and the export is done by the CellDescriptorRealizer. Serialization is done by the CellDescriptorSerializer.

Hierarchy

  • CellDescriptor

Implements

Index

Properties

Methods

Properties

Private assembly

• assembly: Assembly

Defined in src/model/data/Concepts/CellDescriptor.ts:55


Private cells

• cells: CellMembrane[] = []

Defined in src/model/data/Concepts/CellDescriptor.ts:57


Private changeEmitter

• changeEmitter: EventEmitter‹IModelElementEvent› = new EventEmitter()

Defined in src/model/data/Concepts/CellDescriptor.ts:58


Private meshAnchor

• meshAnchor: MeshAnchor | null

Defined in src/model/data/Concepts/CellDescriptor.ts:56

Methods

Private _onMeshAnchorChange

▸ _onMeshAnchorChange(event: IAnchorChangeEvent): void

Defined in src/model/data/Concepts/CellDescriptor.ts:244

Parameters:

Name Type
event IAnchorChangeEvent

Returns: void


addCell

▸ addCell(cell: CellMembrane, checkForValidSurface: boolean): boolean

Defined in src/model/data/Concepts/CellDescriptor.ts:65

Parameters:

Name Type Default Description
cell CellMembrane - The Cell to add
checkForValidSurface boolean true whether to check for cell with the same membrane and replace them. This can be useful on deserialization, when we can't be sure the anchor is already returning a valid surface.

Returns: boolean


addCells

▸ addCells(cells: CellMembrane[]): void

Defined in src/model/data/Concepts/CellDescriptor.ts:84

Parameters:

Name Type
cells CellMembrane[]

Returns: void


applyAutoCell

▸ applyAutoCell(): void

Defined in src/model/data/Concepts/CellDescriptor.ts:211

Apply a cell in the size stored in the compositeModel to the current assembly. When we have a saved cell, we first apply it and keep it if it is valid. Otherwise we use the AutoCellGenerator to generate a cell.

Returns: void


clearCells

▸ clearCells(emitEvent: boolean): void

Defined in src/model/data/Concepts/CellDescriptor.ts:129

Clears all cell membranes from the object.

Parameters:

Name Type Default Description
emitEvent boolean true If an event should be emitted

Returns: void


clone

▸ clone(): CellDescriptor

Defined in src/model/data/Concepts/CellDescriptor.ts:198

Returns: CellDescriptor


destroy

▸ destroy(): void

Implementation of IModelElement

Defined in src/model/data/Concepts/CellDescriptor.ts:183

Returns: void


displayCellNotification

▸ displayCellNotification(notification: CellNotification): void

Defined in src/model/data/Concepts/CellDescriptor.ts:221

Parameters:

Name Type
notification CellNotification

Returns: void


getAnchor

▸ getAnchor(): MeshAnchor

Defined in src/model/data/Concepts/CellDescriptor.ts:157

Returns: MeshAnchor


getAssembly

▸ getAssembly(): Assembly

Implementation of IModelElement

Defined in src/model/data/Concepts/CellDescriptor.ts:144

Returns: Assembly


getCells

▸ getCells(): CellMembrane[]

Defined in src/model/data/Concepts/CellDescriptor.ts:91

Returns: CellMembrane[]


getChangeEventEmitter

▸ getChangeEventEmitter(): IPublicEventEmitterInterface‹IModelElementEvent›

Implementation of IModelElement

Defined in src/model/data/Concepts/CellDescriptor.ts:140

Returns: IPublicEventEmitterInterface‹IModelElementEvent›


getCompositeModelCellSize

▸ getCompositeModelCellSize(): Vector2 | null

Defined in src/model/data/Concepts/CellDescriptor.ts:230

Return the saved compositeModelCellSize in a Vector2, that is sorted ascending, so x will be the smaller value, and y the bigger value. If cell size could not be determined, returns null

Returns: Vector2 | null


getElementsThisDependsOn

▸ getElementsThisDependsOn(): IModelElement[]

Implementation of IModelElement

Defined in src/model/data/Concepts/CellDescriptor.ts:136

Returns: IModelElement[]


getIsValid

▸ getIsValid(): boolean

Implementation of IModelElement

Defined in src/model/data/Concepts/CellDescriptor.ts:179

Returns: boolean


getMesh

▸ getMesh(): Mesh

Defined in src/model/data/Concepts/CellDescriptor.ts:240

Returns: Mesh


getMeshRealizer

▸ getMeshRealizer(): HullPlateRealizer | null

Defined in src/model/data/Concepts/CellDescriptor.ts:152

Returns: HullPlateRealizer | null


hasCell

▸ hasCell(cell: CellMembrane): boolean

Defined in src/model/data/Concepts/CellDescriptor.ts:99

Parameters:

Name Type
cell CellMembrane

Returns: boolean


removeCell

▸ removeCell(cell: CellMembrane, emitEvent: boolean): void

Defined in src/model/data/Concepts/CellDescriptor.ts:103

Parameters:

Name Type Default
cell CellMembrane -
emitEvent boolean true

Returns: void


removeCells

▸ removeCells(toRemove: CellMembrane[]): void

Defined in src/model/data/Concepts/CellDescriptor.ts:115

Parameters:

Name Type
toRemove CellMembrane[]

Returns: void


setAnchor

▸ setAnchor(newAnchor: MeshAnchor): void

Defined in src/model/data/Concepts/CellDescriptor.ts:164

Parameters:

Name Type Description
newAnchor MeshAnchor the anchor that defines the mesh the cell is applied to

Returns: void


setAssembly

▸ setAssembly(assembly: Assembly): void

Implementation of IModelElement

Defined in src/model/data/Concepts/CellDescriptor.ts:148

Parameters:

Name Type
assembly Assembly

Returns: void


setCells

▸ setCells(cells: CellMembrane[]): void

Defined in src/model/data/Concepts/CellDescriptor.ts:95

Parameters:

Name Type
cells CellMembrane[]

Returns: void


Static disableTessellation

▸ disableTessellation(assembly: Assembly): void

Defined in src/model/data/Concepts/CellDescriptor.ts:46

Parameters:

Name Type
assembly Assembly

Returns: void


Static enableTessellation

▸ enableTessellation(): void

Defined in src/model/data/Concepts/CellDescriptor.ts:42

Returns: void


Static findOrCreateCellDescriptor

▸ findOrCreateCellDescriptor(mesh: Mesh, assembly: Assembly): CellDescriptor

Defined in src/model/data/Concepts/CellDescriptor.ts:27

Parameters:

Name Type
mesh Mesh
assembly Assembly

Returns: CellDescriptor