BoxObject Class Reference
The BoxObject is a variant type. More...
#include <boxobject.h>
Public Types | |
| enum | BoxObjectType { NIL, BOOL, CAMERA, DOUBLE, FLOAT, INTEGER, LONG, SHADER, STRING, STRINGVEC, IVEC2, IVEC3, IVEC4, TRANSFUNC, VEC2, VEC3, VEC4, MAT2, MAT3, MAT4, VOLUMEHANDLE, VOLUMECOLLECTION } |
Specifies the data type of the value that is currently stored in the BoxObject. | |
Public Member Functions | |
| BoxObject (const BoxObject &obj) | |
| BoxObject (bool value) | |
| BoxObject (double value) | |
| BoxObject (float value) | |
| BoxObject (int value) | |
| BoxObject (long value) | |
| BoxObject (const std::string &value) | |
| BoxObject (const std::vector< std::string > &value) | |
| BoxObject (const tgt::ivec2 &value) | |
| BoxObject (const tgt::ivec3 &value) | |
| BoxObject (const tgt::ivec4 &value) | |
| BoxObject (const tgt::vec2 &value) | |
| BoxObject (const tgt::vec3 &value) | |
| BoxObject (const tgt::vec4 &value) | |
| BoxObject (const tgt::mat2 &value) | |
| BoxObject (const tgt::mat3 &value) | |
| BoxObject (const tgt::mat4 &value) | |
| BoxObject (const ShaderSource &value) | |
| BoxObject (const TransFunc *value) | |
| Constructs a BoxObject from a transfer function. | |
| BoxObject (const tgt::Camera *value) | |
| Constructs a BoxObject from a camera. | |
| BoxObject (const VolumeHandle *value) | |
| Constructs a BoxObject from a volume handle. | |
| BoxObject (const VolumeCollection *value) | |
| Constructs a BoxObject from a volume collection. | |
| BoxObjectType | getType () const |
| Returns the data type of the value that is currently stored in the BoxObject. | |
| bool | getBool () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to Bool if needed and/or possible and returns it. | |
| double | getDouble () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to Double if needed and/or possible and returns it. | |
| float | getFloat () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to Float if needed and/or possible and returns it. | |
| int | getInt () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to Int if needed and/or possible and returns it. | |
| long | getLong () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to Long if needed and/or possible and returns it. | |
| std::string | getString () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to String if needed and/or possible and returns it. | |
| std::vector< std::string > | getStringVec () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to StringVec if needed and/or possible and returns it. | |
| tgt::ivec2 | getIVec2 () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to IVec2 if needed and/or possible and returns it. | |
| tgt::ivec3 | getIVec3 () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to IVec3 if needed and/or possible and returns it. | |
| tgt::ivec4 | getIVec4 () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to IVec4 if needed and/or possible and returns it. | |
| tgt::vec2 | getVec2 () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to Vec2 if needed and/or possible and returns it. | |
| tgt::vec3 | getVec3 () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to Vec3 if needed and/or possible and returns it. | |
| tgt::vec4 | getVec4 () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to Vec4 if needed and/or possible and returns it. | |
| tgt::mat2 | getMat2 () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to mat2 if needed and/or possible and returns it. | |
| tgt::mat3 | getMat3 () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to mat2 if needed and/or possible and returns it. | |
| tgt::mat4 | getMat4 () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to mat2 if needed and/or possible and returns it. | |
| ShaderSource | getShader () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to ShaderSource if needed and/or possible and returns a copy of it. | |
| const TransFunc * | getTransFunc () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to TransFunc if needed and/or possible and returns it. | |
| const tgt::Camera * | getCamera () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to Camera if needed and/or possible and returns it. | |
| const VolumeHandle * | getVolumeHandle () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to VolumeHandle if needed and/or possible and returns it. | |
| const VolumeCollection * | getVolumeCollection () const throw (VoreenException) |
| Converts the current value regardless of type of the BoxObject to VolumeCollection if needed and/or possible and returns it. | |
| void | setInt (const int &value) |
| void | setFloat (const float &value) |
| void | setDouble (const double &value) |
| void | setBool (const bool &value) |
| void | setString (const std::string &value) |
| void | setStringVec (const std::vector< std::string > &value) |
| void | setLong (const long &value) |
| void | setVec2 (const tgt::vec2 &value) |
| void | setVec3 (const tgt::vec3 &value) |
| void | setVec4 (const tgt::vec4 &value) |
| void | setIVec2 (const tgt::ivec2 &value) |
| void | setIVec3 (const tgt::ivec3 &value) |
| void | setIVec4 (const tgt::ivec4 &value) |
| void | setMat2 (const tgt::mat2 &value) |
| void | setMat3 (const tgt::mat3 &value) |
| void | setMat4 (const tgt::mat4 &value) |
| void | setShader (const ShaderSource *value) |
| void | setTransFunc (const TransFunc *value) |
| Assigns a transfer function. The passed object is not copied. | |
| void | setCamera (const tgt::Camera *value) |
| Assigns a camera. The passed object is not copied. | |
| void | setVolumeHandle (const VolumeHandle *value) |
| Assigns a VolumeHandle. The passed object is not copied. | |
| void | setVolumeCollection (const VolumeCollection *value) |
| Assigns a VolumeCollection. The passed object is not copied. | |
| BoxObject & | operator= (const BoxObject &rhs) |
| BoxObject & | operator= (const bool &rhs) |
| BoxObject & | operator= (const double &rhs) |
| BoxObject & | operator= (const float &rhs) |
| BoxObject & | operator= (const int &rhs) |
| BoxObject & | operator= (const long &rhs) |
| BoxObject & | operator= (const std::string &rhs) |
| BoxObject & | operator= (const std::vector< std::string > &rhs) |
| BoxObject & | operator= (const tgt::ivec2 &rhs) |
| BoxObject & | operator= (const tgt::ivec3 &rhs) |
| BoxObject & | operator= (const tgt::ivec4 &rhs) |
| BoxObject & | operator= (const tgt::vec2 &rhs) |
| BoxObject & | operator= (const tgt::vec3 &rhs) |
| BoxObject & | operator= (const tgt::vec4 &rhs) |
| BoxObject & | operator= (const tgt::mat2 &rhs) |
| BoxObject & | operator= (const tgt::mat3 &rhs) |
| BoxObject & | operator= (const tgt::mat4 &rhs) |
| BoxObject & | operator= (const ShaderSource &rhs) |
| BoxObject & | operator= (const TransFunc *rhs) |
| BoxObject & | operator= (const tgt::Camera *rhs) |
| BoxObject & | operator= (const VolumeHandle *rhs) |
| BoxObject & | operator= (const VolumeCollection *rhs) |
Static Public Member Functions | |
| static std::string | getTypeName (BoxObjectType type) |
| Returns the passed type as string, which might be used in a user interface. | |
Protected Member Functions | |
| void | deleteValue () |
| Frees the currently stored value, if necessary. | |
| template<class T > | |
| void | set (const T &value, BoxObjectType type) |
| void | set (const TransFunc &value, BoxObjectType type) |
| void | set (const tgt::Camera &value, BoxObjectType type) |
| void | set (const VolumeHandle &value, BoxObjectType type) |
| void | set (const VolumeCollection &value, BoxObjectType type) |
| template<class T > | |
| const std::string | toString (const T &value) const |
Protected Attributes | |
| void * | value_ |
| The currently stored value. | |
| BoxObjectType | currentType_ |
| Data type of the currently stored value. | |
Detailed Description
The BoxObject is a variant type.
It can take different types of values and convert them on demand if a conversion is implemented.
Definition at line 49 of file boxobject.h.
Constructor & Destructor Documentation
Constructs a BoxObject from a transfer function.
The passed object is not copied, but stored directly.
Definition at line 254 of file boxobject.cpp.
| BoxObject | ( | const tgt::Camera * | value | ) | [explicit] |
Constructs a BoxObject from a camera.
The passed object is not copied, but stored directly.
Definition at line 258 of file boxobject.cpp.
| BoxObject | ( | const VolumeHandle * | value | ) | [explicit] |
Constructs a BoxObject from a volume handle.
The passed object is not copied, but stored directly.
Definition at line 262 of file boxobject.cpp.
| BoxObject | ( | const VolumeCollection * | value | ) | [explicit] |
Constructs a BoxObject from a volume collection.
The passed object is not copied, but stored directly.
Definition at line 266 of file boxobject.cpp.
Member Function Documentation
| bool getBool | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to Bool if needed and/or possible and returns it.
- Exceptions:
-
VoreenException if the stored value cannot be converted
Definition at line 429 of file boxobject.cpp.
| const Camera * getCamera | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to Camera if needed and/or possible and returns it.
- Note:
- The returned value is not a copy, but is still owned by the link source. Therefore, it must not be altered or freed by the caller.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 849 of file boxobject.cpp.
| double getDouble | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to Double if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 468 of file boxobject.cpp.
| float getFloat | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to Float if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 501 of file boxobject.cpp.
| int getInt | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to Int if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 534 of file boxobject.cpp.
| ivec2 getIVec2 | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to IVec2 if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 639 of file boxobject.cpp.
| ivec3 getIVec3 | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to IVec3 if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 666 of file boxobject.cpp.
| ivec4 getIVec4 | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to IVec4 if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 693 of file boxobject.cpp.
| long getLong | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to Long if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 567 of file boxobject.cpp.
| mat2 getMat2 | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to mat2 if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 801 of file boxobject.cpp.
| mat3 getMat3 | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to mat2 if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 813 of file boxobject.cpp.
| mat4 getMat4 | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to mat2 if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 825 of file boxobject.cpp.
| ShaderSource getShader | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to ShaderSource if needed and/or possible and returns a copy of it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 885 of file boxobject.cpp.
| string getString | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to String if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 600 of file boxobject.cpp.
| vector< string > getStringVec | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to StringVec if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 627 of file boxobject.cpp.
| const TransFunc * getTransFunc | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to TransFunc if needed and/or possible and returns it.
- Note:
- The returned value is not a copy, but is still owned by the link source. Therefore, it must not be altered or freed by the caller.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 837 of file boxobject.cpp.
| vec2 getVec2 | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to Vec2 if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 720 of file boxobject.cpp.
| vec3 getVec3 | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to Vec3 if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 747 of file boxobject.cpp.
| vec4 getVec4 | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to Vec4 if needed and/or possible and returns it.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 774 of file boxobject.cpp.
| const VolumeCollection * getVolumeCollection | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to VolumeCollection if needed and/or possible and returns it.
- Note:
- The returned value is not a copy, but is still owned by the link source. Therefore, it must not be altered or freed by the caller.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 873 of file boxobject.cpp.
| const VolumeHandle * getVolumeHandle | ( | ) | const throw (VoreenException) |
Converts the current value regardless of type of the BoxObject to VolumeHandle if needed and/or possible and returns it.
- Note:
- The returned value is not a copy, but is still owned by the link source. Therefore, it must not be altered or freed by the caller.
- Exceptions:
-
VoreenException,if the stored value cannot be converted
Definition at line 861 of file boxobject.cpp.