MVRTypes

package
v0.3.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 6, 2026 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IgnoreMeshes         = 0 // ignore meshes entirely (leave nil)
	ReadMeshesIntoModels = 1 // generate individual model part meshes
	BuildFixtureModels   = 2 // assemble single mesh with correct rotations per fixture type
	BuildStageModel      = 3 // assemble
)

Variables

This section is empty.

Functions

func CopyMeshSlice added in v0.1.0

func CopyMeshSlice(source []MeshTypes.Mesh) []MeshTypes.Mesh

func CopySlice added in v0.1.0

func CopySlice[Source DeepCopy[Destination], Destination any](source []Source) []Destination

func CreateGeometryReferencePointers

func CreateGeometryReferencePointers[T GeometryReferenceCreation](refPointers *ReferencePointers, source *[]T, parentPrefix string)

func CreateReferencePointers

func CreateReferencePointers[T ReferenceCreation](refPointers *ReferencePointers, source *[]T)

func CreateReferencePointersMap

func CreateReferencePointersMap[T ReferenceCreation](refPointers *ReferencePointers, source *map[string]T)

func GenerateMeshes added in v0.1.0

func GenerateMeshes[T MeshTaskCreator](objects []T, parentMeshConfig ParentMeshConfig)

func GetBoolPtr added in v0.1.0

func GetBoolPtr(value bool) *bool

func ReadMeshes

func ReadMeshes[T MeshReader](src []T, fileMap map[string]*zip.File) error

func ResolveReferences

func ResolveReferences[T ReferenceResolver](refPointers *ReferencePointers, source *[]T)

func ResolveReferencesMap

func ResolveReferencesMap[T ReferenceResolver](refPointers *ReferencePointers, source *map[string]T)

Types

type Address

type Address struct {
	Break int
	Value DMXAddress
}

type Addresses

type Addresses struct {
	Addresses []*Address
	Networks  []*Network
}

type Alignment

type Alignment struct {
	Geometry  string // Defines the Beam Geometry that gets aligned.
	Up        Vector // default: 0,0,1
	Direction Vector // default: 0,0,-1
}

type AuxData

type AuxData struct {
	SymDefs            []*SymDef
	Positions          []*Position
	MappingDefinitions []*MappingDefinition
	Classes            []*Class
}

auxiliary data for the scene node

func (*AuxData) CreateReferencePointer

func (a *AuxData) CreateReferencePointer(refPointers *ReferencePointers)

func (*AuxData) ReadMesh

func (a *AuxData) ReadMesh(fileMap map[string]*zip.File) error

type ChildList

type ChildList struct {
	SceneObjects []*SceneObject
	GroupObjects []*GroupObject
	FocusPoints  []*FocusPoint
	Fixtures     []*Fixture
	Supports     []*Support
	Trusses      []*Truss
	VideoScreens []*VideoScreen
	Projectors   []*Projector
}

func (*ChildList) CreateReferencePointer

func (c *ChildList) CreateReferencePointer(refPointers *ReferencePointers)

func (*ChildList) GenerateMesh added in v0.1.0

func (a *ChildList) GenerateMesh(parentMeshConfig ParentMeshConfig)

func (*ChildList) ReadMesh

func (c *ChildList) ReadMesh(fileMap map[string]*zip.File) error

func (*ChildList) ResolveReference

func (c *ChildList) ResolveReference(refPointers *ReferencePointers)

type Class

type Class struct {
	UUID string
	Name string
}

logical grouping across different layers

func (*Class) CreateReferencePointer

func (a *Class) CreateReferencePointer(refPointers *ReferencePointers)

type ColorCIE

type ColorCIE struct {
	X  float32
	Y  float32
	Y2 float32
}

format xyY (X,Y,Y2)

type Connection

type Connection struct {
	Own      string             // Node Link to the Geometry with DIN SPEC 15800 Type Wiring Object . Starting point is the Geometry Collect of the linked GDTF.
	Other    string             // Node Link to the Geometry with DIN SPEC 15800 Type Wiring Object . Starting point is the Geometry Collect of the linked GDTF of the object defined in toObject.
	ToObject NodeReference[any] // UUID of an other object in the scene.
}

type CustomCommand

type CustomCommand struct {
	Object string
	Value  string
}

type DMXAddress

