VR-Forces 4.10 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) 2020 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 
28  public:
29 
32  virtual void setIndexBounds(unsigned int start, unsigned int count);
33  virtual void getIndexBounds(unsigned int& start, unsigned int& count) const;
34 
37  //{
38  virtual osg::Object* cloneType() const override {
39  return new DtSharedDrawElementsUInt(*this,osg::CopyOp()); }
40  virtual osg::Object* clone(const osg::CopyOp& copyop) const override {
41  return new DtSharedDrawElementsUInt(*this,copyop); }
42  virtual bool isSameKindAs(const osg::Object* obj) const override {
43  return dynamic_cast<const DtSharedDrawElementsUInt*>(obj)!=NULL; }
44  virtual const char* libraryName() const override { return "vrvOsg"; }
45  virtual const char* className() const override { return "DtSharedDrawElementsUInt"; }
46  virtual const GLvoid* getDataPointer() const override;
47  virtual unsigned int getTotalDataSize() const override;
48  virtual bool supportsBufferObject() const override;
49  virtual osg::DrawElements* getDrawElements() override;
50  virtual const osg::DrawElements* getDrawElements() const override;
51  virtual void accept(osg::PrimitiveFunctor& functor) const override;
52  virtual void accept(osg::PrimitiveIndexFunctor& functor) const override;
53  virtual unsigned int index(unsigned int pos) const override;
54  virtual unsigned int getNumIndices() const override;
55  virtual void offsetIndices(int offset) override;
56  virtual unsigned int getNumPrimitives() const override;
58  virtual void resizeGLObjectBuffers(unsigned int maxSize) override;
62  virtual void releaseGLObjects(osg::State* state=0) const override;
63  virtual void computeRange() const override;
65  virtual void draw(osg::State& state, bool useVertexBufferObjects) const override;
66  //}
67 
68  protected:
69 
71  unsigned int myStartIndex;
72  unsigned int myCount;
73  };
74 }
75 
unsigned int myCount
Definition: DtSharedDrawElementsUInt.h:72
unsigned int myStartIndex
Definition: DtSharedDrawElementsUInt.h:71
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 bool isSameKindAs(const osg::Object *obj) const override
Definition: DtSharedDrawElementsUInt.h:42
virtual const char * libraryName() const override
Definition: DtSharedDrawElementsUInt.h:44
virtual const char * className() const override
Definition: DtSharedDrawElementsUInt.h:45
unsigned int GLenum
Definition: DtGlTextureBufferObject.h:18
virtual osg::Object * clone(const osg::CopyOp &copyop) const override
Definition: DtSharedDrawElementsUInt.h:40
const char int mode
Definition: ioapi.h:38
Contains DLL export macros.
virtual osg::Object * cloneType() const override
All of the remaining functions are simply necessary to implement the DrawElements API forwarded to th...
Definition: DtSharedDrawElementsUInt.h:38
voidpf uLong offset
Definition: ioapi.h:42
osg::ref_ptr< osg::DrawElementsUInt > myIndices
Definition: DtSharedDrawElementsUInt.h:70

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)