VR-Forces 4.10 Class Documentation
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
disaggregatedFormationController.h
Go to the documentation of this file.
1 /*******************************************************************************
2 ** Copyright (c) 1999 MAK Technologies, Inc.
3 ** All rights reserved.
4 *******************************************************************************/
5 
8 
12 
13 #pragma once
14 
15 #include <vlutil/vlConfig.h>
16 #include <vector>
17 
20 
22 class DtSimMessage;
23 class DtFormationState;
26 class DtFormation;
28 class DtSetDataRequest;
29 class DtSetDataManager;
30 class DtFormationPSR;
33 
63 {
64 private:
71 
72 public:
73 
77  DtVrfObject* owner,
78  DtSimManager* simManager,
79  DtComponentDescriptor* desc = 0,
80  DtReaderWriterRegistry* parentRegistry = 0);
81 
83 
90  virtual bool init();
91 
94  virtual void tick();
95 
98  virtual const char* type() const;
99 
110  virtual void setRadio(DtSimRadio * radio);
111 
117  static void setFormationCallback(DtSimMessage * msg, void * usr);
118 
124  static void setFormationTypeCallback(DtSimMessage * msg, void * usr);
125 
131  static void setHeadingCallback(DtSimMessage * msg, void * usr);
132 
138  static void setLocationCallback(DtSimMessage * msg, void * usr);
139 
145  static void snapIntoFormationCallback(DtSimMessage * msg, void * usr);
146 
152  static void subordinatesChangedCallback(const DtUUID& superior, const DtUUID& subordinate, void* usr);
153 
159  static void nodeAddedCallback(const DtUUID& subordinate, void* userData);
160  virtual void processNodeAddedCallback(const DtUUID& subordinate);
161 
163  virtual void enable();
164 
166  virtual void disable();
167 
168 public:
169 
177  static void onTaskNotifyCallback(const DtSimTask & task,
178  const DtSimComponent &notifier, void* usr);
179 
183  static DtSimComponent * creator(const DtString& name,
184  DtVrfObject* owner,
185  DtSimManager* simManager,
186  DtComponentDescriptor* desc = 0,
187  DtReaderWriterRegistry* parentRegistry = 0);
188 
189 protected:
190 
194  virtual bool formationUpdateIsNeeded() const;
195 
201  virtual void processSetFormation(DtSimMessage * msg);
202 
209  virtual void processSetFormationType(DtSimMessage * msg);
210 
216  virtual void processSetHeading(DtSimMessage * msg);
217 
223  virtual void processSetLocation(DtSimMessage * msg);
224 
229  virtual void processSnapIntoFormation(DtSimMessage * msg);
230 
239  virtual void processSubordinatesChanged(const DtUUID& superior, const DtUUID& subordinate);
240 
259  virtual void snapIntoFormation(const DtString& formation,
260  const DtVector& location, double heading, bool applyHeading);
261 
270  virtual void getCurrentFormation(DtFormation& formation);
271 
277  virtual DtOrgViewManagedObjectListConstPtr generateListOfSubordinatesEligibleForFormation();
278 
284  virtual std::list<int> generateFormationPositions(DtOrgViewManagedObjectListConstPtr& entityInFormation);
285 
288  virtual int findPositionInVector(const std::vector<DtEntityIdentifier> subordinateList,
289  const DtEntityIdentifier& entityId) const;
290 
302  virtual void generateFormationAtPositionAndOrientation(const DtVector& geocentricOrigin,
303  const DtTaitBryan& geocentricOrientation, std::vector<DtVector> geocentricPositions,
304  DtFormation& formation);
305 
310  virtual void generateWorkingFormation(DtFormation& formation);
311 
314  virtual void updateFormationState();
315 
317  virtual void registerWithOrgManager();
318 
320  virtual void unregisterWithOrgManager();
321 
326  virtual void sendRequestToSelf(const DtSetDataRequest& request) const;
327 
334  virtual void sendRequestToSubordinate(const DtSetDataRequest& request,
335  const DtUUID& subordinate) const;
336 
342  virtual bool createPSR();
343 
352  virtual void processOnTaskNotifyCallback(const DtSimTask & task,
353  const DtSimComponent &notifier);
354 
355  static void requestAvailableFormationsCallback(const DtVrfObjectMessage* msg, void* usr);
356  virtual void processRequestAvailableFormations(const DtVrfObjectMessage* msg);
357 
360  virtual void addSetDataCallbacks();
361 
364  void removeSetDataCallbacks();
365 
366 protected:
367 
370 
374 
378 
385 
389 
393 
397 
403 
406 
408 
411 };
412 
417 {
418 private:
425 
426 public:
427 
431  DtVrfObject* owner,
432  DtSimManager* simManager,
433  DtComponentDescriptor* desc = 0,
434  DtReaderWriterRegistry* parentRegistry = 0);
435 
437 
440  virtual const char* type() const;
441 
442 
445  virtual void addSetDataCallbacks();
446 
449  void removeSetDataCallbacks();
450 
454  static DtSimComponent * creator(const DtString& name,
455  DtVrfObject* owner,
456  DtSimManager* simManager,
457  DtComponentDescriptor* desc = 0,
458  DtReaderWriterRegistry* parentRegistry = 0);
459 };
UUID is a unique ID wrapper class.
Definition: rwUUID.h:222
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Description: Objects may contain a collection of other objects, such as overlays or pseudo-aggregate ...
Definition: subordinateManager.h:45
const DtFormationControllerDescriptor * myFormationControllerDescriptor
Descriptor used to configure this component.
Definition: disaggregatedFormationController.h:369
DtVrfObject is used to represent any type of simulated object (entities, aggregate, control objects) in a VR-Forces application.
Definition: vrfObject.h:215
Definition: organizationManagerNode.h:64
Definition: formationState.h:38
bool myRegisteredWithOrgManager
Flag used to indicate if the subordinateOrderChangedCallback() has been registered with the aggregate...
Definition: disaggregatedFormationController.h:384
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
class DtSimRadio:
Definition: simRadio.h:25
DtBoost::shared_ptr< const DtOrgViewManagedObjectList > DtOrgViewManagedObjectListConstPtr
Typedef for a shared pointer to a const DtOrgViewManagedObjectList.
Definition: orgViewManagedObjectList.h:34
virtual void setRadio(DtSimRadio *radio)
virtual const char * type() const =0
This returns a string from compTypes.h, and identifies the type of component.
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:42
DtFormationControllerDescriptor; descriptor for the DtDisaggregatedFormationController component...
Definition: formationControllerDescriptor.h:24
Definition: readerWriterRegistry.h:39
const DtAggregateObjectParameters * myAggregateParameters
Convenience pointer to the aggregate parameters for this entity.
Definition: disaggregatedFormationController.h:410
Instances of DtFormation are a list of DtFormationEntry objects which make up an aggregate formation...
Definition: formation.h:26
Class DtAggregateFormationController is a controller that manages the formation state for an aggregat...
Definition: disaggregatedFormationController.h:62
virtual void addSetDataCallbacks()
Add set data request callbacks.
virtual bool init()
Calls setRadio()
virtual void disable()
virtual const char * type() const
Returns a string identifies the class type of component.
static DtSimComponent * creator(const DtString &name, DtVrfObject *owner, DtSimManager *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
void removeSetDataCallbacks()
Callbacks are removed when component is disabled or destroyed.
DtVrfAggregateStateRepository * myAggregateStateRepository
Pointer to aggregate&#39;s state repository, cached in this class for convenience.
Definition: disaggregatedFormationController.h:373
DtDisaggregatedFormationController & operator=(const DtDisaggregatedFormationController &orig)
assignment operator - not implemented
bool myRegisteredForAddNodeCallback
Definition: disaggregatedFormationController.h:407
DtSetDataRequest is an abstract base class from which real setDataRequests can derive.
Definition: setDataRequest.h:40
virtual void enable()
Is this component enabled or not.
File: simMsg.h.
Definition: simMessage.h:35
virtual void tick()
This gives the thread of control to the component.
The base class for all messages to/from a specific DtVrfObject.
Definition: vrfObjectMessage.h:30
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:29
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:67
DtFormationState * myFormationState
Pointer to aggregate&#39;s formation state repository, cached in this for convenience.
Definition: disaggregatedFormationController.h:377
bool myFormationCallbacksAreDisabled
Flag used to indicate if formation-related callbacks are disabled (not registered).
Definition: disaggregatedFormationController.h:402
This class manages the distribution of DtSetDataRequests within a single DtVrfObject.
Definition: setDataManager.h:37
DtSimTask is an abstract base class from which real tasks can derive.
Definition: simTask.h:31
bool myFirstTick
Flag used to indicate first non-zero dT() tick.
Definition: disaggregatedFormationController.h:405
DtCompatibilityRadio * myCommandChannelRadio
Pointer to aggregate&#39;s command radio, cached in this class for convenience.
Definition: disaggregatedFormationController.h:388
The simulation engine is controlled by a single,top-level class called the Simulation Manager...
Definition: simManager.h:103
DtSetDataManager * mySetDataManager
Pointer to aggregate&#39;s DtSetDataManager, cached in this class for convenience.
Definition: disaggregatedFormationController.h:392
void processSetLocation(DtSetDataRequest *set, const DtVertexList &vertices, double position, DtMoveAlongRouteTimeEstimator *est)
These functions handle the standard sets that can affect the time estimates.
Definition: vrfAggregateStateRepository.h:22
Contains the set of readable/writeable parameters associated with a pseudo-aggregate entities...
Definition: aggregateObjectParameters.h:29
DtCompatibilityRadio.
Definition: compatibilityRadio.h:30
class DtFormationPSR:
Definition: formationPSR.h:27
DtFormationPSR * myProcessState
Container for state data associated with this component.
Definition: disaggregatedFormationController.h:396
Specialized aggregate formation controller for convoys that will only register for the setting of loc...
Definition: disaggregatedFormationController.h:416

Document ID: Generated on Tue Sep 21 17:42:52 EDT 2021 from SVN revision 234861
Copyright © 2005-2021 MAK Technologies. All Rights Reserved (www.mak.com)