VR-Forces Developer's Guide
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Static Public Member Functions | Static Private Member Functions | Friends
DtTerrainReasonerAlgos Class Reference

This class services DtTerrainReasoner. It contains actual implementations of the algorithms used for both hilltops finding and position finding. DtTerrainReasoner provides a client oriented interface: based on local coordinates and double precision range/height measurements. DtTerrainReasonerAlgos is implementation oriented: uses topographic coordinates and integer values (where applicable) for simplicity and efficiency.

Static Public Member Functions

static bool SolveHilltops (const DtIntMatrix &grid, int prominenceSpan, int prominence, vector< int > &hilltopX, vector< int > &hilltopY, vector< int > &groupIndex)
 
static void LocatePositions (const DtArea &area, int sampleFactor, const DtTopoPoint &domPoint, int posCount, int lateralSpacing, int lateralInterval, int lateralRange, int metersFire, int metersCover, int interval, double heightFire, double heightCover, double heightTo, double maxSlopeDegrees, const DtHostQueryInterface &losChecker, vector< DtTopoPoint > &samplePoints, vector< DtGradeResult > &fireResult, vector< DtGradeResult > &coverResult)
 
static double GradeCoverage (const DtTopoPoint &pointFrom, double heightFrom, const vector< DtTopoPoint > &samplePoints, double heightTo, const DtHostQueryInterface &losChecker, vector< bool > &covered)
 
static void SelectGrades (vector< int > &grades, int selectCount, int spacing, vector< int > &selected)
 
static void FindPotentialPositionsAlongCrossSection (const DtTopoPoint &originPoint, double originHeightMeters, const DtTopoPoint &endPoint, double startCheckOffsetMeters, double startSearchOffsetMeters, double searchIntervalMeters, double viewHeightMeters, double coverHeightMeters, double coverRangeMeters, const DtHostQueryInterface &losChecker, vector< DtTopoPoint > &viewPoints, vector< DtTopoPoint > &coverPoints)
 
static void FindPotentialPositionsInArea (const DtArea &searchArea, const DtArea &targetsArea, unsigned int targetsAreaSampleCount, double lateralIntervalMeters, double verticalIntervalMeters, double targetHeightMeters, double viewHeightMeters, double coverHeightMeters, double coverRangeMeters, const DtHostQueryInterface &losChecker, DtTopoPoint &targetAreaCenter, vector< DtTopoPoint > &viewPoints, vector< DtTopoPoint > &coverPoints)
 
static void ClusterPotentialPositions (const DtTopoPoint &targetCenter, const vector< DtTopoPoint > &viewPoints, const vector< DtTopoPoint > &coverPoints, double maxGroupWidth, double maxGroupDepth, vector< DtArea > &clusters, vector< DtTopoPoint > &clusterCenters, vector< double > &clusterDepths, vector< double > &clusterWidths)
 

Static Private Member Functions

static void ConvertAreasToCrossSections (const DtArea &searchArea, const DtArea &targetsArea, unsigned int targetsAreaSampleCount, double lateralIntervalMeters, DtTopoPoint &originPoint, vector< double > &startCheckOffsetMeters, vector< double > &startSearchOffsetMeters, const DtHostQueryInterface &losChecker, vector< DtTopoPoint > &endPoints)
 
static bool PointInside (const DtTopoPoint &pt, const DtTopoPoint &fromP, const DtTopoPoint &toP)
 
static bool LineIntersection (const DtTopoPoint &from1, const DtTopoPoint &to1, const DtTopoPoint &from2, const DtTopoPoint &to2, DtTopoPoint &intersection)
 
static void LineAreaIntersection (const DtTopoPoint &fromLine, const DtTopoPoint &toLine, DtArea area, vector< DtTopoPoint > &intersectionVec)
 
static int ProminenceCircle (int radius, DtIntMatrix &circle)
 
static void FindPeaks (const DtIntMatrixSlice &slice, vector< int > &indices)
 
static void GradeSinglePosition (const vector< DtTopoPoint > &samplePoints, const DtTopoPoint &areaCenter, const DtTopoPoint &position, int metersFire, int metersCover, int interval, double heightFire, double heightCover, double heightTo, double maxSlopeDegrees, const DtHostQueryInterface &_losChecker, DtGradeResult &fireResult, DtGradeResult &coverResult)
 
static void SelectGradesImp (vector< int > &grades, int fromInd, int toInd, vector< int > &indices, int top, int selectCount, int spacing, vector< int > &selected)
 

Friends

class DtTerrainReasonerTester
 

Member Function Documentation

static bool DtTerrainReasonerAlgos::SolveHilltops ( const DtIntMatrix grid,
int  prominenceSpan,
int  prominence,
vector< int > &  hilltopX,
vector< int > &  hilltopY,
vector< int > &  groupIndex 
)
static

This algorithm serves DtTerrainReasoner::findHilltopsInArea.

static void DtTerrainReasonerAlgos::LocatePositions ( const DtArea area,
int  sampleFactor,
const DtTopoPoint domPoint,
int  posCount,
int  lateralSpacing,
int  lateralInterval,
int  lateralRange,
int  metersFire,
int  metersCover,
int  interval,
double  heightFire,
double  heightCover,
double  heightTo,
double  maxSlopeDegrees,
const DtHostQueryInterface losChecker,
vector< DtTopoPoint > &  samplePoints,
vector< DtGradeResult > &  fireResult,
vector< DtGradeResult > &  coverResult 
)
static

This algorithm serves DtTerrainReasoner::findPositionGroup.