type DMXAddress struct {
	Address  int16 // 0 indexed
	Universe int   // 0 indexed
}

NOTE: values are 0 indexed

func GetDMXAddress

func GetDMXAddress(value string) (*DMXAddress, error)

type Data

type Data struct {
	Provider string
	Version  string
}

type DeepCopy added in v0.1.0

type DeepCopy[T any] interface {
	Copy() T
}

type Fixture

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 (*Fixture) CreateReferencePointer

func (a *Fixture) CreateReferencePointer(refPointers *ReferencePointers)

func (*Fixture) GenerateMesh added in v0.1.0

func (obj *Fixture) GenerateMesh(parentMeshConfig ParentMeshConfig)

func (*Fixture) ReadMesh

func (a *Fixture) ReadMesh(fileMap map[string]*zip.File) error

func (*Fixture) ResolveReference

func (a *Fixture) ResolveReference(refPointers *ReferencePointers)

type FixtureModel added in v0.1.0

type FixtureModel struct {
	Fixture              *Fixture
	TransformationMatrix MeshTypes.Matrix
	MeshModel            []GDTFTypes.MeshModel
	Geometries           []MeshTypes.Mesh
}

func (FixtureModel) Copy added in v0.1.0

func (obj FixtureModel) Copy() FixtureModel

type FocusPoint

type FocusPoint struct {
	UUID       string
	Name       string
	Matrix     MeshTypes.Matrix
	Class      NodeReference[Class]
	Model      FocusPointModel
	Geometries *Geometries
}

func (*FocusPoint) CreateReferencePointer

func (a *FocusPoint) CreateReferencePointer(refPointers *ReferencePointers)

func (*FocusPoint) GenerateMesh added in v0.1.0

func (obj *FocusPoint) GenerateMesh(parentMeshConfig ParentMeshConfig)

func (*FocusPoint) ReadMesh

func (a *FocusPoint) ReadMesh(fileMap map[string]*zip.File) error

func (*FocusPoint) ResolveReference

func (a *FocusPoint) ResolveReference(refPointers *ReferencePointers)

type FocusPointModel added in v0.1.0

type FocusPointModel struct {
	FocusPoint           *FocusPoint
	TransformationMatrix MeshTypes.Matrix
	Geometries           []MeshTypes.Mesh
}

func (FocusPointModel) Copy added in v0.1.0

func (obj FocusPointModel) Copy() FocusPointModel

type GDTF

type GDTF struct {
	Name string
	Data *GDTFTypes.GDTF
}

type GeneralSceneDescription

type GeneralSceneDescription struct {
	VersionMajor    int
	VersionMinor    int
	Provider        string
	ProviderVersion string
	UserData        *UserData
	Scene           *Scene
}

func (*GeneralSceneDescription) CreateReferencePointer

func (a *GeneralSceneDescription) CreateReferencePointer(refPointers *ReferencePointers)

func (*GeneralSceneDescription) GenerateMeshes added in v0.1.0

func (a *GeneralSceneDescription) GenerateMeshes()

func (*GeneralSceneDescription) GetStageModel added in v0.2.0

func (a *GeneralSceneDescription) GetStageModel(config ModelConfig) StageModel

func (*GeneralSceneDescription) ResolveReference

func (a *GeneralSceneDescription) ResolveReference(refPointers *ReferencePointers)

type Geometries

type Geometries struct {
	Geometry3D []*Geometry3D
	Symbol     []*Symbol
}

func (*Geometries) GenerateMeshes added in v0.1.0

func (obj *Geometries) GenerateMeshes(parentMeshConfig ParentMeshConfig) []MeshTypes.Mesh

func (*Geometries) ReadMesh

func (a *Geometries) ReadMesh(fileMap map[string]*zip.File) error

func (*Geometries) ResolveReference

func (a *Geometries) ResolveReference(refPointers *ReferencePointers)

type Geometry3D

type Geometry3D struct {
	FileName fileName
	Matrix   MeshTypes.Matrix
	Mesh     *MeshTypes.Mesh
}

func (*Geometry3D) ReadMesh

func (a *Geometry3D) ReadMesh(fileMap map[string]*zip.File) error

type GeometryReferenceCreation

type GeometryReferenceCreation interface {
	CreateGeometryReferencePointer(refPointers *ReferencePointers, parentPrefix string)
}

type GlobalModelConfig

