Logo Search packages:      
Sourcecode: qmk-groundstation version File versions  Download package

qmapcontrol::Point Class Reference

#include <point.h>

Inheritance diagram for qmapcontrol::Point:

qmapcontrol::Geometry qmapcontrol::CirclePoint qmapcontrol::ImagePoint qmapcontrol::FixedImageOverlay

List of all members.

Detailed Description

A geometric point to draw objects into maps.

This class can be used to draw your custom QPixmap or other QWidgets into maps. You can instantiate a Point with any Pixmap you want. The objects cares about collision detection (for clickable objects)

When drawing a pixmap, take care you are adding the point to a GeometryLayer. You can also add a point to a MapLayer, but this should only be done, if the point is not changing its position or color etc. (GeometryLayers are assured to be repainted on any changes at the point. MapLayers only gets repainted, if a new offscreenImage is painter. This is a performance issue.)

Points emit click events, if the containing layer receives clickevents (the default)

You can also add a widget into maps. But keep in mind, that widgets always are drawn on top of all layers. You also have to handle click events yourself.

To create "zoomable objects" (objects that increases size on zooming), a base level have to be set. The base level is the zoom level on which the point´s pixmap gets displayed on full size. On lower zoom levels it gets displayed smaller and on higher zoom levels larger. A minimal size can be set as well as a maximum size.

See also:
setBaselevel, setMinsize, setMaxsize
Kai Winter <kaiwinter@gmx.de>

Definition at line 57 of file point.h.

Public Types

enum  Alignment {
  TopLeft, TopRight, BottomLeft, BottomRight,
 sets where the point should be aligned More...

Public Slots

void setCoordinate (QPointF point)
virtual void setVisible (bool visible)
 if visible is true, the layer is made visible


void geometryClicked (Geometry *geometry, QPoint point)
 This signal is emitted when a Geometry is clicked.
void positionChanged (Geometry *geom)
 A Geometry emits this signal, when its position gets changed.
void updateRequest (QRectF rect)
void updateRequest (Geometry *geom)

Public Member Functions

Point::Alignment alignment () const
virtual QRectF boundingBox ()
 returns the bounding box of the point
virtual QList< Geometry * > clickedPoints ()
QPointF coordinate () const
 returns the coordinate of the point
bool Equals (Geometry *geom)
virtual bool hasClickedPoints () const
virtual bool hasPoints () const
bool isVisible () const
 returns true if this Geometry is visible
qreal latitude () const
 returns the latitude of the point
qreal longitude () const
 returns the longitude of the point
QString name () const
 returns the name of this Geometry
GeometryparentGeometry () const
 returns the parent Geometry of this Geometry
QPen * pen () const
 returns the QPen which is used on drawing
QPixmap * pixmap ()
 returns the pixmap of the point
 Point (qreal x, qreal y, QPixmap *pixmap, QString name=QString(), enum Alignment alignment=Middle)
 Point (qreal x, qreal y, QWidget *widget, QString name=QString(), enum Alignment alignment=Middle)
 Point (qreal x, qreal y, QString name=QString(), enum Alignment alignment=Middle)
 Copy Constructor.
 Point (const Point &)
virtual QList< Point * > points ()
void setBaselevel (int zoomlevel)
 Sets the zoom level on which the point�s pixmap gets displayed on full size.
void setMaxsize (QSize maxsize)
 sets a maximal size for the pixmap
void setMinsize (QSize minsize)
 sets a minimal size for the pixmap
void setName (QString name)
 sets the name of the geometry
virtual void setPen (QPen *pen)
QString toString ()
 returns a String representation of this Geometry
QWidget * widget ()
 returns the widget of the point

Public Attributes

QString GeometryType

Protected Member Functions

QPoint alignedPoint (const QPoint point) const
virtual void draw (QPainter *painter, const MapAdapter *mapadapter, const QRect &viewport, const QPoint offset)
void drawWidget (const MapAdapter *mapadapter, const QPoint offset)
void setParentGeometry (Geometry *geom)
virtual bool Touches (Point *geom, const MapAdapter *mapadapter)
 returns true if the given Point touches this Point

Protected Attributes

QSize displaysize
int homelevel
QSize maxsize
QSize minsize
Alignment myalignment
QString myname
QPen * mypen
QPixmap * mypixmap
QWidget * mywidget
QSize size
bool visible
qreal X
qreal Y


class Layer
class LineString

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index