27 #include "../../af/events/LayerEvents.h" 28 #include "../../af/ApplicationController.h" 37 m_popupMenu(popupMenu),
39 m_popupAction(nullptr)
61 if(pixmap.empty() ==
false)
62 m_action->setIcon(QIcon::fromTheme(pixmap.c_str()));
77 if(pixmap.empty() ==
false)
102 std::unique_ptr<te::da::DataSetType> dsType = evt.
m_layer->getSchema();
104 if(dsType.get() && dsType->hasRaster())
119 std::list<te::map::AbstractLayerPtr> allLayers = e.
m_layers;
121 std::list<te::map::AbstractLayerPtr> layers;
123 for (std::list<te::map::AbstractLayerPtr>::iterator it = allLayers.begin(); it != allLayers.end(); ++it)
125 if ((*it)->isValid())
126 layers.push_back(*it);
131 if (!selectedlayer || !selectedlayer->isValid())
134 std::list<te::map::AbstractLayerPtr> result;
136 result.push_back(selectedlayer);
138 for (std::list<te::map::AbstractLayerPtr>::iterator it = layers.begin(); it != layers.end(); ++it)
140 if ((*it)->getId() != selectedlayer->getId())
141 result.push_back(*it);
This event signals that a new layer was created.
te::map::AbstractLayerPtr m_layer
Layer selected.
This event is used to get a single layer selected in layer tree.
QMenu * m_popupMenu
Parent popMenu.
void createPopUpAction(std::string name, std::string pixmap="")
Create and set the actions parameters.
This file defines the abstract class AbstractAction.
void createAction(std::string name, std::string pixmap="")
Create and set the actions parameters.
virtual void onActionActivated(bool checked)=0
Slot function used when a action was selected.
te::map::AbstractLayerPtr getCurrentLayer()
Get the selected layer from layer explorer in app.
QAction * m_action
Action used to call the process.
virtual void onPopUpActionActivated(bool checked)
Slot function used when a action was selected from layer pop up.
virtual ~AbstractAction()
Destructor.
QMenu * m_menu
Parent Menu.
void triggered(te::qt::af::evt::Event *e)
AbstractAction(QMenu *menu, QMenu *popupMenu)
Constructor.
std::list< te::map::AbstractLayerPtr > m_layers
void addNewLayer(te::map::AbstractLayerPtr layer)
Add a new layer into layer explorer widget.
QAction * m_popupAction
Action used to call the process from pop up layer.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
std::list< te::map::AbstractLayerPtr > getLayers()
Get the list of layers from app.