type GlobalModelConfig struct {
	RenderOnlyAddressedFixture bool
}

type Gobo

type Gobo struct {
	Rotation float32
}

type GroupObject

type GroupObject struct {
	UUID   string
	Name   string
	Matrix MeshTypes.Matrix
	Class  NodeReference[Class]
	ChildList
}

func (*GroupObject) CreateReferencePointer

func (a *GroupObject) CreateReferencePointer(refPointers *ReferencePointers)

func (*GroupObject) GenerateMesh added in v0.1.0

func (obj *GroupObject) GenerateMesh(parentMeshConfig ParentMeshConfig)

func (*GroupObject) ReadMesh

func (a *GroupObject) ReadMesh(fileMap map[string]*zip.File) error

func (*GroupObject) ResolveReference

func (a *GroupObject) ResolveReference(refPointers *ReferencePointers)

type IPv4

type IPv4 = string

type IPv6

type IPv6 = string

type Layer

type Layer struct {
	UUID   string
	Name   string
	Matrix MeshTypes.Matrix
	ChildList
}

spatial representation of a geometric container

func (*Layer) CreateReferencePointer

func (a *Layer) CreateReferencePointer(refPointers *ReferencePointers)

func (*Layer) ResolveReference

func (a *Layer) ResolveReference(refPointers *ReferencePointers)

type MVRParserConfig

type MVRParserConfig struct {
	MeshHandling      int
	ReadThumbnail     bool
	GDTFParserWorkers int
	StageMeshWorkers  int
}

type Mapping

type Mapping struct {
	LinkedDef NodeReference[MappingDefinition]
	Ux        int
	Uy        int
	Ox        int
	Oy        int
	Rz        float32
}

func (*Mapping) ResolveReference

func (a *Mapping) ResolveReference(refPointers *ReferencePointers)

type MappingDefinition

type MappingDefinition struct {
	UUID           string
	Name           string
	SizeX          int
	SizeY          int
	Source         Source
	ScaleHandeling *string // ScaleKeepRatio or ScaleIgnoreRatio or KeepSizeCenter
}

input source for fixture color mapping applications

func (*MappingDefinition) CreateReferencePointer

func (a *MappingDefinition) CreateReferencePointer(refPointers *ReferencePointers)

type Matrix

type Matrix = MeshTypes.Matrix

type MeshReader

type MeshReader interface {
	ReadMesh(fileMap map[string]*zip.File) error
}

type MeshTaskCreator

type MeshTaskCreator interface {
	GenerateMesh(parentMeshConfig ParentMeshConfig)
}

type ModelConfig

type ModelConfig struct {
	Global     GlobalModelConfig
	Individual map[string]ModelNodeConfig // configure by Node (fixture, ...) UUID (also applies to children)
}

type ModelNodeConfig

type ModelNodeConfig struct {
	RenderOnlyAddressedFixture *bool
	Exclude                    *bool
}

type Network

type Network struct {
	Geometry   string
	IPv4       *IPv4
	SubNetMask *IPv4
	IPv6       *IPv6
	DHCP       bool
	Hostname   *string
}

type NodeModel added in v0.2.0

type NodeModel interface {
	// contains filtered or unexported methods
}

type NodeReference

type NodeReference[T any] struct {
	String *string
	Ptr    *T
}

type Overwrite

type Overwrite struct {
	Universal string // Node Link to the Wheel, Emitter or Filter. Starting point is the the collect of the Universal GDTF.
	Target    string // Node Link to the Wheel, Emitter or Filter. Starting point is the the collect of the linked GDTF of the fixture. When no target is given, it will be like a static gobo or filter that you attach in front of all beams
}

This node defines an overwrite with the Universal.gdtt GDTF template inside the MVR to overwrite Wheel Slots, Emitters and Filters for the fixture

type ParentMeshConfig

type ParentMeshConfig struct {
	Transformation MeshTypes.Matrix
}

type Position

type Position struct {
	UUID string
	Name string
}

logical grouping of lighting devices and trusses

func (*Position) CreateReferencePointer

func (a *Position) CreateReferencePointer(refPointers *ReferencePointers)

type Projection

type Projection struct {
	Source         Source
	ScaleHandeling string
}

type Projector

