![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2010 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: DtAggregateElementProcessor.h,v $ $Revision: 1.17 $ $State: Exp $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 00015 #include <vrvVrl/vrvVrl.h> 00016 #include <vrvUtil/DtSignalConnectionManager.h> 00017 #include <boost/unordered_map.hpp> 00018 #include <vl/globalObjDes.h> 00019 00020 #include <vrvCore/DtVisualizerSet.h> 00021 #include <makArchives/DtAggregateSettingsRecord.h> 00022 #include <vrvVrl/DtAggregateEchelonManager.h> 00023 00024 namespace makVrv 00025 { 00026 class DtAggregateVisualizerSet; 00027 00028 namespace DT_PROTOCOL_NAMESPACE 00029 { 00030 class DtAggregateElement; 00031 class DtVrlinkConnection; 00032 class DtVrlinkAggregateStateListener; 00033 class DtVrlinkAggregateListener; 00034 00040 class DL_DLL_IGCONVRLINK DtAggregateElementProcessor : public DtVirtualBaseClass 00041 { 00042 public: 00043 00045 DtAggregateElementProcessor(DtVrlinkConnection& conn); 00046 00049 static void registerInstance(DtVrlinkConnection& conn, 00050 DtAggregateElementProcessor* instance); 00051 00053 static DtAggregateElementProcessor* findInstance(DtVrlinkConnection& conn); 00054 00056 virtual ~DtAggregateElementProcessor(); 00057 00059 DtAggregateVisualizerSet* findVisualizer(int modelSet, 00060 const DtGlobalObjectDesignator& id); 00061 00064 std::vector<DtAggregateVisualizerSet*> findVisualizers( 00065 const DtGlobalObjectDesignator& id); 00066 00068 DtAggregateVisualizerSet* findVisualizer( DtUniqueID sceneId ); 00069 00071 DtVrlinkAggregateStateListener* findListener( DtUniqueID elementId ); 00072 00074 DtAggregateElement* findElement( const DtUniqueID& elementId ); 00075 00077 DtAggregateElement* findElement( const DtGlobalObjectDesignator& id ); 00078 00080 void toggleLabelPinnedState(const DtSelectionManager::IdSet& ids); 00081 00083 void changeAggregateSelection(const DtSelectionManager::IdSet& selected, 00084 const DtSelectionManager::IdSet& deselected); 00085 00087 virtual void setAggregateSettings(const makArchives::DtAggregateSettingsRecord&); 00088 00090 virtual void setCollapseWithNoChildren(bool); 00091 bool collapseWithNoChildren() const; 00092 00095 void setVisualizerCreationProcessingTime(double); 00096 double visualizerCreationProcessingTime() const; 00097 00098 public: 00099 boost::signal<void (DtVrlinkAggregateStateListener&, DtAggregateElement*)> signal_elementCreated; 00100 boost::signal<void (DtVrlinkAggregateStateListener&, DtAggregateElement*)> signal_elementAboutToBeDestroyed; 00101 00102 protected: 00103 00106 virtual void modelSetVisualized(int modelSet, bool enabled); 00107 00109 virtual void elementAttributeChangeRequested( DtUniqueID id, 00110 DtUniqueID parentID, DtBoost::shared_ptr<const DtElementAttribute> atr ); 00111 00113 virtual void handleElementAttributeChanged( 00114 DtAggregateElement& entity, const DtElementAttribute* attr); 00115 00117 virtual void onAggregateDiscovered(DtVrlinkAggregateStateListener& listener); 00118 00120 virtual void onAggregateToBeDestroyed(DtVrlinkAggregateStateListener& listener); 00121 00123 virtual void slot_echelonVisibilityChange(DtElementID, DtElementIDHierarchyNode::DisplayState); 00124 virtual void slot_echelonVisibilityChanged(DtElementIDHierarchy::VisibilityProcessingList); 00125 00127 virtual void slot_aggregateDestroyedStateChanged(DtElementID, bool); 00128 00130 virtual void processVisualizer(int modelSet, DtElementIDHierarchyNode::DisplayState displayState, 00131 DtElementID id, DtVisualizerSet* s, bool respectLeafFlag); 00132 00134 virtual bool isGhostable(DtVisualizerSet* set) const; 00135 00137 virtual double setTransparency(DtVisualizerSet* set, double t) const; 00138 00140 virtual double currentTransparency(DtVisualizerSet* set) const; 00141 00143 virtual void applyGhosting(int modelSet, DtElementID elementID, DtVisualizerSet*); 00144 00145 virtual void removeGhosting(int modelSet, DtElementID elementID); 00146 00148 virtual void setDisplayAggregates(bool b); 00149 00151 virtual void setShowLeafNodes(bool b); 00152 00154 virtual void setGhostEchelonLevelItems(bool b); 00155 00157 virtual void setEchelonLevel(int i); 00158 00160 virtual void setAllowSelectionOfGhostedItems(bool); 00161 00163 virtual void slot_hierarchyItemModified(DtElementIDHierarchyNode*); 00164 00167 virtual void slot_hierarchyItemToBeRemoved(DtElementIDHierarchyNode*); 00168 00172 virtual void slot_subordinatesChanged(DtAggregateElement*); 00173 00177 virtual void mapGlobalIdsToElementIds(DtElementID parent, 00178 const std::set<std::string>& globalIds, DtElementIDHierarchy::ElementIDs& children); 00179 00182 virtual void watchForGlobalIdDiscovery(DtElementID parent, const std::string& globalId); 00183 00185 virtual void slot_entityElementCreated(DtVrlinkEntityStateListener&, DtEntityElement*); 00186 00188 virtual void aggregateElementCreated(DtVrlinkAggregateStateListener&, DtAggregateElement*); 00189 00191 virtual void removeFromWatchList(DtElementID id); 00192 00194 virtual void connectToElementProcessor(); 00195 virtual void disconnectFromElementProcessor(); 00196 00198 virtual void slot_completeDiscovery(); 00199 00200 virtual void createVisualizer(DtVrlinkAggregateStateListener&); 00201 00202 protected: 00203 00204 typedef boost::unordered_map<DtUniqueID, DtAggregateElement*> 00205 AggregateElementVisualizerMap; 00206 typedef boost::unordered_map<std::string, DtAggregateElement*> 00207 GlobalIdToAggregateElementVisualizerMap; 00208 typedef boost::unordered_map<DtUniqueID, DtVrlinkAggregateStateListener*> 00209 ToBeVisualizedMap; 00210 00211 DtVrlinkConnection& myConnection; 00212 DtSignalConnectionManager myConnections; 00213 AggregateElementVisualizerMap myAggregateElementVisualizers; 00214 GlobalIdToAggregateElementVisualizerMap myGlobalIdToElementVisualizerMap; 00215 makArchives::DtAggregateSettingsRecord myAggregateSettings; 00216 00217 DtAggregateEchelonManager& myEchelonHierarchy; 00218 ToBeVisualizedMap myToBeVisualized; 00219 double myVisualizerCreationProcessingTime; 00220 00221 protected: 00222 typedef boost::unordered_map<int, DtVisualizerSet*> GhostPair; 00223 typedef boost::unordered_map<DtElementID, GhostPair> GhostMap; 00224 00225 GhostMap myGhostMap; 00226 00227 typedef boost::unordered_map<std::string, DtElementID> WatchList; 00228 WatchList myWatchList; 00229 bool myCollapseWithNoChildren; 00230 }; 00231 } 00232 }