VR-Forces 4.2 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
include
vrfutil
scriptGeometry.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2012 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
#pragma once
6
7
#include <
vrfutil/vrfutilDefines.h
>
8
#include <matrix/vlVector.h>
9
#include <
vrfutil/asciiSerializable.h
>
10
#include <matrix/geodCoord.h>
11
16
17
class
DtVectorGeoc3D
;
18
class
DtVector3D
;
19
class
DtVectorOffset3D
;
20
22
class
DT_DLL_vrfutil
DtLocation3D
:
public
DtAsciiSerializable
23
{
24
public
:
27
30
DtLocation3D
(
const
DtVector
&vect);
31
DtLocation3D
(
const
DtGeodeticCoord &geodCoord);
32
DtLocation3D
(
const
DtLocation3D
& orig);
33
DtLocation3D
();
34
~
DtLocation3D
();
35
DtLocation3D
& operator=(
const
DtLocation3D
& orig);
36
38
DtLocation3D
(
const
double
latitude,
const
double
longitude,
39
const
double
altitudeMSL);
40
44
DtLocation3D
makeCopy()
const
;
45
46
//-------------------------------------------
49
51
DtString
objectType
()
const
;
52
54
DtString
serialize
();
55
58
bool
deserialize
(
const
DtString
& data);
59
61
static
DtAsciiSerializable
* creator();
63
//--------------------------------------------
64
69
DtVector
getGeocentric()
const
;
70
DtGeodeticCoord geodLocation()
const
;
71
77
void
setGeodeticFromVector(
const
DtVector
& geodeticData);
78
DtVector
getGeodeticVector(
void
)
const
;
79
83
double
getLat()
const
;
84
void
setLat(
const
double
lat);
85
double
getLon()
const
;
86
void
setLon(
const
double
lon);
87
double
getAlt()
const
;
88
void
setAlt(
const
double
alt);
90
92
double
distanceToLocation3D(
const
DtLocation3D
&location)
const
;
93
94
bool
isNearLocation3D(
const
DtLocation3D
&loc,
const
double
error
)
const
;
95
99
bool
isInsidePolygon(
const
std::vector<DtLocation3D> polyPoints)
const
;
100
104
bool
isLeftOfLine(
const
DtLocation3D
&loc1,
const
DtLocation3D
& loc2)
const
;
105
109
114
DtVector3D
vectorToLoc3D(
const
DtLocation3D
&location)
const
;
115
117
DtVectorGeoc3D
vectorGeocToLoc3D(
const
DtLocation3D
&location)
const
;
118
120
DtLocation3D
addVector3D(
const
DtVector3D
&vec)
const
;
121
124
DtLocation3D
addVectorGeoc3D(
const
DtVectorGeoc3D
&vec)
const
;
125
protected
:
129
DtGeodeticCoord
myGeodLocation
;
130
};
131
132
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream& stream,
const
DtLocation3D
& loc);
133
139
class
DT_DLL_vrfutil
DtVector3D
:
public
DtAsciiSerializable
140
{
141
public
:
144
146
DtVector3D
();
147
DtVector3D
(
const
DtVector
&vect);
148
DtVector3D
(
const
DtVector3D
&vect);
149
~
DtVector3D
();
150
DtVector3D
& operator=(
const
DtVector3D
& orig);
151
DtVector
nedVector()
const
;
152
154
DtVector3D
(
const
double
north,
const
double
east,
const
double
down);
155
159
void
setFromGeocentricVector(
const
DtVector
&geocVec,
DtLocation3D
& origin);
160
164
DtVector3D
makeCopy()
const
;
165
166
//-------------------------------------------
169
171
DtString
objectType
()
const
;
172
174
DtString
serialize
();
175
178
bool
deserialize
(
const
DtString
& data);
179
181
static
DtAsciiSerializable
* creator();
183
//--------------------------------------------
184
186
void
setNorthEastDown(
const
double
north,
const
double
east,
187
const
double
down);
191
void
setBearingInclRange(
const
double
bearing,
const
double
inclination,
192
const
double
range);
193
198
double
getBearing(
void
)
const
;
200
double
getInclination(
void
)
const
;
202
double
getRange(
void
)
const
;
204
205
double
getNorth(
void
)
const
;
207
double
getEast(
void
)
const
;
209
double
getDown(
void
)
const
;
212
215
DtVector3D
getScaled(
const
double
scale)
const
;
216
DtVector3D
getNegated(
void
)
const
;
217
DtVector3D
getUnit(
void
)
const
;
218
220
DtVector3D
addVector3D(
const
DtVector3D
&vec)
const
;
221
223
DtVector3D
crossVector3D(
const
DtVector3D
&vec)
const
;
224
226
double
dotVector3D(
const
DtVector3D
&vec)
const
;
227
231
DtVector3D
addOffset(
const
DtVectorOffset3D
& offset)
const
;
232
236
double
headingDiff(
const
DtVector3D
&vec)
const
;
237
240
DtVectorGeoc3D
makeVectorGeoc3DAtLoc(
const
DtLocation3D
&loc)
const
;
241
242
protected
:
244
DtVector
myNEDVector
;
245
};
246
247
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream& stream,
const
DtVector3D
& vec);
248
255
class
DT_DLL_vrfutil
DtVector2D
:
public
DtVector3D
256
{
257
public
:
260
264
DtVector2D
();
265
DtVector2D
(
const
DtVector
&vect);
266
DtVector2D
(
const
DtVector3D
&vect);
267
~
DtVector2D
();
268
DtVector2D
&
operator=
(
const
DtVector3D
& orig);
269
271
DtVector2D
(
const
double
north,
const
double
east);
272
274
DtString
objectType
()
const
;
275
277
static
DtAsciiSerializable
*
creator
();
278
279
void
setNorth(
const
double
north);
280
void
setEast(
const
double
east);
281
283
DtVector2D
addVector2D(
const
DtVector3D
& vec);
284
286
double
crossVector2D(
const
DtVector3D
&vec);
287
289
double
dotVector2D(
const
DtVector3D
&vec);
290
292
DtVector2D
addOffset2D(
const
DtVectorOffset3D
&vec);
293
};
294
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream& stream,
const
DtVector2D
& vec);
295
296
300
class
DT_DLL_vrfutil
DtVectorGeoc3D
:
public
DtAsciiSerializable
301
{
302
public
:
303
DtVectorGeoc3D
(
const
DtVector
&vect);
304
DtVectorGeoc3D
(
const
DtVectorGeoc3D
& orig);
305
~
DtVectorGeoc3D
();
306
DtVectorGeoc3D
& operator=(
const
DtVectorGeoc3D
& orig);
307
308
DtVector
geocVector()
const
;
309
310
//-------------------------------------------
313
315
DtString
objectType
()
const
;
316
318
DtString
serialize
();
319
322
bool
deserialize
(
const
DtString
& data);
323
325
static
DtAsciiSerializable
* creator();
327
//--------------------------------------------
328
332
DtVectorGeoc3D
makeCopy()
const
;
333
336
DtVector3D
makeVector3DAtLoc(
const
DtLocation3D
loc)
const
;
337
340
DtVectorGeoc3D
getScaled(
const
double
scale)
const
;
341
DtVectorGeoc3D
getNegated(
void
)
const
;
342
DtVectorGeoc3D
getUnit(
void
)
const
;
344
346
DtVectorGeoc3D
crossVectorGeoc3D(
const
DtVectorGeoc3D
&vec)
const
;
347
349
double
dotVectorGeoc3D(
const
DtVectorGeoc3D
&vec)
const
;
350
351
353
double
getLength()
const
;
354
355
protected
:
356
DtVector
myGeocVector
;
357
};
358
359
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream& stream,
const
DtVectorGeoc3D
& vec);
367
368
class
DT_DLL_vrfutil
DtVectorOffset3D
:
public
DtAsciiSerializable
369
{
370
public
:
371
DtVectorOffset3D
();
372
375
DtVectorOffset3D
(
const
DtVector
&vect);
376
DtVectorOffset3D
(
const
DtVectorOffset3D
&orig);
377
~
DtVectorOffset3D
();
378
DtVectorOffset3D
& operator=(
const
DtVectorOffset3D
& orig);
379
381
DtVectorOffset3D
(
double
right,
double
forward,
double
up);
382
385
void
setFromBodyVector(
const
DtVector
&vect);
386
390
DtVectorOffset3D
makeCopy()
const
;
391
392
//-------------------------------------------
395
397
DtString
objectType
()
const
;
398
400
DtString
serialize
();
401
404
bool
deserialize
(
const
DtString
& data);
405
407
static
DtAsciiSerializable
* creator();
409
//--------------------------------------------
410
413
double
getRight(
void
)
const
;
414
void
setRight(
const
double
right);
415
double
getForward(
void
)
const
;
416
void
setForward(
const
double
forward);
417
double
getUp(
void
)
const
;
418
void
setUp(
const
double
up);
420
423
DtVectorOffset3D
getScaled(
const
double
scale)
const
;
424
DtVectorOffset3D
getNegated(
void
)
const
;
425
DtVectorOffset3D
getUnit(
void
)
const
;
427
429
DtVectorOffset3D
addOffset(
const
DtVectorOffset3D
offset)
const
;
430
432
DtVectorOffset3D
crossVectorOffset3D(
const
DtVectorOffset3D
&vec)
const
;
433
435
double
dotVectorOffset3D(
const
DtVectorOffset3D
&vec)
const
;
436
440
DtVector3D
makeVectorRefToDirection(
const
DtVector3D
dirVect)
const
;
441
442
DtVector
vector()
const
;
443
protected
:
445
DtVector
myVector
;
446
};
447
448
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream& stream,
const
DtVectorOffset3D
& vec);
449
Document ID: Generated on Sun Nov 24 19:49:21 EST 2013 from SVN revision 133924
Copyright © 2005-2013 VT MÄK. All Rights Reserved (
www.mak.com
)