35
// Use filesystem version 2 for compatibility with newer boost versions.
36
#ifndef BOOST_FILESYSTEM_VERSION
37
#define BOOST_FILESYSTEM_VERSION 2
39
35
#include <boost/filesystem.hpp>
40
#include <boost/lexical_cast.hpp>
37
#include "WStringUtils.h"
42
38
#include "math/linearAlgebra/WLinearAlgebra.h"
43
39
#include "math/linearAlgebra/WMatrixFixed.h"
44
40
#include "math/linearAlgebra/WVectorFixed.h"
49
45
template < typename T >
50
46
class WPropertyVariable;
49
class WTransferFunction;
53
51
////////////////////////////////////////////////////////////////////////////////////////////////////////
54
// NOTE: If you add new types here, please also add corresponding addProperty methods to WProperties
52
// NOTE: If you add new types here, please also add corresponding addProperty methods to WPropertyGroup
55
53
////////////////////////////////////////////////////////////////////////////////////////////////////////
57
55
////////////////////////////////////////////////////////////////////////////////////////////////////////
66
PV_UNKNOWN, //!< type not known
67
PV_GROUP, //!< the group property
68
PV_INT, //!< integer value
69
PV_DOUBLE, //!< floating point value
71
PV_STRING, //!< a string
72
PV_PATH, //!< a Boost Path object denoting a filename/path
73
PV_SELECTION, //!< a list of strings, selectable
74
PV_POSITION, //!< a position property
75
PV_COLOR, //!< a color property
76
PV_TRIGGER, //!< for triggering an event
77
PV_MATRIX4X4 //!< for 4x4 matrices
64
PV_UNKNOWN, //!< type not known
65
PV_GROUP, //!< the group property
66
PV_INT, //!< integer value
67
PV_DOUBLE, //!< floating point value
69
PV_STRING, //!< a string
70
PV_PATH, //!< a Boost Path object denoting a filename/path
71
PV_SELECTION, //!< a list of strings, selectable
72
PV_POSITION, //!< a position property
73
PV_COLOR, //!< a color property
74
PV_TRIGGER, //!< for triggering an event
75
PV_MATRIX4X4, //!< for 4x4 matrices
76
PV_TRANSFERFUNCTION, //!< for transfer function textures
77
PV_STRUCT, //!< for complex, structured properties (used by \ref WPropertyStruct)
78
PV_LIST //!< for a dynamic list of properties of the same type (see \ref WPropertyList)
100
101
namespace WPVBaseTypes
102
typedef int32_t PV_INT; //!< base type used for every WPVInt
103
typedef double PV_DOUBLE; //!< base type used for every WPVDouble
104
typedef bool PV_BOOL; //!< base type used for every WPVBool
105
typedef std::string PV_STRING; //!< base type used for every WPVString
106
typedef boost::filesystem::path PV_PATH; //!< base type used for every WPVFilename
107
typedef WItemSelector PV_SELECTION; //!< base type used for every WPVSelection
108
typedef WPosition PV_POSITION; //!< base type used for every WPVPosition
109
typedef WColor PV_COLOR; //!< base type used for every WPVColor
110
typedef WMatrix4d PV_MATRIX4X4; //!< base type used for every WPVMatrix4X4
103
typedef int32_t PV_INT; //!< base type used for every WPVInt
104
typedef double PV_DOUBLE; //!< base type used for every WPVDouble
105
typedef bool PV_BOOL; //!< base type used for every WPVBool
106
typedef std::string PV_STRING; //!< base type used for every WPVString
107
typedef boost::filesystem::path PV_PATH; //!< base type used for every WPVFilename
108
typedef WItemSelector PV_SELECTION; //!< base type used for every WPVSelection
109
typedef WPosition PV_POSITION; //!< base type used for every WPVPosition
110
typedef WColor PV_COLOR; //!< base type used for every WPVColor
111
typedef WMatrix4d PV_MATRIX4X4; //!< base type used for every WPVMatrix4X4
112
typedef WTransferFunction PV_TRANSFERFUNCTION; //!< base type for every transfer function
113
115
* Enum denoting the possible trigger states. It is used for trigger properties.
117
119
PV_TRIGGER_READY = 0, //!< Trigger property: is ready to be triggered (again)
118
120
PV_TRIGGER_TRIGGERED //!< Trigger property: got triggered
120
PV_TRIGGER; //!< base type used for every WPVTrigger
122
PV_TRIGGER; //!< base type used for every WPVTrigger
125
* Checks which property types are derived from \ref WPropertyGroupBase. This, for example, is true for PV_GROUP and PV_STRUCT.
127
* \param type the type to check.
129
* \return true if cast-able \ref WPropertyGroupBase.
131
bool isPropertyGroup( PROPERTY_TYPE type );
123
134
* Write a PV_TRIGGER in string representation to the given output stream.
202
213
typedef WPropertyVariable< WPVBaseTypes::PV_MATRIX4X4 > WPVMatrix4X4;
216
* Transfer Function properties
218
typedef WPropertyVariable< WPVBaseTypes::PV_TRANSFERFUNCTION > WPVTransferFunction;
205
221
* Some convenience type alias for a even more easy usage of WPropertyVariable.
206
222
* These typdefs define some pointer alias.
262
278
typedef boost::shared_ptr< WPVMatrix4X4 > WPropMatrix4X4;
281
* Alias for the transfer function properties
283
typedef boost::shared_ptr< WPVTransferFunction > WPropTransferFunction;
266
286
* This namespace contains several helper classes which translate their template type to an enum.
289
309
* Class helping to create a new instance of the property content from an old one. This might be needed by some types (some need to have a
290
310
* predecessor for creation).
291
* You only need to specialize this class for types not allowing the direct use of boost::lexical_cast.
311
* You only need to specialize this class for types not allowing the direct use of string_utils::fromString
293
313
template< typename T >
294
314
class WStringConversion
613
* Class helping to adapt types specified as template parameter into an enum.
616
class WTypeIdentifier< WPVBaseTypes::PV_TRANSFERFUNCTION >
620
* Get type identifier of the template type T.
622
* \return type identifier-
624
PROPERTY_TYPE getType()
626
return PV_TRANSFERFUNCTION;
631
* Class helping to create a new instance of the property content from an old one. Selections need this special care since they contain not
632
* serializable content which needs to be acquired from its predecessor instance.
635
class WStringConversion< WPVBaseTypes::PV_TRANSFERFUNCTION >
639
* Creates a new instance of the type from a given string. Some classes need a predecessor which is also specified here.
641
* \param str the new value as string
643
* \return the new instance
645
WPVBaseTypes::PV_TRANSFERFUNCTION create( const WPVBaseTypes::PV_TRANSFERFUNCTION& /*old*/, const std::string str );
648
* Creates a string from the specified value.
650
* \param tf the value to convert
652
* \return the string representation
654
std::string asString( const WPVBaseTypes::PV_TRANSFERFUNCTION& tf );
593
658
* Class helping to create a new instance of the property content from an old one. Selections need this special care since they contain not
594
659
* serializable content which needs to be acquired from its predecessor instance.