type Projector struct {
	UUID             string
	Name             string
	Multipatch       string
	Matrix           MeshTypes.Matrix
	Class            NodeReference[Class]
	Geometries       *Geometries
	Projections      []*Projection
	Function         *string
	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            ProjectorModel
	ChildList
}

func (*Projector) CreateReferencePointer

func (a *Projector) CreateReferencePointer(refPointers *ReferencePointers)

func (*Projector) GenerateMesh added in v0.1.0

func (obj *Projector) GenerateMesh(parentMeshConfig ParentMeshConfig)

func (*Projector) ReadMesh

func (a *Projector) ReadMesh(fileMap map[string]*zip.File) error

func (*Projector) ResolveReference

func (a *Projector) ResolveReference(refPointers *ReferencePointers)

type ProjectorModel added in v0.1.0

type ProjectorModel struct {
	Projector            *Projector
	TransformationMatrix MeshTypes.Matrix
	MeshModel            []GDTFTypes.MeshModel
	Geometries           []MeshTypes.Mesh
}

func (ProjectorModel) Copy added in v0.1.0

func (obj ProjectorModel) Copy() ProjectorModel

type Protocol

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 ReferenceCreation

type ReferenceCreation interface {
	CreateReferencePointer(refPointers *ReferencePointers)
}

type ReferencePointers

type ReferencePointers struct {
	GDTFSpecs          map[string]*GDTF // handled seperately
	Classes            map[string]*Class
	Positions          map[string]*Position
	SymDefs            map[string]*SymDef
	MappingDefinitions map[string]*MappingDefinition
	FoucsPoints        map[string]*FocusPoint
	Object             map[string]*any
}

func CreateRefPointersMap

func CreateRefPointersMap() *ReferencePointers

type ReferenceResolver

type ReferenceResolver interface {
	ResolveReference(refPointers *ReferencePointers)
}

type Scene

type Scene struct {
	AuxData *AuxData
	Layers  []*Layer
}

func (*Scene) CreateReferencePointer

func (a *Scene) CreateReferencePointer(refPointers *ReferencePointers)

func (*Scene) ResolveReference

func (a *Scene) ResolveReference(refPointers *ReferencePointers)

type SceneObject

type SceneObject struct {
	UUID             string
	Name             string
	Multipatch       string
	Matrix           MeshTypes.Matrix
	Class            NodeReference[Class]
	Geometries       *Geometries
	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            SceneObjectModel
	ChildList
}

func (*SceneObject) CreateReferencePointer

func (a *SceneObject) CreateReferencePointer(refPointers *ReferencePointers)

func (*SceneObject) GenerateMesh added in v0.1.0

func (obj *SceneObject) GenerateMesh(parentMeshConfig ParentMeshConfig)

func (*SceneObject) ReadMesh

func (a *SceneObject) ReadMesh(fileMap map[string]*zip.File) error

func (*SceneObject) ResolveReference

func (a *SceneObject) ResolveReference(refPointers *ReferencePointers)

type SceneObjectModel added in v0.1.0

type SceneObjectModel struct {
	SceneObject          *SceneObject
	TransformationMatrix MeshTypes.Matrix
	MeshModel            []GDTFTypes.MeshModel
	Geometries           []MeshTypes.Mesh
}

func (SceneObjectModel) Copy added in v0.1.0

type Source

type Source struct {
	LinkedGeometry string // reference to a geometry in the gdtf
	Type           string
	Value          string
}

type StageModel added in v0.1.0

type StageModel struct {
	SceneObjectModels []SceneObjectModel
	FocusPointModels  []FocusPointModel
	FixtureModels     []FixtureModel
	SupportModels     []SupportModel
	TrussModels       []TrussModel
	VideoScreenModels []VideoScreenModel
	ProjectorModels   []ProjectorModel
}

func (*StageModel) Copy added in v0.1.0

func (obj *StageModel) Copy() StageModel

type Support

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 (*Support) CreateReferencePointer

func (a *Support) CreateReferencePointer(refPointers *ReferencePointers)

func (*Support) GenerateMesh added in v0.1.0

func (obj *Support) GenerateMesh(parentMeshConfig ParentMeshConfig)

func (*Support) ReadMesh

func (a *Support) ReadMesh(fileMap map[string]*zip.File) error

func (*Support) ResolveReference

func (a *Support) ResolveReference(refPointers *ReferencePointers)

