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

qmapcontrol::Layer Class Reference

#include <layer.h>

Inheritance diagram for qmapcontrol::Layer:

qmapcontrol::GeometryLayer qmapcontrol::MapLayer

List of all members.


Detailed Description

Layer class.

There are two different layer types:

MapLayers also can display Geometry objects. The difference to the GeometryLayer is the repainting. Objects that are added to a MapLayer are "baken" on the map. This means, when you change it´s position for example the changes are not visible until a new offscreen image has been drawn. If you have "static" Geometries which won´t change their position this is fine. But if you want to change the objects position or pen you should use a GeometryLayer. Those are repainted immediately on changes. You can either use this class and give a layertype on creation or you can use the classes MapLayer and GeometryLayer.

Author:
Kai Winter <kaiwinter@gmx.de>

Definition at line 59 of file layer.h.


Public Types

enum  LayerType { MapLayer, GeometryLayer }
 sets the type of a layer, see Layer class doc for further information More...

Public Slots

void setVisible (bool visible)
 if visible is true, the layer is made visible

Signals

void geometryClicked (Geometry *geometry, QPoint point)
 This signal is emitted when a Geometry is clicked.
void updateRequest ()
void updateRequest (QRectF rect)

Public Member Functions

void addGeometry (Geometry *geometry)
 adds a Geometry object to this Layer
void clearGeometries ()
 removes all Geometry objects from this Layer
bool isVisible () const
 return true if the layer is visible
 Layer (const Layer &old)
 Layer (QString layername, MapAdapter *mapadapter, enum LayerType layertype, bool takeevents=true)
 Layer constructor.
QString layername () const
 returns the layer's name
Layer::LayerType layertype () const
 returns the LayerType of the Layer
const MapAdaptermapadapter () const
 returns the layer´s MapAdapter
Layeroperator= (const Layer &rhs)
void removeGeometry (Geometry *geometry)
 removes the Geometry object from this Layer
void setMapAdapter (MapAdapter *mapadapter)

Private Member Functions

void _draw (QPainter *painter, const QPoint mapmiddle_px) const
void drawYourGeometries (QPainter *painter, const QPoint mapmiddle_px, QRect viewport) const
void drawYourImage (QPainter *painter, const QPoint mapmiddle_px) const
void mouseEvent (const QMouseEvent *, const QPoint mapmiddle_px)
void moveWidgets (const QPoint mapmiddle_px) const
QRect offscreenViewport () const
void setSize (QSize size)
bool takesMouseEvents () const
void zoomIn () const
void zoomOut () const

Private Attributes

QList< Geometry * > geometries
MapAdaptermapAdapter
QString mylayername
LayerType mylayertype
QRect myoffscreenViewport
QPoint screenmiddle
QSize size
bool takeevents
bool visible

Friends

class LayerManager

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

Generated by  Doxygen 1.6.0   Back to index