Layer Class Reference

Layer class. More...

#include <layer.h>

Inheritance diagram for Layer:

GeometryLayer MapLayer

List of all members.

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.

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 (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
void removeGeometry (Geometry *geometry)
 removes the Geometry object from this Layer


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>

Member Enumeration Documentation

enum LayerType

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

Layer ( QString  layername,
MapAdapter mapadapter,
enum LayerType  layertype,
bool  takeevents = true 
)

Layer constructor.

This is used to construct a layer.

Parameters:
layername The name of the Layer
mapadapter The MapAdapter which does coordinate translation and Query-String-Forming
layertype The above explained LayerType
takeevents Should 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  ) 

adds a Geometry object to this Layer

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

Parameters:
geometry the new Geometry

References Geometry::boundingBox().

void clearGeometries (  ) 

removes all Geometry objects from this Layer

This method removes all Geometry objects from this Layer.

void geometryClicked ( Geometry geometry,
QPoint  point 
) [signal]

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:
geometry The clicked Geometry
point The coordinate (in widget coordinates) of the click

bool isVisible (  )  const

return true if the layer is visible

Returns:
if the layer is visible

QString layername (  )  const

returns the layer's name

Returns:
the name of this layer

Layer::LayerType layertype (  )  const

returns the LayerType of the Layer

There are two LayerTypes: MapLayer and GeometryLayer

Returns:
the LayerType of this Layer

const MapAdapter * mapadapter (  )  const

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  ) 

removes the Geometry object from this Layer

This method removes a Geometry object from this Layer.

void setVisible ( bool  visible  )  [slot]

if visible is true, the layer is made visible

Parameters:
visible if the layer should be visible


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

Generated on Wed Jul 29 12:38:10 2009 for QMapControl by  doxygen 1.5.9