VR-Forces 4.1 Class Documentation
DtSharedDrawElementsUInt.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2012 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 #include <osg/PrimitiveSet>
14 
15 namespace makVrv
16 {
17 
21  class DT_DLL_VRVOSG DtSharedDrawElementsUInt : public osg::PrimitiveSet
22  {
23  public:
24  DtSharedDrawElementsUInt(GLenum mode, osg::DrawElementsUInt* indices);
26  const osg::CopyOp& copyop);
27 
30  void setIndexBounds(unsigned int start, unsigned int count);
31 
34  //{
35  virtual osg::Object* cloneType() const {
36  return new DtSharedDrawElementsUInt(*this,osg::CopyOp()); }
37  virtual osg::Object* clone(const osg::CopyOp& copyop) const {
38  return new DtSharedDrawElementsUInt(*this,copyop); }
39  virtual bool isSameKindAs(const osg::Object* obj) const {
40  return dynamic_cast<const DtSharedDrawElementsUInt*>(obj)!=NULL; }
41  virtual const char* libraryName() const { return "vrvOsg"; }
42  virtual const char* className() const { return "DtSharedDrawElementsUInt"; }
43  virtual const GLvoid* getDataPointer() const;
44  virtual unsigned int getTotalDataSize() const;
45  virtual bool supportsBufferObject() const;
46  virtual osg::DrawElements* getDrawElements();
47  virtual const osg::DrawElements* getDrawElements() const;
48  void setNumInstances(int n);
49  int getNumInstances() const;
50  void setMode(GLenum mode);
51  GLenum getMode() const;
52  virtual void accept(osg::PrimitiveFunctor& functor) const;
53  virtual void accept(osg::PrimitiveIndexFunctor& functor) const;
54  virtual unsigned int index(unsigned int pos) const;
55  virtual unsigned int getNumIndices() const ;
56  virtual void offsetIndices(int offset);
57  virtual unsigned int getNumPrimitives() const;
60  virtual void dirty();
62  inline void setModifiedCount(unsigned int value);
64  inline unsigned int getModifiedCount() const;
66  virtual void resizeGLObjectBuffers(unsigned int maxSize);
70  virtual void releaseGLObjects(osg::State* state=0) const;
71  virtual void computeRange() const;
73  virtual void draw(osg::State& state, bool useVertexBufferObjects) const;
74  //}
75 
76  protected:
77 
78  osg::ref_ptr<osg::DrawElementsUInt> myIndices;
79  unsigned int myStartIndex;
80  unsigned int myCount;
81  };
82 }
83 

Document ID: Generated on Tue Jan 29 18:21:16 EST 2013 from SVN revision 123193
Copyright © 2005-2013 VT MÄK Inc. All Rights Reserved (www.mak.com)