25 #ifndef WPROPERTYTYPES_H
26 #define WPROPERTYTYPES_H
35 #include <boost/filesystem.hpp>
38 #include "WStringUtils.h"
39 #include "math/linearAlgebra/WMatrixFixed.h"
40 #include "math/linearAlgebra/WPosition.h"
41 #include "math/linearAlgebra/WVectorFixed.h"
42 #include "math/WInterval.h"
45 #include "WItemSelector.h"
47 template <
typename T >
92 PV_PURPOSE_INFORMATION,
237 typedef boost::shared_ptr< WPVInt > WPropInt;
242 typedef boost::shared_ptr< WPVDouble > WPropDouble;
247 typedef boost::shared_ptr< WPVBool > WPropBool;
252 typedef boost::shared_ptr< WPVString > WPropString;
257 typedef boost::shared_ptr< WPVFilename > WPropFilename;
262 typedef boost::shared_ptr< WPVSelection > WPropSelection;
267 typedef boost::shared_ptr< WPVPosition > WPropPosition;
272 typedef boost::shared_ptr< WPVColor > WPropColor;
277 typedef boost::shared_ptr< WPVGroup > WPropGroup;
282 typedef boost::shared_ptr< WPVTrigger > WPropTrigger;
287 typedef boost::shared_ptr< WPVMatrix4X4 > WPropMatrix4X4;
292 typedef boost::shared_ptr< WPVTransferFunction > WPropTransferFunction;
297 typedef boost::shared_ptr< WPVInterval > WPropInterval;
307 template<
typename T >
327 template<
typename T >
338 T
create(
const T& ,
const std::string str )
340 return string_utils::fromString< T >( str );
606 std::vector< std::string > tokens;
608 WAssert( tokens.size() >= 16,
"There weren't 16 values for a 4x4 Matrix" );
611 for(
size_t row = 0; row < 4; ++row )
613 for(
size_t col = 0; col < 4; ++col )
615 c( row, col ) = string_utils::fromString< double >( tokens[ idx ] );
632 std::ostringstream out;
633 for(
size_t row = 0; row < 4; ++row )
635 for(
size_t col = 0; col < 4; ++col )
637 out << v( row, col ) <<
";";
658 return PV_TRANSFERFUNCTION;
707 std::vector< std::string > tokens;
709 WAssert( tokens.size() >= 3,
"There weren't 3 values for a 3D vector" );
712 for(
size_t col = 0; col < 3; ++col )
714 c[ col ] = string_utils::fromString< double >( tokens[ idx ] );
729 std::ostringstream out;
730 for(
size_t col = 0; col < 3; ++col )
732 out << v[ col ] <<
";";
755 std::vector< std::string > tokens;
757 WAssert( tokens.size() >= 2,
"There weren't 2 values for an interval" );
760 string_utils::fromString< double >( tokens[ 1 ] ) );
774 std::ostringstream out;
781 #endif // WPROPERTYTYPES_H
PROPERTY_TYPE getType()
Get type identifier of the template type T.
A class that stores a 1D transfer function which consists of a linear interpolation of alpha and colo...
WMatrix4d PV_MATRIX4X4
base type used for every WPVMatrix4X4
WIntervalDouble PV_INTERVAL
base type used for every PV_INTERVAL
WItemSelector PV_SELECTION
base type used for every WPVSelection
PROPERTY_TYPE getType()
Get type identifier of the template type T.
WTransferFunction PV_TRANSFERFUNCTION
base type for every transfer function
std::string asString(const WPVBaseTypes::PV_SELECTION &v)
Creates a string from the specified value.
std::string asString(const T &v)
Creates a string from the specified value.
int32_t PV_INT
base type used for every WPVInt
Trigger property: got triggered.
const T & getLower() const
Get the lower value of the interval.
boost::filesystem::path PV_PATH
base type used for every WPVFilename
std::ostream & operator<<(std::ostream &out, const PV_TRIGGER &c)
Write a PV_TRIGGER in string representation to the given output stream.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
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).
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
T create(const T &, const std::string str)
Creates a new instance of the type from a given string.
Namespace containing all base types of the WPropertyVariables.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
A named property class with a concrete type.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
std::string asString(const WPVBaseTypes::PV_INTERVAL &v)
Creates a string from the specified value.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
This only is a 3d double vector.
WPVBaseTypes::PV_SELECTION create(const WPVBaseTypes::PV_SELECTION &old, const std::string str)
Creates a new instance of the type from a given string.
double PV_DOUBLE
base type used for every WPVDouble
Basic class for encapsulating a std::pair to be interpreted as interval.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
Class to manage properties of an object and to provide convenience methods for easy access and manipu...
std::string PV_STRING
base type used for every WPVString
bool isPropertyGroup(PROPERTY_TYPE type)
Checks which property types are derived from WPropertyGroupBase.
WItemSelector newSelector(IndexList selected) const
Creates a new valid instance with the specified items selected.
This class represents a subset of a WItemSelection.
std::string toString(const T &value)
Convert a given value to a string.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
WPVBaseTypes::PV_POSITION create(const WPVBaseTypes::PV_POSITION &, const std::string str)
Creates a new instance of the type from a given string.
PROPERTY_TYPE getType()
Get type identifier of the template type T.
PV_TRIGGER
Enum denoting the possible trigger states.
WPVBaseTypes::PV_INTERVAL create(const WPVBaseTypes::PV_INTERVAL &, const std::string str)
Creates a new instance of the type from a given string.
bool PV_BOOL
base type used for every WPVBool
WColor PV_COLOR
base type used for every WPVColor
Class helping to create a new instance of the property content from an old one.
const T & getUpper() const
Return the upper value of the interval.
std::istream & operator>>(std::istream &in, PV_TRIGGER &c)
Write a PV_TRIGGER in string representation to the given input stream.
std::string asString(const WPVBaseTypes::PV_MATRIX4X4 &v)
Creates a string from the specified value.
WPVBaseTypes::PV_MATRIX4X4 create(const WPVBaseTypes::PV_MATRIX4X4 &, const std::string str)
Creates a new instance of the type from a given string.
Class helping to adapt types specified as template parameter into an enum.
This namespace contains several helper classes which translate their template type to an enum...
PROPERTY_TYPE getType()
Get type identifier of the template type T.
Trigger property: is ready to be triggered (again)
std::string asString(const WPVBaseTypes::PV_POSITION &v)
Creates a string from the specified value.
WPosition PV_POSITION
base type used for every WPVPosition