Lumiverse  2.5
A framework for creating lighting control applications
LumiverseTypeUtils.h
Go to the documentation of this file.
1 
4 #ifndef _LUMIVERSETYPEUTILS_H_
5 #define _LUMIVERSETYPEUTILS_H_
6 
7 #pragma once
8 
9 #include "LumiverseFloat.h"
10 #include "LumiverseEnum.h"
11 #include "LumiverseColor.h"
12 #include "LumiverseOrientation.h"
13 #include <math.h>
14 
15 namespace Lumiverse {
25  namespace LumiverseTypeUtils {
32  LumiverseType* copy(LumiverseType* data);
33 
40  void copyByVal(LumiverseType* source, LumiverseType* target);
41 
49  bool equals(LumiverseType* lhs, LumiverseType* rhs);
50 
59  int cmp(LumiverseType* lhs, LumiverseType* rhs);
60 
67  shared_ptr<LumiverseType> lerp(LumiverseType* lhs, LumiverseType* rhs, float t);
68 
74  bool areSameType(LumiverseType* lhs, LumiverseType* rhs);
75 
79  Eigen::Matrix3f getRotationMatrix(Eigen::Vector3f lookat, Eigen::Vector3f up, LumiverseOrientation pan, LumiverseOrientation tilt);
80 
84  Eigen::Matrix3f getRotationMatrix(Eigen::Vector3f lookat, Eigen::Vector3f axis);
85 
92  bool lessThan(LumiverseType* lhs, LumiverseType* rhs);
93 
100  void scaleParam(LumiverseType* val, float scale);
101 
103  LumiverseType* loadFromJSON(JSONNode node);
104 
105  LumiverseOrientation& typeToOrientationRef(LumiverseType* data);
106  LumiverseColor& typeToColorRef(LumiverseType* data);
107  LumiverseFloat& typeToFloatRef(LumiverseType* data);
108  }
109 }
110 #endif
LumiverseType * loadFromJSON(JSONNode node)
Loads a LumiverseType from a JSON node.
Definition: LumiverseTypeUtils.cpp:219
void scaleParam(LumiverseType *val, float scale)
Multiplies a parameter by a constant value (typically from 0 to 1, but no limits are enforced in this...
Definition: LumiverseTypeUtils.cpp:201
LumiverseType * copy(LumiverseType *data)
Copies a LumiverseType and returns an abstracted pointer to the new value.
Definition: LumiverseTypeUtils.cpp:6
bool equals(LumiverseType *lhs, LumiverseType *rhs)
Compares two generic LumiverseType pointers for equality.
Definition: LumiverseTypeUtils.cpp:43
shared_ptr< LumiverseType > lerp(LumiverseType *lhs, LumiverseType *rhs, float t)
Lerps the values of a LumiverseType and returns the value.
Definition: LumiverseTypeUtils.cpp:98
bool areSameType(LumiverseType *lhs, LumiverseType *rhs)
Checks the types of two LumiverseType objects.
Definition: LumiverseTypeUtils.cpp:131
Stores an enumeration in Lumiverse.
Eigen::Matrix3f getRotationMatrix(Eigen::Vector3f lookat, Eigen::Vector3f up, LumiverseOrientation pan, LumiverseOrientation tilt)
Returns a rotation matrix given the up vector, look at vector, the pan, and tilt. ...
Definition: LumiverseTypeUtils.cpp:140
Stores a floating point value in Lumiverse.
int cmp(LumiverseType *lhs, LumiverseType *rhs)
Compares two LumiverseType objects.
Definition: LumiverseTypeUtils.cpp:60
Stores a orientation value in Lumiverse.
A LumiverseColor contains information about a Device Color parameter.
Contains all core Lumiverse functions and variables.
Definition: Device.cpp:2
bool lessThan(LumiverseType *lhs, LumiverseType *rhs)
Compares two LumiverseTypes with <.
Definition: LumiverseTypeUtils.cpp:193
void copyByVal(LumiverseType *source, LumiverseType *target)
Copies the data from source into target.
Definition: LumiverseTypeUtils.cpp:22