15 #define OSG_GEOMETRY 1
17 #include <osg/Drawable>
22 #include <osg/PrimitiveSet>
25 #define OSG_DEPRECATED_GEOMETRY_BINDING 1
46 typedef std::vector< osg::ref_ptr<osg::Array> >
ArrayList;
48 void setVertexArray(
Array* array);
81 Array* getTexCoordArray(
unsigned int unit);
82 const Array* getTexCoordArray(
unsigned int unit)
const;
85 void setTexCoordArrayList(
const ArrayList& arrrayList);
91 Array *getVertexAttribArray(
unsigned int index);
92 const Array *getVertexAttribArray(
unsigned int index)
const;
96 void setVertexAttribArrayList(
const ArrayList& arrayList);
104 void setPrimitiveSetList(
const PrimitiveSetList& primitives);
117 bool setPrimitiveSet(
unsigned int i,
PrimitiveSet* primitiveset);
120 bool insertPrimitiveSet(
unsigned int i,
PrimitiveSet* primitiveset);
123 bool removePrimitiveSet(
unsigned int i,
unsigned int numElementsToRemove=1);
129 unsigned int getPrimitiveSetIndex(
const PrimitiveSet* primitiveset)
const;
133 bool containsSharedArrays()
const;
136 void duplicateSharedArrays();
141 virtual void setUseVertexBufferObjects(
bool flag);
144 virtual void dirtyDisplayList();
148 virtual void resizeGLObjectBuffers(
unsigned int maxSize);
153 virtual void releaseGLObjects(
State* state=0)
const;
155 bool getArrayList(ArrayList& arrayList)
const;
158 bool getDrawElementsList(DrawElementsList& drawElementsList)
const;
166 virtual unsigned int getGLObjectSizeHint()
const;
171 virtual void compileGLObjects(
RenderInfo& renderInfo)
const;
177 virtual void drawImplementation(
RenderInfo& renderInfo)
const;
180 void drawVertexArraysImplementation(
RenderInfo& renderInfo)
const;
183 void drawPrimitivesImplementation(
RenderInfo& renderInfo)
const;
217 void addVertexBufferObjectIfRequired(
osg::Array* array);
239 bool checkForDeprecatedData();
242 void fixDeprecatedData();
244 #if defined(OSG_DEPRECATED_GEOMETRY_BINDING)
250 BIND_PER_PRIMITIVE_SET=2,
255 void setNormalBinding(AttributeBinding ab);
256 void setColorBinding(AttributeBinding ab);
257 void setSecondaryColorBinding(AttributeBinding ab);
258 void setFogCoordBinding(AttributeBinding ab);
259 void setVertexAttribBinding(
unsigned int index,AttributeBinding ab);
262 AttributeBinding getNormalBinding()
const;
263 AttributeBinding getColorBinding()
const;
264 AttributeBinding getSecondaryColorBinding()
const;
265 AttributeBinding getFogCoordBinding()
const;
266 AttributeBinding getVertexAttribBinding(
unsigned int index)
const;
269 void setVertexAttribNormalize(
unsigned int index,GLboolean norm);
272 GLboolean getVertexAttribNormalize(
unsigned int index)
const;
312 BIND_PER_PRIMITIVE_SET=2,
313 BIND_PER_PRIMITIVE=3,
317 void setNormalBinding(AttributeBinding ab);
318 AttributeBinding getNormalBinding()
const;
320 void setColorBinding(AttributeBinding ab);
321 AttributeBinding getColorBinding()
const;
323 void setSecondaryColorBinding(AttributeBinding ab);
324 AttributeBinding getSecondaryColorBinding()
const;
326 void setFogCoordBinding(AttributeBinding ab);
327 AttributeBinding getFogCoordBinding()
const;
329 void setVertexAttribBinding(
unsigned int index,AttributeBinding ab);
330 AttributeBinding getVertexAttribBinding(
unsigned int index)
const;
332 void setVertexAttribNormalize(
unsigned int index,GLboolean norm);
333 GLboolean getVertexAttribNormalize(
unsigned int index)
const;
353 void setVertexAttribIndices(
unsigned int index,
osg::IndexArray* array);
354 const osg::IndexArray* getVertexAttribIndices(
unsigned int index)
const;
std::vector< ref_ptr< PrimitiveSet > > PrimitiveSetList
ArrayList & getTexCoordArrayList()
OSG_EXPORT Geometry * createTexturedQuadGeometry(const Vec3 &corner, const Vec3 &widthVec, const Vec3 &heightVec, float l, float b, float r, float t)
virtual const Geometry * asGeometry() const
unsigned int getNumTexCoordArrays() const
osg::ref_ptr< Array > _fogCoordArray
virtual bool supports(const Drawable::AttributeFunctor &) const
const ArrayList & getVertexAttribArrayList() const
Array * getSecondaryColorArray()
void setFogCoordArray(Array *array)
void setNormalArray(Array *array)
PrimitiveSet * getPrimitiveSet(unsigned int pos)
#define META_Node(library, name)
virtual bool supports(const PrimitiveFunctor &) const
osg::ref_ptr< Array > _vertexArray
const Array * getNormalArray() const
osg::ref_ptr< Array > _secondaryColorArray
virtual bool supports(const Drawable::ConstAttributeFunctor &) const
Geometry(const Geometry &geometry, const osg::CopyOp ©op=osg::CopyOp::SHALLOW_COPY)
const PrimitiveSetList & getPrimitiveSetList() const
const Array * getVertexArray() const
osg::ref_ptr< Array > _normalArray
bool _containsDeprecatedData
unsigned int getNumVertexAttribArrays() const
void setSecondaryColorArray(Array *array)
PrimitiveSetList & getPrimitiveSetList()
const ArrayList & getTexCoordArrayList() const
virtual Geometry * asGeometry()
const Array * getFogCoordArray() const
const Array * getSecondaryColorArray() const
const PrimitiveSet * getPrimitiveSet(unsigned int pos) const
osg::ref_ptr< Array > _colorArray
virtual bool supports(const PrimitiveIndexFunctor &) const
unsigned int getNumPrimitiveSets() const
const Array * getColorArray() const
void setVertexAttribArray(unsigned int index, Array *array)
void setColorArray(Array *array)
ArrayList & getVertexAttribArrayList()
std::vector< osg::DrawElements * > DrawElementsList
PrimitiveSetList _primitives
bool containsDeprecatedData() const
void setTexCoordArray(unsigned int unit, Array *array)
std::vector< osg::ref_ptr< osg::Array > > ArrayList
Array * getFogCoordArray()
ArrayList _vertexAttribList