Skip to content

editorGlobalsSvgJointManager

Class: SvgJointManager

This class manages which joints of an SvgSurfaceDescriptor are occupied, and to which joints they are connected in other meshes. This class should get reworked sooner or later. See: https://gitlab.dev.kyub.io/laser-project/general-issues/-/issues/3416

Hierarchy

  • SvgJointManager

Index

Constructors

Properties

Methods

Constructors

constructor

+ new SvgJointManager(mesh: IAssemblingSvgSurface): SvgJointManager

Defined in src/model/data/Concepts/SvgJointManager.ts:21

Parameters:

Name Type
mesh IAssemblingSvgSurface

Returns: SvgJointManager

Properties

Private connectedJoints

connectedJoints: Map‹string, IConnectingJoint[]› = new Map()

Defined in src/model/data/Concepts/SvgJointManager.ts:20


Private mesh

mesh: IAssemblingSvgSurface

Defined in src/model/data/Concepts/SvgJointManager.ts:21

Methods

Private _getColocatedJoints

_getColocatedJoints(joint: Joint‹AtomicPattern›): Array‹Joint‹AtomicPattern››

Defined in src/model/data/Concepts/SvgJointManager.ts:255

Finds joints that are at the same position as a given joint on this plate. SVG-Import manages the logic of that.

Parameters:

Name Type
joint Joint‹AtomicPattern›

Returns: Array‹Joint‹AtomicPattern››


copy

copy(target: SvgJointManager): SvgJointManager

Defined in src/model/data/Concepts/SvgJointManager.ts:191

Applies the state of the target SvgJointManager into this one.

Parameters:

Name Type
target SvgJointManager

Returns: SvgJointManager

this, for chaining


freeAllJoints

freeAllJoints(): void

Defined in src/model/data/Concepts/SvgJointManager.ts:122

mark all joints of this plate as free again (e.g. when extracting this plate)

Returns: void


getConnectedJoints

getConnectedJoints(): Map‹string, IConnectingJoint[]›

Defined in src/model/data/Concepts/SvgJointManager.ts:43

Returns: Map‹string, IConnectingJoint[]›


getConnectedJointsTo

getConnectedJointsTo(jointId: string): IConnectingJoint[]

Defined in src/model/data/Concepts/SvgJointManager.ts:47

Parameters:

Name Type
jointId string

Returns: IConnectingJoint[]


getJoints

getJoints(): Array‹Joint‹AtomicPattern››

Defined in src/model/data/Concepts/SvgJointManager.ts:70

Returns: Array‹Joint‹AtomicPattern››

The joints that are still available


getMesh

getMesh(): IAssemblingSvgSurface

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

Returns: IAssemblingSvgSurface


getUsedJointCount

getUsedJointCount(): number

Defined in src/model/data/Concepts/SvgJointManager.ts:35

Returns: number


getUsedJoints

getUsedJoints(): Array‹Joint‹AtomicPattern››

Defined in src/model/data/Concepts/SvgJointManager.ts:80

Returns: Array‹Joint‹AtomicPattern››

The joints that are already used


isConnectedWith

isConnectedWith(surface: IAssemblingSvgSurface): boolean

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

Has this SvgJointManager joints which are connected to this surface?

Parameters:

Name Type
surface IAssemblingSvgSurface

Returns: boolean


isJointUsed

isJointUsed(joint: Joint‹AtomicPattern›): boolean

Defined in src/model/data/Concepts/SvgJointManager.ts:39

Parameters:

Name Type
joint Joint‹AtomicPattern›

Returns: boolean


isRestConnected

isRestConnected(): boolean

Defined in src/model/data/Concepts/SvgJointManager.ts:199

if this plate would be detached from its assembly, would the remaining plates form one connected component?

Returns: boolean


markJointAsConnectedWith

markJointAsConnectedWith(joint: Joint‹AtomicPattern›, otherJoint: Joint‹AtomicPattern›, otherMesh: IAssemblingSvgSurface): void

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

marks this joint as used/occupied. This takes care of the symmetry.

Parameters:

Name Type Description
joint Joint‹AtomicPattern› the joint to close
otherJoint Joint‹AtomicPattern› joint that is connected with this one. Use a falsy value to just mark the first argument as closed.
otherMesh IAssemblingSvgSurface the mesh that otherJoint belongs to

Returns: void


markJointAsFree

markJointAsFree(joint: Joint‹AtomicPattern›): void

Defined in src/model/data/Concepts/SvgJointManager.ts:138

marks this joint as free

Parameters:

Name Type
joint Joint‹AtomicPattern›

Returns: void


markJointAsFreeById

markJointAsFreeById(id: string): void

Defined in src/model/data/Concepts/SvgJointManager.ts:128

Parameters:

Name Type
id string

Returns: void


refreshJointMeshReferences

refreshJointMeshReferences(changes: Map‹IAssemblingSvgSurface, IAssemblingSvgSurface›): void

Defined in src/model/data/Concepts/SvgJointManager.ts:167

see refreshJointMeshReferencesWithLambda

Parameters:

Name Type
changes Map‹IAssemblingSvgSurface, IAssemblingSvgSurface

Returns: void


refreshJointMeshReferencesWithLambda

refreshJointMeshReferencesWithLambda(changeFn: function): void

Defined in src/model/data/Concepts/SvgJointManager.ts:176

Update the mesh references of connected joints. This is intended to be used for virtualization (e.g. when the connected meshes have been cloned)

Parameters:

changeFn: function

the converter to update mesh references. No update happens, when this returns a falsy value

▸ (IAssemblingSvgSurface: any): IAssemblingSvgSurface

Parameters:

Name Type
IAssemblingSvgSurface any

Returns: void


setConnectedJoints

setConnectedJoints(connectedJoints: Map‹string, IConnectingJoint[]›): void

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

Parameters:

Name Type
connectedJoints Map‹string, IConnectingJoint[]›

Returns: void


setMesh

setMesh(newMesh: IAssemblingSvgSurface): void

Defined in src/model/data/Concepts/SvgJointManager.ts:31

Parameters:

Name Type
newMesh IAssemblingSvgSurface

Returns: void