VR-Forces 4.3.1 Class Documentation
Home
Modules
Namespaces
Classes
Files
Examples
Behavior Models
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
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
128
bool
operator==
(
const
DtLocation3D
&)
const
;
129
bool
operator!=
(
const
DtLocation3D
& orig)
const
130
{
131
return
!(*
this
== orig);
132
}
133
protected
:
137
DtGeodeticCoord
myGeodLocation
;
138
};
139
140
DT_DEFINE_OBJECT_DEBUGGER_NAME
(
DtLocation3D
);
141
142
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream& stream,
const
DtLocation3D
& loc);
143
149
class
DT_DLL_vrfutil
DtVector3D
150
:
public
DtAsciiSerializable
151
,
public
DtObjectDebugger
<DtVector3D>
152
{
153
public
:
156
158
DtVector3D
();
159
DtVector3D
(
const
DtVector
&vect);
160
DtVector3D
(
const
DtVector3D
&vect);
161
~
DtVector3D
();
162
DtVector3D
& operator=(
const
DtVector3D
& orig);
163
DtVector
nedVector()
const
;
164
166
DtVector3D
(
const
double
north,
const
double
east,
const
double
down);
167
171
void
setFromGeocentricVector(
const
DtVector
&geocVec,
DtLocation3D
& origin);
172
176
DtVector3D
makeCopy()
const
;
177
178
//-------------------------------------------
181
183
DtString
objectType
()
const
;
184
186
DtString
serialize
();
187
190
bool
deserialize
(
const
DtString
& data);
191
193
static
DtAsciiSerializable
* creator();
195
//--------------------------------------------
196
198
void
setNorthEastDown(
const
double
north,
const
double
east,
199
const
double
down);
203
void
setBearingInclRange(
const
double
bearing,
const
double
inclination,
204
const
double
range);
205
210
double
getBearing(
void
)
const
;
212
double
getInclination(
void
)
const
;
214
double
getRange(
void
)
const
;
216
217
double
getNorth(
void
)
const
;
219
double
getEast(
void
)
const
;
221
double
getDown(
void
)
const
;
224
227
DtVector3D
getScaled(
const
double
scale)
const
;
228
DtVector3D
getNegated(
void
)
const
;
229
DtVector3D
getUnit(
void
)
const
;
230
232
DtVector3D
addVector3D(
const
DtVector3D
&vec)
const
;
233
235
DtVector3D
crossVector3D(
const
DtVector3D
&vec)
const
;
236
238
double
dotVector3D(
const
DtVector3D
&vec)
const
;
239
243
DtVector3D
addOffset(
const
DtVectorOffset3D
& offset)
const
;
244
248
double
headingDiff(
const
DtVector3D
&vec)
const
;
249
252
DtVectorGeoc3D
makeVectorGeoc3DAtLoc(
const
DtLocation3D
&loc)
const
;
253
254
bool
operator==
(
const
DtVector3D
&)
const
;
255
bool
operator!=
(
const
DtVector3D
& orig)
const
256
{
257
return
!(*
this
== orig);
258
}
259
260
protected
:
262
DtVector
myNEDVector
;
263
};
264
265
DT_DEFINE_OBJECT_DEBUGGER_NAME
(
DtVector3D
);
266
267
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream& stream,
const
DtVector3D
& vec);
268
275
class
DT_DLL_vrfutil
DtVector2D
276
:
public
DtVector3D
277
,
public
DtObjectDebugger
<DtVector2D>
278
{
279
public
:
282
286
DtVector2D
();
287
DtVector2D
(
const
DtVector
&vect);
288
DtVector2D
(
const
DtVector3D
&vect);
289
~
DtVector2D
();
290
DtVector2D
&
operator=
(
const
DtVector3D
& orig);
291
293
DtVector2D
(
const
double
north,
const
double
east);
294
296
DtString
objectType
()
const
;
297
299
static
DtAsciiSerializable
*
creator
();
300
301
void
setNorth(
const
double
north);
302
void
setEast(
const
double
east);
303
305
DtVector2D
addVector2D(
const
DtVector3D
& vec);
306
308
double
crossVector2D(
const
DtVector3D
&vec);
309
311
double
dotVector2D(
const
DtVector3D
&vec);
312
314
DtVector2D
addOffset2D(
const
DtVectorOffset3D
&vec);
315
316
bool
operator==
(
const
DtVector2D
&)
const
;
317
bool
operator!=
(
const
DtVector2D
& orig)
const
318
{
319
return
!(*
this
== orig);
320
}
321
};
322
323
DT_DEFINE_OBJECT_DEBUGGER_NAME
(
DtVector2D
);
324
325
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream& stream,
const
DtVector2D
& vec);
326
327
331
class
DT_DLL_vrfutil
DtVectorGeoc3D
332
:
public
DtAsciiSerializable
333
,
public
DtObjectDebugger
<DtVectorGeoc3D>
334
{
335
public
:
336
DtVectorGeoc3D
(
const
DtVector
&vect);
337
DtVectorGeoc3D
(
const
DtVectorGeoc3D
& orig);
338
~
DtVectorGeoc3D
();
339
DtVectorGeoc3D
& operator=(
const
DtVectorGeoc3D
& orig);
340
341
DtVector
geocVector()
const
;
342
343
//-------------------------------------------
346
348
DtString
objectType
()
const
;
349
351
DtString
serialize
();
352
355
bool
deserialize
(
const
DtString
& data);
356
358
static
DtAsciiSerializable
* creator();
360
//--------------------------------------------
361
365
DtVectorGeoc3D
makeCopy()
const
;
366
369
DtVector3D
makeVector3DAtLoc(
const
DtLocation3D
loc)
const
;
370
373
DtVectorGeoc3D
getScaled(
const
double
scale)
const
;
374
DtVectorGeoc3D
getNegated(
void
)
const
;
375
DtVectorGeoc3D
getUnit(
void
)
const
;
377
379
DtVectorGeoc3D
crossVectorGeoc3D(
const
DtVectorGeoc3D
&vec)
const
;
380
382
double
dotVectorGeoc3D(
const
DtVectorGeoc3D
&vec)
const
;
383
384
386
double
getLength()
const
;
387
388
bool
operator==
(
const
DtVectorGeoc3D
&)
const
;
389
bool
operator!=
(
const
DtVectorGeoc3D
& orig)
const
390
{
391
return
!(*
this
== orig);
392
}
393
394
protected
:
395
DtVector
myGeocVector
;
396
};
397
398
DT_DEFINE_OBJECT_DEBUGGER_NAME
(
DtVectorGeoc3D
);
399
400
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream& stream,
const
DtVectorGeoc3D
& vec);
401
409
410
class
DT_DLL_vrfutil
DtVectorOffset3D
411
:
public
DtAsciiSerializable
412
,
public
DtObjectDebugger
<DtVectorOffset3D>
413
{
414
public
:
415
DtVectorOffset3D
();
416
419
DtVectorOffset3D
(
const
DtVector
&vect);
420
DtVectorOffset3D
(
const
DtVectorOffset3D
&orig);
421
~
DtVectorOffset3D
();
422
DtVectorOffset3D
& operator=(
const
DtVectorOffset3D
& orig);
423
425
DtVectorOffset3D
(
double
right,
double
forward,
double
up);
426
429
void
setFromBodyVector(
const
DtVector
&vect);
430
434
DtVectorOffset3D
makeCopy()
const
;
435
436
//-------------------------------------------
439
441
DtString
objectType
()
const
;
442
444
DtString
serialize
();
445
448
bool
deserialize
(
const
DtString
& data);
449
451
static
DtAsciiSerializable
* creator();
453
//--------------------------------------------
454
457
double
getRight(
void
)
const
;
458
void
setRight(
const
double
right);
459
double
getForward(
void
)
const
;
460
void
setForward(
const
double
forward);
461
double
getUp(
void
)
const
;
462
void
setUp(
const
double
up);
464
467
DtVectorOffset3D
getScaled(
const
double
scale)
const
;
468
DtVectorOffset3D
getNegated(
void
)
const
;
469
DtVectorOffset3D
getUnit(
void
)
const
;
471
473
DtVectorOffset3D
addOffset(
const
DtVectorOffset3D
offset)
const
;
474
476
DtVectorOffset3D
crossVectorOffset3D(
const
DtVectorOffset3D
&vec)
const
;
477
479
double
dotVectorOffset3D(
const
DtVectorOffset3D
&vec)
const
;
480
484
DtVector3D
makeVectorRefToDirection(
const
DtVector3D
dirVect)
const
;
485
486
DtVector
vector()
const
;
487
488
bool
operator==
(
const
DtVectorOffset3D
&)
const
;
489
bool
operator!=
(
const
DtVectorOffset3D
& orig)
const
490
{
491
return
!(*
this
== orig);
492
}
493
protected
:
495
DtVector
myVector
;
496
};
497
498
DT_DEFINE_OBJECT_DEBUGGER_NAME
(
DtVectorOffset3D
);
499
500
DT_DLL_vrfutil
std::ostream&
operator<<
(std::ostream& stream,
const
DtVectorOffset3D
& vec);
501
Document ID: Generated on Wed Jul 29 00:55:00 EDT 2015 from SVN revision 155257
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)