• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdeedu API Reference
  • KDE Home
  • Contact Us
 

marble

  • sources
  • kde-4.14
  • kdeedu
  • marble
  • src
  • plugins
  • render
  • annotate
AreaAnnotation.h
Go to the documentation of this file.
1 //
2 // This file is part of the Marble Virtual Globe.
3 //
4 // This program is free software licensed under the GNU LGPL. You can
5 // find a copy of this license in LICENSE.txt in the top directory of
6 // the source code.
7 //
8 // Copyright 2009 Andrew Manson <g.real.ate@gmail.com>
9 // Copyright 2013 Thibaut Gridel <tgridel@free.fr>
10 // Copyright 2014 Calin-Cristian Cruceru <crucerucalincristian@gmail.com
11 //
12 
13 #ifndef AREAANNOTATION_H
14 #define AREAANNOTATION_H
15 
16 #include "SceneGraphicsItem.h"
17 #include "GeoDataCoordinates.h"
18 
19 #include <QPair>
20 
21 namespace Marble
22 {
23 
24 class AreaAnnotation : public SceneGraphicsItem
25 {
26 public:
27  explicit AreaAnnotation( GeoDataPlacemark *placemark );
28 
29  enum ActionState {
30  Normal,
31  MergingNodes,
32  AddingNodes // TODO
33  };
34 
35  virtual void paint( GeoPainter *painter, const ViewportParams *viewport );
36 
41  void setState( ActionState state );
42 
46  ActionState state() const;
47 
51  QList<int> &selectedNodes();
52 
57  int rightClickedNode() const;
58 
68  bool isInnerBoundsPoint( const QPoint &point, bool restrictive = false ) const;
69 
75  bool isValidPolygon() const;
76 
80  void setMergedNodes( const QPair<int, int> &nodes );
81 
85  QPair<int, int> &mergedNodes();
86 
87  const QPair<int, int> &mergedNodes() const;
88 
92  virtual const char *graphicType() const;
93 
94 private:
99  int firstRegionWhichContains( QMouseEvent *mouseEvent );
100 
101 
102  QList<QRegion> m_innerBoundariesList;
103  ActionState m_state;
104 
105  QPair<int, int> m_mergedNodes;
106 
107  int m_movedNodeIndex;
108  int m_rightClickedNode;
109  QList<int> m_selectedNodes;
110  GeoDataCoordinates m_movedPointCoords;
111 
112  const ViewportParams *m_viewport;
113 
114 protected:
120  virtual bool mousePressEvent( QMouseEvent *event );
121  virtual bool mouseMoveEvent( QMouseEvent *event );
122  virtual bool mouseReleaseEvent( QMouseEvent *event );
123 };
124 
125 }
126 
127 #endif // AREAANNOTATION_H
GeoDataCoordinates.h
Marble::AreaAnnotation::Normal
Definition: AreaAnnotation.h:30
Marble::GeoDataCoordinates
A 3d point representation.
Definition: GeoDataCoordinates.h:52
Marble::GeoPainter
A painter that allows to draw geometric primitives on the map.
Definition: GeoPainter.h:98
Marble::AreaAnnotation::graphicType
virtual const char * graphicType() const
Provides information for downcasting a SceneGraphicsItem.
Definition: AreaAnnotation.cpp:378
Marble::AreaAnnotation::mergedNodes
QPair< int, int > & mergedNodes()
Getters for the nodes to be merged.
Definition: AreaAnnotation.cpp:373
Marble::AreaAnnotation::paint
virtual void paint(GeoPainter *painter, const ViewportParams *viewport)
Paints the item using the given GeoPainter.
Definition: AreaAnnotation.cpp:41
Marble::AreaAnnotation::mouseReleaseEvent
virtual bool mouseReleaseEvent(QMouseEvent *event)
Definition: AreaAnnotation.cpp:253
Marble::AreaAnnotation::selectedNodes
QList< int > & selectedNodes()
Returns the list of selected node indexes.
Definition: AreaAnnotation.cpp:320
Marble::AreaAnnotation::rightClickedNode
int rightClickedNode() const
Returns the node index on which the mouse press event (with the right button) has been caught...
Definition: AreaAnnotation.cpp:325
Marble::AreaAnnotation::MergingNodes
Definition: AreaAnnotation.h:31
QPoint
QMouseEvent
Marble::AreaAnnotation::AreaAnnotation
AreaAnnotation(GeoDataPlacemark *placemark)
Definition: AreaAnnotation.cpp:31
Marble::AreaAnnotation::isInnerBoundsPoint
bool isInnerBoundsPoint(const QPoint &point, bool restrictive=false) const
Checks whether the point parameter is contained by one of its inner boundaries.
Definition: AreaAnnotation.cpp:330
Marble::AreaAnnotation
Definition: AreaAnnotation.h:24
Marble::SceneGraphicsItem
This is the base class for all scene graphics included within the annotate plugin.
Definition: SceneGraphicsItem.h:34
Marble::AreaAnnotation::mouseMoveEvent
virtual bool mouseMoveEvent(QMouseEvent *event)
Definition: AreaAnnotation.cpp:153
Marble::AreaAnnotation::AddingNodes
Definition: AreaAnnotation.h:32
Marble::AreaAnnotation::setState
void setState(ActionState state)
Sets the state of the object.
Definition: AreaAnnotation.cpp:305
QList< int >
Marble::ViewportParams
A public class that controls what is visible in the viewport of a Marble map.
Definition: ViewportParams.h:44
QPair< int, int >
SceneGraphicsItem.h
Marble::AreaAnnotation::state
ActionState state() const
Getter for the state.
Definition: AreaAnnotation.cpp:315
Marble::SceneGraphicsItem::placemark
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
Marble::AreaAnnotation::ActionState
ActionState
Definition: AreaAnnotation.h:29
Marble::AreaAnnotation::setMergedNodes
void setMergedNodes(const QPair< int, int > &nodes)
Sets the nodes to be merged.
Definition: AreaAnnotation.cpp:368
Marble::AreaAnnotation::isValidPolygon
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
Marble::GeoDataPlacemark
a class representing a point of interest on the map
Definition: GeoDataPlacemark.h:54
Marble::AreaAnnotation::mousePressEvent
virtual bool mousePressEvent(QMouseEvent *event)
In the implementation of these virtual functions, the following convention has been followed: if the ...
Definition: AreaAnnotation.cpp:109
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

KDE's Doxygen guidelines are available online.

marble

Skip menu "marble"
  • Main Page
  • Namespace List
  • Namespace Members
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdeedu API Reference

Skip menu "kdeedu API Reference"
  • Analitza
  •     lib
  • kalgebra
  • kalzium
  •   libscience
  • kanagram
  • kig
  •   lib
  • klettres
  • marble
  • parley
  • rocs
  •   App
  •   RocsCore
  •   VisualEditor
  •   stepcore

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal