marble/src
AbstractLayerContainer Class Reference
#include <AbstractLayerContainer.h>

Detailed Description
Container to hold AbstractLayerData objects.
This container will hold all data that can be drawn on the Marble Widget. The Container inherits the AbstractLayerInterface Class and provides sensible default implementations for its methods using the draw() implementations in the AbstractLayerData objects. Because of the presence of pretty large Containers the container itself will only represent visible data and will contain a reference to a binary file that represents all of the layer data. The intention of this class is to keep the complicated memory management away from any new developers making it easier to implement a new layer Each time the view changes the visible data should be altered by a thread that will monitor and deal with this process.
Definition at line 45 of file AbstractLayerContainer.h.
Public Member Functions | |
| AbstractLayerContainer (int size=0) | |
| AbstractLayerContainer (const QString &name, int size=0) | |
| virtual | ~AbstractLayerContainer () |
| virtual void | draw (ClipPainter *painter, const QPoint &point) |
| virtual void | draw (ClipPainter *painter, const QSize &canvasSize, ViewParams *viewParams) |
| virtual void | draw (ClipPainter *painter, const QSize &canvasSize, ViewParams *viewParams, BoundingBox box) |
| QString | name () const |
| double | distance (const QPoint &a, const QPoint &b) |
| double | distance (const QPointF &a, const QPointF &b) |
| void | createBoundingBox () |
| QVector< QPointF > | geoCoord () |
Protected Member Functions | |
| virtual void | processVisible () |
| virtual void | printToStream (QTextStream &) const |
| void | manageMemory () |
Protected Attributes | |
| BoundingBox * | m_boundingBox |
Constructor & Destructor Documentation
| AbstractLayerContainer::AbstractLayerContainer | ( | int | size = 0 |
) |
simple constructor with optional starting size.
- Parameters:
-
size the amount of Data objects this container will have at first.
Definition at line 18 of file AbstractLayerContainer.cpp.
| AbstractLayerContainer::AbstractLayerContainer | ( | const QString & | name, | |
| int | size = 0 | |||
| ) | [explicit] |
simple constructor with optional starting size and name for the container.
- Parameters:
-
size the amount of Data objects this container will have at first. name the name of the Container
Definition at line 27 of file AbstractLayerContainer.cpp.
| AbstractLayerContainer::~AbstractLayerContainer | ( | ) | [virtual] |
Member Function Documentation
| void AbstractLayerContainer::draw | ( | ClipPainter * | painter, | |
| const QPoint & | point | |||
| ) | [virtual] |
default implementation of AbstractLayerInterface function.
this method does not apply to AbstractLayerContainer and should never be called.
- Parameters:
-
painter only provided to match AbstractLayerInterface point only provided to match AbstractLayerInterface
Implements AbstractLayerInterface.
Reimplemented in Route, Track, and TrackSegment.
Definition at line 45 of file AbstractLayerContainer.cpp.
| void AbstractLayerContainer::draw | ( | ClipPainter * | painter, | |
| const QSize & | canvasSize, | |||
| ViewParams * | viewParams | |||
| ) | [virtual] |
draw all AbstraceLayerData objects in this container
draw() is intended to deal with drawing all visable Data Objects in this Container by calling their draw() function.
- Parameters:
-
painter this will be used to draw the contianer canvasSize the size of the marble widget view radius measure of zoom level invRotAxis inversion of the rotation Quaternion that represents the rotation of the globe
Implements AbstractLayerInterface.
Reimplemented in Route, Track, TrackContainer, TrackSegment, and WaypointContainer.
Definition at line 55 of file AbstractLayerContainer.cpp.
| void AbstractLayerContainer::draw | ( | ClipPainter * | painter, | |
| const QSize & | canvasSize, | |||
| ViewParams * | viewParams, | |||
| BoundingBox | box | |||
| ) | [virtual] |
draw this Container after evaluating its bounding Box
this container will only get drawn if the bounding box of the view intersects with the bounding box of the container
- Parameters:
-
painter this will be used to draw the contianer canvasSize the size of the marble widget view radius measure of zoom level invRotAxis inversion of the rotation Quaternion that represents the rotation of the globe box the bounding box that holds the view
Implements AbstractLayerInterface.
Reimplemented in Route, RouteContainer, Track, TrackContainer, TrackSegment, and WaypointContainer.
Definition at line 66 of file AbstractLayerContainer.cpp.
| QString AbstractLayerContainer::name | ( | ) | const |
get the distance between 2 points
This is just a convience method to make certain optimisations easier, such as not drawing an AbstractLayerData if it is too close to another
- Returns:
- the square of the distance between the points, if the actual distance is needed get the square root.
Definition at line 109 of file AbstractLayerContainer.cpp.
get the distance between 2 points
Overloaded method to work with QPointF objects and allow for floating point Points.
- Returns:
- the square of the distance between the points, if the actual distance is needed get the square root.
Definition at line 116 of file AbstractLayerContainer.cpp.
| void AbstractLayerContainer::createBoundingBox | ( | ) |
creates a bouding box from this Contianer
Definition at line 123 of file AbstractLayerContainer.cpp.
generate a QVector of QPointF representing the x and y values of each AbstractLayerData's Quaternion
this method is used to collect the information nessary to create the bounding box from this container.
Definition at line 128 of file AbstractLayerContainer.cpp.
| void AbstractLayerContainer::processVisible | ( | ) | [protected, virtual] |
Method to process what Data Objects need to be in memory.
Intended to be implemented by each subclass of AbstractLayerContainer with specific needs but a very basic implementation is available.
Definition at line 85 of file AbstractLayerContainer.cpp.
| void AbstractLayerContainer::printToStream | ( | QTextStream & | out | ) | const [protected, virtual] |
print a text representation of this class to a stream
Reimplemented from AbstractLayerInterface.
Reimplemented in Route, Track, and TrackSegment.
Definition at line 99 of file AbstractLayerContainer.cpp.
| void AbstractLayerContainer::manageMemory | ( | ) | [protected] |
brings data from file into memory
This method reads the Bit Array to find out which items need to be in memory and processes this information. FIXME: make this work with a binary file
Definition at line 139 of file AbstractLayerContainer.cpp.
Member Data Documentation
BoundingBox* AbstractLayerContainer::m_boundingBox [protected] |
bounding box to quickly identify if this should be drawn
Definition at line 180 of file AbstractLayerContainer.h.
The documentation for this class was generated from the following files:
KDE 4.0 API Reference