![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2010 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtVlinkEchelonHierarchy.h,v $ $Revision: 1.1 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 00015 #include <vrvVrl/vrvVrl.h> 00016 #include <vrvCore/DtElementIDHierarchy.h> 00017 00018 #include <vrvUtil/DtVirtualBaseClass.h> 00019 #include <makArchives/DtAggregateSettingsRecord.h> 00020 00021 #include <boost/function.hpp> 00022 #include <boost/signal.hpp> 00023 00024 namespace makVrv 00025 { 00026 class DtDe; 00027 } 00028 00029 namespace makVrv 00030 { 00031 class DtConnection; 00032 00034 class DT_DLL_VRVVRL DtAggregateEchelonManager : public DtVirtualBaseClass 00035 { 00036 public: 00037 enum Flags 00038 { 00039 Destroyed = 0x80000000 00040 }; 00041 00042 public: 00044 static DtAggregateEchelonManager& instance(DtConnection& sim); 00045 00047 static void registerInstance(DtConnection& sim, DtAggregateEchelonManager*); 00048 00049 virtual ~DtAggregateEchelonManager(); 00050 00051 protected: 00053 virtual void hierarchyItemModified(DtElementIDHierarchyNode*); 00054 00056 virtual void hierarchyItemAboutToBeRemoved(DtElementIDHierarchyNode*); 00057 00058 public: 00059 00061 virtual void setRecord(const makArchives::DtAggregateSettingsRecord&); 00062 00066 virtual void setDestroyed(DtElementID id, bool); 00067 bool destroyed(DtElementID) const; 00068 00071 void removeElementPendingDestroyedState(DtElementID id); 00072 00074 const DtElementIDHierarchy& hierarchy() const 00075 { 00076 return myHierarchy; 00077 } 00078 00079 DtElementIDHierarchy& hierarchy() 00080 { 00081 return myHierarchy; 00082 } 00083 00084 boost::signal<void (DtElementID, bool b) > signal_aggregateDestroyedStateChanged; 00085 boost::signal<void (DtElementIDHierarchyNode*) > signal_hierarchyItemModified; 00086 00087 protected: 00088 00090 virtual DtElementIDHierarchyNode::DisplayState expectedDisplayStateFor(const DtElementIDHierarchyNode* node); 00091 00093 virtual void updateDestroyedState(DtElementIDHierarchyNode* parentNode); 00094 00096 virtual void updateHierarchy(DtElementID parentId, const DtElementIDHierarchy::ElementIDs& children); 00097 00098 protected: 00099 DtAggregateEchelonManager(); 00100 00101 protected: 00102 makArchives::DtAggregateSettingsRecord myAggregateSettings; 00103 std::map<DtElementID, bool> myPendingDestroyedStates; 00104 DtElementIDHierarchy myHierarchy; 00105 }; 00106 }