VR-Forces 4.6 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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  void getIndexBounds(unsigned int& start, unsigned int& count) const;
32 
35  //{
36  virtual osg::Object* cloneType() const {
37  return new DtSharedDrawElementsUInt(*this,osg::CopyOp()); }
38  virtual osg::Object* clone(const osg::CopyOp& copyop) const {
39  return new DtSharedDrawElementsUInt(*this,copyop); }
40  virtual bool isSameKindAs(const osg::Object* obj) const {
41  return dynamic_cast<const DtSharedDrawElementsUInt*>(obj)!=NULL; }
42  virtual const char* libraryName() const { return "vrvOsg"; }
43  virtual const char* className() const { return "DtSharedDrawElementsUInt"; }
44  virtual const GLvoid* getDataPointer() const;
45  virtual unsigned int getTotalDataSize() const;
46  virtual bool supportsBufferObject() const;
47  virtual osg::DrawElements* getDrawElements();
48  virtual const osg::DrawElements* getDrawElements() const;
49  void setNumInstances(int n);
50  int getNumInstances() const;
51  void setMode(GLenum mode);
52  GLenum getMode() const;
53  virtual void accept(osg::PrimitiveFunctor& functor) const;
54  virtual void accept(osg::PrimitiveIndexFunctor& functor) const;
55  virtual unsigned int index(unsigned int pos) const;
56  virtual unsigned int getNumIndices() const ;
57  virtual void offsetIndices(int offset);
58  virtual unsigned int getNumPrimitives() const;
61  virtual void dirty();
63  inline void setModifiedCount(unsigned int value);
65  inline unsigned int getModifiedCount() const;
67  virtual void resizeGLObjectBuffers(unsigned int maxSize);
71  virtual void releaseGLObjects(osg::State* state=0) const;
72  virtual void computeRange() const;
74  virtual void draw(osg::State& state, bool useVertexBufferObjects) const;
75  //}
76 
77  protected:
78 
79  osg::ref_ptr<osg::DrawElementsUInt> myIndices;
80  unsigned int myStartIndex;
81  unsigned int myCount;
82  };
83 }
84 

Document ID: Generated on Thu Apr 12 03:15:37 EDT 2018 from SVN revision 187986
Copyright © 2005-2018 VT MÄK. All Rights Reserved (www.mak.com)