diff --git a/include/osg/Export b/include/osg/Export index 5dfcf0caf..6110e661c 100644 --- a/include/osg/Export +++ b/include/osg/Export @@ -8,7 +8,7 @@ // define used to include in API which is being fazed out // if you can compile your apps with this turned off you are // well placed for compatablity with future versions. -// #define USE_DEPRECATED_API +#define USE_DEPRECATED_API #if defined(_MSC_VER) #pragma warning( disable : 4244 ) diff --git a/include/osg/Geometry b/include/osg/Geometry index 221e67cfc..c807dd142 100644 --- a/include/osg/Geometry +++ b/include/osg/Geometry @@ -130,6 +130,22 @@ class SG_EXPORT Geometry : public Drawable void addPrimitiveSet(PrimitiveSet* primitive) { if (primitive) _primitives.push_back(primitive); dirtyDisplayList(); dirtyBound(); } +#ifdef USE_DEPRECATED_API + + typedef PrimitiveSetList PrimitiveList; + + void setPrimitiveList(const PrimitiveSetList& primitives) { _primitives = primitives; dirtyDisplayList(); dirtyBound(); } + PrimitiveList& getPrimitiveList() { return _primitives; } + const PrimitiveList& getPrimitiveList() const { return _primitives; } + + unsigned int getNumPrimitives() const { return _primitives.size(); } + Primitive* getPrimitive(unsigned int pos) { return _primitives[pos].get(); } + const Primitive* getPrimitive(unsigned int pos) const { return _primitives[pos].get(); } + + void addPrimitive(PrimitiveSet* primitive) { if (primitive) _primitives.push_back(primitive); dirtyDisplayList(); dirtyBound(); } + +#endif + /** return true if OpenGL fast paths will be used with drawing this Geometry. * Fast paths use vertex arrays, and glDrawArrays/glDrawElements. Slow paths * use glBegin()/glVertex.../glEnd(). Use of per primtive bindings or per vertex indexed diff --git a/include/osg/PrimitiveSet b/include/osg/PrimitiveSet index f9c279b29..6c1cd9189 100644 --- a/include/osg/PrimitiveSet +++ b/include/osg/PrimitiveSet @@ -135,9 +135,10 @@ class PrimitiveSet : public Object GLenum _mode; }; -// temporary addition for backwards compatiblity. -typedef PrimitiveSet Primitive; - +#ifdef USE_DEPRECATED_API + // temporary addition for backwards compatiblity. + typedef PrimitiveSet Primitive; +#endif class SG_EXPORT DrawArrays : public PrimitiveSet {