VR-Forces 4.6.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
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/geodeticCoord.h>
11
16
17
class
DtVectorGeoc3D
;
18
class
DtVector3D
;
19
class
DtVectorOffset3D
;
20
22
class
DT_DLL_vrfutil
DtLocation3D
23
:
public
DtAsciiSerializable
24
,
public
DtObjectDebugger
<DtLocation3D>
25
{
26
public
:
29
32
DtLocation3D
(
const
DtVector
&vect);
33
DtLocation3D
(
const
DtGeodeticCoord &geodCoord);
34
DtLocation3D
(
const
DtLocation3D
& orig);
35
DtLocation3D
();
36
~
DtLocation3D
();
37
DtLocation3D
& operator=(
const
DtLocation3D
& orig);
38
40
DtLocation3D
(
const
double
latitude,
const
double
longitude,
41
const
double
altitudeMSL);
42
46
DtLocation3D
makeCopy()
const
;
47
48
//-------------------------------------------
51
53
DtString
objectType
()
const
;
54
56
DtString
serialize
();
57
60
bool
deserialize
(
const
DtString
& data);
61
63
static
DtAsciiSerializable
* creator();
65
//--------------------------------------------
66
71
DtVector
getGeocentric()
const
;
72
DtGeodeticCoord geodLocation()
const
;
73
79
void
setGeodeticFromVector(
const
DtVector
& geodeticData);
80
DtVector
getGeodeticVector(
void
)
const
;
81
85
double
getLat()
const
;
86
void
setLat(
const
double
lat);
87
double
getLon()
const
;
88
void
setLon(
const
double
lon);
89
double
getAlt()
const
;
90
void
setAlt(
const
double
alt);
92
94
double
distanceToLocation3D(
const
DtLocation3D
&location)
const
;
95
96
bool
isNearLocation3D(
const
DtLocation3D
&loc,
const
double
error
)
const
;
97
101
bool
isInsidePolygon(
const
std::vector<DtLocation3D> polyPoints)
const
;
102
106
bool
isLeftOfLine(
const
DtLocation3D
&loc1,
const
DtLocation3D
& loc2)
const
;
107
111
116
DtVector3D
vectorToLoc3D(
const
DtLocation3D
&location)
const
;
117
119
DtVectorGeoc3D
vectorGeocToLoc3D(
const
DtLocation3D
&location)
const
;
120
122
DtLocation3D
addVector3D(
const
DtVector3D
&vec)
const
;
123
126
DtLocation3D
addVectorGeoc3D(
const
DtVectorGeoc3D
&vec)
const
;
127
129
void
setGeocentric(
double
x,
double
y,
double
z);
130
132
void
getGeocentricCoords(
double
& x,
double
& y,
double
& z)
const
;
133
134
bool
operator==
(
const
DtLocation3D
&)
const
;
135
bool
operator!=
(
const
DtLocation3D
& orig)
const
136
{
137
return
!(*
this
== orig);
138
}
139
protected
:
143
DtGeodeticCoord
myGeodLocation
;
144
};
145
146
DT_DEFINE_OBJECT_DEBUGGER_NAME
(
DtLocation3D
);
147
148
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream&
stream
,
const
DtLocation3D
& loc);
149
155
class
DT_DLL_vrfutil
DtVector3D
156
:
public
DtAsciiSerializable
157
,
public
DtObjectDebugger
<DtVector3D>
158
{
159
public
:
162
164
DtVector3D
();
165
DtVector3D
(
const
DtVector
&vect);
166
DtVector3D
(
const
DtVector3D
&vect);
167
~
DtVector3D
();
168
DtVector3D
& operator=(
const
DtVector3D
& orig);
169
DtVector
nedVector()
const
;
170
172
DtVector3D
(
const
double
north,
const
double
east,
const
double
down);
173
177
void
setFromGeocentricVector(
const
DtVector
&geocVec,
DtLocation3D
&
origin
);
178
182
DtVector3D
makeCopy()
const
;
183
184
//-------------------------------------------
187
189
DtString
objectType
()
const
;
190
192
DtString
serialize
();
193
196
bool
deserialize
(
const
DtString
& data);
197
199
static
DtAsciiSerializable
* creator();
201
//--------------------------------------------
202
204
void
setNorthEastDown(
const
double
north,
const
double
east,
205
const
double
down);
209
void
setBearingInclRange(
const
double
bearing,
const
double
inclination,
210
const
double
range);
211
216
double
getBearing(
void
)
const
;
218
double
getInclination(
void
)
const
;
220
double
getRange(
void
)
const
;
222
223
double
getNorth(
void
)
const
;
225
double
getEast(
void
)
const
;
227
double
getDown(
void
)
const
;
230
233
DtVector3D
getScaled(
const
double
scale)
const
;
234
DtVector3D
getNegated(
void
)
const
;
235
DtVector3D
getUnit(
void
)
const
;
236
238
DtVector3D
addVector3D(
const
DtVector3D
&vec)
const
;
239
241
DtVector3D
crossVector3D(
const
DtVector3D
&vec)
const
;
242
244
double
dotVector3D(
const
DtVector3D
&vec)
const
;
245
249
DtVector3D
addOffset(
const
DtVectorOffset3D
&
offset
)
const
;
250
254
double
headingDiff(
const
DtVector3D
&vec)
const
;
255
258
DtVectorGeoc3D
makeVectorGeoc3DAtLoc(
const
DtLocation3D
&loc)
const
;
259
260
bool
operator==
(
const
DtVector3D
&)
const
;
261
bool
operator!=
(
const
DtVector3D
& orig)
const
262
{
263
return
!(*
this
== orig);
264
}
265
266
protected
:
268
DtVector
myNEDVector
;
269
};
270
271
DT_DEFINE_OBJECT_DEBUGGER_NAME
(
DtVector3D
);
272
273
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream&
stream
,
const
DtVector3D
& vec);
274
281
class
DT_DLL_vrfutil
DtVector2D
282
:
public
DtVector3D
283
,
public
DtObjectDebugger
<DtVector2D>
284
{
285
public
:
288
292
DtVector2D
();
293
DtVector2D
(
const
DtVector
&vect);
294
DtVector2D
(
const
DtVector3D
&vect);
295
~
DtVector2D
();
296
DtVector2D
&
operator=
(
const
DtVector3D
& orig);
297
299
DtVector2D
(
const
double
north,
const
double
east);
300
302
DtString
objectType
()
const
;
303
305
static
DtAsciiSerializable
*
creator
();
306
307
void
setNorth(
const
double
north);
308
void
setEast(
const
double
east);
309
311
DtVector2D
addVector2D(
const
DtVector3D
& vec);
312
314
double
crossVector2D(
const
DtVector3D
&vec);
315
317
double
dotVector2D(
const
DtVector3D
&vec);
318
320
DtVector2D
addOffset2D(
const
DtVectorOffset3D
&vec);
321
322
bool
operator==
(
const
DtVector2D
&)
const
;
323
bool
operator!=
(
const
DtVector2D
& orig)
const
324
{
325
return
!(*
this
== orig);
326
}
327
};
328
329
DT_DEFINE_OBJECT_DEBUGGER_NAME
(
DtVector2D
);
330
331
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream&
stream
,
const
DtVector2D
& vec);
332
333
337
class
DT_DLL_vrfutil
DtVectorGeoc3D
338
:
public
DtAsciiSerializable
339
,
public
DtObjectDebugger
<DtVectorGeoc3D>
340
{
341
public
:
342
DtVectorGeoc3D
(
const
DtVector
&vect);
343
DtVectorGeoc3D
(
const
DtVectorGeoc3D
& orig);
344
~
DtVectorGeoc3D
();
345
DtVectorGeoc3D
& operator=(
const
DtVectorGeoc3D
& orig);
346
347
DtVector
geocVector()
const
;
348
349
//-------------------------------------------
352
354
DtString
objectType
()
const
;
355
357
DtString
serialize
();
358
361
bool
deserialize
(
const
DtString
& data);
362
364
static
DtAsciiSerializable
* creator();
366
//--------------------------------------------
367
371
DtVectorGeoc3D
makeCopy()
const
;
372
375
DtVector3D
makeVector3DAtLoc(
const
DtLocation3D
loc)
const
;
376
379
DtVectorGeoc3D
getScaled(
const
double
scale)
const
;
380
DtVectorGeoc3D
getNegated(
void
)
const
;
381
DtVectorGeoc3D
getUnit(
void
)
const
;
383
385
DtVectorGeoc3D
crossVectorGeoc3D(
const
DtVectorGeoc3D
&vec)
const
;
386
388
double
dotVectorGeoc3D(
const
DtVectorGeoc3D
&vec)
const
;
389
390
392
double
getLength()
const
;
393
394
bool
operator==
(
const
DtVectorGeoc3D
&)
const
;
395
bool
operator!=
(
const
DtVectorGeoc3D
& orig)
const
396
{
397
return
!(*
this
== orig);
398
}
399
400
protected
:
401
DtVector
myGeocVector
;
402
};
403
404
DT_DEFINE_OBJECT_DEBUGGER_NAME
(
DtVectorGeoc3D
);
405
406
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream&
stream
,
const
DtVectorGeoc3D
& vec);
407
415
416
class
DT_DLL_vrfutil
DtVectorOffset3D
417
:
public
DtAsciiSerializable
418
,
public
DtObjectDebugger
<DtVectorOffset3D>
419
{
420
public
:
421
DtVectorOffset3D
();
422
425
DtVectorOffset3D
(
const
DtVector
&vect);
426
DtVectorOffset3D
(
const
DtVectorOffset3D
&orig);
427
~
DtVectorOffset3D
();
428
DtVectorOffset3D
& operator=(
const
DtVectorOffset3D
& orig);
429
431
DtVectorOffset3D
(
double
right,
double
forward,
double
up);
432
435
void
setFromBodyVector(
const
DtVector
&vect);
436
440
DtVectorOffset3D
makeCopy()
const
;
441
442
//-------------------------------------------
445
447
DtString
objectType
()
const
;
448
450
DtString
serialize
();
451
454
bool
deserialize
(
const
DtString
& data);
455
457
static
DtAsciiSerializable
* creator();
459
//--------------------------------------------
460
463
double
getRight(
void
)
const
;
464
void
setRight(
const
double
right);
465
double
getForward(
void
)
const
;
466
void
setForward(
const
double
forward);
467
double
getUp(
void
)
const
;
468
void
setUp(
const
double
up);
470
473
DtVectorOffset3D
getScaled(
const
double
scale)
const
;
474
DtVectorOffset3D
getNegated(
void
)
const
;
475
DtVectorOffset3D
getUnit(
void
)
const
;
477
479
DtVectorOffset3D
addOffset(
const
DtVectorOffset3D
offset
)
const
;
480
482
DtVectorOffset3D
crossVectorOffset3D(
const
DtVectorOffset3D
&vec)
const
;
483
485
double
dotVectorOffset3D(
const
DtVectorOffset3D
&vec)
const
;
486
490
DtVector3D
makeVectorRefToDirection(
const
DtVector3D
dirVect)
const
;
491
492
DtVector
vector()
const
;
493
494
bool
operator==
(
const
DtVectorOffset3D
&)
const
;
495
bool
operator!=
(
const
DtVectorOffset3D
& orig)
const
496
{
497
return
!(*
this
== orig);
498
}
499
protected
:
501
DtVector
myVector
;
502
};
503
504
DT_DEFINE_OBJECT_DEBUGGER_NAME
(
DtVectorOffset3D
);
505
506
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream&
stream
,
const
DtVectorOffset3D
& vec);
507
Document ID: Generated on Wed Jul 25 16:57:45 EDT 2018 from SVN revision 190790
Copyright © 2005-2018 VT MÄK. All Rights Reserved (
www.mak.com
)