VR-Forces 4.8 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 
80  unsigned int myStartIndex;
81  unsigned int myCount;
82  };
83 }
84 
unsigned int myCount
Definition: DtSharedDrawElementsUInt.h:81
unsigned int myStartIndex
Definition: DtSharedDrawElementsUInt.h:80
This is a utility class used to allow sharing of index buffers while allowing for unique start and co...
Definition: DtSharedDrawElementsUInt.h:21
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
virtual const char * className() const
Definition: DtSharedDrawElementsUInt.h:43
virtual osg::Object * clone(const osg::CopyOp &copyop) const
Definition: DtSharedDrawElementsUInt.h:38
virtual osg::Object * cloneType() const
All of the remaining functions are simply necessary to implement the DrawElements API forwarded to th...
Definition: DtSharedDrawElementsUInt.h:36
unsigned int GLenum
Definition: DtGlTextureBufferObject.h:18
const char int mode
Definition: ioapi.h:38
Contains DLL export macros.
voidpf uLong offset
Definition: ioapi.h:42
virtual bool isSameKindAs(const osg::Object *obj) const
Definition: DtSharedDrawElementsUInt.h:40
osg::ref_ptr< osg::DrawElementsUInt > myIndices
Definition: DtSharedDrawElementsUInt.h:79
virtual const char * libraryName() const
Definition: DtSharedDrawElementsUInt.h:42

Document ID: Generated on Thu Aug 27 10:56:05 EDT 2020 from SVN revision 217100
Copyright © 2005-2020 MAK Technologies. All Rights Reserved (www.mak.com)