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) 2026 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 
343  virtual DtVector livingFormationAnchor();
344 
350  virtual void updateFormationState();
351 
356  virtual void sendRequestToSelf(const DtSetDataRequest& request) const;
357 
364  virtual void sendRequestToSubordinate(const DtSetDataRequest& request,
365  const DtUUID& subordinate) const;
366 
372  virtual bool createPSR();
373 
382  //virtual void processOnTaskNotifyCallback(const DtSimTask & task,
384 
385  static void requestAvailableFormationsCallback(const DtVrfObjectMessage* msg, void* usr);
386  virtual void processRequestAvailableFormations(const DtVrfObjectMessage* msg);
387 
390  virtual void addSetDataCallbacks();
391 
394  void removeSetDataCallbacks();
395 
396  virtual void timedTick() override;
397 
398 protected:
399 
402 
406 
410 
414 
418 
422 
428 
431 
434 
435  boost::signals2::scoped_connection mySubordinateAddedConnection;
436  boost::signals2::scoped_connection mySubordinateRemovedConnection;
437  boost::signals2::scoped_connection myDesignatorOrderChangedCallback;
438  boost::signals2::scoped_connection myAdvanceFrameConnection;
439 
442 
448 
449  bool myFirstTimedTick = true;
450 };
451 
456 {
457 private:
464 
465 public:
466 
470  DtLocalObject* owner,
471  DtSimulationServices* simManager,
472  DtComponentDescriptor* desc = 0,
473  DtReaderWriterRegistry* parentRegistry = 0);
474 
475  virtual ~DtDisaggregatedConvoyFormationController() override;
476 
479  virtual const char* type() const override;
480 
481 
484  virtual void addSetDataCallbacks() override;
485 
488  void removeSetDataCallbacks();
489 
493  static DtSimComponent * creator(const DtString& name,
494  DtLocalObject* owner,
495  DtSimulationServices* simManager,
496  DtComponentDescriptor* desc = 0,
497  DtReaderWriterRegistry* parentRegistry = 0);
498 };
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:401
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:433
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...
DtAggregateLocalObjectFacade myAggregateLocalObjectFacade
Definition: disaggregatedFormationController.h:441
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:405
bool myFormationStateNeedsUpdate
Definition: disaggregatedFormationController.h:440
DtDisaggregatedFormationController & operator=(const DtDisaggregatedFormationController &orig)
assignment operator - not implemented
virtual void disable() override
Disables the component and resends capable tasks and sets.
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:438
boost::signals2::scoped_connection mySubordinateAddedConnection
Definition: disaggregatedFormationController.h:435
File: simMsg.h.
Definition: simMessage.h:35
boost::signals2::scoped_connection mySubordinateRemovedConnection
Definition: disaggregatedFormationController.h:436
virtual void tick()
This gives the thread of control to the component. The component is ticked once each simulation frame...
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:437
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:97
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:409
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:427
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:47
std::string myInvalidFormationName
For debugging output. If the formation in the aggregateParameters isn&#39;t valid, print a warning; this ...
Definition: disaggregatedFormationController.h:447
bool myFirstTick
Flag used to indicate first non-zero dT() tick.
Definition: disaggregatedFormationController.h:430
DtCompatibilityRadio * myCommandChannelRadio
Pointer to aggregate&#39;s command radio, cached in this class for convenience.
Definition: disaggregatedFormationController.h:413
DtSetDataManager * mySetDataManager
Pointer to aggregate&#39;s DtSetDataManager, cached in this class for convenience.
Definition: disaggregatedFormationController.h:417
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:421
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:455

Document ID: Generated on Thu Oct 15 21:27:02 EDT 2026 from SVN revision 296421
Copyright © 2005-2026 MAK Technologies. All Rights Reserved (www.mak.com)