25 #ifndef WPROPERTYTYPES_H
26 #define WPROPERTYTYPES_H
34 #include <boost/filesystem.hpp>
36 #include "WStringUtils.h"
37 #include "math/linearAlgebra/WMatrixFixed.h"
38 #include "math/linearAlgebra/WPosition.h"
39 #include "math/linearAlgebra/WVectorFixed.h"
40 #include "math/WInterval.h"
43 #include "WItemSelector.h"
45 template <
typename T >
90 PV_PURPOSE_INFORMATION,
102 namespace WPVBaseTypes
235 typedef boost::shared_ptr< WPVInt > WPropInt;
240 typedef boost::shared_ptr< WPVDouble > WPropDouble;
245 typedef boost::shared_ptr< WPVBool > WPropBool;
250 typedef boost::shared_ptr< WPVString > WPropString;
255 typedef boost::shared_ptr< WPVFilename > WPropFilename;
260 typedef boost::shared_ptr< WPVSelection > WPropSelection;
265 typedef boost::shared_ptr< WPVPosition > WPropPosition;
270 typedef boost::shared_ptr< WPVColor > WPropColor;
275 typedef boost::shared_ptr< WPVGroup > WPropGroup;
280 typedef boost::shared_ptr< WPVTrigger > WPropTrigger;
285 typedef boost::shared_ptr< WPVMatrix4X4 > WPropMatrix4X4;
290 typedef boost::shared_ptr< WPVTransferFunction > WPropTransferFunction;
295 typedef boost::shared_ptr< WPVInterval > WPropInterval;
300 namespace PROPERTY_TYPE_HELPER
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;
779 #endif // WPROPERTYTYPES_H