![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2008 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtVrlinkViewControlProcessor.h,v $ $Revision: 1.8 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 #ifndef DT_PROTOCOL_NAMESPACE 00015 #error Namespace Protocol Macro DT_PROTOCOL_NAMESPACE not defined. 00016 #endif 00017 00018 #include <vrvVrl/vrvVrl.h> 00019 #include <vrvUtil/DtVirtualBaseClass.h> 00020 00021 #include <boost/unordered_map.hpp> 00022 #include <boost/function.hpp> 00023 00024 namespace makVrv 00025 { 00026 namespace DT_PROTOCOL_NAMESPACE 00027 { 00028 00032 class DL_DLL_IGCONVRLINK DtStealthControlProcessor 00033 : public DtVirtualBaseClass 00034 { 00035 public: 00036 00037 typedef boost::function< void (const DtStealthControlPdu*) > 00038 ViewControlFunction; 00039 00041 static DtStealthControlProcessor* findInstance( 00042 DtVrlinkConnection& baseSimulation); 00043 00045 static void registerInstance(DtVrlinkConnection& baseSimulation, 00046 DtStealthControlProcessor*); 00047 00048 00050 DtStealthControlProcessor(DtVrlinkConnection& baseSimulation); 00051 00053 virtual ~DtStealthControlProcessor(); 00054 00056 void processInteraction(const DtStealthControlInteraction& stealthControl ); 00057 00059 void registerProcessFunction(DtViewerCommand command, 00060 const ViewControlFunction& function); 00061 00063 void unregisterProcessFunction(DtViewerCommand command); 00064 00066 void sendStealthControlPdu(const DtGlobalObjectDesignator& id, 00067 DtStealthControlPdu& p, bool status); 00068 00069 protected: 00070 00072 //View control functions. All functions are registered by default in 00073 //the CTOR. 00074 00075 void processMimicTrackViewControl( const DtStealthControlPdu * pdu ); 00076 void processTetherTrackViewControl( const DtStealthControlPdu * pdu ); 00077 void processTrackViewControl( const DtStealthControlPdu * pdu ); 00078 void processOrbitViewControl( const DtStealthControlPdu * pdu ); 00079 void processMimicViewControl( const DtStealthControlPdu * pdu ); 00080 void processMoveViewControl( const DtStealthControlPdu * pdu ); 00081 void processTetherViewControl( const DtStealthControlPdu * pdu ); 00082 void processAbsoluteViewControl( const DtStealthControlPdu * pdu ); 00083 void processCompassViewControl( const DtStealthControlPdu * pdu ); 00084 00086 00087 protected: 00088 00089 typedef boost::unordered_map<DtViewerCommand, ViewControlFunction> ViewControlFunctionMap; 00090 00091 DtVrlinkConnection& mySimulation; 00092 DtViewStateProcessor* myViewStateProcessor; 00093 ViewControlFunctionMap myViewControlFunctions; 00094 00095 }; 00096 } 00097 }