27 #include "../../../common/Config.h" 28 #include "../../../core/translator/Translator.h" 29 #include "../../../core/logger/Logger.h" 30 #include "../../../edit/SnapManager.h" 31 #include "../../../edit/qt/Renderer.h" 32 #include "../../../maptools/AbstractLayer.h" 33 #include "../../af/ApplicationController.h" 34 #include "../../af/events/ApplicationEvents.h" 35 #include "../../af/events/LayerEvents.h" 36 #include "../../af/events/MapEvents.h" 37 #include "../../widgets/canvas/MapDisplay.h" 38 #include "../../widgets/canvas/Canvas.h" 39 #include "../../widgets/layer/explorer/LayerItem.h" 40 #include "../../widgets/layer/explorer/LayerItemView.h" 52 std::list<te::map::AbstractLayer*>
GetVisibleLayers(
const std::list<te::map::AbstractLayerPtr>& ls)
54 std::list<te::map::AbstractLayer*> res;
56 for(std::list<te::map::AbstractLayerPtr>::const_iterator it = ls.begin(); it != ls.end(); ++it)
58 res.push_back((*it).get());
65 QModelIndex idx = *view->selectionModel()->selectedIndexes().begin();
67 if(view !=
nullptr && idx.isValid())
70 roles << Qt::DecorationRole;
72 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)) 73 view->dataChanged(idx, idx, roles);
75 view->dataChanged(idx, idx);
82 QModelIndexList idxs = view->selectionModel()->selectedIndexes();
84 if(idxs.isEmpty() || idxs.size() > 1)
96 :
te::core::CppPlugin(pluginInfo), m_toolbar(nullptr)
128 m_action->setText(tr(
"&Edition Tools"));
129 m_action->setIcon(QIcon::fromTheme(
"layer-edit"));
141 for(std::set<std::string>::iterator it = sts.begin(); it != sts.end(); ++it)
252 draft->fill(Qt::transparent);
virtual const std::string & getId() const
It returns the layer id.
This is the base class for layers.
static te::dt::Date de(2010, 12, 31)
virtual const std::string & getTitle() const
It returns the layer title.
A base class for application events.
te::qt::widgets::MapDisplay * getDisplay()
void UpdateTreeView(QTreeView *view)
te::qt::widgets::LayerItemView * m_layerExplorer
te::map::AbstractLayerPtr m_layer
Pointer to the selected layer.
EditDelegate * m_delegate
double m_urx
Upper right corner x-coordinate.
Basic information about a plugin.
virtual Visibility getVisibility() const
It returns the layer visibility.
ToolBar * m_toolbar
Main toolbar of TerraLib Edit Qt Plugin.
#define TE_TR(message)
It marks a string in order to get translated.
This event indicates that the layer has been selected.
double m_llx
Lower left corner x-coordinate.
static ApplicationController & getInstance()
It returns a reference to the singleton instance.
An Envelope defines a 2D rectangular region.
void RemoveStash(const te::map::AbstractLayer *layer)
virtual int getSRID() const
It return the Spatial Reference System used by the Map Display.
This event can be used to retrieve the MapDisplat component.
te::qt::widgets::LayerItemView * getLayerExplorer()
void startup()
This method will be called by applications to startup some plugin's functionality.
void addEdited(const std::string &lName)
virtual const te::gm::Envelope & getExtent() const
It returns the world extent showned by the MapDisplay.
void shutdown()
This method will be called by applicatons to shutdown plugin's functionality.
void onApplicationTriggered(te::qt::af::evt::Event *e)
QAction * m_action
Action used to call the process.
#define TERRALIB_PLUGIN_CALL_BACK_IMPL(PLUGIN_CLASS_NAME)
This macro should be used by C++ plugins in order to declare the exportable/callable DLL function...
This is a singleton for rendering geometries and features.
double m_lly
Lower left corner y-coordinate.
void onGeometriesChanged()
Plugin implementation for the TerraLib Edit Qt Plugin.
double m_ury
Upper right corner y-coordinate.
std::list< te::map::AbstractLayer * > GetVisibleLayers(const std::list< te::map::AbstractLayerPtr > &ls)
void begin(QPaintDevice *device, const te::gm::Envelope &e, int srid)
void addStashed(const std::string &lName)
#define TE_LOG_TRACE(message)
Use this tag in order to log a message to the TerraLib default logger with the TRACE level...
void drawRepository(const std::string &source, const te::gm::Envelope &e, int srid)
te::map::AbstractLayer * GetSelectedLayer(QTreeView *view)
void removeStashed(const std::string &lName)
te::qt::af::MapDisplay * m_display
void triggered(te::qt::af::evt::Event *e)
bool isStached(const std::string &lName)
std::set< std::string > GetStashedLayers()
void onStashedLayer(te::map::AbstractLayer *layer)
void onUpdateDelegate(const bool &add)
Plugin(const te::core::PluginInfo &pluginInfo)
void onActionActivated(bool)
Slot function used when a action was selected.