VR-Forces 5.0.1 Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtInstanceContainer.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 
15 
17 
18 #include <unordered_map>
19 
20 namespace makVrv
21 {
22  typedef std::vector<Matrix4_64> VectorMatrix4_64;
23 
24  class DtIndirectModelInfo;
25 
32  {
33  public:
36 
38  virtual ~DtInstanceContainer();
39 
40  private:
44  DtInstanceContainer& operator=(const DtInstanceContainer&) = delete;
45 
46  public:
47 
49  virtual void addInstance(const int modelId
54  , const DtPerGeomInstances& perGeomInstancesTemplate
55  , int geometryLocations, int lightSourceCount
56  , int &outPerGeomTemplateOffset, int& outNumGeoms, int& outInstanceIndex);
57 
59  virtual bool removeInstance(int instanceId);
60 
62  virtual bool hasInstance(int instanceId) const;
63 
65  virtual const DtReusablePerGeomInstances& perGeomInstances(void) const;
66 
68  virtual DtReusablePerGeomInstances& perGeomInstances(void);
69 
71  virtual void printPerGeomInstances() const;
72 
74  virtual int numValidInstances(void) const;
75 
77  virtual int numUniqueGeometriesForModel(int modelId) const;
78 
81  virtual int numUniqueGeometries() const;
82 
85  virtual bool instanceEverAdded(void) const;
86 
88  virtual const DtIndirectOffsetAndSize& perGeomInstanceOffsetAndSize(int instanceId) const;
89 
90 
92  virtual void incrementNumUniqueGeometries(int number);
93 
95  virtual const std::vector<int>& modelAddedOrder() const;
96 
99  virtual unsigned int maxNumLightSources() const;
100 
101  protected:
106 
108 
109  typedef std::unordered_map<int, DtIndirectOffsetAndSize> MapInstanceIdToPerGeomInstanceOffsetAndSize;
111 
112  typedef std::unordered_map<int, int> MapInstanceIdToNumLightSources;
114 
116 
118 
120  unsigned int myMaxNumLightSources;
121  };
122 }
SetInts myUniqueModels
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:103
std::set< int > SetInts
Definition: DtCommonTypes.h:22
structure for some internal GPU book-keeping
Definition: DtIndirectOffsetAndSize.h:17
Dll export defines.
MapIntToInt myModelIdToGeometryCount
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:105
#define DT_DLL_VRVINDIRECTRENDERING
Definition: vrvIndirectRendering.h:19
std::map< int, int > MapIntToInt
Definition: DtCommonTypes.h:25
int myRunningInstanceId
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:115
Contains makVrv::DtIndirectOffsetAndSize class.
std::vector< int > VectorInts
Definition: DtCommonTypes.h:20
std::unordered_map< int, int > MapInstanceIdToNumLightSources
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:112
VectorInts myModelAddedOrder
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:104
std::vector< PerGeomInstance > DtPerGeomInstances
Definition: DtPerGeomInstance.h:26
unsigned int myMaxNumLightSources
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:120
std::unordered_map< int, DtIndirectOffsetAndSize > MapInstanceIdToPerGeomInstanceOffsetAndSize
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:109
int myNumValidInstances
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:117
std::vector< Matrix4_64 > VectorMatrix4_64
Definition: DtInstanceContainer.h:22
int myNumUniqueGeometries
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:107
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
MapInstanceIdToPerGeomInstanceOffsetAndSize myMapInstanceIdToPerGeomInstanceOffsetAndSize
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:110
MapInstanceIdToNumLightSources myMapInstanceIdToNumLightSources
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:113
MapIntToInt myModelIdToGeomOffset
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:102
DtReusablePerGeomInstances myPerGeomInstances
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:119
DtPerGeomInstance class declaration.
Contains the per Model info which the indirect module needs It is owned by the Indirect geometry regi...
Definition: DtIndirectModelInfo.h:44
4 dimensional matrix

Document ID: Generated on Mon Jun 20 00:38:30 EDT 2022 from SVN revision 244029
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)