25 #ifndef WPROPERTYTYPES_H
26 #define WPROPERTYTYPES_H
36 #ifndef BOOST_FILESYSTEM_VERSION
37 #define BOOST_FILESYSTEM_VERSION 2
39 #include <boost/filesystem.hpp>
40 #include <boost/lexical_cast.hpp>
42 #include "math/linearAlgebra/WLinearAlgebra.h"
43 #include "math/linearAlgebra/WMatrixFixed.h"
44 #include "math/linearAlgebra/WVectorFixed.h"
47 #include "WItemSelector.h"
49 template <
typename T >
88 PV_PURPOSE_INFORMATION,
100 namespace WPVBaseTypes
212 typedef boost::shared_ptr< WPVInt > WPropInt;
217 typedef boost::shared_ptr< WPVDouble > WPropDouble;
222 typedef boost::shared_ptr< WPVBool > WPropBool;
227 typedef boost::shared_ptr< WPVString > WPropString;
232 typedef boost::shared_ptr< WPVFilename > WPropFilename;
237 typedef boost::shared_ptr< WPVSelection > WPropSelection;
242 typedef boost::shared_ptr< WPVPosition > WPropPosition;
247 typedef boost::shared_ptr< WPVColor > WPropColor;
252 typedef boost::shared_ptr< WPVGroup > WPropGroup;
257 typedef boost::shared_ptr< WPVTrigger > WPropTrigger;
262 typedef boost::shared_ptr< WPVMatrix4X4 > WPropMatrix4X4;
268 namespace PROPERTY_TYPE_HELPER
273 template<
typename T >
293 template<
typename T >
304 T
create(
const T& ,
const std::string str )
306 return boost::lexical_cast< T >( str );
318 return boost::lexical_cast< std::string >( v );
460 return boost::lexical_cast< std::string >( v );
554 std::vector< std::string > tokens;
556 WAssert( tokens.size() >= 16,
"There weren't 16 values for a 4x4 Matrix" );
559 for(
size_t row = 0; row < 4; ++row )
561 for(
size_t col = 0; col < 4; ++col )
563 c( row, col ) = boost::lexical_cast<
double >( tokens[ idx ] );
580 std::ostringstream out;
581 for(
size_t row = 0; row < 4; ++row )
583 for(
size_t col = 0; col < 4; ++col )
585 out << v( row, col ) <<
";";
610 std::vector< std::string > tokens;
612 WAssert( tokens.size() >= 3,
"There weren't 3 values for a 3D vector" );
615 for(
size_t col = 0; col < 3; ++col )
617 c[ col ] = boost::lexical_cast<
double >( tokens[ idx ] );
632 std::ostringstream out;
633 for(
size_t col = 0; col < 3; ++col )
635 out << v[ col ] <<
";";
642 #endif // WPROPERTYTYPES_H