VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectUvOffsetManager.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2021 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
14 
16 
19 
21 
22 #include <unordered_map>
23 
24 namespace osg
25 {
26 class State;
27 }
28 
29 namespace makVrv
30 {
31  class DtInstanceContainer;
32  class DtDe;
33  class DtGlBuffer;
34 
37 
40 
42  template <>
43  inline const char* creatorTypeName<DtIndirectUvOffsetManager>(void) { return "DtIndirectUvOffsetManagerCreator"; }
44 
50  {
51  public:
52 
53  typedef std::map<std::string, unsigned int> AnnotationToUvOffsetMap;
54  typedef std::map<int, AnnotationToUvOffsetMap> MapIntToAnnotationToUvOffsetMap;
55  typedef std::unordered_map<int, Vector2_32> ScrollableUvOffsetIdsAndMultipliers;
56  typedef std::unordered_map< int, ScrollableUvOffsetIdsAndMultipliers > MapInstancesToScrollableUvOffsetIds;
57 
58  //Simple data struct for holding 2 floats for the uv offset
59  struct UvOffset
60  {
61  float uOffset;
62  float vOffset;
63  };
64 
65  public:
68 
70  virtual ~DtIndirectUvOffsetManager();
71  protected:
74 
75  private:
77  DtIndirectUvOffsetManager() = delete;
81  DtIndirectUvOffsetManager &operator=(const DtIndirectUvOffsetManager &other) = delete;
82 
83  public:
85  virtual void addUvOffsetAnnotations(int perGeomInstanceIndex, int size, const AnnotationToUvOffsetMap& annotationToUvOffsetMap, const ScrollableUvOffsetIdsAndMultipliers& scrollableUvOffsetIds, int instanceId);
86 
88  virtual void addUvOffsetAnnotation(int perGeomInstanceIndex, unsigned int uvOffsetStartId);
89 
91  virtual void removeUvOffsets(int instanceId);
92 
94  virtual void setUvOffset(const std::string& annotation, int instanceId, float uOffset, float vOffset);
95 
97  virtual void scrollUv(int instanceId, float uOffset, float vOffset);
98 
100  virtual void annotationAndUvOffsets(int instanceId, std::vector<DtIndirectAnnotationAndUvOffset>& annotations) const;
101 
104  virtual void setPureSignalBasedUvOffsets(bool val);
105 
108  virtual bool pureSignalBasedUvOffsets(void) const;
109 
111  virtual void processUvOffsets(void);
112 
114  virtual void releaseGLObjects(osg::State* state) const;
115 
117  virtual const DtGlBuffer* gpuUvOffsetBuffer(void) const;
118 
119  protected:
120 
122  virtual void updateUvOffsetBufferIfNecessary(void);
123 
125  virtual void deleteBuffers(void);
126 
128  virtual void tearDownBuffers(void) const;
129 
130  protected:
131 
134 
136 
137  //Simple operator for initializing the UVOffsets to 0
139  {
140  void operator()(UvOffset& info);
141  };
142 
143  //which parent switches of this geometry are turned off
144  //(so if this is 0 then all switches are turned on and the geometry should be visible)
147 
149 
151  };
152 
153 }
MapInstancesToScrollableUvOffsetIds myMapInstancesToScrollableUvOffsetIds
Definition: DtIndirectUvOffsetManager.h:133
parent manager class for all Indirect managers.
Definition: DtIndirectManager.h:26
2 dimensional vector
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
const char * creatorTypeName< DtIndirectUvOffsetManager >(void)
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtIndirectUvOffsetManager.h:43
Contains makVrv::DtIndirectManager class.
voidpf void uLong size
Definition: ioapi.h:39
bool myPureSignalBasedSwitches
Definition: DtIndirectUvOffsetManager.h:150
Definition: DtIndirectUvOffsetManager.h:59
friend DtIndirectUvOffsetManagerCreator
only creator can create
Definition: DtIndirectUvOffsetManager.h:67
float uOffset
Definition: DtIndirectUvOffsetManager.h:61
bool myMutableUvOffsetsDirty
Definition: DtIndirectUvOffsetManager.h:135
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:22
VectorUvOffsets myVectorUvOffsets
Definition: DtIndirectUvOffsetManager.h:146
std::map< std::string, unsigned int > AnnotationToUvOffsetMap
Definition: DtIndirectUvOffsetManager.h:53
float vOffset
Definition: DtIndirectUvOffsetManager.h:62
std::map< int, AnnotationToUvOffsetMap > MapIntToAnnotationToUvOffsetMap
Definition: DtIndirectUvOffsetManager.h:54
DtReusableMemoryVector< UvOffset, UvOffsetInitializer > VectorUvOffsets
Definition: DtIndirectUvOffsetManager.h:145
Definition: DtIndirectUvOffsetManager.h:138
A generic OpenGL buffer.
Definition: DtGlBuffer.h:27
Contains makVrv::DtIndirectAnnotationAndUvOffset class.
DtGlBuffer * myGpuUvOffsetBuffer
Definition: DtIndirectUvOffsetManager.h:148
Contains makVrv::DtReusableMemoryVector class.
std::unordered_map< int, ScrollableUvOffsetIdsAndMultipliers > MapInstancesToScrollableUvOffsetIds
Definition: DtIndirectUvOffsetManager.h:56
handles the uv offsets for all the indirect geometry.
Definition: DtIndirectUvOffsetManager.h:49
Contains DLL export macros.
DtVirtualBaseClassCreator< DtIndirectUvOffsetManager, DtInstanceContainer & > DtIndirectUvOffsetManagerCreator
creator
Definition: DtIndirectUvOffsetManager.h:36
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
Helper class to manage instances This class allows you to add a DtInstance_64 Internally, however it stores this as a DtInstance (which the GPU can directly read)
Definition: DtInstanceContainer.h:31
std::unordered_map< int, Vector2_32 > ScrollableUvOffsetIdsAndMultipliers
Definition: DtIndirectUvOffsetManager.h:55
MapIntToAnnotationToUvOffsetMap myMapIntToAnnotationToUvOffsetMap
Definition: DtIndirectUvOffsetManager.h:132

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)