diff --git a/examples/osgcomputeshaders/osgcomputeshaders.cpp b/examples/osgcomputeshaders/osgcomputeshaders.cpp index 26dfd5671..8aec0d178 100644 --- a/examples/osgcomputeshaders/osgcomputeshaders.cpp +++ b/examples/osgcomputeshaders/osgcomputeshaders.cpp @@ -27,7 +27,7 @@ #include #include -static char* computeSrc = { +static const char* computeSrc = { "#version 430\n" "uniform float osg_FrameTime;\n" "uniform image2D targetTex;\n" diff --git a/examples/osgimpostor/osgimpostor.cpp b/examples/osgimpostor/osgimpostor.cpp index 02fc9239e..86bdfb669 100644 --- a/examples/osgimpostor/osgimpostor.cpp +++ b/examples/osgimpostor/osgimpostor.cpp @@ -16,7 +16,10 @@ * THE SOFTWARE. */ +#include +#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS #define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1 +#endif #include #include @@ -246,14 +249,14 @@ int main( int argc, char **argv ) // load the nodes from the commandline arguments. - osg::Node* model = osgDB::readNodeFiles(arguments); + osg::ref_ptr model = osgDB::readNodeFiles(arguments); if (model) { // the osgSim::InsertImpostorsVisitor used lower down to insert impostors // only operators on subclass of Group's, if the model top node is not // a group then it won't be able to insert an impostor. We therefore // manually insert an impostor above the model. - if (dynamic_cast(model)==0) + if (dynamic_cast(model.get())==0) { const osg::BoundingSphere& bs = model->getBound(); if (bs.valid()) @@ -262,7 +265,7 @@ int main( int argc, char **argv ) osgSim::Impostor* impostor = new osgSim::Impostor; // standard LOD settings - impostor->addChild(model); + impostor->addChild(model.get()); impostor->setRange(0,0.0f,1e7f); impostor->setCenter(bs.center()); @@ -281,8 +284,8 @@ int main( int argc, char **argv ) // up from model. This is really what should be done, but I'll pass // on it right now as it requires a getRoots() method to be added to // osg::Node, and we're about to make a release so no new features! - osg::Group* rootnode = new osg::Group; - rootnode->addChild(model); + osg::ref_ptr rootnode = new osg::Group; + rootnode->addChild(model.get()); // now insert impostors in the model using the InsertImpostorsVisitor. @@ -306,7 +309,7 @@ int main( int argc, char **argv ) } // add model to viewer. - viewer.setSceneData(model); + viewer.setSceneData(model.get()); return viewer.run(); } diff --git a/src/osg/Geometry.cpp b/src/osg/Geometry.cpp index 36b1c89c6..f3f30fb30 100644 --- a/src/osg/Geometry.cpp +++ b/src/osg/Geometry.cpp @@ -12,10 +12,6 @@ */ #include -//#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS -//#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1 -//#endif - #include #include #include diff --git a/src/osgPlugins/Inventor/ConvertToInventor.cpp b/src/osgPlugins/Inventor/ConvertToInventor.cpp index 40fd35844..49ea35dab 100644 --- a/src/osgPlugins/Inventor/ConvertToInventor.cpp +++ b/src/osgPlugins/Inventor/ConvertToInventor.cpp @@ -25,6 +25,7 @@ // but you are not forced to do so. // +#include #ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS #define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1 #endif diff --git a/src/osgPlugins/ive/Geometry.cpp b/src/osgPlugins/ive/Geometry.cpp index c1c6fcf63..722c53106 100644 --- a/src/osgPlugins/ive/Geometry.cpp +++ b/src/osgPlugins/ive/Geometry.cpp @@ -12,6 +12,7 @@ * Copyright 2003 VR-C **********************************************************************/ +#include #ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS #define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1 #endif diff --git a/src/osgPlugins/md2/ReaderWriterMD2.cpp b/src/osgPlugins/md2/ReaderWriterMD2.cpp index ad0d494d6..0c9b2bcf0 100644 --- a/src/osgPlugins/md2/ReaderWriterMD2.cpp +++ b/src/osgPlugins/md2/ReaderWriterMD2.cpp @@ -6,6 +6,7 @@ * Author(s): Vladimir Vukicevic * */ +#include #ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS #define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1 #endif diff --git a/src/osgPlugins/pfb/ConvertFromPerformer.cpp b/src/osgPlugins/pfb/ConvertFromPerformer.cpp index c2b8d3d25..632aea85a 100644 --- a/src/osgPlugins/pfb/ConvertFromPerformer.cpp +++ b/src/osgPlugins/pfb/ConvertFromPerformer.cpp @@ -1,5 +1,6 @@ // -*-c++-*- +#include #ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS #define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1 #endif diff --git a/src/osgPlugins/vrml/IndexedFaceSet.cpp b/src/osgPlugins/vrml/IndexedFaceSet.cpp index 630d6d505..113c7328f 100644 --- a/src/osgPlugins/vrml/IndexedFaceSet.cpp +++ b/src/osgPlugins/vrml/IndexedFaceSet.cpp @@ -108,7 +108,7 @@ osg::ref_ptr ReaderWriterVRML2::convertVRML97IndexedFaceSet(openv osg_geom->setTexCoordIndices(0, osg_tex_coord_index.get()); } else // no indices defined, use coordIndex - osg_geom->setTexCoordIndices(0, osg_geom->getVertexIndices()); + osg_geom->setTexCoordIndices(0, const_cast(osg_geom->getVertexIndices())); } } @@ -152,7 +152,7 @@ osg::ref_ptr ReaderWriterVRML2::convertVRML97IndexedFaceSet(openv } else // unspecified, use the coordIndex field - osg_geom->setNormalIndices(osg_geom->getVertexIndices()); + osg_geom->setNormalIndices(const_cast(osg_geom->getVertexIndices())); // get normal binding std::auto_ptr fv3 = vrml_ifs->field("normalPerVertex"); @@ -206,7 +206,7 @@ osg::ref_ptr ReaderWriterVRML2::convertVRML97IndexedFaceSet(openv osg_geom->setColorIndices(osg_color_index.get()); } else // unspecified, use coordIndices field - osg_geom->setColorIndices(osg_geom->getVertexIndices()); + osg_geom->setColorIndices(const_cast(osg_geom->getVertexIndices())); // get color binding std::auto_ptr fv3 = vrml_ifs->field("colorPerVertex"); @@ -250,7 +250,7 @@ osg::ref_ptr ReaderWriterVRML2::convertVRML97IndexedFaceSet(openv } - osg::IntArray& indices = *static_cast(osg_geom->getVertexIndices()); + const osg::IntArray& indices = *static_cast(osg_geom->getVertexIndices()); osg::DrawArrayLengths& lengths = *static_cast(osg_geom->getPrimitiveSet(0)); unsigned index = 0; @@ -280,7 +280,7 @@ osg::ref_ptr ReaderWriterVRML2::convertVRML97IndexedFaceSet(openv } osg_geom->setNormalArray(normals); - osg_geom->setNormalIndices(osg_geom->getVertexIndices()); + osg_geom->setNormalIndices(const_cast(osg_geom->getVertexIndices())); osg_geom->setNormalBinding(osg::Geometry::BIND_PER_VERTEX); #endif diff --git a/src/osgPlugins/vrml/Primitives.cpp b/src/osgPlugins/vrml/Primitives.cpp index 21fd35e6b..9c71a53a2 100644 --- a/src/osgPlugins/vrml/Primitives.cpp +++ b/src/osgPlugins/vrml/Primitives.cpp @@ -109,7 +109,7 @@ osg::ref_ptr ReaderWriterVRML2::convertVRML97IndexedLineSet(openv osg_geom->setColorIndices(osg_color_index.get()); } else // unspecified, use coordIndices field - osg_geom->setColorIndices(osg_geom->getVertexIndices()); + osg_geom->setColorIndices(const_cast(osg_geom->getVertexIndices())); // get color binding std::auto_ptr fv3 = vrml_ifs->field("colorPerVertex"); diff --git a/src/osgPlugins/vrml/ReaderWriterVRML2.cpp b/src/osgPlugins/vrml/ReaderWriterVRML2.cpp index c2acc73bc..7b7b782c7 100644 --- a/src/osgPlugins/vrml/ReaderWriterVRML2.cpp +++ b/src/osgPlugins/vrml/ReaderWriterVRML2.cpp @@ -250,9 +250,6 @@ osg::Node* ReaderWriterVRML2::convertFromVRML(openvrml::node *obj) const if (obj->type().id() == "Group") // Group node { - openvrml::grouping_node *vrml_group; - vrml_group = dynamic_cast(obj); - osg::ref_ptr osg_group = new osg::Group; if (!obj->id().empty()) diff --git a/src/osgPlugins/vrml/ReaderWriterVRML2.h b/src/osgPlugins/vrml/ReaderWriterVRML2.h index 68eb9e61a..2e996a486 100644 --- a/src/osgPlugins/vrml/ReaderWriterVRML2.h +++ b/src/osgPlugins/vrml/ReaderWriterVRML2.h @@ -21,6 +21,7 @@ #include #include +#include #ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS #define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1 #endif diff --git a/src/osgWrappers/deprecated-dotosg/osg/Geometry.cpp b/src/osgWrappers/deprecated-dotosg/osg/Geometry.cpp index e69118313..eaaaafe29 100644 --- a/src/osgWrappers/deprecated-dotosg/osg/Geometry.cpp +++ b/src/osgWrappers/deprecated-dotosg/osg/Geometry.cpp @@ -1,3 +1,4 @@ +#include #ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS #define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1 #endif diff --git a/src/osgWrappers/serializers/osg/Geometry.cpp b/src/osgWrappers/serializers/osg/Geometry.cpp index 87f931060..6d3f45c24 100644 --- a/src/osgWrappers/serializers/osg/Geometry.cpp +++ b/src/osgWrappers/serializers/osg/Geometry.cpp @@ -98,7 +98,7 @@ ADD_ARRAYDATA_FUNCTIONS( FogCoordData, FogCoordArray ) for ( osg::Geometry::ArrayList::const_iterator itr=LISTNAME.begin(); \ itr!=LISTNAME.end(); ++itr ) { \ os << os.PROPERTY("Data") << os.BEGIN_BRACKET << std::endl; \ - writeArray(os, *itr); os << os.END_BRACKET << std::endl; \ + writeArray(os, itr->get()); os << os.END_BRACKET << std::endl; \ } \ os << os.END_BRACKET << std::endl; \ return true; \