25 #ifndef WPROPERTYTYPES_H
26 #define WPROPERTYTYPES_H
34 #include <boost/filesystem.hpp>
38 #include "WItemSelector.h"
39 #include "WStringUtils.h"
40 #include "math/WInterval.h"
41 #include "math/linearAlgebra/WMatrixFixed.h"
42 #include "math/linearAlgebra/WPosition.h"
43 #include "math/linearAlgebra/WVectorFixed.h"
45 template <
typename T >
90 PV_PURPOSE_INFORMATION,
235 typedef std::shared_ptr< WPVInt > WPropInt;
240 typedef std::shared_ptr< WPVDouble > WPropDouble;
245 typedef std::shared_ptr< WPVBool > WPropBool;
250 typedef std::shared_ptr< WPVString > WPropString;
255 typedef std::shared_ptr< WPVFilename > WPropFilename;
260 typedef std::shared_ptr< WPVSelection > WPropSelection;
265 typedef std::shared_ptr< WPVPosition > WPropPosition;
270 typedef std::shared_ptr< WPVColor > WPropColor;
275 typedef std::shared_ptr< WPVGroup > WPropGroup;
280 typedef std::shared_ptr< WPVTrigger > WPropTrigger;
285 typedef std::shared_ptr< WPVMatrix4X4 > WPropMatrix4X4;
290 typedef std::shared_ptr< WPVTransferFunction > WPropTransferFunction;
295 typedef std::shared_ptr< WPVInterval > WPropInterval;
305 template<
typename T >
325 template<
typename T >
336 T
create(
const T& ,
const std::string str )
338 return string_utils::fromString< T >( str );
604 std::vector< std::string > tokens;
606 WAssert( tokens.size() >= 16,
"There weren't 16 values for a 4x4 Matrix" );
609 for(
size_t row = 0; row < 4; ++row )
611 for(
size_t col = 0; col < 4; ++col )
613 c( row, col ) = string_utils::fromString< double >( tokens[ idx ] );
630 std::ostringstream out;
631 for(
size_t row = 0; row < 4; ++row )
633 for(
size_t col = 0; col < 4; ++col )
635 out << v( row, col ) <<
";";
656 return PV_TRANSFERFUNCTION;
705 std::vector< std::string > tokens;
707 WAssert( tokens.size() >= 3,
"There weren't 3 values for a 3D vector" );
710 for(
size_t col = 0; col < 3; ++col )
712 c[ col ] = string_utils::fromString< double >( tokens[ idx ] );
727 std::ostringstream out;
728 for(
size_t col = 0; col < 3; ++col )
730 out << v[ col ] <<
";";
753 std::vector< std::string > tokens;
755 WAssert( tokens.size() >= 2,
"There weren't 2 values for an interval" );
758 string_utils::fromString< double >( tokens[ 1 ] ) );
772 std::ostringstream out;
std::string asString(const WPVBaseTypes::PV_INTERVAL &v)
Creates a string from the specified value.
WPVBaseTypes::PV_INTERVAL create(const WPVBaseTypes::PV_INTERVAL &, const std::string str)
Creates a new instance of the type from a given string.
WPVBaseTypes::PV_MATRIX4X4 create(const WPVBaseTypes::PV_MATRIX4X4 &, const std::string str)
Creates a new instance of the type from a given string.
std::string asString(const WPVBaseTypes::PV_MATRIX4X4 &v)
Creates a string from the specified value.
WPVBaseTypes::PV_POSITION create(const WPVBaseTypes::PV_POSITION &, const std::string str)
Creates a new instance of the type from a given string.
std::string asString(const WPVBaseTypes::PV_POSITION &v)
Creates a string from the specified value.
WPVBaseTypes::PV_SELECTION create(const WPVBaseTypes::PV_SELECTION &old, const std::string str)
Creates a new instance of the type from a given string.
std::string asString(const WPVBaseTypes::PV_SELECTION &v)
Creates a string from the specified value.
Class helping to create a new instance of the property content from an old one.
T create(const T &, const std::string str)
Creates a new instance of the type from a given string.
std::string asString(const T &v)
Creates a string from the specified value.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
Class helping to adapt types specified as template parameter into an enum.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
const T & getUpper() const
Return the upper value of the interval.
const T & getLower() const
Get the lower value of the interval.
This class represents a subset of a WItemSelection.
WItemSelector newSelector(IndexList selected) const
Creates a new valid instance with the specified items selected.
This only is a 3d double vector.
Class to manage properties of an object and to provide convenience methods for easy access and manipu...
A named property class with a concrete type.
A class that stores a 1D transfer function which consists of a linear interpolation of alpha and colo...
This namespace contains several helper classes which translate their template type to an enum.
Namespace containing all base types of the WPropertyVariables.
PV_TRIGGER
Enum denoting the possible trigger states.
@ PV_TRIGGER_TRIGGERED
Trigger property: got triggered.
@ PV_TRIGGER_READY
Trigger property: is ready to be triggered (again)
WColor PV_COLOR
base type used for every WPVColor
std::string PV_STRING
base type used for every WPVString
bool isPropertyGroup(PROPERTY_TYPE type)
Checks which property types are derived from WPropertyGroupBase.
WItemSelector PV_SELECTION
base type used for every WPVSelection
WTransferFunction PV_TRANSFERFUNCTION
base type for every transfer function
WPosition PV_POSITION
base type used for every WPVPosition
double PV_DOUBLE
base type used for every WPVDouble
std::ostream & operator<<(std::ostream &out, const PV_TRIGGER &c)
Write a PV_TRIGGER in string representation to the given output stream.
WMatrix4d PV_MATRIX4X4
base type used for every WPVMatrix4X4
std::istream & operator>>(std::istream &in, PV_TRIGGER &c)
Write a PV_TRIGGER in string representation to the given input stream.
WIntervalDouble PV_INTERVAL
base type used for every PV_INTERVAL
bool PV_BOOL
base type used for every WPVBool
boost::filesystem::path PV_PATH
base type used for every WPVFilename
int32_t PV_INT
base type used for every WPVInt
std::vector< std::string > tokenize(const std::string &source, const std::string &delim=WHITESPACE, bool compress=true)
Splits the given string into a vector of strings (so called tokens).
std::string toString(const T &value)
Convert a given value to a string.