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

marble/src

AbstractLayer Class Reference

#include <AbstractLayer.h>

Inheritance diagram for AbstractLayer:

Inheritance graph
[legend]

List of all members.


Detailed Description

framework class for each display layer in Marble

This class is intended to be used as a base class for all layers in Marble. It contains convienience classes and can be used as a framework for implementing new layers. So far there is default implementations for all of the virtual methods so that any developer may implement a whole new layer with the least amount of effort.

Definition at line 41 of file AbstractLayer.h.


Public Slots

virtual void paintLayer (ClipPainter *painter, const QSize &screenSize, ViewParams *viewParams)
virtual void paintLayer (ClipPainter *painter, const QSize &screenSize, ViewParams *viewParams, BoundingBox bounding)

Public Member Functions

 AbstractLayer (QObject *parent=0)
 ~AbstractLayer ()
bool getPixelPosFromGeoDataPoint (GeoDataPoint geoPosition, const QSize &screenSize, ViewParams *viewParams, QPoint *position)
bool visible () const
void setVisible (bool visible)

Static Public Member Functions

static bool getPixelPosFromGeoDataPoint (double _lon, double _lat, const QSize &screenSize, ViewParams *viewParams, QPoint *position)
static double distance (const QPoint &, const QPoint &)
static double distance (const QPointF &, const QPointF &)

Protected Attributes

QVector
< AbstractLayerContainer * > * 
m_containers

Constructor & Destructor Documentation

AbstractLayer::AbstractLayer ( QObject *  parent = 0  ) 

Construct this layer with a parent.

Definition at line 24 of file AbstractLayer.cpp.

AbstractLayer::~AbstractLayer (  ) 

distructor

Definition at line 31 of file AbstractLayer.cpp.


Member Function Documentation

void AbstractLayer::paintLayer ( ClipPainter *  painter,
const QSize &  screenSize,
ViewParams *  viewParams 
) [virtual, slot]

method to paint the whole Layer

This method is intended to keep the painting of an entire layer a simple function call.

Parameters:
painter pointer to the painter that will paint this layer
screenSize used to calculate the pixel position
radius globe radius, used as a measure of zoom level
rotAxis quaternion that represents the current rotation of the globe

Definition at line 87 of file AbstractLayer.cpp.

void AbstractLayer::paintLayer ( ClipPainter *  painter,
const QSize &  screenSize,
ViewParams *  viewParams,
BoundingBox  bounding 
) [virtual, slot]

method to paint the whole Layer

This overloaded method is intended to add the functionality of having a bounding box implementation.

Parameters:
painter pointer to the painter that will paint this layer
screenSize used to calculate the pixel position
radius globe radius, used as a measure of zoom level
rotAxis quaternion that represents the current rotation of the globe
bounding BoundingBox object that represents the smallest area that contains all of the view

Reimplemented in GpsLayer.

Definition at line 100 of file AbstractLayer.cpp.

bool AbstractLayer::getPixelPosFromGeoDataPoint ( double  _lon,
double  _lat,
const QSize &  screenSize,
ViewParams *  viewParams,
QPoint *  position 
) [static]

get screen pixel position from a geographical position

Method to simplify the retrieval of the screen pixel position from a longditude and latitude. This static method is not intended for use in a layer that implements AbstractLayerData objects because AbstractLayerData has a memeber function for this purpose

Parameters:
_lon the longitude of the point we want to find
_lat the latitude of the point we want to find
invRotAxis inversion of the Quaternion status of the globe
screenSize size of the screen
position QPoint that the position on screen will be saved into
radius the radius of the globe, a measure of zoom level
Returns:
true if the pixel is visible on the screen false if the pixel is outside the screen

Definition at line 37 of file AbstractLayer.cpp.

bool AbstractLayer::getPixelPosFromGeoDataPoint ( GeoDataPoint  geoPosition,
const QSize &  screenSize,
ViewParams *  viewParams,
QPoint *  position 
)

get screen pixel position.

Method to simplify the retreval of the screen pixel position from a GeoDataPoint object.

Parameters:
geoPosition the position of the point we want to find
invRotAxis inversion of the Quaternion status of the globe
screenSize size of the screen
position QPoint where the position on screen will be saved into
radius the radius of the globe, a measure of zoom level
Returns:
true if the pixel is visible on the screen false if the pixel is outside the screen

Definition at line 57 of file AbstractLayer.cpp.

bool AbstractLayer::visible (  )  const

Return whether the Layer is visible.

Returns:
The Layer visibility.

Definition at line 77 of file AbstractLayer.cpp.

void AbstractLayer::setVisible ( bool  visible  ) 

Set whether the Layer is visible.

Parameters:
visible visibility of the Layer

Definition at line 82 of file AbstractLayer.cpp.

double AbstractLayer::distance ( const QPoint &  a,
const QPoint &  b 
) [static]

convenience method to find the distance between 2 points

This is not intended to be used as a distance between 2 geoPoints, the intended use is only for measuring points on the view for drawing purposes.

Definition at line 115 of file AbstractLayer.cpp.

double AbstractLayer::distance ( const QPointF &  a,
const QPointF &  b 
) [static]

overloaded method to allow for double presision distance

Definition at line 122 of file AbstractLayer.cpp.


Member Data Documentation

QVector<AbstractLayerContainer *>* AbstractLayer::m_containers [protected]

a collection of all containers that hold the data for this layer

To draw a layer you should be able to iterate through this collection and call each container's draw() function

Definition at line 182 of file AbstractLayer.h.


The documentation for this class was generated from the following files:
  • AbstractLayer.h
  • AbstractLayer.cpp

marble/src

Skip menu "marble/src"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members

kdeedu

Skip menu "kdeedu"
  • kalzium
  • kanagram
  • kig
  • klettres
  • kstars
  • libkdeedu
  •   keduvocdocument
  •   docs
  •   src
  • parley
Generated for kdeedu by doxygen 1.5.4
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal