27 #include "../../af/events/LayerEvents.h"
28 #include "../../af/ApplicationController.h"
29 #include "../../af/Project.h"
37 m_popupMenu(popupMenu),
56 m_action =
new QAction(m_menu);
58 m_action->setText(name.c_str());
60 if(pixmap.empty() ==
false)
61 m_action->setIcon(QIcon::fromTheme(pixmap.c_str()));
63 connect(m_action, SIGNAL(triggered(
bool)),
this, SLOT(onActionActivated(
bool)));
65 m_menu->addAction(m_action);
72 m_popupAction =
new QAction(m_popupMenu);
74 m_popupAction->setText(name.c_str());
76 if(pixmap.empty() ==
false)
77 m_popupAction->setIcon(QIcon::fromTheme(pixmap.c_str()));
79 connect(m_popupAction, SIGNAL(triggered(
bool)),
this, SLOT(onPopUpActionActivated(
bool)));
81 m_popupMenu->addAction(m_popupAction);
101 std::auto_ptr<te::da::DataSetType> dsType = evt.
m_layer->getSchema();
103 if(dsType.get() && dsType->hasRaster())
112 std::list<te::map::AbstractLayerPtr> list;
te::map::AbstractLayerPtr m_layer
Layer selected.
std::list< te::map::AbstractLayerPtr > getAllLayers()
It gets all the layers (single and folder layers) of the project.
virtual ~AbstractAction()
Destructor.
This event is used to get a single layer selected in layer tree.
static ApplicationController & getInstance()
It gives access to the controller singleton.
AbstractAction(QMenu *menu, QMenu *popupMenu)
Constructor.
std::list< te::map::AbstractLayerPtr > getLayers()
Get the list of layers from app.
This class models the concept of a project for the TerraLib Application Framework.
This event signals that a new layer was created.
void createAction(std::string name, std::string pixmap="")
Create and set the actions parameters.
void addNewLayer(te::map::AbstractLayerPtr layer)
Add a new layer into layer explorer widget.
te::map::AbstractLayerPtr getCurrentLayer()
Get the selected layer from layer explorer in app.
void createPopUpAction(std::string name, std::string pixmap="")
Create and set the actions parameters.
boost::intrusive_ptr< AbstractLayer > AbstractLayerPtr
virtual void onPopUpActionActivated(bool checked)
Slot function used when a action was selected from layer pop up.
This file defines the abstract class AbstractAction.
void broadcast(te::qt::af::evt::Event *evt)
Send events in broadcast for all registered components.
te::qt::af::Project * getProject()
Get the current project.