VR-Forces 4.0.4 Class Documentation
include/vrfmodel/disaggregatedMoveIntoFormController.h
Go to the documentation of this file.
00001 /*******************************************************************************
00002 ** Copyright (c) 2004 MAK Technologies, Inc.
00003 ** All rights reserved.
00004 *******************************************************************************/
00005 /*******************************************************************************
00006 ** $RCSfile: disaggregatedMoveIntoFormController.h,v $ $Revision: 1.2 $ $State: Exp $
00007 *******************************************************************************/
00008 
00011 
00015 
00016 #ifndef disaggregatedMoveIntoFormController_H_
00017 #define disaggregatedMoveIntoFormController_H_
00018 
00019 #include "vrfobjcore/singleTaskControllerComponent.h"
00020 #include <matrix/vlVector.h>
00021 #include <vector>
00022 #include "vrfobjcore/cmdChanRadio.h"
00023 
00024 
00025 class DtAggregateMoveIntoFormationDescriptor;
00026 class DtFormationState;
00027 class DtSimMessage;
00028 class DtSetDataManager;
00029 class DtSetDataRequest;
00030 class DtAggregateMoveToPSR;
00031 class DtVrfAggregateStateRepository;
00032 
00053 #include "vrfmodel/vrfmodelDefines.h"
00054 class DT_DLL_vrfmodel DtDisaggregatedMoveIntoFormationController : public DtSingleTaskControllerComponent
00055 {
00056 public:
00057 
00060    DtDisaggregatedMoveIntoFormationController(const DtString& name, 
00061       DtVrfObject* owner,
00062       DtSimManager* simManager, 
00063       DtComponentDescriptor* desc = 0,
00064       DtReaderWriterRegistry* parentRegistry = 0);
00065 
00066    virtual ~DtDisaggregatedMoveIntoFormationController();
00067 
00070    virtual DtString type() const;
00071 
00073    virtual bool init();
00074 
00076    virtual void tick();
00077 
00081    virtual void registerTaskMsgCallbacks();
00082 
00084    virtual void clearTask();
00085 
00088    static void taskCompleteReportCallback(DtSimMessage * msg, void * usr);
00089 
00092    static void formationStateChanged(const DtFormationState& formationState,
00093       void* usr);
00094 
00098    static DtSimComponent * creator(const DtString& name, 
00099       DtVrfObject* owner,
00100       DtSimManager* simManager, 
00101       DtComponentDescriptor* desc = 0,
00102       DtReaderWriterRegistry* parentRegistry = 0);
00103 
00106    static void moveIntoFormationTaskCallback(DtSimMessage * msg, void * usr);
00107 
00110    static void subordinateRemoved(DtEntityIdentifier childEid, void* usr);
00111 
00112 protected:
00113 
00120    virtual void moveIntoFormation(const DtVector& location, double heading,  DtString formation);
00121 
00132    virtual void onTaskComplete(DtSimMessage * msg);
00133 
00138    virtual void onFormationStateChanged();
00139 
00141    virtual void sendRequestToSelf(const DtSetDataRequest& request) const;
00142 
00144    virtual void sendTaskToSubordinate(const DtSimTask& task, 
00145       const DtString& subordinateName) const;
00146 
00148    void sendSetDataRequestToSubordinate(const DtSetDataRequest& request, 
00149       const DtString& subordinateName) const;
00150 
00152    virtual void processMoveIntoFormationTask(DtSimMessage * msg);
00153 
00159    virtual bool createPSR();
00160 
00161    virtual void clearDebugWaypointNames();
00162 
00166    virtual void processSubordinateRemoved(DtEntityIdentifier childEid);
00167 
00170    virtual bool registerOrgNodeCallbacks();
00171 
00173    virtual void groundClampLocation(DtVector& location);
00174 
00177    virtual bool shouldGroundClamp() const;
00178 
00179 private:
00180 
00182    DtDisaggregatedMoveIntoFormationController(const DtDisaggregatedMoveIntoFormationController& orig);
00183 
00185    DtDisaggregatedMoveIntoFormationController& operator=(const DtDisaggregatedMoveIntoFormationController& orig);
00186 
00187 protected:
00188 
00189    const DtAggregateMoveIntoFormationDescriptor* myAggregateMoveIntoFormationDescriptor;
00190    DtFormationState* myFormationState;
00191    DtVector myLocation;
00192    DtString myFormation;
00193 
00198    DtCommandChannelRadio* myCommandRadio;
00199 
00202    DtSetDataManager* mySetDataManager;
00203 
00206    std::vector<DtString> myDebugWaypointNames;
00207 
00210    DtVrfAggregateStateRepository* myAggregateStateRepository;
00211 
00214    DtAggregateMoveToPSR* myProcessState;
00215 
00219    bool myStopMovingUponArrival;
00220 
00224    bool myTurnToHeadingUponArrival;
00225 
00231    bool myRegisteredWithOrgNode;
00232 };
00233 
00234 #endif

Document ID: Generated on Fri Jun 29 16:33:32 EDT 2012 from SVN revision 116588
Copyright © 2005-2012 VT MÄK Inc. All Rights Reserved (www.mak.com)