VR-Forces Developer's Guide
 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 
18 #include <vlutil/vlConfig.h>
19 #include <vector>
20 
22 class DtSimMessage;
23 class DtFormationState;
26 class DtFormation;
28 class DtSetDataRequest;
29 class DtSetDataManager;
30 class DtFormationPSR;
35 
66 {
67 private:
74 
75 public:
76 
80  DtLocalObject* owner,
81  DtSimulationServices* simManager,
82  DtComponentDescriptor* desc = 0,
83  DtReaderWriterRegistry* parentRegistry = 0);
84 
85  virtual ~DtDisaggregatedFormationController() override;
86 
93  virtual bool init() override;
94 
97  virtual void tick() override;
98 
101  virtual const char* type() const override;
102 
113  virtual void setRadio(DtSimRadio* radio) override;
114 
120  static void setFormationCallback(DtSimMessage * msg, void * usr);
121 
128  static void setFormationTypeCallback(DtSimMessage * msg, void * usr);
129 
135  static void setHeadingCallback(DtSimMessage * msg, void * usr);
136 
142  static void setLocationCallback(DtSimMessage * msg, void * usr);
143 
149  static void snapIntoFormationCallback(DtSimMessage * msg, void * usr);
150 
152  virtual void enable() override;
153 
155  virtual void disable() override;
156 
157 public:
158 
162  static DtSimComponent * creator(const DtString& name,
163  DtLocalObject* owner,
164  DtSimulationServices* simManager,
165  DtComponentDescriptor* desc = 0,
166  DtReaderWriterRegistry* parentRegistry = 0);
167 
168 protected:
170  virtual void checkForFormationStateUpdate();
171 
175  virtual bool formationUpdateIsNeeded() ;
176 
182  virtual void processSetFormation(DtSimMessage * msg);
183 
191  virtual void processSetFormationType(DtSimMessage * msg);
192 
198  virtual void processSetHeading(DtSimMessage * msg);
199 
205  virtual void processSetLocation(DtSimMessage * msg);
206 
211  virtual void processSnapIntoFormation(DtSimMessage * msg);
212 
221  virtual void processSubordinateAdded(const DtUUID& info);
222  virtual void processSubordinateRemoved(const DtUUID& info);
223  virtual void processDesignatorOrderChanged();
224 
243  virtual void snapIntoFormation(const DtString& formation,
244  const DtVector& location, double heading, bool applyHeading);
245 
261  virtual std::string getCurrentFormation(const DtOrganizedManagedObjectList& subordList,
262  DtFormation& formation);
263 
288  virtual std::vector<int> assignPromotionIdsToSubordinates(
289  std::vector<DtUUID>& subordinateList,
290  DtFormation& formation, const std::string formationName,
291  const bool doPromote = false);
292 
294  virtual std::vector<int> generateFormationIndices(
295  const DtOrganizedManagedObjectList& entityList);
296 
299  virtual int findPositionInVector(const std::vector<DtUUID> subordinateList,
300  const DtUUID& entityId) const;
301 
309  virtual void extendFormation(DtFormation& formation,
310  const std::string formationName, const int size);
311 
323  virtual void generateFormationAtPositionAndOrientation(const DtVector& geocentricOrigin,
324  const DtTaitBryan& geocentricOrientation, std::vector<DtVector> geocentricPositions,
325  DtFormation& formation);
326 
331  virtual void generateWorkingFormation(DtFormation& formation, const DtOrganizedManagedObjectList&);
332 
338  virtual void updateFormationState();
339 
344  virtual void sendRequestToSelf(const DtSetDataRequest& request) const;
345 
352  virtual void sendRequestToSubordinate(const DtSetDataRequest& request,
353  const DtUUID& subordinate) const;
354 
360  virtual bool createPSR();
361 
370  //virtual void processOnTaskNotifyCallback(const DtSimTask & task,
372 
373  static void requestAvailableFormationsCallback(const DtVrfObjectMessage* msg, void* usr);
374  virtual void processRequestAvailableFormations(const DtVrfObjectMessage* msg);
375 
378  virtual void addSetDataCallbacks();
379 
382  void removeSetDataCallbacks();
383 
384  virtual void timedTick() override;
385 
386 protected:
387 
390 
394 
398 
402 
406 
410 
416 
419 
422 
423  boost::signals2::scoped_connection mySubordinateAddedConnection;
424  boost::signals2::scoped_connection mySubordinateRemovedConnection;
425  boost::signals2::scoped_connection myDesignatorOrderChangedCallback;
426  boost::signals2::scoped_connection myAdvanceFrameConnection;
427 
430 
436 
437  bool myFirstTimedTick = true;
438 };
439 
444 {
445 private:
452 
453 public:
454 
458  DtLocalObject* owner,
459  DtSimulationServices* simManager,
460  DtComponentDescriptor* desc = 0,
461  DtReaderWriterRegistry* parentRegistry = 0);
462 
463  virtual ~DtDisaggregatedConvoyFormationController() override;
464 
467  virtual const char* type() const override;
468 
469 
472  virtual void addSetDataCallbacks() override;
473 
476  void removeSetDataCallbacks();
477 
481  static DtSimComponent * creator(const DtString& name,
482  DtLocalObject* owner,
483  DtSimulationServices* simManager,
484  DtComponentDescriptor* desc = 0,
485  DtReaderWriterRegistry* parentRegistry = 0);
486 };
UUID is a unique ID wrapper class.
Definition: uuid.h:59
#define DT_DLL_vrfmodel
This file is used to determine how to build.
Definition: vrfmodelDefines.h:24
Objects may contain a collection of other objects, such as overlays or pseudo-aggregate entities...
Definition: subordinateManager.h:43
const DtFormationControllerDescriptor * myFormationControllerDescriptor
Descriptor used to configure this component.
Definition: disaggregatedFormationController.h:389
Definition: organizationManagerNode.h:40
Definition: organizedManagedObjectList.h:17
Definition: formationState.h:40
const DtControllerComponent & operator=(const DtControllerComponent &orig)
assignment operator
Definition: simRadio.h:30
virtual void timedTick()
This version of tick checks to see if the time to tick has arrived. It checks to see if myNextTickTim...
virtual void setRadio(DtSimRadio *radio)
virtual void enable() override
Enables the component and resends capable tasks and sets.
voidpf void uLong size
Definition: ioapi.h:39
A readable, writable type whose name is the name of a component and that has a list of component name...
Definition: componentDescriptor.h:49
DtFormationControllerDescriptor; descriptor for the DtDisaggregatedFormationController component...
Definition: formationControllerDescriptor.h:24
virtual const char * type() const override=0
This returns a string from compTypes.h, and identifies the type of component.
Definition: readerWriterRegistry.h:39
const DtAggregateObjectParameters * myAggregateParameters
Convenience pointer to the aggregate parameters for this entity.
Definition: disaggregatedFormationController.h:421
Instances of DtFormation are a list of DtFormationEntry objects which make up an aggregate formation...
Definition: formation.h:22
Class DtAggregateFormationController is a controller that manages the formation state for an aggregat...
Definition: disaggregatedFormationController.h:65
virtual void addSetDataCallbacks()
Add set data request callbacks. Set data request callbacks are added when component is first created...
virtual void disable()
Is this component enabled or not. If enabled, component&#39;s tick function will be called, otherwise it will not. Default is true (enabled).
DtAggregateLocalObjectFacade myAggregateLocalObjectFacade
Definition: disaggregatedFormationController.h:429
void removeSetDataCallbacks()
Callbacks are removed when component is disabled or destroyed. Non-virtual because it is called from ...
DtVrfAggregateStateRepository * myAggregateStateRepository
Pointer to aggregate&#39;s state repository, cached in this class for convenience.
Definition: disaggregatedFormationController.h:393
bool myFormationStateNeedsUpdate
Definition: disaggregatedFormationController.h:428
DtDisaggregatedFormationController & operator=(const DtDisaggregatedFormationController &orig)
assignment operator - not implemented
virtual const char * type() const override
Returns a string identifies the class type of component. Type values are defined in compTypes...
virtual bool init() override
Calls setRadio()
DtSetDataRequest is an abstract base class from which real setDataRequests can derive. It manages the read/write capability; derived classes need only use and register read/writatble data types for derived information.
Definition: setDataRequest.h:41
boost::signals2::scoped_connection myAdvanceFrameConnection
Definition: disaggregatedFormationController.h:426
boost::signals2::scoped_connection mySubordinateAddedConnection
Definition: disaggregatedFormationController.h:423
File: simMsg.h.
Definition: simMessage.h:35
boost::signals2::scoped_connection mySubordinateRemovedConnection
Definition: disaggregatedFormationController.h:424
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation from ...
static DtSimComponent * creator(const DtString &name, DtLocalObject *owner, DtSimulationServices *simManager, DtComponentDescriptor *desc=0, DtReaderWriterRegistry *parentRegistry=0)
The base class for all messages to/from a specific DtVrfObject. Various subclasses of this class will...
Definition: vrfObjectMessage.h:30
boost::signals2::scoped_connection myDesignatorOrderChangedCallback
Definition: disaggregatedFormationController.h:425
End User Description: DtControllerComponent is the base class for all controllers components...
Definition: controllerComponent.h:31
Central access point of all non-object-specific the services and managers that are available for use ...
Definition: simulationServices.h:96
The DtSimComponent class is the base class for the entire simulation model component hierarchy...
Definition: simComponent.h:89
DtFormationState * myFormationState
Pointer to aggregate&#39;s formation state repository, cached in this for convenience.
Definition: disaggregatedFormationController.h:397
bool myFormationCallbacksAreDisabled
Flag used to indicate if formation-related callbacks are disabled (not registered). These callbacks are disabled until the first tick. Flag is initially false, and then set to true in the first non-zero dt() tick.
Definition: disaggregatedFormationController.h:415
This class manages the distribution of DtSetDataRequests within a single DtLocalObject. Components of the object, or other parts of the code, register interested in particular types of set data messages and when such a message is processed by the DtSetDataManager, each of the registered parties is notified.
Definition: setDataManager.h:48
std::string myInvalidFormationName
For debugging output. If the formation in the aggregateParameters isn&#39;t valid, print a warning; this ...
Definition: disaggregatedFormationController.h:435
bool myFirstTick
Flag used to indicate first non-zero dT() tick.
Definition: disaggregatedFormationController.h:418
DtCompatibilityRadio * myCommandChannelRadio
Pointer to aggregate&#39;s command radio, cached in this class for convenience.
Definition: disaggregatedFormationController.h:401
DtSetDataManager * mySetDataManager
Pointer to aggregate&#39;s DtSetDataManager, cached in this class for convenience.
Definition: disaggregatedFormationController.h:405
void processSetLocation(DtSetDataRequest *set, const DtVertexList &vertices, double position, DtMoveAlongRouteTimeEstimator *est)
Instances of DtManagedObjectList are created and maintained by a DtManagedObjectListManager. The lists contains a subset of the objects in DtSimObjectManager that meet the specified predicate. If specified at creation time, the list automatically updates itself periodically. The lists should be handled though shared pointers.
Definition: managedObjectList.h:45
Definition: vrfAggregateStateRepository.h:21
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. This state is saved and restored as part of ...
Definition: disaggregatedFormationController.h:409
A locally simulated VRF object.
Definition: localObject.h:98
Specialized aggregate formation controller for convoys that will only register for the setting of loc...
Definition: disaggregatedFormationController.h:443

Document ID: Generated on Thu Oct 23 22:29:17 EDT 2025 from SVN revision 280951
Copyright © 2005-2024 MAK Technologies. All Rights Reserved (www.mak.com)