![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2011 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: $ $Revision: $ $State: $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 #include <vrvOsg/vrvOsg.h> 00015 #include <osg/PrimitiveSet> 00016 00017 namespace makVrv 00018 { 00019 00023 class DT_DLL_VRVOSG DtSharedDrawElementsUInt : public osg::PrimitiveSet 00024 { 00025 public: 00026 DtSharedDrawElementsUInt(GLenum mode, osg::DrawElementsUInt* indices); 00027 DtSharedDrawElementsUInt(const DtSharedDrawElementsUInt& copy, 00028 const osg::CopyOp& copyop); 00029 00032 void setIndexBounds(unsigned int start, unsigned int count); 00033 00036 //{ 00037 virtual osg::Object* cloneType() const { 00038 return new DtSharedDrawElementsUInt(*this,osg::CopyOp()); } 00039 virtual osg::Object* clone(const osg::CopyOp& copyop) const { 00040 return new DtSharedDrawElementsUInt(*this,copyop); } 00041 virtual bool isSameKindAs(const osg::Object* obj) const { 00042 return dynamic_cast<const DtSharedDrawElementsUInt*>(obj)!=NULL; } 00043 virtual const char* libraryName() const { return "vrvOsg"; } 00044 virtual const char* className() const { return "DtSharedDrawElementsUInt"; } 00045 virtual const GLvoid* getDataPointer() const; 00046 virtual unsigned int getTotalDataSize() const; 00047 virtual bool supportsBufferObject() const; 00048 virtual osg::DrawElements* getDrawElements(); 00049 virtual const osg::DrawElements* getDrawElements() const; 00050 void setNumInstances(int n); 00051 int getNumInstances() const; 00052 void setMode(GLenum mode); 00053 GLenum getMode() const; 00054 virtual void accept(osg::PrimitiveFunctor& functor) const; 00055 virtual void accept(osg::PrimitiveIndexFunctor& functor) const; 00056 virtual unsigned int index(unsigned int pos) const; 00057 virtual unsigned int getNumIndices() const ; 00058 virtual void offsetIndices(int offset); 00059 virtual unsigned int getNumPrimitives() const; 00062 virtual void dirty(); 00064 inline void setModifiedCount(unsigned int value); 00066 inline unsigned int getModifiedCount() const; 00068 virtual void resizeGLObjectBuffers(unsigned int maxSize); 00072 virtual void releaseGLObjects(osg::State* state=0) const; 00073 virtual void computeRange() const; 00075 virtual void draw(osg::State& state, bool useVertexBufferObjects) const; 00076 //} 00077 00078 protected: 00079 00080 osg::ref_ptr<osg::DrawElementsUInt> myIndices; 00081 unsigned int myStartIndex; 00082 unsigned int myCount; 00083 }; 00084 } 00085