VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtIndirectGeometryGrid.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2020 VT-MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvOsg/vrvOsg.h>
13 
15 
18 
20 
21 #include <osg/Node>
22 
23 #include <boost/thread.hpp>
24 #include <unordered_map>
25 
26 namespace makVrv
27 {
28  class DtDe;
29  class DtIndirectGeometry;
30  class DtIndirectModelsContainer;
31 
45  {
46  public:
47 
48  // The map of a cell 'id' to its corresponding indirect geometry
49  typedef std::unordered_map<Vector3_int, osg::ref_ptr<DtIndirectGeometry>, DtIndirectCellHasher> MapCellIdsToIndirectGeometry;
50 
51  // The map of a cell 'id' to its corresponding debug drawable
52  typedef std::unordered_map<Vector3_int, osg::ref_ptr<osg::Drawable>, DtIndirectCellHasher > MapCellIdsToDebugCellDrawables;
53  public:
56 
58  virtual ~DtIndirectGeometryGrid();
59 
60  private:
62  DtIndirectGeometryGrid() = delete;
64  DtIndirectGeometryGrid(const DtIndirectGeometryGrid &other) = delete;
66  DtIndirectGeometryGrid &operator=(const DtIndirectGeometryGrid &other) = delete;
67 
68  public:
72  virtual DtIndirectGeometry* ts_getOrCreateForCell(const Vector3_int& cellId, bool& created);
73 
75  virtual bool ts_removeCell(const Vector3_int& cellId);
76 
78  virtual Vector3_int cellIdFor(const Vector3_64& position) const;
79 
81  virtual Vector3_64 cellCenter(const Vector3_int& cellId) const;
82 
84  virtual AxisAlignedBoundingBox_64 GetAxisAlignedBoundingBox(const Vector3_int& cellId) const;
85 
87  virtual AxisAlignedBoundingBox_64 GetAxisAlignedBoundingBoxWithPadding(const Vector3_int& cellId) const;
88 
90  virtual DtIndirectModelsContainer* modelsContainer();
91 
93  virtual void setCellSize(const Vector3_64& cellSize);
95  virtual const Vector3_64& cellSize(void) const;
97 
99  virtual void setCellPadding(const Vector3_64& padding);
104  virtual const Vector3_64& cellPadding(void) const;
106 
108  virtual osg::ref_ptr<osg::Node> gridNode();
109 
111  virtual const MapCellIdsToIndirectGeometry& mapCellIdsToIndirectGeometry(void) const;
112 
114  virtual const MapCellIdsToDebugCellDrawables& mapCellIdsToDebugCellDrawables(void) const;
115 
116  protected:
117 
120 
121  // The parent group for all indirect geometries in the grid
123 
125 
127 
129 
132 
135 
137 
138  };
139 
143  {
144  public:
147 
150 
152  virtual DtIndirectGeometryGrid* create() const;
153 
157  static DtIndirectGeometryGridCreator& instance(DtDe& de);
158 
160  static const std::string& theClassName();
161  protected:
163  };
164 }
Vector3_64 myCellPadding
the cell &#39;padding&#39;
Definition: DtIndirectGeometryGrid.h:134
Virtual base class.
Definition: DtVirtualBaseClass.h:19
#define DT_DLL_VRVOSG
Definition: vrvOsg.h:23
boost::mutex myMapCellIdsToIndirectGeometryMutex
Definition: DtIndirectGeometryGrid.h:136
3 dimensional vector
class for holding an indirect geometry registrar (which holds the information about how to draw model...
Definition: DtIndirectModelsContainer.h:43
std::unordered_map< Vector3_int, osg::ref_ptr< DtIndirectGeometry >, DtIndirectCellHasher > MapCellIdsToIndirectGeometry
Definition: DtIndirectGeometryGrid.h:49
std::unordered_map< Vector3_int, osg::ref_ptr< osg::Drawable >, DtIndirectCellHasher > MapCellIdsToDebugCellDrawables
Definition: DtIndirectGeometryGrid.h:52
Contains makVrv::DtVirtualBaseClass class.
Axis Aligned Bounding Box class.
\ ::, which allows us to hook into our indirect engine to render using indirect rendering...
Definition: DtIndirectGeometry.h:102
creator for DtIndirectGeometryGrid
Definition: DtIndirectGeometryGrid.h:142
DtDe & myDe
Definition: DtIndirectGeometryGrid.h:162
Vector3_64 myCellSize
the cell size
Definition: DtIndirectGeometryGrid.h:131
MapCellIdsToDebugCellDrawables myMapCellIdsToDebugCellDrawables
Definition: DtIndirectGeometryGrid.h:126
DtIndirectModelsContainer * myModelsContainer
Definition: DtIndirectGeometryGrid.h:128
Contains DLL export macros.
MapCellIdsToIndirectGeometry myMapCellIdsToIndirectGeometry
Definition: DtIndirectGeometryGrid.h:124
The DtDe is the core component of any VR-Vantage application.
Definition: DtDe.h:69
osg::ref_ptr< osg::Node > myGridNode
Definition: DtIndirectGeometryGrid.h:122
DtDe & myDe
reference to DtDe
Definition: DtIndirectGeometryGrid.h:119
Manages a bunch of &#39;cells&#39; for a given cell size (similar to a sparse octree) each cell has a...
Definition: DtIndirectGeometryGrid.h:44
hash for Vector3Int (cell ids), so that we can map cell ids to the corresponding indirect geometry ...
Definition: DtIndirectCellHasher.h:19
Contains makVrv::DtIndirectCellHasher class.

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)