-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfixture.go
More file actions
102 lines (89 loc) · 3.02 KB
/
fixture.go
File metadata and controls
102 lines (89 loc) · 3.02 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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
package MVRTypes
import (
"archive/zip"
"github.com/Patch2PDF/GDTF-Mesh-Reader/v2/pkg/MeshTypes"
)
type Fixture struct {
UUID string
Name string
Multipatch *string
Matrix MeshTypes.Matrix
Class NodeReference[Class]
GDTFSpec NodeReference[GDTF]
GDTFMode string
Focus NodeReference[FocusPoint]
CastShadow bool
DMXInvertPan bool
DMXInvertTilt bool
Position NodeReference[Position]
Function *string
FixtureID string
FixtureIDNumeric int
UnitNumber int
ChildPosition string // Node link to the geometry. Starting point is the Geometry Collect of the linked parent GDTF of this object.
Addresses *Addresses
Protocols []*Protocol
Alignments []*Alignment
CustomCommands []*CustomCommand
Overwrites []*Overwrite
Connections []*Connection
Color *ColorCIE
CustomId int
CustomIdType int
Mappings []*Mapping
Gobo *Gobo
Model FixtureModel
ChildList
}
func (a *Fixture) CreateReferencePointer(refPointers *ReferencePointers) {
a.ChildList.CreateReferencePointer(refPointers)
}
func (a *Fixture) 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]
}
if a.Focus.String != nil {
a.Focus.Ptr = refPointers.FoucsPoints[*a.Focus.String]
}
ResolveReferences(refPointers, &a.Mappings)
}
func (a *Fixture) ReadMesh(fileMap map[string]*zip.File) error {
return a.ChildList.ReadMesh(fileMap)
}
func (a *Fixture) addNodeModelsToStageModel(stageModel *StageModel, modelConfig ModelConfig, parentConfig ModelNodeConfig) {
config := getConfigOverrides(modelConfig, parentConfig, a.UUID)
if (config.Exclude == nil ||
!(*config.Exclude)) &&
!(config.RenderOnlyAddressedFixture != nil && *config.RenderOnlyAddressedFixture &&
(a.Addresses == nil || len(a.Addresses.Addresses) == 0)) { // remove unpatched fixtures if desired
stageModel.FixtureModels = append(stageModel.FixtureModels, a.Model.Copy())
}
a.ChildList.addNodeModelsToStageModel(stageModel, modelConfig, config)
}
type Gobo struct {
Rotation float32
}
type Protocol struct {
Geometry string // defaults to NetworkInOut_1
Name string // Custom Name of the protocol to identify the protocol. Needs to be unique for this instance of object.
Type string // Name of the protocol.
Version string // This is the protocol version if available.
Transmission string // Unicast, Multicast, Broadcast, Anycast
}
type Mapping struct {
LinkedDef NodeReference[MappingDefinition]
Ux int
Uy int
Ox int
Oy int
Rz float32
}
func (a *Mapping) ResolveReference(refPointers *ReferencePointers) {
a.LinkedDef.Ptr = refPointers.MappingDefinitions[*a.LinkedDef.String]
}