WSF
WsfNavigationCell.hpp
Go to the documentation of this file.
1// ****************************************************************************
2// CUI
3//
4// The Advanced Framework for Simulation, Integration, and Modeling (AFSIM)
5//
6// Copyright 2003-2015 The Boeing Company. All rights reserved.
7//
8// The use, dissemination or disclosure of data in this file is subject to
9// limitation or restriction. See accompanying README and LICENSE for details.
10// ****************************************************************************
11// ****************************************************************************
12// Updated by Infoscitex, a DCS Company.
13// ****************************************************************************
14
15#ifndef WSFNAVIGATIONCELL_HPP
16#define WSFNAVIGATIONCELL_HPP
17
18#include "wsf_export.h"
19
20#include <limits>
21
22#include "UtLineSegment.hpp"
23#include "UtMath.hpp"
24#include "UtVec3.hpp"
25#include "WsfGeoPoint.hpp"
26#include "WsfPathFinder.hpp"
27
29{
30public:
32 {
33 VERT_A = 0,
36 };
37
44
46 {
47 NO_RELATIONSHIP, // the path does not cross this cell
48 ENDING_CELL, // the path ends in this cell
49 EXITING_CELL // the path crosses through this cell
50 };
51
58
60 WsfNavigationCell(float aX, float aY, float aZ, bool aMirror);
61
62 void SetWeight(double aWeight) { mWeight = aWeight; }
63
64 void AddVertex(const WsfGeoPoint& aPoint);
65
66 bool PointInCell(double aX, double aY,
67 double aZ); // return true if the given point lies within this cell
68
69 double AngleBetween(double aFirstX, double aFirstY, double aSecondX, double aSecondY);
70
71 PATH_RESULT ClassifyPathToCell(UtLineSegment& aMotionPath,
72 WsfNavigationCell** aNextCell,
73 CELL_SIDE& aCellSide,
74 UtVec3d* aIntersectionPoint,
75 WsfNavigationCell* aPrevCell);
76
77 POINT_CLASSIFICATION ClassifyPoint(UtLineSegment aSide, UtVec3d aPathEndPoint);
78
79 bool PointOnSameSide(UtVec3d aPathEndPoint, int aSideIndex);
80
81 WsfNavigationCell* GetNeighborForSide(int aSideIndex, UtVec3d* aIntersectionPoint);
82
83 std::string GetValueForCellModifier(const std::string& aModifier);
84
85
86 std::vector<WsfGeoPoint> mVerts; // the vertexes that make up this cell
87 std::vector<UtLineSegment> mSides; // the sides that make up this cell
88 std::vector<WsfNavigationCell*> mNeighbors; // pointers to this cell's neighbors
89
90 // iterators for all the vectors
91 std::vector<WsfGeoPoint>::iterator mVertexIterator;
92 std::vector<UtLineSegment>::iterator mSideIterator;
93 std::vector<WsfNavigationCell*>::iterator mNeighborIterator;
94
95 UtVec3d mCellNormal;
97 unsigned int mCellID;
98 unsigned int mCellNumber; // essentially the same as ID, but pathfinder doesnt use this value
99 unsigned int mX;
100 unsigned int mY;
103 double mWeight; // pathing weight
104 std::map<WsfStringId, WsfStringId> mModifierList;
105 std::vector<unsigned int> mNeighborIDs;
106
107 bool mNoZoneInteraction; // a flag used while tessilating
108};
109#endif
#define WSF_EXPORT
Definition WsfXIO_Export.hpp:35
Definition WsfGeoPoint.hpp:29
Definition WsfNavigationCell.hpp:29
bool mNoZoneInteraction
Definition WsfNavigationCell.hpp:107
UtVec3d mCellCentroid
Definition WsfNavigationCell.hpp:96
POINT_CLASSIFICATION
Definition WsfNavigationCell.hpp:53
@ ON_LINE
Definition WsfNavigationCell.hpp:54
@ LEFT_SIDE
Definition WsfNavigationCell.hpp:56
@ RIGHT_SIDE
Definition WsfNavigationCell.hpp:55
int mTessilationLevel
Definition WsfNavigationCell.hpp:102
std::vector< WsfGeoPoint > mVerts
Definition WsfNavigationCell.hpp:86
std::vector< WsfNavigationCell * > mNeighbors
Definition WsfNavigationCell.hpp:88
PATH_RESULT
Definition WsfNavigationCell.hpp:46
@ ENDING_CELL
Definition WsfNavigationCell.hpp:48
@ EXITING_CELL
Definition WsfNavigationCell.hpp:49
@ NO_RELATIONSHIP
Definition WsfNavigationCell.hpp:47
std::vector< unsigned int > mNeighborIDs
Definition WsfNavigationCell.hpp:105
unsigned int mY
Definition WsfNavigationCell.hpp:100
bool mTessillated
Definition WsfNavigationCell.hpp:101
std::vector< UtLineSegment >::iterator mSideIterator
Definition WsfNavigationCell.hpp:92
CELL_SIDE
Definition WsfNavigationCell.hpp:39
@ SIDE_BC
Definition WsfNavigationCell.hpp:41
@ SIDE_CA
Definition WsfNavigationCell.hpp:42
@ SIDE_AB
Definition WsfNavigationCell.hpp:40
CELL_VERT
Definition WsfNavigationCell.hpp:32
@ VERT_A
Definition WsfNavigationCell.hpp:33
@ VERT_B
Definition WsfNavigationCell.hpp:34
@ VERT_C
Definition WsfNavigationCell.hpp:35
std::map< WsfStringId, WsfStringId > mModifierList
Definition WsfNavigationCell.hpp:104
unsigned int mCellNumber
Definition WsfNavigationCell.hpp:98
std::vector< WsfGeoPoint >::iterator mVertexIterator
Definition WsfNavigationCell.hpp:91
std::vector< WsfNavigationCell * >::iterator mNeighborIterator
Definition WsfNavigationCell.hpp:93
unsigned int mX
Definition WsfNavigationCell.hpp:99
void SetWeight(double aWeight)
Definition WsfNavigationCell.hpp:62
unsigned int mCellID
Definition WsfNavigationCell.hpp:97
double mWeight
Definition WsfNavigationCell.hpp:103
std::vector< UtLineSegment > mSides
Definition WsfNavigationCell.hpp:87
UtVec3d mCellNormal
Definition WsfNavigationCell.hpp:95
WsfNavigationCell()
Definition WsfNavigationCell.cpp:18
Copyrights Multiple, All Rights Reserved