type SupportModel added in v0.1.0

type SupportModel struct {
	Support              *Support
	TransformationMatrix MeshTypes.Matrix
	MeshModel            []GDTFTypes.MeshModel
	Geometries           []MeshTypes.Mesh
}

func (SupportModel) Copy added in v0.1.0

func (obj SupportModel) Copy() SupportModel

type SymDef

type SymDef struct {
	UUID       string
	Name       string
	Geometries *Geometries
}

contains the graphics so the scene can refer to this, thus optimizing repetition of the geometry

func (*SymDef) CreateReferencePointer

func (a *SymDef) CreateReferencePointer(refPointers *ReferencePointers)

func (*SymDef) ReadMesh

func (a *SymDef) ReadMesh(fileMap map[string]*zip.File) error

func (*SymDef) ResolveReference

func (a *SymDef) ResolveReference(refPointers *ReferencePointers)

type Symbol

type Symbol struct {
	UUID   string
	SymDef NodeReference[SymDef]
	Matrix MeshTypes.Matrix
}

func (*Symbol) GenerateMeshes added in v0.1.0

func (a *Symbol) GenerateMeshes(parentMeshConfig ParentMeshConfig) []MeshTypes.Mesh

func (*Symbol) ResolveReference

func (a *Symbol) ResolveReference(refPointers *ReferencePointers)

type Truss

type Truss struct {
	UUID             string
	Name             string
	Multipatch       string
	Matrix           MeshTypes.Matrix
	Class            NodeReference[Class]
	Position         NodeReference[Position]
	Geometries       *Geometries
	Function         *string
	GDTFSpec         NodeReference[GDTF]
	GDTFMode         string
	CastShadow       bool
	Addresses        *Addresses
	Alignments       []*Alignment
	CustomCommands   []*CustomCommand
	Overwrites       []*Overwrite
	Connections      []*Connection
	ChildPosition    *string // Node link to the geometry. Starting point is the Geometry Collect of the linked parent GDTF of this object.
	FixtureID        string
	FixtureIDNumeric int // v1.6 only, MA exports 1.5
	UnitNumber       int
	CustomId         int
	CustomIdType     int
	Model            TrussModel
	ChildList
}

func (*Truss) CreateReferencePointer

func (a *Truss) CreateReferencePointer(refPointers *ReferencePointers)

func (*Truss) GenerateMesh added in v0.1.0

func (obj *Truss) GenerateMesh(parentMeshConfig ParentMeshConfig)

func (*Truss) ReadMesh

func (a *Truss) ReadMesh(fileMap map[string]*zip.File) error

func (*Truss) ResolveReference

func (a *Truss) ResolveReference(refPointers *ReferencePointers)

type TrussModel added in v0.1.0

type TrussModel struct {
	Truss                *Truss
	TransformationMatrix MeshTypes.Matrix
	MeshModel            []GDTFTypes.MeshModel
	Geometries           []MeshTypes.Mesh
}

func (TrussModel) Copy added in v0.1.0

func (obj TrussModel) Copy() TrussModel

type UserData

type UserData struct {
	Data []Data
}

type Vector

type Vector = string

type VideoScreen

type VideoScreen struct {
	UUID             string
	Name             string
	Multipatch       string
	Matrix           MeshTypes.Matrix
	Class            NodeReference[Class]
	Geometries       *Geometries
	Sources          []*Source
	Function         *string
	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            VideoScreenModel
	ChildList
}

func (*VideoScreen) CreateReferencePointer

func (a *VideoScreen) CreateReferencePointer(refPointers *ReferencePointers)

func (*VideoScreen) GenerateMesh added in v0.1.0

func (obj *VideoScreen) GenerateMesh(parentMeshConfig ParentMeshConfig)

func (*VideoScreen) ReadMesh

func (a *VideoScreen) ReadMesh(fileMap map[string]*zip.File) error

func (*VideoScreen) ResolveReference

func (a *VideoScreen) ResolveReference(refPointers *ReferencePointers)

type VideoScreenModel added in v0.1.0

type VideoScreenModel struct {
	VideoScreen          *VideoScreen
	TransformationMatrix MeshTypes.Matrix
	MeshModel            []GDTFTypes.MeshModel
	Geometries           []MeshTypes.Mesh
}

func (VideoScreenModel) Copy added in v0.1.0

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL