editor › Globals › VirtualPlateStack
Class: VirtualPlateStack
This is a virtual representation of a PlateStack, keeping its own counter on how many plates of that type are still left.
Hierarchy
- VirtualPlateStack
Index
Constructors
Properties
Methods
- createCopyWithExtractedPlate
- getOriginalPlate
- getPlateAmount
- getSvgPlate
- hasPlate
- isSinglePlateLeft
- extractExactPlate
- extractPlate
Constructors
constructor
+ new VirtualPlateStack(plates: SvgSurfaceDescriptor[], index: number): VirtualPlateStack
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:55
Parameters:
| Name | Type |
|---|---|
plates |
SvgSurfaceDescriptor[] |
index |
number |
Returns: VirtualPlateStack
Properties
Private Readonly count
• count: number
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:55
Readonly index
• index: number
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:53
Private Readonly plates
• plates: SvgSurfaceDescriptor[]
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:54
Methods
createCopyWithExtractedPlate
▸ createCopyWithExtractedPlate(svgPlate: IAssemblingSvgSurface): VirtualPlateStack
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:93
Creates a new VirtualPlateStack that contains one plate less. Do not call if isSinglePlateLeft returned true.
Parameters:
| Name | Type | Default |
|---|---|---|
svgPlate |
IAssemblingSvgSurface | undefined |
Returns: VirtualPlateStack
getOriginalPlate
▸ getOriginalPlate(): SvgSurfaceDescriptor
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:63
Returns: SvgSurfaceDescriptor
getPlateAmount
▸ getPlateAmount(): number
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:85
Returns: number
the amount of plates left in this PlateStack
getSvgPlate
▸ getSvgPlate(): VirtualAssemblingSvgSurface
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:70
Creates a new virtual plate based on the SvgSurfaceDescriptor that this mesh represents
Returns: VirtualAssemblingSvgSurface
hasPlate
▸ hasPlate(svgPlate: IAssemblingSvgSurface): boolean
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:105
Parameters:
| Name | Type |
|---|---|
svgPlate |
IAssemblingSvgSurface |
Returns: boolean
isSinglePlateLeft
▸ isSinglePlateLeft(): boolean
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:78
If there is only one plate left in this stack, instead of calling createCopyWithExtractedPlate, don't pass on this stack to child states.
Returns: boolean
Static extractExactPlate
▸ extractExactPlate(plateStacks: readonly VirtualPlateStack[], svgPlate: IAssemblingSvgSurface): VirtualPlateStack‹›[]
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:38
Parameters:
| Name | Type |
|---|---|
plateStacks |
readonly VirtualPlateStack[] |
svgPlate |
IAssemblingSvgSurface |
Returns: VirtualPlateStack‹›[]
Static extractPlate
▸ extractPlate(plateStacks: readonly VirtualPlateStack[], plateStackIndex: number): VirtualPlateStack[]
Defined in src/modules/kyub.core.plateImport/src/autoAssembly/VirtualPlateStack.ts:20
Given a list of plate stacks, remove one plate from the stack at the given index, and return the new modified list. This list might be smaller, if the stack to take from had only one plate left, and is thus removed from the list. None of the given objects are modified, and the non-target plate stack objects are forwarded into the new list.
Parameters:
| Name | Type | Description |
|---|---|---|
plateStacks |
readonly VirtualPlateStack[] | all the plate stacks available |
plateStackIndex |
number | the index of the plate stack to take from. If out of bounds, no plate stack is modified, and just a copy of the list is returned. |
Returns: VirtualPlateStack[]