VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
terrainReasoner.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 #pragma once
6 
8 #include "matrix/vlVector.h"
9 #include <vector>
10 using namespace std;
11 
12 class DtPhysicalWorld;
13 class DtLocalVertexList;
15 class DtIntMatrix;
16 class DtArea;
17 class DtTopoPoint;
18 
99 
101 {
102  DtVector viewPointLocal;
103  double viewPct;
104  DtVector coverPointLocal;
105  double coverPct;
106 };
107 
109  DtVector pivotPointLocal;
110  vector<DtViewCoverPosition> positions;
111  double viewPctAvg;
112  double coverPctAvg;
113  double overallPctAvg;
114 };
115 
117 {
118 public:
119  typedef DtTerrainReasoner* (*DtTerrainReasonerCreatorFcn)(DtPhysicalWorld& physicalWorld);
120 
121 protected:
122  explicit DtTerrainReasoner(DtPhysicalWorld& physicalWorld);
123 
126  DtTerrainReasoner(const DtTerrainReasoner& other);
127  DtTerrainReasoner& operator=(const DtTerrainReasoner& other);
129 
130 public:
131  virtual ~DtTerrainReasoner();
132 
134  static DtTerrainReasoner* instance();
135 
137  static DtTerrainReasoner* createInstance(DtPhysicalWorld& physicalWorld);
138 
140  static DtTerrainReasoner* creator(DtPhysicalWorld& physicalWorld);
141 
170  bool findHilltopsInArea(
171  const DtLocalVertexList& areaVertices,
172  double gridResolutionMeters,
173  double prominenceMeters,
174  double prominenceRangeMeters,
175  vector<DtVector>& foundHilltopsLocal,
176  string* queryString = NULL,
177  string* problemDescription = NULL);
178 
226  bool findPositionGroup(
227  const DtLocalVertexList& targetsAreaVertices,
228  unsigned int targetsAreaSampleCount,
229  double targetsHeightMeters,
230  double viewHeightMeters,
231  double coverHeightMeters,
232  const DtVector& pivotLocal,
233  double forwardRangeMeters,
234  double backwardRangeMeters,
235  double lateralRangeMeters,
236  double verticalIntervalMeters,
237  double maxSlopeDegrees,
238  double lateralIntervalMeters,
239  double positionsLateralSpacingMeters,
240  unsigned int positionsCount,
241  vector<DtViewCoverPosition>& foundPositions,
242  string* queryString = NULL,
243  string* problemDescription = NULL);
244 
288  bool findPosition(
289  const DtLocalVertexList& targetsAreaVertices,
290  unsigned int targetsAreaSampleCount,
291  double targetsHeightMeters,
292  double viewHeightMeters,
293  double coverHeightMeters,
294  const DtVector& pivotLocal,
295  double forwardRangeMeters,
296  double backwardRangeMeters,
297  double verticalIntervalMeters,
298  double maxSlopeDegrees,
299  DtViewCoverPosition& foundPosition,
300  string* queryString = NULL,
301  string* problemDescription = NULL);
302 
362  bool findPositionGroupsInArea(
363  const DtLocalVertexList& searchAreaVertices,
364  double gridResolutionMeters,
365  double prominenceMeters,
366  double prominenceRangeMeters,
367  const DtLocalVertexList& targetsAreaVertices,
368  unsigned int targetsAreaSampleCount,
369  double targetsHeightMeters,
370  double viewHeightMeters,
371  double coverHeightMeters,
372  double forwardRangeMeters,
373  double backwardRangeMeters,
374  double lateralRangeMeters,
375  double verticalIntervalMeters,
376  double maxSlopeDegrees,
377  double lateralIntervalMeters,
378  double positionsLateralSpacingMeters,
379  unsigned int positionsCount,
380  vector<DtViewCoverPositionGroup>& foundPositionGroups,
381  string* queryString = NULL,
382  string* problemDescription = NULL);
383 
439  bool findRidgedPositionGroupsInArea(
440  const DtLocalVertexList& searchAreaVertices,
441  const DtLocalVertexList& targetsAreaVertices,
442  unsigned int targetsAreaSampleCount,
443  double targetsHeightMeters,
444  double viewHeightMeters,
445  double coverHeightMeters,
446  double coverRangeMeters,
447  double lateralRangeMeters,
448  double lateralIntervalMeters,
449  double verticalRangeMeters,
450  double verticalIntervalMeters,
451  double maxSlopeDegrees,
452  double positionsLateralSpacingMeters,
453  unsigned int positionsCount,
454  vector<DtViewCoverPositionGroup>& foundPositionGroups,
455  string* queryString = NULL,
456  string* problemDescription = NULL);
457 
458 private:
459  void findPositionGroupWithHostQuery(
460  const DtLocalVertexList& targetsAreaVertices,
461  unsigned int targetsAreaSampleCount,
462  double targetsHeightMeters,
463  double viewHeightMeters,
464  double coverHeightMeters,
465  const DtVector& pivotLocal,
466  unsigned int forwardRangeMeters,
467  unsigned int backwardRangeMeters,
468  unsigned int lateralRangeMeters,
469  unsigned int verticalIntervalMeters,
470  double maxSlopeDegrees,
471  unsigned int lateralIntervalMeters,
472  unsigned int positionsLateralSpacingMeters,
473  unsigned int positionsCount,
474  DtHostQueryImplementation& hostQuery,
475  vector<DtViewCoverPosition>& foundPositions);
476  void BuildHeightGrid(double fromX, double fromY, double toX, double toY, int intervalMeters,
477  const DtHostQueryImplementation& hostQuery, DtIntMatrix& grid);
478  void CovertToArea(const DtLocalVertexList& areaVertices, DtHostQueryImplementation& hostQuery, DtArea& area);
479  bool ValidateNoOverlap(string functionName, const DtArea& searchArea, const DtArea& targetArea, string* problemDescription);
480  string ValidationMessage(string functionName, bool isError, string offendingParameterName,
481  double offendingParameterValue, string description);
482  string ValidationMessage(string functionName, bool isError, string offendingParameterName,
483  string description);
484  bool ValidateAreaVertices(string functionName, const DtLocalVertexList& areaVertices, string name, string* problemDescription);
485  bool ValidateGreaterThanZero(string functionName, double value, string name, string* problemDescription);
486  bool ValidateLessThan(string functionName,
487  double value, string name,
488  double refValue, string refName,
489  string* problemDescription);
490  bool ValidateNotLessThan(string functionName,
491  double value, string name,
492  double refValue, string refName,
493  string* problemDescription,
494  bool isError=true);
495  bool ValidateGreaterThan(string functionName,
496  double value, string name,
497  double refValue, string refName,
498  string* problemDescription);
499  bool ValidateNotGreaterThan(string functionName,
500  double value, string name,
501  double refValue, string refName,
502  string* problemDescription,
503  bool isError = true);
504  bool ValidateLocatedOutside(string functionName, const DtArea& targetsArea, const DtTopoPoint& pt, string* problemDescription);
505  bool ValidateCoverNotLessThanView(string functionName, double coverHeightMeters, double viewHeightMeters, string* problemDescription);
506 protected:
508 
509  static DtTerrainReasonerCreatorFcn TheCreatorFcn;
511 };
512 
double viewPctAvg
Definition: terrainReasoner.h:111
Definition: hostQueryImplementation.h:10
Definition: terrainReasoner.h:116
DtVector pivotPointLocal
Definition: terrainReasoner.h:109
DtPhysicalWorld & myPhysicalWorld
Definition: terrainReasoner.h:507
double coverPctAvg
Average of viewPct values from all positions.
Definition: terrainReasoner.h:112
This class represents a topographic coordinate. It has the exact same interface as DtVector...
Definition: terrainReasonerAlgos.h:16
double coverPct
Definition: terrainReasoner.h:105
DtVector viewPointLocal
Definition: terrainReasoner.h:102
static DtTerrainReasonerCreatorFcn TheCreatorFcn
Definition: terrainReasoner.h:509
DtVector coverPointLocal
100 means ViewPoint has line-of-sight to entire targets area.
Definition: terrainReasoner.h:104
The DtPhysicalWorld is the primary interface to and manager of all of the &quot;physical&quot; aspects of the s...
Definition: physicalWorld.h:112
vector< DtViewCoverPosition > positions
Definition: terrainReasoner.h:110
double viewPct
Definition: terrainReasoner.h:103
Definition: terrainUtility.h:15
#define DT_DLL_terrainReasoning
This file is used to determine how to build.
Definition: terrainReasoningDefines.h:25
This interface defines terrain reasoning queries providing tactical analysis of terrain ( DtPhysicalW...
Definition: terrainReasoner.h:100
double overallPctAvg
Average of coverPct values from all positions.
Definition: terrainReasoner.h:113
Definition: terrainReasoner.h:108
class DtLocalVertexList:
Definition: localVertexList.h:20
Definition: terrainUtility.h:24
static DtTerrainReasoner * TheInstance
Definition: terrainReasoner.h:510

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)