QMapControl  0.9.7.4
Public Types | Public Slots | Signals | Public Member Functions | List of all members
MapLayer Class Reference

MapLayer class. More...

#include <maplayer.h>

Inheritance diagram for MapLayer:
Layer QObject

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 More...
 

Signals

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

Public Member Functions

void addGeometry (Geometry *geometry)
 adds a Geometry object to this Layer More...
 
void clearGeometries (bool qDeleteObject=false)
 removes all Geometry objects from this Layer More...
 
bool containsGeometry (Geometry *geometry)
 returns true if Layer contains geometry More...
 
QList< Geometry * > & getGeometries ()
 returns all Geometry objects from this Layer More...
 
bool isVisible () const
 return true if the layer is visible More...
 
QString layername () const
 returns the layer's name More...
 
Layer::LayerType layertype () const
 returns the LayerType of the Layer More...
 
MapAdaptermapadapter ()
 returns the layer´s MapAdapter More...
 
 MapLayer (QString layername, MapAdapter *mapadapter, bool takeevents=true)
 MapLayer constructor. More...
 
void removeGeometry (Geometry *geometry, bool qDeleteObject=false)
 removes the Geometry object from this Layer More...
 
void sendGeometryToBack (Geometry *geometry)
 allow moving a geometry to the top of the list (drawing last) More...
 
void sendGeometryToFront (Geometry *geometry)
 allow moving a geometry to the top of the list (drawing last) More...
 

Detailed Description

MapLayer 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.

Author
Kai Winter kaiwi.nosp@m.nter.nosp@m.@gmx..nosp@m.de

Member Enumeration Documentation

enum LayerType
inherited

sets the type of a layer, see Layer class doc for further information

Enumerator
MapLayer 

uses the MapAdapter to display maps, only gets refreshed when a new offscreen image is needed

GeometryLayer 

gets refreshed everytime when a geometry changes

Constructor & Destructor Documentation

MapLayer ( QString  layername,
MapAdapter mapadapter,
bool  takeevents = true 
)

MapLayer constructor.

This is used to construct a map layer.

Parameters
layernameThe name of the Layer
mapadapterThe MapAdapter which does coordinate translation and Query-String-Forming
takeeventsShould the Layer receive MouseEvents? This is set to true by default. Setting it to false could be something like a "speed up hint"

Member Function Documentation

void addGeometry ( Geometry geometry)
inherited

adds a Geometry object to this Layer

Please notice the different LayerTypes (MapLayer and GeometryLayer) and the differences

Parameters
geometrythe new Geometry

References Geometry::boundingBox(), and Layer::containsGeometry().

void clearGeometries ( bool  qDeleteObject = false)
inherited

removes all Geometry objects from this Layer

This method removes all Geometry objects from this Layer. NOTE: this method does not delete the object unless qDeleteObject is set

Parameters
qDeleteObjectcleans up memory of object after removal
bool containsGeometry ( Geometry geometry)
inherited

returns true if Layer contains geometry

This method returns if a Geometry objects is on this Layer.

Referenced by Layer::addGeometry().

void geometryClicked ( Geometry geometry,
QPoint  point 
)
signalinherited

This signal is emitted when a Geometry is clicked.

A Geometry is clickable, if the containing layer is clickable. The layer emits a signal for every clicked geometry

Parameters
geometryThe clicked Geometry
pointThe coordinate (in widget coordinates) of the click
QList< Geometry * > & getGeometries ( )
inherited

returns all Geometry objects from this Layer

This method removes all Geometry objects from this Layer.

Returns
a list of geometries that are on this Layer
bool isVisible ( ) const
inherited

return true if the layer is visible

Returns
if the layer is visible
QString layername ( ) const
inherited

returns the layer's name

Returns
the name of this layer
Layer::LayerType layertype ( ) const
inherited

returns the LayerType of the Layer

There are two LayerTypes: MapLayer and GeometryLayer

Returns
the LayerType of this Layer
MapAdapter * mapadapter ( )
inherited

returns the layer´s MapAdapter

This method returns the MapAdapter of this Layer, which can be useful to do coordinate transformations.

Returns
the MapAdapter which us used by this Layer
void removeGeometry ( Geometry geometry,
bool  qDeleteObject = false 
)
inherited

removes the Geometry object from this Layer

This method removes a Geometry object from this Layer. NOTE: this method does not delete the object unless qDeleteObject is set

Parameters
qDeleteObjectcleans up memory of object after removal

References Geometry::boundingBox().

void sendGeometryToBack ( Geometry geometry)
inherited

allow moving a geometry to the top of the list (drawing last)

This method re-order the Geometry objects so the desired geometry is drawn first and under all other geometries

void sendGeometryToFront ( Geometry geometry)
inherited

allow moving a geometry to the top of the list (drawing last)

This method re-order the Geometry objects so the desired geometry is drawn last and visible above all geometries

void setVisible ( bool  visible)
slotinherited

if visible is true, the layer is made visible

Parameters
visibleif the layer should be visible

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