VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectRenderingSystemTest.h
Go to the documentation of this file.
1 /*****************************************************************************
2  * Copyright (c) 2025 MAK Technologies, Inc.
3  * All rights reserved.
4  *****************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 
17 
18 #include <osg/Group>
19 #include <osg/Matrix>
20 #include <osg/Texture2D>
21 #include <osg/Vec3d>
22 
23 #include <map>
24 #include <string>
25 #include <vector>
26 
27 namespace makVrv
28 {
29  // Forward declarations
30  class DtIndirectGeometry;
31  class DtIndirectGeometryRegistrar;
32  class DtIndirectLimitTextureStrategy;
33  class DtIndirectRenderingSystemTest;
34  class DtModelInfo;
36 
39 
41  template <>
42  inline const char* creatorTypeName<DtIndirectRenderingSystemTest>() { return "DtIndirectRenderingSystemTestCreator"; }
43 
44 
55  {
56  public:
57 
59  enum class TestType
60  {
61  None,
62  Rendering,
64  };
65 
67  enum class TestControlType
68  {
71  UvScroll,
72  };
73 
75  enum class TestControlGuiType
76  {
77  CheckBox,
78  };
79 
81  struct TestControl
82  {
83  TestControl(const std::string& name, TestControlType testType, TestControlGuiType guiType)
84  : myName(name)
85  , myTestType(testType)
86  , myGuiType(guiType)
87  {
88  // intentional no-op
89  }
90 
91  std::string myName;
94 
95  // State vectors
96  std::vector<bool> myBools;
97  };
98 
100 
102 
105 
108 
111 
112  public:
113 
115  static const std::string getTestDescription(DtIndirectRenderingSystemTest::TestType testType);
116 
119 
123  virtual std::vector<DtIndirectRenderingSystemTest::TestControl>& testControls();
124 
128 
130  virtual void update(const float timestep);
131 
134 
135  protected:
136 
141  virtual void createAndSaveCheckeredImage(const std::string& filename, int imageSize, int blockSize) const;
142 
145  const std::string createTestImage() const;
146 
148  virtual osg::Texture2D* loadTexture(const std::string& filename) const;
149 
151  virtual osg::Group* createBoxModel(int renderBin, const std::string& renderBinName, const osg::Vec4& color) const;
152 
154  virtual osg::Group* createSimpleTestModel(int renderBin, const std::string& renderBinName) const;
155 
158  virtual osg::Group* createEntityTestModel(int renderBin, const std::string& renderBinName) const;
159 
161  virtual osg::Group* findRendererRootGroup();
162 
164  virtual const osg::Matrixd computeSpawnTransform() const;
165 
167  virtual int findEntityModelSwitchIdByName(const std::string& switchName) const;
168 
170  virtual void setEntityModelSwitch(const std::string& switchName, int stateValue);
171 
173  virtual void startRenderingTest();
174 
176  virtual void startEntityRenderingTest();
177 
180 
183 
186 
187  protected:
188 
190 
192  std::vector<TestControl> myTestControls;
193 
195 
199 
201 
202  std::map<int, DtModelInfo*> myModelIdToInfoMap;
204 
206  std::unique_ptr<DtOsgModelInstance> myEntityModelInstance;
207  std::unique_ptr<DtArticulatedModelParser> myEntityModelCloneParser;
209  };
210 
211 }
osg::ref_ptr< DtIndirectGeometryRegistrar > myIndirectGeometryRegistrar
Definition: DtIndirectRenderingSystemTest.h:196
DtUniqueID myEntityId
Definition: DtIndirectRenderingSystemTest.h:205
virtual osg::Texture2D * loadTexture(const std::string &filename) const
Loads a texture from file.
DtVirtualBaseClassCreator< DtIndirectRenderingSystemTest > DtIndirectRenderingSystemTestCreator
creator
Definition: DtIndirectRenderingSystemTest.h:35
DtIndirectLimitTextureStrategy * myLimitTextureStrategy
Definition: DtIndirectRenderingSystemTest.h:194
virtual osg::Group * createEntityTestModel(int renderBin, const std::string &renderBinName) const
Creates an entity test model for the entity rendering test. The model includes a multi-switch for dam...
virtual const osg::Matrixd computeSpawnTransform() const
Computes and returns a trasnform in front of the observer for a test instance.
osg::ref_ptr< osg::Group > myMasterModelRoot
Definition: DtIndirectRenderingSystemTest.h:198
Class for testing the indirect rendering system.
Definition: DtIndirectRenderingSystemTest.h:54
virtual void applyTestControl(const DtIndirectRenderingSystemTest::TestControl &control)
Applies the given test control to the running test. Filters to the appropriate internal apply method ...
osg::ref_ptr< DtIndirectGeometry > myIndirectGeometry
Definition: DtIndirectRenderingSystemTest.h:197
virtual void applyTestControlUvScroll(const DtIndirectRenderingSystemTest::TestControl &control)
Applies the given test control for UV scroll to the running test.
virtual void applyTestControlDamageState(const DtIndirectRenderingSystemTest::TestControl &control)
Applies the given test control for damage state to the running test.
virtual osg::Group * createSimpleTestModel(int renderBin, const std::string &renderBinName) const
Creates a simple test model for the rendering test.
static const std::string getTestDescription(DtIndirectRenderingSystemTest::TestType testType)
Returns a description for the given test type.
virtual osg::Group * createBoxModel(int renderBin, const std::string &renderBinName, const osg::Vec4 &color) const
Creates a box model with the given color.
virtual void createAndSaveCheckeredImage(const std::string &filename, int imageSize, int blockSize) const
Creates and saves a checkered image to file.
virtual std::vector< DtIndirectRenderingSystemTest::TestControl > & testControls()
Returns all active test controls (modifiable). This is used to populate gui controls for the test...
Variadic templated creator class for defining a DtVirtualBaseClass creator that is automatically regi...
Definition: DtVirtualBaseClassCreator.h:23
virtual void startRenderingTest()
Starts the rendering test.
std::string myName
Definition: DtIndirectRenderingSystemTest.h:91
TestControl(const std::string &name, TestControlType testType, TestControlGuiType guiType)
Definition: DtIndirectRenderingSystemTest.h:83
The base class for simple OSG based model instances. This call can&#39;t be instantiated itself...
Definition: DtOsgModelInstance.h:77
TestControlGuiType
Enum for what gui type a test control uses.
Definition: DtIndirectRenderingSystemTest.h:75
virtual void applyTestControlDofVelocity(const DtIndirectRenderingSystemTest::TestControl &control)
Applies the given test control for DOF velocity to the running test.
bool myEntityEnableUvScroll
Definition: DtIndirectRenderingSystemTest.h:208
std::vector< bool > myBools
Definition: DtIndirectRenderingSystemTest.h:96
virtual osg::Group * findRendererRootGroup()
Finds the root group node for the renderer&#39;s scene graph.
TestControlType myTestType
Definition: DtIndirectRenderingSystemTest.h:92
virtual void startTest(DtIndirectRenderingSystemTest::TestType type)
Starts the given test type.
virtual void update(const float timestep)
Updates the currently running test.
TestType
Enum for selecting the indirect system test type.
Definition: DtIndirectRenderingSystemTest.h:59
virtual DtIndirectRenderingSystemTest::TestType runningTestType() const
Returns the currently running test type.
virtual void setEntityModelSwitch(const std::string &switchName, int stateValue)
Sets the switch state for the given switch name in the entity test model parser.
unsigned long long DtUniqueID
Definition: DtUniqueID.h:19
std::unique_ptr< DtArticulatedModelParser > myEntityModelCloneParser
Definition: DtIndirectRenderingSystemTest.h:207
The indirect system uses this in conjunction with the system wide limits (for entity/terrain) to clam...
Definition: DtIndirectLimitTextureStrategy.h:65
const char * creatorTypeName< DtIndirectRenderingSystemTest >()
template specialization for the creator (pass the class being created to the creatorTypeName template...
Definition: DtIndirectRenderingSystemTest.h:42
DtIndirectRenderingSystemTest::TestType myRunningTestType
Definition: DtIndirectRenderingSystemTest.h:191
virtual int findEntityModelSwitchIdByName(const std::string &switchName) const
Finds the switch ID for the given switch name in the entity test model parser.
virtual void startEntityRenderingTest()
Starts the entity rendering test.
DtDe & myDe
Definition: DtIndirectRenderingSystemTest.h:189
int myNextModelId
Definition: DtIndirectRenderingSystemTest.h:203
osg::ref_ptr< osg::Group > mySceneRoot
Definition: DtIndirectRenderingSystemTest.h:200
TestControlType
Enum for test control types.
Definition: DtIndirectRenderingSystemTest.h:67
const std::string createTestImage() const
Creates a test image if needed and returns the filename. The image is stored in the application cache...
std::unique_ptr< DtOsgModelInstance > myEntityModelInstance
Definition: DtIndirectRenderingSystemTest.h:206
Contains makVrv::DtArticulatedModelParser class.
Contains DLL export macros.
std::vector< TestControl > myTestControls
Definition: DtIndirectRenderingSystemTest.h:192
DtIndirectRenderingSystemTest & operator=(const DtIndirectRenderingSystemTest &rhs)=delete
not allowed
The DtDe is the core component of any VR-Vantage application. It owns a DtRenderer, DtDeCommunicator, as well as a DtDisplay and other things.
Definition: DtDe.h:76
TestControlGuiType myGuiType
Definition: DtIndirectRenderingSystemTest.h:93
A structure to define a type and gui control used for a test.
Definition: DtIndirectRenderingSystemTest.h:81
std::map< int, DtModelInfo * > myModelIdToInfoMap
Definition: DtIndirectRenderingSystemTest.h:202
DtIndirectRenderingSystemTest()=delete
not allowed

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)