![]() |
VR-Forces 4.0.4 Class Documentation
|
00001 /****************************************************************************** 00002 ** Copyright (c) 2010 MAK Technologies, Inc. 00003 ** All rights reserved. 00004 ******************************************************************************/ 00005 /****************************************************************************** 00006 ** $RCSfile: $ $Revision: $ $State: $ 00007 ******************************************************************************/ 00008 00012 00013 #pragma once 00014 #include <vrvCoreQt/DtVectorNetworkTreeInterface.h> 00015 #include <QtGui/QTreeWidget> 00016 #include <boost/unordered_map.hpp> 00017 00018 namespace makVrv 00019 { 00020 class DtVectorNetworkTreeLogic; 00021 00025 class DT_DLL_VRVCOREQT DtVectorNetworkTreeWidget : public QTreeWidget, 00026 public DtVectorNetworkTreeInterface 00027 { 00028 Q_OBJECT 00029 00030 public: 00031 00033 DtVectorNetworkTreeWidget(DtDe& de, QWidget* parent); 00034 00036 virtual ~DtVectorNetworkTreeWidget(); 00037 00038 virtual void addLayer(const std::string& layerName); 00039 virtual void removeLayer(const std::string& layerName); 00040 virtual void showLayer(const std::string& layerName); 00041 virtual void hideLayer(const std::string& layerName); 00042 00043 virtual void addPointFeature(DtElementID id, const std::string& layerName, 00044 unsigned int index, DFAD::FeatureID feature, const DtFaccCode& code); 00045 00046 virtual void addLinearFeature(DtElementID id,const std::string& layerName, 00047 unsigned int index, DFAD::FeatureID feature, const DtFaccCode& code); 00048 00049 virtual void addArealFeature(DtElementID id, const std::string& layerName, 00050 unsigned int index, DFAD::FeatureID feature, const DtFaccCode& code); 00051 00052 virtual void removeFeature(DtElementID id); 00053 00054 virtual void setFeatureSelected(DtElementID id, bool selected); 00055 00056 virtual void finishedAdding(); 00057 00058 protected: 00059 00061 virtual void selectionChanged( const QItemSelection& selected, 00062 const QItemSelection& deselected ); 00063 00064 protected: 00065 00066 enum FeatureType 00067 { 00068 Point, 00069 Linear, 00070 Areal 00071 }; 00072 00073 QTreeWidgetItem& layerRoot(const std::string& layerName); 00074 QTreeWidgetItem& featureTypeRoot(const std::string& layerName,FeatureType type); 00075 QTreeWidgetItem* findFeatureItem(DtElementID id) const; 00076 protected: 00077 typedef boost::unordered_map<QTreeWidgetItem*, QList<QTreeWidgetItem*> > ToAddMap; 00078 ToAddMap myItemsToAdd; 00079 DtVectorNetworkTreeLogic* myLogic; 00080 }; 00081 } 00082