diff --git a/include/osgSim/ShapeAttribute b/include/osgSim/ShapeAttribute index 231fcd2af..48bafcb55 100644 --- a/include/osgSim/ShapeAttribute +++ b/include/osgSim/ShapeAttribute @@ -52,12 +52,18 @@ class OSGSIM_EXPORT ShapeAttribute ShapeAttribute& operator = (const ShapeAttribute& sa); const std::string & getName() const { return _name; } + void setName(const std::string& name) { _name = name; } + const Type getType() const { return _type; } int getInt() const { return _integer; } double getDouble() const { return _double; } const char * getString() const { return _string; } - + + void setValue(int value) {_type = INTEGER; _integer = value; } + void setValue(double value) {_type = DOUBLE; _double = value; } + void setValue(const char * value) {_type = STRING; _string = (value ? strdup(value) : 0); } + /** return -1 if *this < *rhs, 0 if *this==*rhs, 1 if *this>*rhs.*/ int compare(const osgSim::ShapeAttribute& sa) const; diff --git a/src/osgViewer/ViewerEventHandlers.cpp b/src/osgViewer/ViewerEventHandlers.cpp index 08e3e06d2..a3de7da79 100644 --- a/src/osgViewer/ViewerEventHandlers.cpp +++ b/src/osgViewer/ViewerEventHandlers.cpp @@ -463,6 +463,9 @@ bool RecordCameraPathHandler::handle(const osgGA::GUIEventAdapter &ea, osgGA::GU osg::notify(osg::NOTICE) << "Recording camera path to file " << ss.str() << std::endl; _fout.open( ss.str().c_str() ); + + // make sure doubles are not trucated by default stream precision = 6 + _fout.precision( 15 ); } else {