![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /******************************************************************************* 00002 ** Copyright (c) 2004 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 *******************************************************************************/ 00005 /******************************************************************************* 00006 ** $RCSfile: humanPatrolController.h,v $ $Revision: 1.2 $ $State: Exp $ 00007 *******************************************************************************/ 00008 00011 00015 00016 #ifndef humanPatrolController_H_ 00017 #define humanPatrolController_H_ 00018 00019 #include "vrfobjcore/singleTaskControllerComponent.h" 00020 #include "vrfmodel/vrfmodelDefines.h" 00021 00022 class DtFormationState; 00023 class DtHumanPatrolPSR; 00024 class DtVrfObjectManager; 00025 00036 class DT_DLL_vrfmodel DtHumanPatrolController : public DtSingleTaskControllerComponent 00037 { 00038 public: 00039 00040 enum DtPatrolAlongState 00041 { 00042 DtMovingAlongRoute = 0, 00043 DtReversingDirection = 1 00044 }; 00045 00048 DtHumanPatrolController(const DtString& name, 00049 DtVrfObject* owner, 00050 DtSimManager* simManager, 00051 DtComponentDescriptor* desc = 0, 00052 DtReaderWriterRegistry* parentRegistry = 0); 00053 00055 virtual ~DtHumanPatrolController(); 00056 00059 virtual DtString type() const; 00060 00063 virtual bool init(); 00064 00066 virtual void registerTaskMsgCallbacks(); 00067 00072 static void patrolTwoPointsTaskCallback(DtSimMessage * msg, void * usr); 00073 00077 static void patrolAlongTaskCallback(DtSimMessage * msg, void * usr); 00078 00083 static void taskCompleteReportCallback(DtSimMessage * msg, void * usr); 00084 00088 static DtSimComponent * creator(const DtString& name, 00089 DtVrfObject* owner, 00090 DtSimManager* simManager, 00091 DtComponentDescriptor* desc = 0, 00092 DtReaderWriterRegistry* parentRegistry = 0); 00093 00094 protected: 00095 00100 virtual void onPatrolTwoPointsTask(DtSimMessage * msg); 00101 00109 virtual void onTaskComplete(DtSimMessage * msg); 00110 00118 virtual bool moveTo(const DtString& controlPointName); 00119 00123 virtual void processPatrolAlongTask(DtSimMessage * msg); 00124 00130 virtual bool createPSR(); 00131 00139 virtual DtIteratorDirection initialTraversalDirection( 00140 const DtString& routeName, const DtVector& initialWorldPosition) const; 00141 00150 virtual void sendMoveAlongToSelf(const DtString& routeName, 00151 enum DtIteratorDirection traversalDirection, bool startAtClosestPoint); 00152 00153 private: 00154 00156 DtHumanPatrolController(const DtHumanPatrolController& orig); 00157 00159 DtHumanPatrolController& operator=(const DtHumanPatrolController& orig); 00160 00161 protected: 00162 00165 DtHumanPatrolPSR* myProcessState; 00166 }; 00167 00168 #endif