diff --git a/Make/makedirdefs b/Make/makedirdefs index 2756ea14c..806b0b06a 100644 --- a/Make/makedirdefs +++ b/Make/makedirdefs @@ -16,6 +16,7 @@ SRC_DIRS = \ osgSim\ osgGL2\ osgFX\ + osgTerrain\ osgProducer\ osgPlugins\ ../examples diff --git a/VisualStudio/VisualStudio.dsw b/VisualStudio/VisualStudio.dsw index e4570241d..2b88bcc25 100644 --- a/VisualStudio/VisualStudio.dsw +++ b/VisualStudio/VisualStudio.dsw @@ -1727,6 +1727,9 @@ Package=<4> Begin Project Dependency Project_Dep_Name Core osgUtil End Project Dependency + Begin Project Dependency + Project_Dep_Name Core osgSim + End Project Dependency }}} ############################################################################### diff --git a/VisualStudio/osg/osg.dsp b/VisualStudio/osg/osg.dsp index 57b0bda64..c340d9b7a 100755 --- a/VisualStudio/osg/osg.dsp +++ b/VisualStudio/osg/osg.dsp @@ -181,10 +181,6 @@ SOURCE=..\..\src\osg\DisplaySettings.cpp # End Source File # Begin Source File -SOURCE=..\..\src\osg\DOFTransform.cpp -# End Source File -# Begin Source File - SOURCE=..\..\src\osg\Drawable.cpp # End Source File # Begin Source File @@ -561,10 +557,6 @@ SOURCE=..\..\include\osg\DisplaySettings # End Source File # Begin Source File -SOURCE=..\..\include\osg\DOFTransform -# End Source File -# Begin Source File - SOURCE=..\..\Include\Osg\Drawable # End Source File # Begin Source File diff --git a/VisualStudio/osgPlugins/ive/ive.dsp b/VisualStudio/osgPlugins/ive/ive.dsp index 32adba99f..d3ec1a3dd 100755 --- a/VisualStudio/osgPlugins/ive/ive.dsp +++ b/VisualStudio/osgPlugins/ive/ive.dsp @@ -134,6 +134,10 @@ SOURCE=..\..\..\src\osgPlugins\ive\DataOutputStream.cpp # End Source File # Begin Source File +SOURCE=..\..\..\src\osgPlugins\ive\DOFTransform.cpp +# End Source File +# Begin Source File + SOURCE=..\..\..\src\osgPlugins\ive\Drawable.cpp # End Source File # Begin Source File @@ -382,6 +386,10 @@ SOURCE=..\..\..\src\osgPlugins\ive\DrawElementsUShort.h # End Source File # Begin Source File +SOURCE=..\..\..\src\osgPlugins\ive\DOFTransform.h +# End Source File +# Begin Source File + SOURCE=..\..\..\src\osgPlugins\ive\Exception.h # End Source File # Begin Source File diff --git a/VisualStudio/osgPlugins/osgSim/dot_osgSim.dsp b/VisualStudio/osgPlugins/osgSim/dot_osgSim.dsp index d3034519b..a9605567a 100644 --- a/VisualStudio/osgPlugins/osgSim/dot_osgSim.dsp +++ b/VisualStudio/osgPlugins/osgSim/dot_osgSim.dsp @@ -190,13 +190,19 @@ LINK32=link.exe -SOURCE=..\..\..\src\osgPlugins\osgSim\IO_LightPointNode.cpp +SOURCE=..\..\..\src\osgPlugins\osgSim\IO_DOFTransform.cpp # End Source File # Begin Source File +SOURCE=..\..\..\src\osgPlugins\osgSim\IO_LightPointNode.cpp + +# End Source File + +# Begin Source File + SOURCE=..\..\..\src\osgPlugins\osgSim\IO_LightPoint.cpp diff --git a/VisualStudio/osgSim/osgSim.dsp b/VisualStudio/osgSim/osgSim.dsp index d62d3fb4b..0adfc8a92 100644 --- a/VisualStudio/osgSim/osgSim.dsp +++ b/VisualStudio/osgSim/osgSim.dsp @@ -97,6 +97,10 @@ SOURCE=..\..\src\osgSim\BlinkSequence.cpp # End Source File # Begin Source File +SOURCE=..\..\src\osgSim\DOFTransform.cpp +# End Source File +# Begin Source File + SOURCE=..\..\src\osgSim\LightPoint.cpp # End Source File # Begin Source File @@ -141,6 +145,10 @@ SOURCE=..\..\include\osgSim\BlinkSequence # End Source File # Begin Source File +SOURCE=..\..\include\osgSim\DOFTransform +# End Source File +# Begin Source File + SOURCE=..\..\include\osgSim\LightPoint # End Source File # Begin Source File diff --git a/include/osg/DOFTransform b/include/osg/DOFTransform deleted file mode 100644 index bb1fd62fd..000000000 --- a/include/osg/DOFTransform +++ /dev/null @@ -1,178 +0,0 @@ -/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield - * - * This library is open source and may be redistributed and/or modified under - * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or - * (at your option) any later version. The full license is in LICENSE file - * included with this distribution, and on the openscenegraph.org website. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * OpenSceneGraph Public License for more details. -*/ -//C++ header - Open Scene Graph - Copyright (C) 1998-2002 Robert Osfield -//created by Sasa Bistrovic -//Distributed under the terms of the GNU Library General Public License (LGPL) -//as published by the Free Software Foundation. - -#ifndef OSG_DOFTRANSFORM -#define OSG_DOFTRANSFORM 1 - -//base class: -#include - -namespace osg{ -/** DOFTransform - encapsulates Multigen DOF behavior*/ -class SG_EXPORT DOFTransform : public Transform -{ - public: - /** constructor*/ - DOFTransform(); - - /**copy constructor*/ - DOFTransform(const DOFTransform& dof, const CopyOp& copyop=CopyOp::SHALLOW_COPY): - Transform(dof, copyop), - _minHPR(dof._minHPR), - _maxHPR(dof._maxHPR), - _currentHPR(dof._currentHPR), - _incrementHPR(dof._incrementHPR), - _minTranslate(dof._minTranslate), - _maxTranslate(dof._maxTranslate), - _currentTranslate(dof._currentTranslate), - _incrementTranslate(dof._incrementTranslate), - _minScale(dof._minScale), - _maxScale(dof._maxScale), - _currentScale(dof._currentScale), - _incrementScale(dof._incrementScale), - _Put(dof._Put), - _inversePut(dof._inversePut), - _limitationFlags(dof._limitationFlags), - _animationOn(dof._animationOn), - _increasingFlags(dof._increasingFlags) {} - - META_Node(osg, DOFTransform); - - virtual DOFTransform* asDOFTransform() { return this; } - virtual const DOFTransform* asDOFTransform() const { return this; } - - virtual void traverse(NodeVisitor& nv); - - void setMinHPR(const Vec3& hpr) { _minHPR = hpr;} - const Vec3& getMinHPR() const { return _minHPR;} - - void setMaxHPR(const Vec3& hpr) {_maxHPR = hpr;} - const Vec3& getMaxHPR() const { return _maxHPR;} - - void setIncrementHPR(const Vec3& hpr) {_incrementHPR = hpr;} - const Vec3& getIncrementHPR() const { return _incrementHPR;} - - void setCurrentHPR(const Vec3& hpr) {_currentHPR = hpr;} - const Vec3& getCurrentHPR() const {return _currentHPR;} - - void updateCurrentHPR(const Vec3& hpr); - - - void setMinTranslate(const Vec3& translate) {_minTranslate = translate;} - const Vec3& getMinTranslate() const { return _minTranslate;} - - void setMaxTranslate(const Vec3& translate) {_maxTranslate = translate;} - const Vec3& getMaxTranslate() const { return _maxTranslate;} - - void setIncrementTranslate(const Vec3& translate) { _incrementTranslate = translate;} - const Vec3& getIncrementTranslate() const { return _incrementTranslate;} - - void setCurrentTranslate(const Vec3& translate){ _currentTranslate = translate;} - inline const Vec3& getCurrentTranslate() const { return _currentTranslate;} - - void updateCurrentTranslate(const Vec3& translate); - - - void setMinScale(const Vec3& scale) { _minScale = scale;} - const Vec3& getMinScale() const { return _minScale;} - - void setMaxScale(const Vec3& scale) { _maxScale = scale;} - const Vec3& getMaxScale() const { return _maxScale;} - - void setIncrementScale(const Vec3& scale) { _incrementScale = scale;} - const Vec3& getIncrementScale() const { return _incrementScale;} - - void setCurrentScale(const Vec3& scale) { _currentScale = scale;} - inline const Vec3& getCurrentScale() const { return _currentScale;} - - void updateCurrentScale(const Vec3& scale); - - - void setPutMatrix(const Matrix& put) { _Put = put;} - inline const Matrix& getPutMatrix() const {return _Put;} - - void setInversePutMatrix(const Matrix& inversePut) { _inversePut = inversePut;} - inline const Matrix& getInversePutMatrix() const {return _inversePut;} - - void setLimitationFlags(unsigned long flags) { _limitationFlags = flags;} - inline unsigned long getLimitationFlags() const {return _limitationFlags;} - - - inline void setAnimationOn(bool do_animate) {_animationOn = do_animate;} - inline bool getAnimationOn() const {return _animationOn;} - - void animate(); - - virtual bool computeLocalToWorldMatrix(Matrix& matrix,NodeVisitor* nv) const; - - virtual bool computeWorldToLocalMatrix(Matrix& matrix,NodeVisitor* nv) const; - - protected: - - virtual ~DOFTransform() {} - - Vec3 _minHPR; - Vec3 _maxHPR; - Vec3 _currentHPR; - Vec3 _incrementHPR; - - Vec3 _minTranslate; - Vec3 _maxTranslate; - Vec3 _currentTranslate; - Vec3 _incrementTranslate; - - Vec3 _minScale; - Vec3 _maxScale; - Vec3 _currentScale; - Vec3 _incrementScale; - - Matrix _Put; - Matrix _inversePut; - - unsigned long _limitationFlags; - /* bits from left to right - 0 = x translation limited (2^31) - 1 = y translation limited (2^30) - 2 = z translation limited (2^29) - 3 = pitch limited (2^28) - 4 = roll limited (2^27) - 5 = yaw limited (2^26) - 6 = x scale limited (2^25) - 7 = y scale limited (2^24) - 8 = z scale limited (2^23) - - else reserved - */ - - bool _animationOn; - /** flags indicating whether value is incerasing or decreasing in animation - bits form right to left, 1 means increasing while 0 is decreasing - 0 = x translation - 1 = y translation - 2 = z translation - 3 = pitch - 4 = roll - 5 = yaw - 6 = x scale - 7 = y scale - 8 = z scale - */ - unsigned short _increasingFlags; -}; - -} -#endif diff --git a/include/osg/NodeVisitor b/include/osg/NodeVisitor index 15ae4a20a..572e64af5 100644 --- a/include/osg/NodeVisitor +++ b/include/osg/NodeVisitor @@ -26,7 +26,6 @@ class LightSource; class ClipNode; class Group; class Transform; -class DOFTransform; class MatrixTransform; class PositionAttitudeTransform; class Projection; @@ -226,7 +225,6 @@ class SG_EXPORT NodeVisitor : public virtual Referenced virtual void apply(LightSource& node) { apply((Group&)node); } virtual void apply(Transform& node) { apply((Group&)node); } - virtual void apply(DOFTransform& node) { apply((Transform&)node); } virtual void apply(MatrixTransform& node) { apply((Transform&)node); } virtual void apply(PositionAttitudeTransform& node) { apply((Transform&)node); } diff --git a/include/osg/Transform b/include/osg/Transform index 1ed82c7ab..50296b3bc 100644 --- a/include/osg/Transform +++ b/include/osg/Transform @@ -84,9 +84,6 @@ class SG_EXPORT Transform : public Group virtual PositionAttitudeTransform* asPositionAttitudeTransform() { return 0; } virtual const PositionAttitudeTransform* asPositionAttitudeTransform() const { return 0; } - virtual DOFTransform* asDOFTransform() { return 0; } - virtual const DOFTransform* asDOFTransform() const { return 0; } - enum ReferenceFrame { RELATIVE_TO_PARENTS, diff --git a/include/osgSim/DOFTransform b/include/osgSim/DOFTransform new file mode 100644 index 000000000..4cbdca041 --- /dev/null +++ b/include/osgSim/DOFTransform @@ -0,0 +1,174 @@ +/* -*-c++-*- OpenSceneGraph - Copyright (C) 1998-2003 Robert Osfield + * + * This library is open source and may be redistributed and/or modified under + * the terms of the OpenSceneGraph Public License (OSGPL) version 0.0 or + * (at your option) any later version. The full license is in LICENSE file + * included with this distribution, and on the openscenegraph.org website. + * + * This library is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * OpenSceneGraph Public License for more details. +*/ + +#ifndef OSGSIM_DOFTRANSFORM +#define OSGSIM_DOFTRANSFORM 1 + +//base class: +#include + +#include + +namespace osgSim { + +/** DOFTransform - encapsulates Multigen DOF behavior*/ +class OSGSIM_EXPORT DOFTransform : public osg::Transform +{ + public: + /** constructor*/ + DOFTransform(); + + /**copy constructor*/ + DOFTransform(const DOFTransform& dof, const osg::CopyOp& copyop=osg::CopyOp::SHALLOW_COPY): + Transform(dof, copyop), + _minHPR(dof._minHPR), + _maxHPR(dof._maxHPR), + _currentHPR(dof._currentHPR), + _incrementHPR(dof._incrementHPR), + _minTranslate(dof._minTranslate), + _maxTranslate(dof._maxTranslate), + _currentTranslate(dof._currentTranslate), + _incrementTranslate(dof._incrementTranslate), + _minScale(dof._minScale), + _maxScale(dof._maxScale), + _currentScale(dof._currentScale), + _incrementScale(dof._incrementScale), + _Put(dof._Put), + _inversePut(dof._inversePut), + _limitationFlags(dof._limitationFlags), + _animationOn(dof._animationOn), + _increasingFlags(dof._increasingFlags) {} + + META_Node(osgSim, DOFTransform); + + virtual void traverse(osg::NodeVisitor& nv); + + void setMinHPR(const osg::Vec3& hpr) { _minHPR = hpr;} + const osg::Vec3& getMinHPR() const { return _minHPR;} + + void setMaxHPR(const osg::Vec3& hpr) {_maxHPR = hpr;} + const osg::Vec3& getMaxHPR() const { return _maxHPR;} + + void setIncrementHPR(const osg::Vec3& hpr) {_incrementHPR = hpr;} + const osg::Vec3& getIncrementHPR() const { return _incrementHPR;} + + void setCurrentHPR(const osg::Vec3& hpr) {_currentHPR = hpr;} + const osg::Vec3& getCurrentHPR() const {return _currentHPR;} + + void updateCurrentHPR(const osg::Vec3& hpr); + + + void setMinTranslate(const osg::Vec3& translate) {_minTranslate = translate;} + const osg::Vec3& getMinTranslate() const { return _minTranslate;} + + void setMaxTranslate(const osg::Vec3& translate) {_maxTranslate = translate;} + const osg::Vec3& getMaxTranslate() const { return _maxTranslate;} + + void setIncrementTranslate(const osg::Vec3& translate) { _incrementTranslate = translate;} + const osg::Vec3& getIncrementTranslate() const { return _incrementTranslate;} + + void setCurrentTranslate(const osg::Vec3& translate){ _currentTranslate = translate;} + inline const osg::Vec3& getCurrentTranslate() const { return _currentTranslate;} + + void updateCurrentTranslate(const osg::Vec3& translate); + + + void setMinScale(const osg::Vec3& scale) { _minScale = scale;} + const osg::Vec3& getMinScale() const { return _minScale;} + + void setMaxScale(const osg::Vec3& scale) { _maxScale = scale;} + const osg::Vec3& getMaxScale() const { return _maxScale;} + + void setIncrementScale(const osg::Vec3& scale) { _incrementScale = scale;} + const osg::Vec3& getIncrementScale() const { return _incrementScale;} + + void setCurrentScale(const osg::Vec3& scale) { _currentScale = scale;} + inline const osg::Vec3& getCurrentScale() const { return _currentScale;} + + void updateCurrentScale(const osg::Vec3& scale); + + + void setPutMatrix(const osg::Matrix& put) { _Put = put;} + inline const osg::Matrix& getPutMatrix() const {return _Put;} + + void setInversePutMatrix(const osg::Matrix& inversePut) { _inversePut = inversePut;} + inline const osg::Matrix& getInversePutMatrix() const {return _inversePut;} + + void setLimitationFlags(unsigned long flags) { _limitationFlags = flags;} + inline unsigned long getLimitationFlags() const {return _limitationFlags;} + + + inline void setAnimationOn(bool do_animate) {_animationOn = do_animate;} + inline bool getAnimationOn() const {return _animationOn;} + + void animate(); + + virtual bool computeLocalToWorldMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const; + + virtual bool computeWorldToLocalMatrix(osg::Matrix& matrix,osg::NodeVisitor* nv) const; + + protected: + + virtual ~DOFTransform() {} + + osg::Vec3 _minHPR; + osg::Vec3 _maxHPR; + osg::Vec3 _currentHPR; + osg::Vec3 _incrementHPR; + + osg::Vec3 _minTranslate; + osg::Vec3 _maxTranslate; + osg::Vec3 _currentTranslate; + osg::Vec3 _incrementTranslate; + + osg::Vec3 _minScale; + osg::Vec3 _maxScale; + osg::Vec3 _currentScale; + osg::Vec3 _incrementScale; + + osg::Matrix _Put; + osg::Matrix _inversePut; + + unsigned long _limitationFlags; + /* bits from left to right + 0 = x translation limited (2^31) + 1 = y translation limited (2^30) + 2 = z translation limited (2^29) + 3 = pitch limited (2^28) + 4 = roll limited (2^27) + 5 = yaw limited (2^26) + 6 = x scale limited (2^25) + 7 = y scale limited (2^24) + 8 = z scale limited (2^23) + + else reserved + */ + + bool _animationOn; + /** flags indicating whether value is incerasing or decreasing in animation + bits form right to left, 1 means increasing while 0 is decreasing + 0 = x translation + 1 = y translation + 2 = z translation + 3 = pitch + 4 = roll + 5 = yaw + 6 = x scale + 7 = y scale + 8 = z scale + */ + unsigned short _increasingFlags; +}; + +} +#endif diff --git a/include/osgSim/LightPointNode b/include/osgSim/LightPointNode index bb77d7abd..5d4ed78ca 100644 --- a/include/osgSim/LightPointNode +++ b/include/osgSim/LightPointNode @@ -53,9 +53,9 @@ class OSGSIM_EXPORT LightPointNode : public osg::Node void removeLightPoint(unsigned int pos); - LightPoint& getLightPoint(unsigned int pos) { return _lightPointList[pos]; } + LightPoint& getLightPoint(unsigned int pos) { return _lightPointList[pos]; } - const LightPoint& getLightPoint(unsigned int pos) const { return _lightPointList[pos]; } + const LightPoint& getLightPoint(unsigned int pos) const { return _lightPointList[pos]; } void setLightPointList(const LightPointList& lpl) { _lightPointList=lpl; } diff --git a/src/osg/GNUmakefile b/src/osg/GNUmakefile index 43f495da5..95ae89a8d 100644 --- a/src/osg/GNUmakefile +++ b/src/osg/GNUmakefile @@ -26,7 +26,6 @@ CXXFILES =\ CullStack.cpp\ Depth.cpp\ DisplaySettings.cpp\ - DOFTransform.cpp\ Drawable.cpp\ DrawPixels.cpp\ ClearNode.cpp\ diff --git a/src/osgPlugins/flt/GNUmakefile b/src/osgPlugins/flt/GNUmakefile index e1e2938da..86f54aec2 100644 --- a/src/osgPlugins/flt/GNUmakefile +++ b/src/osgPlugins/flt/GNUmakefile @@ -52,7 +52,7 @@ CXXFILES =\ INC += -I$(THISDIR) -LIBS += $(OSG_LIBS) $(OTHER_LIBS) +LIBS += -losgSim $(OSG_LIBS) $(OTHER_LIBS) TARGET_BASENAME = flt include $(TOPDIR)/Make/cygwin_plugin_def diff --git a/src/osgPlugins/flt/flt2osg.cpp b/src/osgPlugins/flt/flt2osg.cpp index 723c37fd6..481dbf14c 100644 --- a/src/osgPlugins/flt/flt2osg.cpp +++ b/src/osgPlugins/flt/flt2osg.cpp @@ -30,7 +30,6 @@ #include #include -#include #include #include @@ -38,6 +37,8 @@ #include #include +#include + #include "opcodes.h" #include "flt.h" #include "flt2osg.h" @@ -800,7 +801,7 @@ osg::Group* ConvertFromFLT::visitDOF(osg::Group& osgParent, DofRecord* rec) #if defined(USE_DOFTransform) - osg::DOFTransform* transform = new osg::DOFTransform; + osgSim::DOFTransform* transform = new osgSim::DOFTransform; transform->setName(rec->getData()->szIdent); transform->setDataVariance(osg::Object::DYNAMIC); visitAncillary(osgParent, *transform, rec)->addChild( transform ); diff --git a/src/osgPlugins/ive/DataInputStream.cpp b/src/osgPlugins/ive/DataInputStream.cpp index 71878f03c..000582418 100644 --- a/src/osgPlugins/ive/DataInputStream.cpp +++ b/src/osgPlugins/ive/DataInputStream.cpp @@ -35,6 +35,7 @@ #include "LOD.h" #include "PagedLOD.h" #include "PositionAttitudeTransform.h" +#include "DOFTransform.h" #include "Transform.h" #include "Switch.h" #include "OccluderNode.h" @@ -184,6 +185,17 @@ long DataInputStream::readLong(){ return l; } +unsigned long DataInputStream::readULong(){ + unsigned long l; + _istream->read((char*)&l, LONGSIZE); + if (_istream->rdstate() & _istream->failbit) + throw Exception("DataInputStream::readULong(): Failed to read unsigned long value."); + + if (_verboseOutput) std::cout<<"read/writeULong() ["<read((char*)&d, DOUBLESIZE); @@ -623,6 +635,10 @@ osg::Node* DataInputStream::readNode() node = new osg::PositionAttitudeTransform(); ((ive::PositionAttitudeTransform*)(node))->read(this); } + else if(nodeTypeID== IVEDOFTRANSFORM){ + node = new osgSim::DOFTransform(); + ((ive::DOFTransform*)(node))->read(this); + } else if(nodeTypeID== IVETRANSFORM){ node = new osg::Transform(); ((ive::Transform*)(node))->read(this); diff --git a/src/osgPlugins/ive/DataInputStream.h b/src/osgPlugins/ive/DataInputStream.h index 59334eefc..daf52d638 100644 --- a/src/osgPlugins/ive/DataInputStream.h +++ b/src/osgPlugins/ive/DataInputStream.h @@ -38,6 +38,7 @@ public: int peekInt(); float readFloat(); long readLong(); + unsigned long readULong(); double readDouble(); std::string readString(); void readCharArray(char* data, int size); diff --git a/src/osgPlugins/ive/DataOutputStream.cpp b/src/osgPlugins/ive/DataOutputStream.cpp index 6d1c95753..56ae1c327 100644 --- a/src/osgPlugins/ive/DataOutputStream.cpp +++ b/src/osgPlugins/ive/DataOutputStream.cpp @@ -37,6 +37,7 @@ #include "LOD.h" #include "PagedLOD.h" #include "PositionAttitudeTransform.h" +#include "DOFTransform.h" #include "Transform.h" #include "Switch.h" #include "OccluderNode.h" @@ -110,6 +111,12 @@ void DataOutputStream::writeLong(long l){ if (_verboseOutput) std::cout<<"read/writeLong() ["<write((char*)&l, LONGSIZE); + + if (_verboseOutput) std::cout<<"read/writeULong() ["<write((char*)&d, DOUBLESIZE); @@ -500,6 +507,9 @@ void DataOutputStream::writeNode(const osg::Node* node) else if(dynamic_cast(node)){ ((ive::PositionAttitudeTransform*)(node))->write(this); } + else if(dynamic_cast(node)){ + ((ive::DOFTransform*)(node))->write(this); + } else if(dynamic_cast(node)){ ((ive::LightSource*)(node))->write(this); } diff --git a/src/osgPlugins/ive/DataOutputStream.h b/src/osgPlugins/ive/DataOutputStream.h index 6556b8356..2b525ea6d 100644 --- a/src/osgPlugins/ive/DataOutputStream.h +++ b/src/osgPlugins/ive/DataOutputStream.h @@ -34,6 +34,7 @@ public: void writeInt(int i); void writeFloat(float f); void writeLong(long l); + void writeULong(unsigned long l); void writeDouble(double d); void writeString(const std::string& s); void writeCharArray(const char* data, int size); diff --git a/src/osgPlugins/ive/GNUmakefile b/src/osgPlugins/ive/GNUmakefile index ebc9088a9..d8e9e9509 100644 --- a/src/osgPlugins/ive/GNUmakefile +++ b/src/osgPlugins/ive/GNUmakefile @@ -12,6 +12,7 @@ CXXFILES =\ CullFace.cpp\ DataInputStream.cpp\ DataOutputStream.cpp\ + DOFTransform.cpp\ DrawArrayLengths.cpp\ DrawArrays.cpp\ DrawElementsUByte.cpp\ diff --git a/src/osgPlugins/ive/Image.cpp b/src/osgPlugins/ive/Image.cpp index 765e91f60..69f8742ca 100644 --- a/src/osgPlugins/ive/Image.cpp +++ b/src/osgPlugins/ive/Image.cpp @@ -16,6 +16,8 @@ #include "Image.h" #include "Object.h" +#include + using namespace ive; void Image::write(DataOutputStream* out) @@ -40,7 +42,7 @@ void Image::write(DataOutputStream* out) out->writeInt(r()); - std::cout << getFileName()<<"\t"<writeInt(getInternalTextureFormat()); diff --git a/src/osgPlugins/ive/ReadWrite.h b/src/osgPlugins/ive/ReadWrite.h index cbd6b1fda..053321fba 100644 --- a/src/osgPlugins/ive/ReadWrite.h +++ b/src/osgPlugins/ive/ReadWrite.h @@ -28,6 +28,7 @@ namespace ive { #define IVECONVEXPLANAROCCLUDER 0x00000019 #define IVECONVEXPLANARPOLYGON 0x00000020 #define IVEPAGEDLOD 0x00000021 +#define IVEDOFTRANSFORM 0x00000022 // Node callbacks #define IVENODECALLBACK 0x00000050 diff --git a/src/osgPlugins/osg/GNUmakefile b/src/osgPlugins/osg/GNUmakefile index 6da9e4f2c..1bb73eff0 100644 --- a/src/osgPlugins/osg/GNUmakefile +++ b/src/osgPlugins/osg/GNUmakefile @@ -12,7 +12,6 @@ CXXFILES =\ CullFace.cpp\ ClipNode.cpp\ Depth.cpp\ - DOFTransform.cpp\ Drawable.cpp\ ClearNode.cpp\ Fog.cpp\ diff --git a/src/osgPlugins/osg/Node.cpp b/src/osgPlugins/osg/Node.cpp index e5a631905..0ee128679 100644 --- a/src/osgPlugins/osg/Node.cpp +++ b/src/osgPlugins/osg/Node.cpp @@ -91,7 +91,7 @@ bool Node_readLocalData(Object& obj, Input& fr) while (fr.matchSequence("description %s")) { - node.addDescription(fr[1].getStr()); + if (fr[1].getStr()) node.addDescription(fr[1].getStr()); fr+=2; iteratorAdvanced = true; } diff --git a/src/osgPlugins/osgSim/GNUmakefile b/src/osgPlugins/osgSim/GNUmakefile index 369acd468..a93e95e85 100644 --- a/src/osgPlugins/osgSim/GNUmakefile +++ b/src/osgPlugins/osgSim/GNUmakefile @@ -2,6 +2,7 @@ TOPDIR = ../../.. include $(TOPDIR)/Make/makedefs CXXFILES =\ + IO_DOFTransform.cpp\ IO_LightPointNode.cpp\ IO_LightPoint.cpp\ IO_BlinkSequence.cpp\ diff --git a/src/osgPlugins/osg/DOFTransform.cpp b/src/osgPlugins/osgSim/IO_DOFTransform.cpp similarity index 98% rename from src/osgPlugins/osg/DOFTransform.cpp rename to src/osgPlugins/osgSim/IO_DOFTransform.cpp index 002280f28..b5e2047ea 100644 --- a/src/osgPlugins/osg/DOFTransform.cpp +++ b/src/osgPlugins/osgSim/IO_DOFTransform.cpp @@ -1,10 +1,11 @@ -#include "osg/DOFTransform" +#include "osgSim/DOFTransform" #include "osgDB/Registry" #include "osgDB/Input" #include "osgDB/Output" using namespace osg; +using namespace osgSim; using namespace osgDB; using namespace std; @@ -15,7 +16,7 @@ bool DOFTransform_writeLocalData(const Object& obj, Output& fw); // register the read and write functions with the osgDB::Registry. RegisterDotOsgWrapperProxy g_DOFTransformProxy ( - new osg::DOFTransform, + new osgSim::DOFTransform, "DOFTransform", "Object Node Transform DOFTransform Group", &DOFTransform_readLocalData, diff --git a/src/osgSim/GNUmakefile b/src/osgSim/GNUmakefile index 646da856f..a54d186b2 100644 --- a/src/osgSim/GNUmakefile +++ b/src/osgSim/GNUmakefile @@ -4,6 +4,7 @@ include $(TOPDIR)/Make/makedefs CXXFILES = \ ColorRange.cpp\ + DOFTransform.cpp\ ScalarBar.cpp\ ScalarsToColors.cpp\ BlinkSequence.cpp\