[Marble-commits] KDE/kdeedu/marble/src/lib/geodata
Torsten Rahn
tackat at kde.org
Sun Aug 9 12:12:26 CEST 2009
SVN commit 1009149 by rahn:
- Welcome GeoDataRegion ... still isn't 100% done and needs lots of
work.
M +14 -0 data/GeoDataLatLonAltBox.cpp
M +4 -3 data/GeoDataLatLonAltBox.h
M +0 -7 data/GeoDataLatLonBox.h
M +2 -1 data/GeoDataLod.h
M +1 -1 data/GeoDataPlacemark.cpp
A data/GeoDataRegion.cpp [License: LGPL]
M +10 -31 data/GeoDataRegion.h
A data/GeoDataRegion_p.h [License: LGPL]
M +1 -0 parser/GeoDocument.cpp
M +1 -0 parser/GeoDocument.h
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataLatLonAltBox.cpp #1009148:1009149
@@ -88,6 +88,20 @@
}
+GeoDataLatLonAltBox::GeoDataLatLonAltBox( const GeoDataCoordinates & coordinates )
+ : GeoDataLatLonBox(),
+ d( new GeoDataLatLonAltBoxPrivate )
+{
+ setWest( coordinates.longitude() );
+ setEast( coordinates.longitude() );
+ setNorth( coordinates.latitude() );
+ setSouth( coordinates.latitude() );
+
+ d->m_minAltitude = coordinates.altitude();
+ d->m_maxAltitude = coordinates.altitude();
+}
+
+
GeoDataLatLonAltBox::~GeoDataLatLonAltBox()
{
delete d;
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataLatLonAltBox.h #1009148:1009149
@@ -51,9 +51,10 @@
public:
GeoDataLatLonAltBox();
- GeoDataLatLonAltBox( const GeoDataLatLonAltBox & );
- GeoDataLatLonAltBox( const GeoDataLatLonBox & );
-
+ GeoDataLatLonAltBox( const GeoDataLatLonAltBox & other );
+ GeoDataLatLonAltBox( const GeoDataLatLonBox & other );
+ GeoDataLatLonAltBox( const GeoDataCoordinates & coordinates );
+
virtual ~GeoDataLatLonAltBox();
GeoDataLatLonAltBox& operator=( const GeoDataLatLonAltBox& other );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataLatLonBox.h #1009148:1009149
@@ -140,13 +140,6 @@
virtual bool intersects( const GeoDataLatLonBox & ) const;
/**
- * @brief Create a bounding box from a set of geographic points.
- * @return the bounding box that contains the geographic points.
- * NOTE: Use fromLineString for line strings!
- */
- static GeoDataLatLonBox fromCoordinates( const QVector<GeoDataCoordinates*>& coordinates );
-
- /**
* @brief Create the smallest bounding box from a line string.
* @return the smallest bounding box that contains the linestring.
*/
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataLod.h #1009148:1009149
@@ -42,7 +42,8 @@
*/
class GEODATA_EXPORT GeoDataLod : public GeoDataObject {
-
+
+ public:
/*!
\brief Creates a new Level of Detail object.
*/
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataPlacemark.cpp #1009148:1009149
@@ -72,7 +72,7 @@
}
GeoDataCoordinates GeoDataPlacemark::coordinate() const
-{
+{
if( p()->m_geometry &&
( p()->m_geometry->geometryId() == GeoDataLineStringId ||
p()->m_geometry->geometryId() == GeoDataLinearRingId ) ) {
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataRegion.h #1009148:1009149
@@ -13,11 +13,14 @@
#define GEODATAREGION_H
#include "GeoDataObject.h"
+#include "GeoDataLatLonAltBox.h"
+#include "GeoDataLod.h"
namespace Marble
{
+class GeoDataFeature;
class GeoDataRegionPrivate;
/*!
@@ -45,6 +48,7 @@
class GEODATA_EXPORT GeoDataRegion : public GeoDataObject {
+ public:
/*!
\brief Creates a new GeoDataRegion object that is not assigned to a \a feature.
Naturally it's recommended to assign a feature or a link to the region (and
@@ -59,49 +63,25 @@
\brief Creates a new GeoDataRegion object that is associated to a \a feature.
In the model the feature represents the parent object of the region.
*/
- explicit GeoDataRegion( const GeoDataFeature & feature );
+ explicit GeoDataRegion( GeoDataFeature * feature );
-
-/*!
- \brief Creates a new GeoDataRegion object that is associated to a \a link.
- In the model the link represents the parent object of the region.
-*/
- explicit GeoDataRegion( const GeoDataLink & link );
-
/*!
\brief Destroys a Region object.
*/
virtual ~GeoDataRegion();
- /// Provides type information for downcasting a GeoNode
- virtual QString nodeType() const;
-
-
/*!
- \brief Returns whether a feature or a link is considered to be visible.
- The region is visible if the region is active and if the associated
- latLonAltBox intersects with the camera's/observer's
- \a viewLatLonAltBox.
+ \brief Provides type information for downcasting a GeoNode
*/
- bool isVisible( const GeoDataLatLonAltBox& viewLatLonAltBox ) const;
+ virtual QString nodeType() const;
-
-/*!
- \brief Returns whether a feature or a link is considered to be active.
- The value of the returned boolean is based on the lod property and its
- minLodPixels and maxLodPixels values.
-*/
- bool isActive() const;
-
/*!
- \brief Returns the suggested alpha level at which the feature is visible.
- The alpha level is calculated by taking the minFadeExtent and maxFadeExtent
- properties of the Level of Detail ("lod" object) into account.
+ \brief Assigns a feature associated as a parent
*/
- qreal alpha() const;
+ void setParent( GeoDataFeature * feature );
/*!
@@ -159,8 +139,7 @@
protected:
- GeoDataRegionPrivate *p() const;
- GeoDataRegion(GeoDataRegionPrivate* priv);
+ GeoDataRegionPrivate * const d;
};
}
--- trunk/KDE/kdeedu/marble/src/lib/geodata/parser/GeoDocument.cpp #1009148:1009149
@@ -54,6 +54,7 @@
const char* GeoDataPointType = "GeoDataPoint";
const char* GeoDataPolygonType = "GeoDataPolygon";
const char* GeoDataPolyStyleType = "GeoDataPolyStyle";
+const char* GeoDataRegionType = "GeoDataRegion";
const char* GeoDataStyleSelectorType = "GeoDataStyleSelector";
const char* GeoDataStyleType = "GeoDataStyle";
const char* GeoDataSyleMapType = "GeoDataStyleMap";
--- trunk/KDE/kdeedu/marble/src/lib/geodata/parser/GeoDocument.h #1009148:1009149
@@ -66,6 +66,7 @@
extern const char* GeoDataPointType;
extern const char* GeoDataPolygonType;
extern const char* GeoDataPolyStyleType;
+extern const char* GeoDataRegionType;
extern const char* GeoDataStyleSelectorType;
extern const char* GeoDataStyleType;
extern const char* GeoDataSyleMapType;
More information about the Marble-commits
mailing list