VR-Forces 4.0.4 Class Documentation
include/vrvVrl/DtDetonationElementProcessor.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002  * Copyright (c) 2012 MAK Technologies, Inc.
00003  * All rights reserved.
00004  *****************************************************************************/
00005 
00009 
00010 #pragma once
00011 
00012 #include <vrvVrl/vrvVrl.h>
00013 #include <vrvUtil/DtVirtualBaseClass.h>
00014 #include <vrvUtil/DtSignalConnectionManager.h>
00015 #include <set>
00016 #include <vrvCore/DtVisualizerSet.h>
00017 #include <vrvCore/DtDetonationInteractionStateListener.h>
00018 
00019 #include <vl/detonateInter.h>
00020 
00021 #ifndef DT_PROTOCOL_NAMESPACE
00022 #error Namespace Protocol Macro DT_PROTOCOL_NAMESPACE not defined.
00023 #endif
00024 
00025 namespace makVrv
00026 {
00027 
00028    class DtAgent;
00029    class DtModelAgent;
00030 
00031    namespace DT_PROTOCOL_NAMESPACE
00032    {
00033       class DtVrlinkConnection;
00034 
00037       class DL_DLL_IGCONVRLINK DtVrlinkDetonationInteractionStateListener
00038          : public DtDetonationInteractionStateListener
00039       {
00040       public:
00041 
00042          DtVrlinkDetonationInteractionStateListener( DtUniqueID elementId )
00043             : DtDetonationInteractionStateListener( elementId )
00044             , myForceId( 0 )
00045          {
00046          }
00047          void setForceId(int i)
00048          {
00049             myForceId = i;
00050          }
00051 
00052          int forceId() const
00053          {
00054             return myForceId;
00055          }
00056 
00057          void setDetonationPdu(const DtDetonationInteraction& pdu)
00058          {
00059             myDetonation = pdu;
00060          }
00061 
00062          const DtDetonationInteraction& detonation() const
00063          {
00064             return myDetonation;
00065          }
00066 
00067          const DtGlobalObjectDesignator& attackerId() const
00068          {
00069             return myDetonation.attackerId();
00070          }
00071 
00072          const DtGlobalObjectDesignator& targetId() const
00073          {
00074             return myDetonation.targetId();
00075          }
00076 
00077          int detonationResult() const
00078          {
00079             return myDetonation.result();
00080          }
00081 
00082       protected:
00083 
00084          int myForceId;
00085 
00086          DtDetonationInteraction myDetonation;
00087 
00088       };
00089 
00090       class DL_DLL_IGCONVRLINK DtVrlinkDetonationVisualizerSet : public DtVisualizerSet
00091       {
00092       public:
00093 
00094          DtVrlinkDetonationVisualizerSet( DtVrlinkConnection& c );
00095 
00096          virtual ~DtVrlinkDetonationVisualizerSet();
00097 
00098          virtual void visualize(const DtUnicode& visDefName, int modelSet);
00099          virtual void setLocation(const DtVector&);
00100 
00101          DtVrlinkDetonationInteractionStateListener& detonationListener()
00102          {
00103             return myInteractionListener;
00104          }
00105 
00106       protected:
00107 
00108          DtVrlinkDetonationInteractionStateListener myInteractionListener;
00109 
00110       };
00111 
00112       class DL_DLL_IGCONVRLINK DtDetonationElementProcessor : public DtVirtualBaseClass
00113       {
00114       public:
00115 
00118          static void registerInstance(DtVrlinkConnection& conn, 
00119             DtDetonationElementProcessor* instance);
00120 
00122          static DtDetonationElementProcessor* findInstance(DtVrlinkConnection& conn);
00123 
00125          DtDetonationElementProcessor(DtVrlinkConnection& baseSimulation);
00126 
00128          virtual ~DtDetonationElementProcessor();
00129 
00131          void processInteraction(const DtDetonationInteraction& fireInteraction );
00132 
00133       protected:
00134 
00135          const DtUnicode& chooseModelDefinition(
00136             const std::vector<DtUnicode>& definitions);
00137 
00138       protected:
00139 
00140          DtVrlinkConnection& mySimulation;
00141          DtSignalConnectionManager myConnections;
00142 
00143          bool myFireDetonatedEnabledFlag;
00144 
00145       };
00146 
00147    }
00148 }

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)