![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: aggregateModelResolutionController.h,v $ $Revision: 1.8 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00012 #include "vrfobjcore/singleTaskControllerComponent.h" 00013 #include "vrfobjcore/simRadio.h" 00014 #include "vrfmodel/vrfmodelDefines.h" 00015 00016 class DtTrueAggregateObjectManager; 00017 class DtVrfAggregateStateRepository; 00018 class DtAggregatedResolutionPSR; 00019 class DtSubordinateObjectsList; 00020 class DtSubordinateEntry; 00021 class DtSubordinateIndividualEntry; 00022 class DtSubordinateAggregateEntry; 00023 class DtIfSubordinateList; 00024 class DtIfSubordinateListRequest; 00025 class DtAggregateModelResolutionDescriptor; 00026 class DtAggregator; 00027 class DtDisaggregator; 00028 class DtFormation; 00029 class DtSettingsObject; 00030 class DtBoolSetting; 00031 00038 class DT_DLL_vrfmodel DtAggregateModelResolutionController : public DtControllerComponent 00039 { 00040 public: 00041 00043 DtAggregateModelResolutionController(const DtString & name, DtVrfObject* owner, 00044 DtSimManager * simManager, DtComponentDescriptor* desc = NULL, 00045 DtReaderWriterRegistry * parentRegistry = 0); 00046 00048 virtual ~DtAggregateModelResolutionController(); 00049 00051 virtual bool init(); 00052 00058 virtual bool postAddComponentsInit(); 00059 00062 virtual DtString type() const; 00063 00065 virtual void tick(); 00066 00072 virtual bool createPSR(); 00073 00075 virtual void enable(); 00076 00078 virtual void disable(); 00079 00083 virtual bool tickWhileDestroyed() const; 00084 00085 public: 00086 00087 static void setDestroyedCallback(DtSimMessage * msg, 00088 void * usrData); 00089 00090 static void setRestoreCallback(DtSimMessage* msg, void* usrData); 00091 00092 static void setAggregateStateCallback(DtSimMessage * msg, void * usrData); 00093 00094 virtual void processSetRestore(DtSimMessage* msg); 00095 00097 static void disaggregationCompleteCallback(void* usr); 00098 00100 static DtSimComponent* creator(const DtString & name, DtVrfObject* owner, 00101 DtSimManager * simManager, DtComponentDescriptor* desc, 00102 DtReaderWriterRegistry * parentRegistry); 00103 00104 protected: 00105 00107 DtAggregateModelResolutionController(const DtAggregateModelResolutionController& orig); 00108 00110 DtAggregateModelResolutionController& operator=(const DtAggregateModelResolutionController& orig); 00111 00112 00114 virtual void setRadio(DtSimRadio * radio); 00115 00118 virtual void addSetDataCallbacks(); 00119 00122 void removeSetDataCallbacks(); 00123 00124 virtual void processSetAggregateState(DtSimMessage * msg); 00125 00129 virtual void startDisaggregation(); 00130 00132 virtual void startAggregation(); 00133 00135 virtual void onDisaggregationComplete(); 00136 00139 virtual bool toggleComponentsAndSystems(enum DtAggregateState newAggregateState); 00140 00143 void enableSystemsAndComponents(DtAggregateState aggregateState); 00144 void disableSystemsAndComponents(DtAggregateState aggregateState); 00146 00148 virtual void initAggregated(); 00149 00151 void updateBoundingGeometry(); 00152 00154 virtual void computeSubordinateObjectsMinMaxVectors( 00155 DtSubordinateObjectsList& subordinateObjectsList,DtVector positionOffset, 00156 DtVector& minVector,DtVector& maxVector); 00157 00160 virtual bool aggregationIsComplete() const; 00161 00165 virtual void onAggregationComplete(); 00166 00167 virtual void createAggregator(); 00168 00169 virtual void createDisaggregator(); 00170 00176 virtual bool allowedToTransition(DtAggregateState targetAggregateState) const; 00177 00178 virtual void processSetDestroyed(); 00179 00180 protected: 00181 00182 DtVrfObjectManager* myObjectManager; 00183 00186 DtAggregatedResolutionPSR* myProcessState; 00187 00188 DtVrfAggregateStateRepository* myAggregateStateRepository; 00189 DtAggregateModelResolutionDescriptor* myAggregateModelResolutionDescriptor; 00190 00191 std::vector<DtComponentSystem*> myAggregatedSystemList; 00192 std::vector<DtSimComponent*> myAggregatedComponentList; 00193 std::vector<DtComponentSystem*> myDisaggregatedSystemList; 00194 std::vector<DtSimComponent*> myDisaggregatedComponentList; 00195 00196 DtAggregator* myAggregator; 00197 DtDisaggregator* myDisaggregator; 00198 bool myFirstTick; 00199 }; 00200