Build fixes for new deprecated osg::Geometry functions
This commit is contained in:
@@ -12,10 +12,6 @@
|
||||
*/
|
||||
#include <stdlib.h>
|
||||
|
||||
//#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
//#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
//#endif
|
||||
|
||||
#include <osg/Geometry>
|
||||
#include <osg/ArrayDispatchers>
|
||||
#include <osg/Notify>
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
// but you are not forced to do so.
|
||||
//
|
||||
|
||||
#include <osg/Config>
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
* Copyright 2003 VR-C
|
||||
**********************************************************************/
|
||||
|
||||
#include <osg/Config>
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
@@ -6,6 +6,7 @@
|
||||
* Author(s): Vladimir Vukicevic <vladimir@pobox.com>
|
||||
*
|
||||
*/
|
||||
#include <osg/Config>
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
// -*-c++-*-
|
||||
|
||||
#include <osg/Config>
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
@@ -108,7 +108,7 @@ osg::ref_ptr<osg::Geometry> 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::IndexArray*>(osg_geom->getVertexIndices()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -152,7 +152,7 @@ osg::ref_ptr<osg::Geometry> ReaderWriterVRML2::convertVRML97IndexedFaceSet(openv
|
||||
}
|
||||
else
|
||||
// unspecified, use the coordIndex field
|
||||
osg_geom->setNormalIndices(osg_geom->getVertexIndices());
|
||||
osg_geom->setNormalIndices(const_cast<osg::IndexArray*>(osg_geom->getVertexIndices()));
|
||||
|
||||
// get normal binding
|
||||
std::auto_ptr<openvrml::field_value> fv3 = vrml_ifs->field("normalPerVertex");
|
||||
@@ -206,7 +206,7 @@ osg::ref_ptr<osg::Geometry> 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::IndexArray*>(osg_geom->getVertexIndices()));
|
||||
|
||||
// get color binding
|
||||
std::auto_ptr<openvrml::field_value> fv3 = vrml_ifs->field("colorPerVertex");
|
||||
@@ -250,7 +250,7 @@ osg::ref_ptr<osg::Geometry> ReaderWriterVRML2::convertVRML97IndexedFaceSet(openv
|
||||
}
|
||||
|
||||
|
||||
osg::IntArray& indices = *static_cast<osg::IntArray*>(osg_geom->getVertexIndices());
|
||||
const osg::IntArray& indices = *static_cast<const osg::IntArray*>(osg_geom->getVertexIndices());
|
||||
osg::DrawArrayLengths& lengths = *static_cast<osg::DrawArrayLengths*>(osg_geom->getPrimitiveSet(0));
|
||||
unsigned index = 0;
|
||||
|
||||
@@ -280,7 +280,7 @@ osg::ref_ptr<osg::Geometry> ReaderWriterVRML2::convertVRML97IndexedFaceSet(openv
|
||||
}
|
||||
|
||||
osg_geom->setNormalArray(normals);
|
||||
osg_geom->setNormalIndices(osg_geom->getVertexIndices());
|
||||
osg_geom->setNormalIndices(const_cast<osg::IndexArray*>(osg_geom->getVertexIndices()));
|
||||
osg_geom->setNormalBinding(osg::Geometry::BIND_PER_VERTEX);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -109,7 +109,7 @@ osg::ref_ptr<osg::Geometry> 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::IndexArray*>(osg_geom->getVertexIndices()));
|
||||
|
||||
// get color binding
|
||||
std::auto_ptr<openvrml::field_value> fv3 = vrml_ifs->field("colorPerVertex");
|
||||
|
||||
@@ -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<openvrml::grouping_node *>(obj);
|
||||
|
||||
osg::ref_ptr<osg::Group> osg_group = new osg::Group;
|
||||
|
||||
if (!obj->id().empty())
|
||||
|
||||
@@ -21,6 +21,7 @@
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
#include <osg/Config>
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
#include <osg/Config>
|
||||
#ifndef OSG_USE_DEPRECATED_GEOMETRY_METHODS
|
||||
#define OSG_USE_DEPRECATED_GEOMETRY_METHODS 1
|
||||
#endif
|
||||
|
||||
@@ -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; \
|
||||
|
||||
Reference in New Issue
Block a user