27 #include "../../../../maptools/AbstractLayer.h"
40 #include <QtGui/QScrollArea>
41 #include <QtGui/QVBoxLayout>
44 : QDockWidget(tr(
"Layer Explorer"), parent, flags),
90 m_treeModel->set(layers);
95 std::list<te::map::AbstractLayerPtr> topLayers;
97 std::vector<te::map::AbstractLayerPtr> modelTopLayers = m_treeModel->getTopLayers();
99 for(std::size_t i = 0; i < modelTopLayers.size(); ++i)
100 topLayers.push_back(modelTopLayers[i]);
107 return m_treeView->getSelectedItems();
112 return m_treeView->getSelectedLayerItems();
117 return m_treeView->getSelectedSingleLayerItems();
122 return m_treeView->getSelectedSingleLayers();
127 return m_treeView->getSelectedAndVisibleSingleLayers();
132 return m_treeModel->getLayerItem(layer);
137 m_treeModel->add(layer, parentItem);
142 return m_treeModel->remove(item);
151 const std::string& menu,
152 const std::string& itemType,
155 m_treeView->add(action, menu, itemType, menuType);
160 emit selectedLayersChanged(selectedLayers);
165 emit visibilityChanged(layer);
170 emit layerOrderChanged();
175 emit doubleClicked(item);
180 QModelIndex index = m_treeModel->getIndex(item);
182 m_treeView->expand(index);
187 QModelIndex index = m_treeModel->getIndex(item);
189 m_treeView->collapse(index);
bool remove(AbstractTreeItem *item)
It removes the given item from the layer explorer.
te::qt::widgets::LayerTreeView::ContextMenuSelectionType getMenuSelectionType(int menuSelectionType) const
It gets the context menu selection type associated to the menu selection type.
void add(const te::map::AbstractLayerPtr &layer, AbstractTreeItem *parentItem=0)
It adds a item layer to the list of item layers of the parent layer item. If the parent layer is not ...
void collapse(te::qt::widgets::AbstractTreeItem *item)
It collapses the specified model item.
A widget designed to explore the layers of an application.
LayerTreeModel * getTreeModel() const
std::list< te::map::AbstractLayerPtr > getSelectedSingleLayers() const
It gets the single layers that are selected.
void visibilityChanged(const te::map::AbstractLayerPtr &layer)
LayerTreeModel * m_treeModel
the tree model for the layers
void onSelectedLayersChanged(const std::list< te::map::AbstractLayerPtr > &selectedLayers)
It sends out a signal indicating that there were changes in the selection of layers in the tree view...
void onLayerOrderChanged()
It sends out a signal indicating that there was a drag and operation on the tree view.
void selectedLayersChanged(const std::list< te::map::AbstractLayerPtr > &selectedLayers)
#define TE_QTWIDGETS_DEFAULT_TREEVIEW_IDENTATION
void setCheckable(const bool checkable)
It sets the model items as checkable or not.
LayerTreeView * getTreeView() const
te::qt::widgets::AbstractTreeItem * getLayerItem(const te::map::AbstractLayerPtr &layer)
It gets the layer item that is associated to the given layer.
void onItemDoubleClicked(te::qt::widgets::AbstractTreeItem *item)
It sends out a signal indicating that the given item was double clicked.
std::list< te::map::AbstractLayerPtr > getSelectedAndVisibleSingleLayers() const
It gets the single layers that are selected and visible.
std::list< te::map::AbstractLayerPtr > getTopLayers() const
It gets the top level layers in the tree model associated to the layer explorer.
A tree view for the layers of an application.
void set(const std::list< te::map::AbstractLayerPtr > &layers)
void doubleClicked(te::qt::widgets::AbstractTreeItem *item)
std::list< AbstractTreeItem * > getSelectedItems() const
It gets all the selected items in the layer explorer.
void onVisibilityChanged(const te::map::AbstractLayerPtr &layer)
It sends out a signal indicating that the visibility of the given single layer was changed in the tre...
void expand(te::qt::widgets::AbstractTreeItem *item)
It expands the specified model item.
LayerTreeView * m_treeView
The tree view for the layers.
The class that represents an item in a LayerTreeModel.
This class defines the model used in the Qt Model/View architecture for the tree of layers...
LayerExplorer(QWidget *parent=0, Qt::WindowFlags flags=0)
std::list< AbstractTreeItem * > getSelectedSingleLayerItems() const
It gets the single layer items that are selected in the tree view.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::list< AbstractTreeItem * > getSelectedLayerItems() const
It gets all the selected layers(single and folders) in the layer explorer.
The class that represents an item in a LayerTreeModel.