marble
AnnotatePlugin.cpp
Go to the documentation of this file.
197 bool AnnotatePlugin::render( GeoPainter *painter, ViewportParams *viewport, const QString &renderPos, GeoSceneLayer *layer )
244 const GeoDataPolygon *poly = dynamic_cast<const GeoDataPolygon*>( m_polygonPlacemark->geometry() );
301 EditGroundOverlayDialog *dialog = new EditGroundOverlayDialog( overlay, m_marbleWidget->textureLayer(), m_marbleWidget );
525 // It is important to deal with the MouseMove event here because it changes the state of the selected
526 // item irrespective of the longitude/latitude the cursor moved to (excepting when it is outside the
568 // that has nothing to do with the annotate plugin items. We "deal" with this situation because,
632 // Events caught by ground overlays at mouse release. So far we have: displaying the overlay frame
656 // Handling easily the mouse move by calling for each scene graphic item their own mouseMoveEvent
686 bool AnnotatePlugin::handleMouseReleaseEvent( QMouseEvent *mouseEvent, SceneGraphicsItem *item )
820 // Store the initial inner boundaries and outer boundary in case the polygon will have an invalid
940 if ( selectedNodes.contains( mergedNodes.first ) || selectedNodes.contains( mergedNodes.second ) ) {
1001 mouseEvent->type() != QEvent::MouseMove && mouseEvent->type() != QEvent::MouseButtonRelease ) {
1194 GroundOverlayFrame *frame = new GroundOverlayFrame( rectangle_placemark, overlay, m_marbleWidget->textureLayer() );
1217 GroundOverlayFrame *frame = static_cast<GroundOverlayFrame *>( m_groundOverlayFrames.value( overlay ) );
1227 GroundOverlayFrame *frame = static_cast<GroundOverlayFrame *>( m_groundOverlayFrames.value( overlay ) );
1244 QAction *deleteAllSelected = new QAction( tr( "Delete All Selected Nodes" ), m_polygonRmbMenu );
1290 GeoDataPolygon *poly = dynamic_cast<GeoDataPolygon*>( m_rmbSelectedArea->placemark()->geometry() );
1296 // Sorting and iterating through the list of selected nodes backwards is important because when
1297 // caling {outerBoundary,innerBoundary[i]}.remove, the indexes of the selected nodes bigger than
1300 // Sorting and iterating backwards is, therefore, faster than iterating through the list and at
1342 // If the number of nodes remained after deleting the selected ones is 0, 1 or 2, we remove the
1432 GeoDataPolygon *poly = dynamic_cast<GeoDataPolygon*>( m_rmbSelectedArea->placemark()->geometry() );
virtual QModelIndex index(int row, int column, const QModelIndex &parent) const
void setText(const QString &text)
QString name() const
Returns the user-visible name of the plugin.
Definition: AnnotatePlugin.cpp:116
void clear()
void setSortRole(int role)
void overlayAdded()
void itemRemoved()
void setTessellate(bool tessellate)
Sets the tessellation property for the LineString.
Definition: GeoDataLineString.cpp:320
virtual const char * nodeType() const
Provides type information for downcasting a GeoData.
Definition: GeoDataGeometry.cpp:77
Type type() const
int addFeature(GeoDataContainer *parent, GeoDataFeature *feature, int row=-1)
Definition: GeoDataTreeModel.cpp:792
A container for Features, Styles and in the future Schemas.
Definition: GeoDataDocument.h:65
Definition: GeoDataParser.h:40
void setSeparator(bool b)
void setDocumentRole(DocumentRole role)
Definition: GeoDataDocument.cpp:86
const T & next()
virtual void sort(int column, Qt::SortOrder order)
const char * GeoDataPolygonType
Definition: GeoDataTypes.cpp:69
void repaintNeeded(QRegion dirtyRegion=QRegion())
This signal is emitted if an update of the view is needed.
GeoDataTreeModel * treeModel()
Return the list of Placemarks as a QAbstractItemModel *.
Definition: MarbleModel.cpp:477
virtual void setSourceModel(QAbstractItemModel *sourceModel)
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
void setChecked(bool)
This file contains the headers for MarbleModel.
QList< PluginAuthor > pluginAuthors() const
Definition: AnnotatePlugin.cpp:146
int x() const
int y() const
void setIcon(const QIcon &icon)
const T & at(int i) const
Definition: PluginInterface.h:28
const char * GeoDataPlacemarkType
Definition: GeoDataTypes.cpp:66
QList< int > & selectedNodes()
Returns the list of selected node indexes.
Definition: AreaAnnotation.cpp:320
bool removeFeature(GeoDataContainer *parent, int index)
Definition: GeoDataTreeModel.cpp:826
QPoint mapToGlobal(const QPoint &pos) const
void setAddingOverlay(bool)
Definition: AnnotatePlugin.cpp:273
int exec()
const GeoDataFeature * feature() const
Returns the placemark for that item.
Definition: GeoGraphicsItem.cpp:62
QAction * addAction(QAction *action)
int rightClickedNode() const
Returns the node index on which the mouse press event (with the right button) has been caught...
Definition: AreaAnnotation.cpp:325
void loadAnnotationFile()
Definition: AnnotatePlugin.cpp:417
T & first()
bool exists() const
The pointer to a specific object.
Definition: MarblePlacemarkModel.h:62
QString tr(const char *sourceText, const char *disambiguation, int n)
int addDocument(GeoDataDocument *document)
Definition: GeoDataTreeModel.cpp:821
void update()
This file contains the headers for AbstractProjection.
virtual int rowCount(const QModelIndex &parent) const
int x() const
int y() const
int size() const
bool isNull() const
GeoDataGeometry * geometry()
The geometry of the GeoDataPlacemark is to be rendered to the marble map along with the icon at the c...
Definition: GeoDataPlacemark.cpp:152
A widget class that displays a view of the earth.
Definition: MarbleWidget.h:104
virtual bool event(QEvent *e)
Definition: GeoDataParser.h:36
virtual void setParent(GeoDataObject *parent)
Sets the parent of the object.
Definition: GeoDataObject.cpp:70
void actionGroupsChanged()
This signal is emitted if the actions that the plugin supports change in any way. ...
virtual const QList< QActionGroup * > * actionGroups() const
Getting all actions.
Definition: AnnotatePlugin.cpp:187
bool sceneEvent(QEvent *event)
This function is used to call the event distributer and makes use of the re-implemented virtual funct...
Definition: SceneGraphicsItem.cpp:51
void clear()
void placemarkAdded()
void setRemovingItems(bool)
Definition: AnnotatePlugin.cpp:289
void append(const T &value)
This class specifies the Marble layer interface of a plugin which annotates maps with polygons and pl...
Definition: AnnotatePlugin.h:49
void setName(const QString &value)
Set a new name for this feature.
Definition: GeoDataFeature.cpp:549
StandardButton question(QWidget *parent, const QString &title, const QString &text, QFlags< QMessageBox::StandardButton > buttons, StandardButton defaultButton)
void removeDocument(int index)
Definition: GeoDataTreeModel.cpp:872
Qt::MouseButton button() const
void setDrawingPolygon(bool)
Definition: AnnotatePlugin.cpp:230
Definition: AreaAnnotation.h:24
This is the base class for all scene graphics included within the annotate plugin.
Definition: SceneGraphicsItem.h:34
Definition: GeoDataDocument.h:42
void visibilityChanged(bool visible, const QString &nameId)
This signal is emitted if the visibility is changed with.
bool eventFilter(QObject *watched, QEvent *event)
Definition: AnnotatePlugin.cpp:468
int removeAll(const T &value)
void remove(int i)
Standard Marble way of writing XML This class is intended to be a standardised way of writing XML for...
Definition: GeoWriter.h:29
bool render(GeoPainter *painter, ViewportParams *viewport, const QString &renderPos, GeoSceneLayer *layer=0)
Renders the content provided by the layer on the viewport.
Definition: AnnotatePlugin.cpp:197
void setDynamicSortFilter(bool enable)
void addStyle(const GeoDataStyle &style)
Add a style to the style storage.
Definition: GeoDataDocument.cpp:134
T & first()
QString renderPolicy() const
Return how the plugin settings should be used.
Definition: AnnotatePlugin.cpp:106
QStringList renderPosition() const
Preferred level in the layer stack for the rendering.
Definition: AnnotatePlugin.cpp:111
GeoDataLatLonAltBox latLonAltBox() const
A convenience function that returns the LatLonAltBox of all placemarks in this container.
Definition: GeoDataContainer.cpp:160
void updateFeature(GeoDataFeature *feature)
Definition: GeoDataTreeModel.cpp:864
virtual bool open(QFlags< QIODevice::OpenModeFlag > mode)
GeoDataLinearRing & outerBoundary()
Returns the outer boundary that is represented as a LinearRing.
Definition: GeoDataPolygon.cpp:123
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
bool contains(const QPoint &p) const
void setStyleUrl(const QString &value)
Set the styleUrl of this feature to value.
Definition: GeoDataFeature.cpp:631
TextureLayer * textureLayer() const
Definition: MarbleWidget.cpp:380
const char * kmlTag_nameSpaceOgc22
Definition: KmlElementDictionary.cpp:34
QString copyrightYears() const
Definition: AnnotatePlugin.cpp:141
iterator end()
void centerOn(const qreal lon, const qreal lat, bool animated=false)
Center the view on a geographical point.
Definition: MarbleWidget.cpp:549
QString description() const
Returns a user description of the plugin.
Definition: AnnotatePlugin.cpp:131
void setDocumentType(const QString &documentType)
Set the current document type.
Definition: GeoWriter.cpp:79
bool contains(const T &value) const
void setAddingPlacemark(bool)
Definition: AnnotatePlugin.cpp:225
virtual void close()
void setCheckable(bool)
The popularity index.
Definition: MarblePlacemarkModel.h:60
const T & at(int i) const
The data model (not based on QAbstractModel) for a MarbleWidget.
Definition: MarbleModel.h:97
QList< QRegion > regions() const
Returns the list of regions which form the scene graphic element.
Definition: SceneGraphicsItem.cpp:31
const char * SceneGraphicAreaAnnotation
Definition: SceneGraphicsTypes.cpp:20
QAbstractItemModel * groundOverlayModel()
Definition: MarbleModel.cpp:497
QVector< GeoDataLinearRing > & innerBoundaries()
Returns a set of inner boundaries which are represented as LinearRings.
Definition: GeoDataPolygon.cpp:139
bool isEmpty() const
Returns whether the LineString has no nodes at all.
Definition: GeoDataLineString.cpp:133
QVariant data(int role) const
QStringList backendTypes() const
Returns the name(s) of the backend that the plugin can render This method should return the name of t...
Definition: AnnotatePlugin.cpp:101
QVector< GeoDataFeature * > featureList() const
A convenience function that returns all features in this container.
Definition: GeoDataContainer.cpp:231
void setAddingPolygonHole(bool)
Definition: AnnotatePlugin.cpp:259
bool geoCoordinates(int x, int y, qreal &lon, qreal &lat, GeoDataCoordinates::Unit=GeoDataCoordinates::Degree) const
Get the earth coordinates corresponding to a pixel in the widget.
Definition: MarbleWidget.cpp:668
virtual const QList< QActionGroup * > * toolbarActionGroups() const
Getting all actions which should be placed in the toolbar.
Definition: AnnotatePlugin.cpp:192
QString getSaveFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
void saveAnnotationFile()
Definition: AnnotatePlugin.cpp:400
const GeoDataPlacemark * placemark() const
SceneGraphicItem class, when called from one of its derived classes' constructors, takes as a parameter a pointer to the placemark of the graphic element.
Definition: SceneGraphicsItem.cpp:41
AnnotatePlugin(const MarbleModel *model=0)
Definition: AnnotatePlugin.cpp:56
This file contains the headers for MarbleWidget.
StandardButton warning(QWidget *parent, const QString &title, const QString &text, QFlags< QMessageBox::StandardButton > buttons, StandardButton defaultButton)
bool write(QIODevice *device, const GeoNode *feature)
The main API call to use the XML writer.
Definition: GeoWriter.cpp:28
const QPoint & pos() const
QString getOpenFileName(QWidget *parent, const QString &caption, const QString &dir, const QString &filter, QString *selectedFilter, QFlags< QFileDialog::Option > options)
Wraps a Marble::MarbleWidget, providing access to important properties and methods.
Definition: MarbleDeclarativeWidget.h:50
virtual QString runtimeTrace() const
Returns a debug line for perfo/tracing issues.
Definition: AnnotatePlugin.cpp:182
bool isValidPolygon() const
Checks if the polygon has a valid shape; an invalid shape would be, for example, if one of its inner ...
Definition: AreaAnnotation.cpp:353
Definition: MarbleGlobal.h:32
bool connect(const QObject *sender, const char *signal, const QObject *receiver, const char *method, Qt::ConnectionType type)
QList< QAction * > actions() const
int size() const
specifies the style how polygons are drawn
Definition: GeoDataPolyStyle.h:34
void setExclusive(bool)
virtual const char * nodeType() const
Provides type information for downcasting a GeoData.
Definition: GeoDataFeature.cpp:158
QString arg(qlonglong a, int fieldWidth, int base, const QChar &fillChar) const
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
The abstract class that creates a renderable item.
Definition: RenderPlugin.h:43
iterator begin()
QString guiString() const
String that should be displayed in GUI.
Definition: AnnotatePlugin.cpp:121
GeoDocument * releaseDocument()
retrieve the parsed document and reset the parser If parsing was successful, retrieve the resulting d...
Definition: GeoParser.cpp:205
void setGeometry(GeoDataGeometry *entry)
Sets the current Geometry of this Placemark.
Definition: GeoDataPlacemark.cpp:230
bool hasNext() const
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
Documentation copyright © 1996-2020 The KDE developers.
Generated on Mon Jun 22 2020 13:13:38 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.