VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
terrainReasoningJob.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 2021 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
6 #pragma once
7 
10 #include "vrfutil/scriptGeometry.h"
13 
14 #include "vlutil/vlMutex.h"
15 
17 #include "features/pathPlanner.h"
18 
19 #include <boost/scoped_ptr.hpp>
20 
21 class DtAsyncJobMapEntry;
22 class DtPhysicalWorld;
23 
24 namespace vrfTrl
25 {
28  void ArrangePositionsLeftToRight2D(const std::vector<std::pair<DtLocation3D, DtLocation3D> >& inPoints,
29  const DtLocation3D& originPoint,
30  const DtLocation3D& destinationPoint,
31  std::vector<std::pair<DtLocation3D, DtLocation3D> >& outPoints);
32 
35  DtLocation3D FindAreaCenter2D(const std::list<DtLocation3D>& targetAreaCorners);
36 
39  const DtLocation3D& referencePoint,
40  double widthSideSide,
41  double depthForwardBack,
42  std::list<DtLocation3D>& searchAreaCorners);
43 
45  void ConvertToLocalVectorList(const std::list<DtLocation3D>& sourceLocations, DtLocalVertexList& resultsList, DtTerrainInterface* pTerrainIf, bool bClamp = true);
46 }
47 
49 {
50 public:
53  virtual ~DtHilltopQueryResult();
54 
55  const DtHilltopQueryResult& operator=(const DtHilltopQueryResult&);
56 
57  virtual void copyResultFrom(const DtHilltopQueryResult& orig);
58 
59  std::vector<DtLocation3D> myHighPoints;
60 };
61 
62 
65 {
66 public:
67 
69  const std::list<DtLocation3D>& corners,
70  int nPointsToReturn,
71  bool bDebug);
72 
73  virtual ~DtHilltopQueryJob();
74 
75  void message(Severity severity, std::string msg);
76 
78  tbb::task* onExecute();
79 
80  tbb::task* onException();
81 
82 protected:
84  std::list<DtLocation3D> myCorners;
86  bool bMyDebug;
87 
88 };
89 
91 {
92 public:
96 
98 
99  virtual void copyResultFrom(const DtVehiclePositionQueryResult& orig);
100 
101  std::vector<std::pair<DtLocation3D, DtLocation3D> > myPositionPairs;
102 };
103 
106 {
107 public:
108 
109  /*
110  findVehiclePlatoonFightingPositions(taskParameters.numberOfPoints,
111  taskParameters.targetArea:getLocations3D(),
112  taskParameters.battlePosition,
113  maxVolume, -- full dimensions of hide position
114  maxVolume:getUp() * 1.34, --67% of total height for shooting height
115  maxVolume:getUp(), -- half height for target height
116  10,
117  searchWidthForward * 2.0, -- how much forward and back to search forward and back
118  searchWidthSide * 2.0 -- how much side to side to search
119  )
120  */
122  int nPositionPairsToReturn,
123  const std::list<DtLocation3D>& targetAreaCorners,
124  const DtLocation3D& originPoint,
125  const DtVectorOffset3D& hideVolume,
126  double shootHeight,
127  double targetHeight,
128  double forwardBackSearchLimit,
129  double sideSideSearchLimit,
130  double maxSlopeDegrees,
131  double positionSpacing,
132  bool bDebug);
133 
134  virtual ~DtVehiclePositionQuery();
135 
136  void message(Severity severity, std::string msg);
137 
139  tbb::task* onExecute();
140 
141  tbb::task* onException();
142 
143 protected:
145  std::list<DtLocation3D> myTargetAreaCorners;
155  bool bMyDebug;
156 
157 };
158 
161 {
162 public:
163 
164  /*
165  findSinglePosition(taskParameters.targetArea:getLocations3D(),
166  targetHeightMeters, -- 2/3 vehicle height, for example.
167  double viewHeightMeters, -- 2/3 vehicle height, for example.
168  double hideHeightMeters, -- 1.1x vehicle height, for example.
169  double forwardBackSearchLimitMeters, -- 50m forward + 50m backward = 100m
170  double forwardBackSearchIntervalMeters, -- half vehicle length, for example.
171  bool bDebug
172  )
173  */
175  const std::list<DtLocation3D>& targetAreaCorners,
176  const DtLocation3D& pivotPoint,
177  double targetHeightMeters,
178  double viewHeightMeters,
179  double hideHeightMeters,
180  double forwardBackSearchLimitMeters,
181  double forwardBackSearchIntervalMeters,
182  double maxSlopeDegrees,
183  bool bDebug);
184 
185  virtual ~DtFindSinglePositionQuery();
186 
187  void message(Severity severity, std::string msg);
188 
190  tbb::task* onExecute();
191 
192  tbb::task* onException();
193 
194 protected:
196  std::list<DtLocation3D> myTargetAreaCorners;
198  double myHideHeight;
199  double myViewHeight;
204 
205  bool bMyDebug;
206 
207 };
208 
210 {
211 public:
212  typedef std::vector<std::pair<DtLocation3D, DtLocation3D> > PositionPairs;
213  typedef struct Group
214  {
220  } PositionGroup;
221 
225 
227 
228  virtual void copyResultFrom(const DtFindPositionGroupsInAreaQueryResult& orig);
229 
230 
231  std::vector<PositionGroup> groups;
232 };
233 
236 {
237 public:
238 
239 
271  const std::list<DtLocation3D>& sourceAreaVertices,
272  unsigned int gridResolutionMeters,
273  double prominenceMeters,
274  unsigned int prominenceRangeMeters,
275  const std::list<DtLocation3D>& targetsAreaVertices,
276  unsigned int targetsAreaSampleCount,
277  double targetsHeightMeters,
278  double viewHeightMeters,
279  double hideHeightMeters,
280  double forwardBackSearchLimitMeters,
281  double sideToSideSearchLimitMeters,
282  double forwardBackSearchIntervalMeters,
283  double maxSlopeDegrees,
284  double sideToSideSearchIntervalMeters,
285  double positionsSpacing,
286  unsigned int positionsCount,
287  bool bDebug);
288 
290 
291  void message(Severity severity, std::string msg);
292 
294  tbb::task* onExecute();
295 
296  tbb::task* onException();
297 
298 protected:
300  std::list<DtLocation3D> mySourceAreaCorners;
301  std::list<DtLocation3D> myTargetAreaCorners;
309  double myHideHight;
316  bool bMyDebug;
317 
318 };
319 
322 {
323 public:
324 
350  const std::list<DtLocation3D>& sourceAreaVertices,
351  const std::list<DtLocation3D>& targetsAreaVertices,
352  unsigned int targetsAreaSampleCount,
353  double targetsHeightMeters,
354  double viewHeightMeters,
355  double hideHeightMeters,
356  double coverRangeMeters,
357  double lateralRangeMeters,
358  double forwardBackRangeMeters,
359  double forwardBackIntervalMeters,
360  double maxSlopeDegrees,
361  double lateralIntervalMeters,
362  double positionsSpacing,
363  unsigned int positionsCount,
364  bool bDebug);
365 
367 
368  void message(Severity severity, std::string msg);
369 
371  tbb::task* onExecute();
372 
373  tbb::task* onException();
374 
375 protected:
377  std::list<DtLocation3D> mySourceAreaCorners;
378  std::list<DtLocation3D> myTargetAreaCorners;
383  double myHideHight;
384  double myCoverRange;
391  bool bMyDebug;
392 
393 };
394 
395 
virtual task * onExecute()=0
Called to execute a task.
int myNumberPositionPairsToReturn
Definition: terrainReasoningJob.h:146
Find Single Position Query Job.
Definition: terrainReasoningJob.h:160
PositionPairs positions
Definition: terrainReasoningJob.h:216
double myForwardBackSearchLimitMeters
Definition: terrainReasoningJob.h:310
Severity
Definition: algorithmManager.h:29
double scoreViewPctAverage
Definition: terrainReasoningJob.h:217
double mySideSideSearchLimit
Definition: terrainReasoningJob.h:152
double myForwardBackSearchLimitMeters
Definition: terrainReasoningJob.h:385
DtTerrainInterface * pMyTerrainInterface
Definition: terrainReasoningJob.h:299
double mySideSideSearchLimit
Definition: terrainReasoningJob.h:386
double scoreCoverPctAverage
Definition: terrainReasoningJob.h:218
double mySideSideSearchLimit
Definition: terrainReasoningJob.h:311
std::list< DtLocation3D > myTargetAreaCorners
Definition: terrainReasoningJob.h:378
voidpf uLong int origin
Definition: ioapi.h:42
double myShootHeight
Definition: terrainReasoningJob.h:149
double myProminenceMeters
Definition: terrainReasoningJob.h:305
DtTerrainInterface * pMyTerrainInterface
Definition: terrainReasoningJob.h:83
std::list< DtLocation3D > myCorners
Definition: terrainReasoningJob.h:84
unsigned int myTargetsAreaSampleCount
Definition: terrainReasoningJob.h:380
double myForwardBackSearchLimit
Definition: terrainReasoningJob.h:151
bool bMyDebug
Definition: terrainReasoningJob.h:155
void ConvertToLocalVectorList(const std::list< DtLocation3D > &sourceLocations, DtLocalVertexList &resultsList, DtTerrainInterface *pTerrainIf, bool bClamp=true)
Given a list of locations in a local coordinate system, clamp them to terrain height.
void MakeRelativeSearchArea2D(const DtLocation3D &origin, const DtLocation3D &referencePoint, double widthSideSide, double depthForwardBack, std::list< DtLocation3D > &searchAreaCorners)
Given an origin point and a reference point, make an area about the origin facing the reference point...
unsigned int myNumberPositionsPerGroupRequested
Definition: terrainReasoningJob.h:302
Definition: terrainReasoningJob.h:213
DtLocation3D FindAreaCenter2D(const std::list< DtLocation3D > &targetAreaCorners)
Given a list of Location3D objects, return a DtLocation3D representing 2D center. Center is an averag...
Concrete job class which manages a shared pointer to it&#39;s job map entry. Using this job does not requ...
Definition: asyncJob.h:106
double myPositionsSpacing
Definition: terrainReasoningJob.h:390
double myHideHeight
Definition: terrainReasoningJob.h:198
bool bMyDebug
Definition: terrainReasoningJob.h:205
double myForwardBackSearchIntervalMeters
Definition: terrainReasoningJob.h:387
double myForwardBackSearchLimit
Definition: terrainReasoningJob.h:201
bool bMyDebug
Definition: terrainReasoningJob.h:86
double myTargetHeight
Definition: terrainReasoningJob.h:200
double myHideHight
Definition: terrainReasoningJob.h:383
Find Position Groups In Area Job.
Definition: terrainReasoningJob.h:235
double myForwardBackSearchInterval
Definition: terrainReasoningJob.h:202
VectorOffset3D is a direction vector that is relative to some direction specified by a Vector3D...
Definition: scriptGeometry.h:424
double mySideSideSearchIntervalMeters
Definition: terrainReasoningJob.h:389
unsigned int myGridResolutionMeters
Definition: terrainReasoningJob.h:304
unsigned int myNumberPositionsPerGroupRequested
Definition: terrainReasoningJob.h:379
double myForwardBackSearchIntervalMeters
Definition: terrainReasoningJob.h:312
int nMyPointsToReturn
Definition: terrainReasoningJob.h:85
The DtPhysicalWorld is the primary interface to and manager of all of the &quot;physical&quot; aspects of the s...
Definition: physicalWorld.h:102
DtLocation3D myOriginPoint
Definition: terrainReasoningJob.h:197
double myMaxSlopeDegrees
Definition: terrainReasoningJob.h:203
DtTerrainInterface * pMyTerrainInterface
Definition: terrainReasoningJob.h:376
std::list< DtLocation3D > mySourceAreaCorners
Definition: terrainReasoningJob.h:377
std::list< DtLocation3D > mySourceAreaCorners
Definition: terrainReasoningJob.h:300
double scoreOverallPctAverage
Definition: terrainReasoningJob.h:219
void ArrangePositionsLeftToRight2D(const std::vector< std::pair< DtLocation3D, DtLocation3D > > &inPoints, const DtLocation3D &originPoint, const DtLocation3D &destinationPoint, std::vector< std::pair< DtLocation3D, DtLocation3D > > &outPoints)
Sort the given points left to right, perpendicular to reference line from origin to destination...
double myCoverRange
Definition: terrainReasoningJob.h:384
DtLocation3D myOriginPoint
Definition: terrainReasoningJob.h:147
double myShootHeight
Definition: terrainReasoningJob.h:308
unsigned int myTargetsAreaSampleCount
Definition: terrainReasoningJob.h:303
double myTargetHeight
Definition: terrainReasoningJob.h:150
DtTerrainInterface allows access to common terrain calls without having to know the terrain implement...
Definition: terrainInterface.h:100
std::list< DtLocation3D > myTargetAreaCorners
Definition: terrainReasoningJob.h:196
double myTargetHeight
Definition: terrainReasoningJob.h:381
Base class for result of job.
Definition: asyncJobServer.h:43
double mySideSideSearchIntervalMeters
Definition: terrainReasoningJob.h:314
virtual void message(Severity, const std::string &) const
Output a messages from within the algorithm.
double myMaxSlopeDegrees
Definition: terrainReasoningJob.h:153
Handle to async job.
Definition: asyncJobMapEntry.h:29
DtVectorOffset3D myHideVolume
Definition: terrainReasoningJob.h:148
double myViewHeight
Definition: terrainReasoningJob.h:199
Vehicle Position Query Job.
Definition: terrainReasoningJob.h:105
#define DT_DLL_terrainReasoning
This file is used to determine how to build.
Definition: terrainReasoningDefines.h:25
struct _Group PositionGroup
Definition: luaTerrainReasoningJob.h:301
Definition: terrainReasoningJob.h:48
double myShootHeight
Definition: terrainReasoningJob.h:382
Definition: terrainReasoningJob.h:90
std::vector< std::pair< DtLocation3D, DtLocation3D > > myPositionPairs
Definition: terrainReasoningJob.h:101
unsigned int myProminenceRangeMeters
Definition: terrainReasoningJob.h:306
std::list< DtLocation3D > myTargetAreaCorners
Definition: terrainReasoningJob.h:301
double myTargetHeight
Definition: terrainReasoningJob.h:307
DtTerrainInterface * pMyTerrainInterface
Definition: terrainReasoningJob.h:144
double myMaxSlopeDegrees
Definition: terrainReasoningJob.h:388
Definition: terrainReasoningJob.h:209
std::list< DtLocation3D > myTargetAreaCorners
Definition: terrainReasoningJob.h:145
bool bMyDebug
Definition: terrainReasoningJob.h:316
Hilltop Query Job.
Definition: terrainReasoningJob.h:64
virtual task * onException()=0
Called when an exception is caught during execution.
double myPositionsSpacing
Definition: terrainReasoningJob.h:315
class DtLocalVertexList:
Definition: localVertexList.h:20
Find Position Groups In Area Using Ridge Algorithm Job.
Definition: terrainReasoningJob.h:321
double myPositionSpacing
Definition: terrainReasoningJob.h:154
std::vector< PositionGroup > groups
Definition: terrainReasoningJob.h:231
bool bMyDebug
Definition: terrainReasoningJob.h:391
std::vector< DtLocation3D > myHighPoints
Definition: terrainReasoningJob.h:59
double myMaxSlopeDegrees
Definition: terrainReasoningJob.h:313
std::vector< std::pair< DtLocation3D, DtLocation3D > > PositionPairs
Definition: terrainReasoningJob.h:212
double myHideHight
Definition: terrainReasoningJob.h:309
DtLocation3D pivotPoint
Definition: terrainReasoningJob.h:215
A location3D is a point in space, i.e. a geocentric coordinate.
Definition: scriptGeometry.h:22
DtTerrainInterface * pMyTerrainInterface
Definition: terrainReasoningJob.h:195

Document ID: Generated on Tue Sep 24 19:28:17 EDT 2024 from SVN revision 269799
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)