[Marble-commits] KDE/kdeedu/marble/src/lib/graphicsview

Bastian Holst bastianholst at gmx.de
Sun Aug 2 23:01:11 CEST 2009


SVN commit 1006026 by bholst:

Marble GeoGraphicsItem:
* Adding properties as a preview for a future "level of detail" implementation.


 M  +24 -0     GeoGraphicsItem.cpp  
 M  +41 -0     GeoGraphicsItem.h  
 M  +12 -1     GeoGraphicsItem_p.h  


--- trunk/KDE/kdeedu/marble/src/lib/graphicsview/GeoGraphicsItem.cpp #1006025:1006026
@@ -89,6 +89,30 @@
     p()->m_flags = flags;
 }
 
+int GeoGraphicsItem::minLodPixels() const {
+    return p()->m_minLodPixels;
+}
+
+void GeoGraphicsItem::setMinLodPixels( int pixels ) {
+    p()->m_minLodPixels = pixels;
+}
+
+int GeoGraphicsItem::maxLodPixels() const {
+    return p()->m_maxLodPixels;
+}
+
+void GeoGraphicsItem::setMaxLodPixels( int pixels ) {
+    p()->m_maxLodPixels = pixels;
+}
+
+GeoDataLatLonAltBox GeoGraphicsItem::geoBoundingBox() const {
+    return p()->m_geoBoundingBox;
+}
+
+void GeoGraphicsItem::setGeoBoundingBox( const GeoDataLatLonAltBox& boundingBox ) {
+    p()->m_geoBoundingBox = boundingBox;
+}
+
 QList<QPointF> GeoGraphicsItem::positions() const
 {
     return p()->positions();
--- trunk/KDE/kdeedu/marble/src/lib/graphicsview/GeoGraphicsItem.h #1006025:1006026
@@ -27,6 +27,7 @@
 {
     
 class GeoDataCoordinates;
+class GeoDataLatLonAltBox;
 class GeoPainter;
 class GeoSceneLayer;
 class ViewportParams;
@@ -99,6 +100,46 @@
     void setFlags( GeoGraphicsItemFlags flags );
 
     /**
+     * Returns the minimum number of pixels the GeoGraphicsItem has to be projected on for this item
+     * to be considered as active. 0 would mean no minimum number of pixels which is also the
+     * standard value.
+     */
+    int minLodPixels() const;
+
+    /**
+     * Sets the minimum number of pixels the GeoGraphicsItem has to be projected on for this item to
+     * be considered as active.
+     */
+    void setMinLodPixels( int pixels );
+
+    /**
+     * Returns the minimum number of pixels the GeoGraphicsItem has to be projected on for this item
+     * to be considered as active. -1 would mean no maximum number of pixels which is also the
+     * standard value.
+     */
+    int maxLodPixels() const;
+
+    /**
+     * Sets the maximum number of pixels the GeoGraphicsItem has to be projected on for this item to
+     * be considered as active.
+     */
+    void setMaxLodPixels( int pixels );
+
+    // int minFadeExtend() const;
+    // int maxFadeExtend() const;
+
+    /**
+     * Returns the box that is used to determine if an item is active or inactive.
+     */
+    GeoDataLatLonAltBox geoBoundingBox() const;
+
+    /**
+     * Set the box used to determine if an item is active or inactive. If an empty box is passed
+     * the item will be shown in every case.
+     */
+    void setGeoBoundingBox( const GeoDataLatLonAltBox& boundingBox );
+
+    /**
      * Returns all coordinates of the item in view coordinates according to the given projection.
      */
     QList<QPointF> positions() const;
--- trunk/KDE/kdeedu/marble/src/lib/graphicsview/GeoGraphicsItem_p.h #1006025:1006026
@@ -11,7 +11,10 @@
 #ifndef SCREENGRAPHICSITEMPRIVATE_H
 #define SCREENGRAPHICSITEMPRIVATE_H
 
+
+// Marble
 #include "MarbleGraphicsItem_p.h"
+#include "GeoDataLatLonAltBox.h"
 
 namespace Marble
 {
@@ -21,7 +24,10 @@
  public:
     explicit GeoGraphicsItemPrivate( GeoGraphicsItem *parent )
         : MarbleGraphicsItemPrivate( parent ),
-          m_positions()
+          m_positions(),
+          m_minLodPixels( 0 ),
+          m_maxLodPixels( -1 ),
+          m_geoBoundingBox()
     {
     }
     
@@ -62,6 +68,11 @@
     QString m_target;
     QList<QPointF> m_positions;
     GeoGraphicsItem::GeoGraphicsItemFlags m_flags;
+
+    // LOD
+    int m_minLodPixels;
+    int m_maxLodPixels;
+    GeoDataLatLonAltBox m_geoBoundingBox;
 };
 
 }


More information about the Marble-commits mailing list