VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
DtProceduralSoundscapeQuery.h
Go to the documentation of this file.
1 /******************************************************************************
2 ** Copyright (c) 2026 MAK Technologies, Inc.
3 ** All rights reserved.
4 ******************************************************************************/
5 
9 
10 #pragma once
11 
12 #include <vrvAudio/vrvAudio.h>
14 
15 #include <osg/observer_ptr>
16 
17 #include <array>
18 #include <map>
19 #include <memory>
20 #include <mutex>
21 #include <string>
22 #include <vector>
23 
24 // Forward declarations
25 namespace osgEarth
26 {
27  class Map;
28  class MapNode;
29  class SpatialReference;
30 }
31 
32 namespace makVrv
33 {
37  struct DtPolygonCacheData;
38 
41  struct DtFeatureTileCacheData;
42 
46  struct DtElevationSampleCache;
47 }
48 
49 namespace makVrv
50 {
53  {
54  std::string key;
55  bool pending = false;
56  bool failed = false;
57  std::size_t polygonCount = 0;
58  double dispatchedAgoMs = 0.0;
59  double durationMs = 0.0;
60  std::vector<std::vector<std::array<double, 2>>> polygonPoints;
63  };
64 
67  {
68  std::vector<DtPolygonCacheEntryInfo> entries;
69  int activeThreads = 0;
70  int totalThreadsSpawned = 0;
71  int totalEvictions = 0;
72  std::vector<double> recentDurationsMs;
74  };
75 
97  {
98  public:
101  explicit DtProceduralSoundscapeQuery(osgEarth::MapNode* mapNode);
102 
117  virtual double querySignedDistance(
118  const DtProceduralSoundscapeChannel& channel,
119  double lon_deg,
120  double lat_deg,
121  double hat_m) const;
122 
125  DtProceduralSoundscapeQuery& operator=(const DtProceduralSoundscapeQuery&) = delete;
126 
136  std::string getRasterStatus(const DtProceduralSoundscapeChannel& channel) const;
137 
140  DtPolygonCacheStats getPolygonCacheStats() const;
141 
144  DtPolygonCacheStats getFeatureTileCacheStats() const;
145 
146  protected:
161  virtual double evaluateElevationConditions(
162  const DtProceduralSoundscapeChannel& channel,
163  osgEarth::Map* map,
164  double lon_deg,
165  double lat_deg) const;
166 
172  virtual double evaluateFeatureDistance(
173  const DtProceduralSoundscapeChannel& channel,
174  osgEarth::Map* map,
175  double lon_deg,
176  double lat_deg) const;
177 
183  virtual double evaluateRasterDistance(
184  const DtProceduralSoundscapeChannel& channel,
185  osgEarth::Map* map,
186  double lon_deg,
187  double lat_deg) const;
188 
196  virtual double evaluateRasterPolygonDistance(
197  const DtProceduralSoundscapeChannel& channel,
198  osgEarth::Map* map,
199  double lon_deg,
200  double lat_deg) const;
201 
202  protected:
203  osg::observer_ptr<osgEarth::MapNode> myMapNode;
207  const osgEarth::SpatialReference* myWgs84Srs{nullptr};
209  mutable std::shared_ptr<DtPolygonCacheData> myPolygonCache;
211  mutable std::shared_ptr<DtFeatureTileCacheData> myFeatureTileCache;
214  mutable std::shared_ptr<DtElevationSampleCache> myElevationSampleCache;
215  };
216 
217 } // namespace makVrv
Diagnostic snapshot of a single entry in the polygon tile cache.
Definition: DtProceduralSoundscapeQuery.h:52
osg::observer_ptr< osgEarth::MapNode > myMapNode
Definition: DtProceduralSoundscapeQuery.h:203
std::shared_ptr< DtFeatureTileCacheData > myFeatureTileCache
Shared cache for fetched feature tile geometry (render thread + worker threads).
Definition: DtProceduralSoundscapeQuery.h:211
std::vector< DtPolygonCacheEntryInfo > entries
Definition: DtProceduralSoundscapeQuery.h:68
std::string key
&quot;layerName|tileKey&quot;
Definition: DtProceduralSoundscapeQuery.h:54
Contains the DLL export macro for vrvAudio classes.
Overall snapshot of the polygon tile cache for debug/profiling display.
Definition: DtProceduralSoundscapeQuery.h:66
Contains the declarations for the makVrv ambient sound channel types.
std::shared_ptr< DtPolygonCacheData > myPolygonCache
Shared cache for polygonised raster tiles (render thread + worker threads).
Definition: DtProceduralSoundscapeQuery.h:209
std::shared_ptr< DtElevationSampleCache > myElevationSampleCache
Per-channel async elevation sample cache (render thread reads, background threads write)...
Definition: DtProceduralSoundscapeQuery.h:214
Query helper that computes the signed distance (in metres) from a geographic point to the nearest mat...
Definition: DtProceduralSoundscapeQuery.h:96
Configuration for one ambient sound channel.
Definition: DtProceduralSoundscapeChannel.h:114
#define DT_DLL_VRVAUDIO
Definition: vrvAudio.h:20

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)