VR-Forces 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) 2023 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
15 
16 #include <vrvMath/DtMatrix4.h>
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 
102  virtual void setInstanceModelId(int instanceId, int modelId
103  , const DtPerGeomInstances& perGeomInstancesTemplate);
104  protected:
109 
111 
112  typedef std::unordered_map<int, DtIndirectOffsetAndSize> MapInstanceIdToPerGeomInstanceOffsetAndSize;
114 
115  typedef std::unordered_map<int, int> MapInstanceIdToNumLightSources;
117 
119 
121 
123  unsigned int myMaxNumLightSources;
124  };
125 }
SetInts myUniqueModels
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:106
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:108
#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:118
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:115
VectorInts myModelAddedOrder
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:107
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:123
std::unordered_map< int, DtIndirectOffsetAndSize > MapInstanceIdToPerGeomInstanceOffsetAndSize
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:112
int myNumValidInstances
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:120
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:110
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:113
MapInstanceIdToNumLightSources myMapInstanceIdToNumLightSources
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:116
MapIntToInt myModelIdToGeomOffset
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:105
DtReusablePerGeomInstances myPerGeomInstances
Add, remove, access instances addInstance also creates the perGeomInstances needed and returns the nu...
Definition: DtInstanceContainer.h:122
DtPerGeomInstance class declaration.
Contains the per Model info which the indirect module needs These objects are owned by the Indirect g...
Definition: DtIndirectModelInfo.h:67
4 dimensional matrix

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)