-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsupport.go
More file actions
70 lines (61 loc) · 1.89 KB
/
support.go
File metadata and controls
70 lines (61 loc) · 1.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
package MVRTypes
import (
"archive/zip"
"github.com/Patch2PDF/GDTF-Mesh-Reader/v2/pkg/MeshTypes"
)
type Support struct {
UUID string
Name string
Multipatch string
Matrix MeshTypes.Matrix
Class NodeReference[Class]
Position NodeReference[Position]
Geometries *Geometries
Function *string
ChainLength float32
GDTFSpec NodeReference[GDTF]
GDTFMode string
CastShadow bool
Addresses *Addresses
Alignments []*Alignment
CustomCommands []*CustomCommand
Overwrites []*Overwrite
Connections []*Connection
FixtureID string
FixtureIDNumeric int
UnitNumber int
CustomId int
CustomIdType int
Model SupportModel
ChildList
}
func (a *Support) CreateReferencePointer(refPointers *ReferencePointers) {
a.ChildList.CreateReferencePointer(refPointers)
}
func (a *Support) ResolveReference(refPointers *ReferencePointers) {
if a.Class.String != nil {
a.Class.Ptr = refPointers.Classes[*a.Class.String]
}
if a.GDTFSpec.String != nil {
a.GDTFSpec.Ptr = refPointers.GDTFSpecs[*a.GDTFSpec.String]
}
if a.Position.String != nil {
a.Position.Ptr = refPointers.Positions[*a.Position.String]
}
a.Geometries.ResolveReference(refPointers)
a.ChildList.ResolveReference(refPointers)
}
func (a *Support) ReadMesh(fileMap map[string]*zip.File) error {
err := a.Geometries.ReadMesh(fileMap)
if err != nil {
return err
}
return a.ChildList.ReadMesh(fileMap)
}
func (a *Support) addNodeModelsToStageModel(stageModel *StageModel, modelConfig ModelConfig, parentConfig ModelNodeConfig) {
config := getConfigOverrides(modelConfig, parentConfig, a.UUID)
if config.Exclude == nil || !(*config.Exclude) {
stageModel.SupportModels = append(stageModel.SupportModels, a.Model.Copy())
}
a.ChildList.addNodeModelsToStageModel(stageModel, modelConfig, config)
}