VR-Forces Development_Version 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
vrfmodel
aggregatedMoveAlongController.h
Go to the documentation of this file.
1
/*******************************************************************************
2
** Copyright (c) 2012 MAK Technologies, Inc.
3
** All rights reserved.
4
*******************************************************************************/
5
8
9
#pragma once
10
11
#include "
vrfobjcore/singleTaskControllerComponent.h
"
12
13
class
DtCgf
;
14
class
DtAnalogOutputPort
;
15
class
DtVectorOutputPort
;
16
class
DtVrfAggregateStateRepository
;
17
class
DtAggregatedMoveAlongPSR
;
18
class
DtAggregatedMoveToDescriptor
;
19
class
DtBooleanOutputPort
;
20
24
#include "
vrfmodel/vrfmodelDefines.h
"
25
class
DT_DLL_vrfmodel
DtAggregatedMoveAlongController
:
public
DtSingleTaskControllerComponent
26
{
27
private
:
29
DtAggregatedMoveAlongController
();
31
DtAggregatedMoveAlongController
(
const
DtAggregatedMoveAlongController
& orig);
33
DtAggregatedMoveAlongController
&
operator=
(
34
const
DtAggregatedMoveAlongController
& orig);
35
public
:
37
DtAggregatedMoveAlongController
(
const
DtString
& name,
DtVrfObject
* owner,
38
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
39
DtReaderWriterRegistry
*parentRegistry=0);
40
42
virtual
~
DtAggregatedMoveAlongController
();
43
45
virtual
bool
init
();
46
48
virtual
const
char
*
type
()
const
;
49
53
virtual
void
preFirstTickInit
();
54
56
virtual
void
tick
();
57
61
static
void
routeChangedCallback(
DtVrfObject
* obj,
void
* usr);
62
virtual
void
processRouteChanged(
DtVrfObject
* obj);
63
65
virtual
void
registerTaskMsgCallbacks
();
66
67
static
void
moveAlongCallback(
DtSimMessage
* msg,
void
* usr,
DtSimTaskStatePtr
taskStatePtr);
68
static
void
moveAlongRetrogradeCallback(
DtSimMessage
* msg,
void
* usr,
DtSimTaskStatePtr
taskStatePtr);
69
77
virtual
bool
setupRoute();
78
85
virtual
bool
setupDestination();
86
88
virtual
double
findDesiredSpeed();
89
95
virtual
void
stop();
96
98
static
void
objectAddedCb(
DtVrfObject
* vrfObject,
void
* usr);
99
101
static
DtSimComponent
* creator(
const
DtString
& name,
DtVrfObject
* owner,
102
DtSimManager
* simManager,
DtComponentDescriptor
* desc=0,
103
DtReaderWriterRegistry
* parentRegistry=0);
104
106
virtual
bool
createPorts
();
107
109
virtual
bool
createPortGroups
();
110
116
virtual
bool
createPSR();
117
121
virtual
void
doMoving();
122
128
virtual
double
findDesiredHeading(
DtVector
& dest);
129
131
//virtual bool destinationIsInsideObstruction(
133
136
//virtual bool decideToGiveUpTask() const;
137
138
protected
:
139
virtual
void
processMoveAlong(
const
DtTaskMessage
& msg,
DtSimTaskStatePtr
taskStatePtr);
140
virtual
void
processMoveAlongRetrograde(
const
DtTaskMessage
& msg,
DtSimTaskStatePtr
taskStatePtr);
141
145
//virtual void buildLocalRoute();
146
149
virtual
void
emptyVertexList();
150
154
virtual
void
processObjectAdded(
DtVrfObject
* vrfObject);
155
158
virtual
void
clearTask
();
159
161
virtual
void
moveToDestination();
162
164
virtual
void
invalidateDestinationVector()
const
;
165
169
virtual
double
distanceToDestination()
const
;
170
179
virtual
bool
atDestination();
180
187
virtual
bool
passedDestination();
188
197
virtual
bool
getDestination(
DtVector
& destination);
198
203
virtual
const
DtVector
& destinationVector()
const
;
204
213
virtual
void
setupDestinationVector()
const
;
214
219
virtual
double
atDistance()
const
;
220
226
virtual
bool
stayOnRoute()
const
;
227
232
virtual
double
minCorrectionDistance()
const
;
233
241
virtual
double
maxCorrectionDistance()
const
;
242
246
virtual
double
correctionAngle(
const
double
distanceFromLine)
const
;
247
256
virtual
void
computePointToSegmentGeometry(
257
const
DtVector
& localPoint,
258
const
DtVector
& localLinePt1,
const
DtVector
& localLinePt2,
259
const
Coordinate_System
& coordinateSystemRef,
260
double
& r,
bool
&leftSide,
double
&distanceToSegment);
261
265
virtual
bool
getCurrentRouteSegment(
DtVector
& routeSegmentStart,
266
DtVector
& routeSegmentEnd)
const
;
267
268
DtSimTaskStatePtr
currentTaskState
()
const
;
269
270
protected
:
271
274
DtOutputPortGroup
*
myMovementControlPortGroup
;
279
DtAnalogOutputPort
*
mySpeedPort
;
280
285
DtAnalogOutputPort
*
myMovementDirectionPort
;
286
292
DtVectorOutputPort
*
myDestinationOutputPort
;
293
294
DtVrfAggregateStateRepository
*
myTrueAggregateRepository
;
295
298
DtAggregatedMoveAlongPSR
*
myProcessState
;
299
302
bool
myRouteHasChanged
;
303
bool
myResetVertex
;
304
305
int
myPreviousVertex
;
306
307
bool
myAtDestination
;
308
bool
myPassedDestination
;
309
310
double
myDistanceSquared
;
311
DtVector
myLocalDestination
;
312
DtVector
myWorldDestination
;
313
double
myCurrentSpeed
;
314
mutable
bool
myDestinationVectorIsValid
;
315
mutable
DtVector
myDestinationVector
;
316
double
myUnitRadius
;
317
318
DtAggregatedMoveToDescriptor
*
myAggregatedMoveToDescriptor
;
319
DtBooleanOutputPort
*
myRetrogradeOutputPort
;
320
};
Document ID: Generated on Tue Mar 8 22:13:38 EST 2016 from SVN revision 162938
Copyright © 2005-2015 VT MÄK. All Rights Reserved (
www.mak.com
)