static double DtTerrainReasonerAlgos::GradeCoverage ( const DtTopoPoint pointFrom,
double  heightFrom,
const vector< DtTopoPoint > &  samplePoints,
double  heightTo,
const DtHostQueryInterface losChecker,
vector< bool > &  covered 
)
static

This algorithm grades an exampned view/cover point based on its coverage of (i.e. line-of-sight to) a collection of sample points.

static void DtTerrainReasonerAlgos::SelectGrades ( vector< int > &  grades,
int  selectCount,
int  spacing,
vector< int > &  selected 
)
static
static void DtTerrainReasonerAlgos::FindPotentialPositionsAlongCrossSection ( const DtTopoPoint originPoint,
double  originHeightMeters,
const DtTopoPoint endPoint,
double  startCheckOffsetMeters,
double  startSearchOffsetMeters,
double  searchIntervalMeters,
double  viewHeightMeters,
double  coverHeightMeters,
double  coverRangeMeters,
const DtHostQueryInterface losChecker,
vector< DtTopoPoint > &  viewPoints,
vector< DtTopoPoint > &  coverPoints 
)
static

This algorithm finds all potential positions along a cross section. A cross section is a line that starts at an originPoint and ends in an endPoint. A potential position is a pair of view point and cover point that are found using elevation comparisons only, i.e. without using true line-of-sight checks. This algorithm serves FindPotentialPositionsInArea.

static void DtTerrainReasonerAlgos::FindPotentialPositionsInArea ( const DtArea searchArea,
const DtArea targetsArea,
unsigned int  targetsAreaSampleCount,
double  lateralIntervalMeters,
double  verticalIntervalMeters,
double  targetHeightMeters,
double  viewHeightMeters,
double  coverHeightMeters,
double  coverRangeMeters,
const DtHostQueryInterface losChecker,
DtTopoPoint targetAreaCenter,
vector< DtTopoPoint > &  viewPoints,
vector< DtTopoPoint > &  coverPoints 
)
static

This algorithm serves DtTerrainReasoner::findRidgedPositionsInArea. It implements the first part of the heuristic stage: finding all potential positions in the specified searchArea.

static void DtTerrainReasonerAlgos::ClusterPotentialPositions ( const DtTopoPoint targetCenter,
const vector< DtTopoPoint > &  viewPoints,
const vector< DtTopoPoint > &  coverPoints,
double  maxGroupWidth,
double  maxGroupDepth,
vector< DtArea > &  clusters,
vector< DtTopoPoint > &  clusterCenters,
vector< double > &  clusterDepths,
vector< double > &  clusterWidths 
)
static

This algorithm serves DtTerrainReasoner::findRidgedPositionsInArea. It implements the second part of the heuristic stage: clustering all previously found potential positions into rectangular clusters/groups of limited dimensions.

static void DtTerrainReasonerAlgos::ConvertAreasToCrossSections ( const DtArea searchArea,
const DtArea targetsArea,
unsigned int  targetsAreaSampleCount,
double  lateralIntervalMeters,
DtTopoPoint originPoint,
vector< double > &  startCheckOffsetMeters,
vector< double > &  startSearchOffsetMeters,
const DtHostQueryInterface losChecker,
vector< DtTopoPoint > &  endPoints 
)
staticprivate

This algorithm finds a "fan" of cross sections. Each cross section starts at an originPoint (also an out parameter) and extends to the far end of the search area. The originPoint (AKA reference point) is set to the center of the targetsArea and its elevation is set to the avarage elevation in the targetsArea. The density of the "fan" is determined by lateralIntervalMeters, applied to the farthest edge of the search area.

static bool DtTerrainReasonerAlgos::PointInside ( const DtTopoPoint pt,
const DtTopoPoint fromP,
const DtTopoPoint toP 
)
staticprivate

This group of methods provide some basic geometric operations.

static bool DtTerrainReasonerAlgos::LineIntersection ( const DtTopoPoint from1,
const DtTopoPoint to1,
const DtTopoPoint from2,
const DtTopoPoint to2,
DtTopoPoint intersection 
)
staticprivate
static void DtTerrainReasonerAlgos::LineAreaIntersection ( const DtTopoPoint fromLine,
const DtTopoPoint toLine,
DtArea  area,
vector< DtTopoPoint > &  intersectionVec 
)
staticprivate
static int DtTerrainReasonerAlgos::ProminenceCircle ( int  radius,
DtIntMatrix circle 
)
staticprivate

This method create a square matrix in which all cells belonging to a circle whose center is the center of the square and whose radius is specified, are marked. This is used to efficiently identify all grid cells belonging to the prominence circle of a hilltop, while traversing the search area.

static void DtTerrainReasonerAlgos::FindPeaks ( const DtIntMatrixSlice slice,
vector< int > &  indices 
)
staticprivate
static void DtTerrainReasonerAlgos::GradeSinglePosition ( const vector< DtTopoPoint > &  samplePoints,
const DtTopoPoint areaCenter,
const DtTopoPoint position,
int  metersFire,
int  metersCover,
int  interval,
double  heightFire,
double  heightCover,
double  heightTo,
double  maxSlopeDegrees,
const DtHostQueryInterface _losChecker,
DtGradeResult fireResult,
DtGradeResult coverResult 
)
staticprivate
static void DtTerrainReasonerAlgos::SelectGradesImp ( vector< int > &  grades,
int  fromInd,
int  toInd,
vector< int > &  indices,
int  top,
int  selectCount,
int  spacing,
vector< int > &  selected 
)
staticprivate

Friends And Related Function Documentation

friend class DtTerrainReasonerTester
friend

The documentation for this class was generated from the following file:

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)