![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2009 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtVrfObjectDataState.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00011 00013 00014 #pragma once 00015 00016 #include <vrfGuiCore/vrfGuiCore.h> 00017 00018 #include <vrvCore/DtSimState.h> 00019 #include <vrvCore/DtStateView.h> 00020 #include <vrvCore/DtSimObjectEntryCollection.h> 00021 #include <vrvCore/DtStateViewCollection.h> 00022 #include <vrvUtil/extendedTypeEncoding.h> 00023 #include <vrvUtil/DtMessage.h> 00024 #include <matrix/vlVector.h> 00025 #include <vector> 00026 #include <string> 00027 00028 namespace makVrv 00029 { 00030 class DtMessage; 00031 } 00032 00033 namespace makVrf 00034 { 00035 struct DT_DLL_VRFGUICORE DtRangeItem 00036 { 00037 int myType; 00038 double myRange; 00039 DtVector myOffsetPosition; 00040 std::string myName; 00041 00042 bool operator==(const DtRangeItem& rhs) const 00043 { 00044 return ((myType == rhs.myType) && 00045 (myRange == rhs.myRange) && 00046 (myName == rhs.myName) && 00047 (myOffsetPosition == rhs.myOffsetPosition)); 00048 } 00049 }; 00050 00052 struct DT_DLL_VRFGUICORE DtVrfObjectDataState : public makVrv::DtSimState 00053 { 00054 public: 00056 DtVrfObjectDataState(); 00057 00059 virtual ~DtVrfObjectDataState(); 00060 00061 bool operator==(const DtVrfObjectDataState& rhs) const; 00062 00063 bool operator!=(const DtVrfObjectDataState& rhs) const 00064 { 00065 return !(*this == rhs); 00066 } 00067 00068 public: 00069 std::string myObjectType; 00070 std::string myObjectLabel; 00071 std::string myEchelonIdString; 00072 std::string myOverlayParent; 00073 int myVrfSessionId; 00074 int myVrfMessageVersionSupported; 00075 bool myIsSubordinateOfForce; 00076 bool myIndependentlyTasked; 00077 char myVrfObjectDataVersion; 00078 bool myUnderFire; 00079 bool myVrfSimulated; 00080 bool myHasPlan; 00081 bool myExecutingPlan; 00082 bool myIsCurrentlyTasked; 00083 std::string myRulesOfEngagement; 00084 DtVector myBoundingVolume; 00085 DtVector myBoundingVolumeOffset; 00086 std::vector<DtRangeItem> myRangeItems; 00087 }; 00088 00090 DT_DLL_VRFGUICORE makVrv::DtMessage& operator<<( makVrv::DtMessage& msg,const DtVrfObjectDataState& state ); 00091 00093 DT_DLL_VRFGUICORE makVrv::DtMessage& operator>>( makVrv::DtMessage& msg, DtVrfObjectDataState& state ); 00094 00095 DT_DLL_VRFGUICORE makVrv::DtMessage& operator<<( makVrv::DtMessage& msg, const makVrf::DtRangeItem& state ); 00096 00097 DT_DLL_VRFGUICORE makVrv::DtMessage& operator>>( makVrv::DtMessage& msg, makVrf::DtRangeItem& state ); 00098 00099 template <typename T> makVrv::DtMessage& operator << (makVrv::DtMessage& msg, const std::vector<T>& t) 00100 { 00101 msg << t.size(); 00102 00103 typename std::vector<T>::const_iterator iter = t.begin(); 00104 00105 while (iter != t.end()) 00106 { 00107 msg << (*iter); 00108 ++iter; 00109 } 00110 00111 return msg; 00112 } 00113 00114 template <typename T> makVrv::DtMessage& operator >> (makVrv::DtMessage& msg, std::vector<T>& t) 00115 { 00116 size_t iLimit; 00117 size_t i; 00118 msg >> iLimit; 00119 00120 for (i = 0; i < iLimit; i++) 00121 { 00122 T item; 00123 00124 msg >> item; 00125 t.push_back(item); 00126 } 00127 00128 return msg; 00129 } 00130 00132 typedef makVrv::DtStateView<DtVrfObjectDataState> DtVrfObjectDataStateView; 00133 00135 typedef makVrv::DtSimObjectEntryCollection<DtVrfObjectDataState> DtVrfObjectDataStateCollection; 00136 }