[Marble-commits] KDE/kdeedu/marble/src/lib/geodata/data
Bastian Holst
bastianholst at gmx.de
Mon Aug 24 21:13:10 CEST 2009
SVN commit 1015175 by bholst:
Adding the attribute region to GeoDataFeature
M +12 -0 GeoDataFeature.cpp
M +26 -13 GeoDataFeature.h
M +9 -3 GeoDataFeature_p.h
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataFeature.cpp #1015174:1015175
@@ -27,6 +27,7 @@
#include "GeoDataDocument.h"
#include "GeoDataFolder.h"
#include "GeoDataPlacemark.h"
+#include "GeoDataRegion.h"
namespace Marble
@@ -470,6 +471,17 @@
d->m_style = style;
}
+GeoDataRegion GeoDataFeature::region() const
+{
+ return d->m_region;
+}
+
+void GeoDataFeature::setRegion( const GeoDataRegion& region )
+{
+ detach();
+ d->m_region = region;
+}
+
GeoDataFeature::GeoDataVisualCategory GeoDataFeature::visualCategory() const
{
return d->m_visualCategory;
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataFeature.h #1015174:1015175
@@ -33,6 +33,7 @@
class GeoDataFolder;
class GeoDataDocument;
class GeoDataPlacemark;
+class GeoDataRegion;
class GeoDataStyle;
class GeoDataStyleSelector;
@@ -219,6 +220,18 @@
void setStyle( GeoDataStyle* style );
/**
+ * Return the region assigned to the placemark.
+ */
+ GeoDataRegion region() const;
+ /**
+ * @brief Sets the region of the placemark.
+ * @param region new value for the region
+ *
+ * The feature is only shown when the region if active.
+ */
+ void setRegion( const GeoDataRegion& region );
+
+ /**
* Return the symbol index of the placemark.
*/
GeoDataVisualCategory visualCategory() const;
@@ -265,27 +278,27 @@
void setPopularity( qint64 popularity );
/**
- * Return a pointer to a GeoDataStyleMap object which represents the styleMap
- * of this feature. A styleMap is simply a QMap<QString,QString> which can connect
- * two styles with a keyword. This can be used to have a highlighted and a
- * normal style.
- * @see GeoDataStyleMap
- */
+ * Return a pointer to a GeoDataStyleMap object which represents the styleMap
+ * of this feature. A styleMap is simply a QMap<QString,QString> which can connect
+ * two styles with a keyword. This can be used to have a highlighted and a
+ * normal style.
+ * @see GeoDataStyleMap
+ */
GeoDataStyleMap* styleMap() const;
/**
- * Sets the styleMap of the feature
- */
+ * Sets the styleMap of the feature
+ */
void setStyleMap( GeoDataStyleMap* map );
/**
- * Returns pointer to the GeoDataLooAt of the feature.
- */
+ * Returns pointer to the GeoDataLooAt of the feature.
+ */
GeoDataLookAt* lookAt() const;
/**
- * Sets the lookAt of the placemark.
- * @param LookAt the new LookAt of the feature.
- */
+ * Sets the lookAt of the placemark.
+ * @param LookAt the new LookAt of the feature.
+ */
void setLookAt( GeoDataLookAt *lookAt );
--- trunk/KDE/kdeedu/marble/src/lib/geodata/data/GeoDataFeature_p.h #1015174:1015175
@@ -15,6 +15,7 @@
#include <QtCore/QAtomicInt>
#include "GeoDataFeature.h"
+#include "GeoDataRegion.h"
namespace Marble
{
@@ -36,6 +37,7 @@
m_role(' '),
m_style( 0 ),
m_styleMap( 0 ),
+ m_region(),
ref( 0 )
{
}
@@ -54,6 +56,7 @@
m_role( other.m_role ),
m_style( other.m_style ), //FIXME: both style and stylemap need to be reworked internally!!!!
m_styleMap( other.m_styleMap ),
+ m_region( other.m_region ),
ref( 0 )
{
}
@@ -73,6 +76,7 @@
m_style = other.m_style;
m_styleMap = other.m_styleMap;
m_visualCategory = other.m_visualCategory;
+ m_region = other.m_region;
}
virtual void* copy()
@@ -80,7 +84,7 @@
GeoDataFeaturePrivate* copy = new GeoDataFeaturePrivate;
*copy = *this;
return copy;
- };
+ }
virtual EnumFeatureId featureId() const
{
@@ -111,9 +115,11 @@
QChar m_role;
- GeoDataStyle* m_style;
+ GeoDataStyle* m_style;
GeoDataStyleMap* m_styleMap;
- GeoDataLookAt* m_lookAt;
+ GeoDataLookAt* m_lookAt;
+
+ GeoDataRegion m_region;
QAtomicInt ref;
};
More information about the Marble-commits
mailing list