[QGIS Commit] r11208 - in branches/symbology-ng-branch/src/core: . pal

svn_qgis at osgeo.org svn_qgis at osgeo.org
Wed Jul 29 20:48:23 EDT 2009


Author: wonder
Date: 2009-07-29 20:48:23 -0400 (Wed, 29 Jul 2009)
New Revision: 11208

Removed:
   branches/symbology-ng-branch/src/core/pal/label.cpp
   branches/symbology-ng-branch/src/core/pal/label.h
Modified:
   branches/symbology-ng-branch/src/core/CMakeLists.txt
   branches/symbology-ng-branch/src/core/pal/costcalculator.cpp
   branches/symbology-ng-branch/src/core/pal/labelposition.cpp
   branches/symbology-ng-branch/src/core/pal/pal.cpp
   branches/symbology-ng-branch/src/core/pal/pal.h
   branches/symbology-ng-branch/src/core/pal/palgeometry.h
   branches/symbology-ng-branch/src/core/pal/problem.cpp
   branches/symbology-ng-branch/src/core/qgspalobjectpositionmanager.cpp
Log:
Removed Label class (not used anymore)


Modified: branches/symbology-ng-branch/src/core/CMakeLists.txt
===================================================================
--- branches/symbology-ng-branch/src/core/CMakeLists.txt	2009-07-30 00:32:20 UTC (rev 11207)
+++ branches/symbology-ng-branch/src/core/CMakeLists.txt	2009-07-30 00:48:23 UTC (rev 11208)
@@ -85,7 +85,6 @@
   pal/costcalculator.cpp
   pal/feature.cpp
   pal/geomfunction.cpp
-  pal/label.cpp
   pal/labelposition.cpp
   pal/layer.cpp
   pal/pal.cpp

Modified: branches/symbology-ng-branch/src/core/pal/costcalculator.cpp
===================================================================
--- branches/symbology-ng-branch/src/core/pal/costcalculator.cpp	2009-07-30 00:32:20 UTC (rev 11207)
+++ branches/symbology-ng-branch/src/core/pal/costcalculator.cpp	2009-07-30 00:48:23 UTC (rev 11208)
@@ -7,7 +7,6 @@
 
 #include <pal/layer.h>
 #include <pal/pal.h>
-#include <pal/label.h>
 
 #include "feature.h"
 #include "geomfunction.h"

Deleted: branches/symbology-ng-branch/src/core/pal/label.cpp
===================================================================
--- branches/symbology-ng-branch/src/core/pal/label.cpp	2009-07-30 00:32:20 UTC (rev 11207)
+++ branches/symbology-ng-branch/src/core/pal/label.cpp	2009-07-30 00:48:23 UTC (rev 11208)
@@ -1,107 +0,0 @@
-/*
- *   libpal - Automated Placement of Labels Library
- *
- *   Copyright (C) 2008 Maxence Laurent, MIS-TIC, HEIG-VD
- *                      University of Applied Sciences, Western Switzerland
- *                      http://www.hes-so.ch
- *
- *   Contact:
- *      maxence.laurent <at> heig-vd <dot> ch
- *    or
- *      eric.taillard <at> heig-vd <dot> ch
- *
- * This file is part of libpal.
- *
- * libpal is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * libpal is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libpal.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#define _CRT_SECURE_NO_DEPRECATE
-
-#include <cstring>
-
-#include <pal/label.h>
-#include <pal/palgeometry.h>
-
-namespace pal
-{
-
-  Label::Label( double x[4], double y[4], double alpha, const char *ftid, const char *lyrName, PalGeometry *userGeom ) : a( alpha ), userGeom( userGeom )
-  {
-
-    for ( int i = 0;i < 4;i++ )
-    {
-      this->x[i] = x[i];
-      this->y[i] = y[i];
-    }
-
-    featureId = new char[strlen( ftid ) +1];
-    strcpy( featureId, ftid );
-
-    this->lyrName = new char[strlen( lyrName ) +1];
-    strcpy( this->lyrName, lyrName );
-  }
-
-  Label::~Label()
-  {
-    delete[] featureId;
-    delete[] lyrName;
-  }
-
-  double Label::getOrigX()
-  {
-    return x[0];
-  }
-
-  double Label::getOrigY()
-  {
-    return y[0];
-  }
-
-  double Label::getX( size_t i )
-  {
-    return ( i < 4 ? x[i] : -1 );
-  }
-
-  double Label::getY( size_t i )
-  {
-    return ( i < 4 ? y[i] : -1 );
-  }
-
-  PalGeometry *Label::getGeometry()
-  {
-    return userGeom;
-  }
-
-  double Label::getRotation()
-  {
-    return a;
-  }
-
-  const char *Label::getLayerName()
-  {
-    return lyrName;
-  }
-
-  const char *Label::getFeatureId()
-  {
-    return featureId;
-  }
-
-} // end namespace
-

Deleted: branches/symbology-ng-branch/src/core/pal/label.h
===================================================================
--- branches/symbology-ng-branch/src/core/pal/label.h	2009-07-30 00:32:20 UTC (rev 11207)
+++ branches/symbology-ng-branch/src/core/pal/label.h	2009-07-30 00:48:23 UTC (rev 11208)
@@ -1,132 +0,0 @@
-/*
- *   libpal - Automated Placement of Labels Library
- *
- *   Copyright (C) 2008 Maxence Laurent, MIS-TIC, HEIG-VD
- *                      University of Applied Sciences, Western Switzerland
- *                      http://www.hes-so.ch
- *
- *   Contact:
- *      maxence.laurent <at> heig-vd <dot> ch
- *    or
- *      eric.taillard <at> heig-vd <dot> ch
- *
- * This file is part of libpal.
- *
- * libpal is free software: you can redistribute it and/or modify
- * it under the terms of the GNU General Public License as published by
- * the Free Software Foundation, either version 3 of the License, or
- * (at your option) any later version.
- *
- * libpal is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
- * GNU General Public License for more details.
- *
- * You should have received a copy of the GNU General Public License
- * along with libpal.  If not, see <http://www.gnu.org/licenses/>.
- *
- */
-
-#ifdef HAVE_CONFIG_H
-#include <config.h>
-#endif
-
-#ifndef _LABEL_H
-#define _LABEL_H
-
-namespace pal
-{
-
-  class LabelPosition;
-  class PalGeometry;
-
-  /**
-   * \brief Represent a label to be displayed
-   */
-  class Label
-  {
-
-      friend class LabelPosition;
-    private:
-      double x[4];
-      double y[4];
-
-      double a;
-
-      char *featureId;
-      char *lyrName;
-
-      PalGeometry *userGeom;
-
-      /**
-       * \brief Create a new label
-       *
-       * @param x x coordinate of down-left label corner
-       * @param y y coordinate of down-left label corner
-       * @param alpha rotation to aplay to the text
-       * @param ftid id of the corresponding feature
-       * @param lyrName name of the corresponding layer
-       * @param userGeom PalGeometry of the feature
-       */
-      Label( double x[4], double y[4], double alpha, const char *ftid, const char *lyrName, PalGeometry *userGeom );
-
-    public:
-      /**
-       * \brief delete a label
-       */
-      ~Label();
-
-      /**
-       * \brief return the down-left x coordinate
-       * @return x coordinate
-       */
-      double getOrigX();
-
-      /**
-       * \brief return the down-left y coordinate
-       * @return y coordinate
-       */
-      double getOrigY();
-
-      /**
-       * \brief get a specific x coordinate
-       * @param i 0 => down-left, 1=>down-right, 2=>up-right 3=> up-left
-       * @return the i'th x coordinate
-       */
-      double getX( size_t i );
-
-      /**
-       * \brief get a specific y coordinate
-       * @param i 0 => down-left, 1=>down-right, 2=>up-right 3=> up-left
-       * @return the i'th y coordinate
-       */
-      double getY( size_t i );
-
-      /**
-       * \brief return the label orientation
-       * @return alpha in rad, couterclockwise
-       */
-      double getRotation();
-
-      /**
-       * \brief return the name of the layer wich contains the feature
-       * @return the layer's name
-       */
-      const char *getLayerName();
-
-      /**
-       * \brief return the feature's unique id
-       * @return the feature's id
-       */
-      const char *getFeatureId();
-
-      /**
-       * \brief return user geometry (pal::Layer::registerFeature())
-       * @return pointer to the user geometry
-       */
-      PalGeometry * getGeometry();
-  };
-
-} // end namespace pal
-
-#endif

Modified: branches/symbology-ng-branch/src/core/pal/labelposition.cpp
===================================================================
--- branches/symbology-ng-branch/src/core/pal/labelposition.cpp	2009-07-30 00:32:20 UTC (rev 11207)
+++ branches/symbology-ng-branch/src/core/pal/labelposition.cpp	2009-07-30 00:48:23 UTC (rev 11208)
@@ -41,7 +41,6 @@
 
 #include <pal/layer.h>
 #include <pal/pal.h>
-#include <pal/label.h>
 
 #include "costcalculator.h"
 #include "feature.h"

Modified: branches/symbology-ng-branch/src/core/pal/pal.cpp
===================================================================
--- branches/symbology-ng-branch/src/core/pal/pal.cpp	2009-07-30 00:32:20 UTC (rev 11207)
+++ branches/symbology-ng-branch/src/core/pal/pal.cpp	2009-07-30 00:48:23 UTC (rev 11208)
@@ -49,6 +49,7 @@
 #include <pal/pal.h>
 #include <pal/layer.h>
 #include <pal/palexception.h>
+#include <pal/palstat.h>
 
 #include "linkedlist.hpp"
 #include "rtree.hpp"

Modified: branches/symbology-ng-branch/src/core/pal/pal.h
===================================================================
--- branches/symbology-ng-branch/src/core/pal/pal.h	2009-07-30 00:32:20 UTC (rev 11207)
+++ branches/symbology-ng-branch/src/core/pal/pal.h	2009-07-30 00:48:23 UTC (rev 11208)
@@ -34,8 +34,6 @@
 #ifndef _PAL_H
 #define _PAL_H
 
-#include <pal/label.h>
-#include <pal/palstat.h>
 
 #include <list>
 #include <iostream>
@@ -62,6 +60,7 @@
 
   class Layer;
   class LabelPosition;
+  class PalStat;
   class Problem;
   class PointSet;
   class SimpleMutex;

Modified: branches/symbology-ng-branch/src/core/pal/palgeometry.h
===================================================================
--- branches/symbology-ng-branch/src/core/pal/palgeometry.h	2009-07-30 00:32:20 UTC (rev 11207)
+++ branches/symbology-ng-branch/src/core/pal/palgeometry.h	2009-07-30 00:48:23 UTC (rev 11208)
@@ -30,8 +30,7 @@
 #ifndef _PAL_GEOMETRY_H
 #define _PAL_GEOMETRY_H
 
-#include <list>
-#include <pal/label.h>
+#include <cstdlib> // for size_t needed in geos_c.h
 #include <geos_c.h>
 
 namespace pal
@@ -43,13 +42,6 @@
   class CORE_EXPORT PalGeometry
   {
     public:
-      /*
-       * \brief get the geometry in WKB hexa format
-       * This method is called by Pal each time it needs a geom's coordinates
-       *
-       * @return WKB Hex buffer
-       */
-      //virtual char * getWkbHexBuffer() = 0;
 
       /**
        * \brief get the GEOSGeometry of the feature
@@ -67,20 +59,6 @@
       virtual void releaseGeosGeometry( GEOSGeometry *the_geom ) = 0;
 
 
-      /*
-       * \brief Called by Pal when it doesn't need the coordinates anymore
-       * @param wkbBuffer is the WkbBuffer from PalGeometry::getWkbHexBuffer()
-       */
-      //virtual void releaseWkbHexBuffer(char *wkbBuffer) = 0;
-
-      /*
-       * \brief Give back a label to display
-       * Pal call this method when label will no move anymore.
-       *
-       * @param label the label to disploy
-       */
-      //virtual void addLabel(Label *label) = 0;
-
       virtual ~PalGeometry() {}
   };
 

Modified: branches/symbology-ng-branch/src/core/pal/problem.cpp
===================================================================
--- branches/symbology-ng-branch/src/core/pal/problem.cpp	2009-07-30 00:32:20 UTC (rev 11207)
+++ branches/symbology-ng-branch/src/core/pal/problem.cpp	2009-07-30 00:48:23 UTC (rev 11208)
@@ -48,7 +48,6 @@
 #include <pal/pal.h>
 #include <pal/palstat.h>
 #include <pal/layer.h>
-#include <pal/label.h>
 
 #include "linkedlist.hpp"
 #include "rtree.hpp"

Modified: branches/symbology-ng-branch/src/core/qgspalobjectpositionmanager.cpp
===================================================================
--- branches/symbology-ng-branch/src/core/qgspalobjectpositionmanager.cpp	2009-07-30 00:32:20 UTC (rev 11207)
+++ branches/symbology-ng-branch/src/core/qgspalobjectpositionmanager.cpp	2009-07-30 00:48:23 UTC (rev 11208)
@@ -109,7 +109,6 @@
   double bbox[4]; bbox[0] = viewExtent.xMinimum(); bbox[1] = viewExtent.yMinimum(); bbox[2] = viewExtent.xMaximum(); bbox[3] = viewExtent.yMaximum();
 
 
-  pal::PalStat* stat = 0;
   //set map units
   pal::Units mapUnits;
   switch ( unitType )
@@ -132,8 +131,7 @@
   mPositionEngine.setMapUnit( mapUnits );
   mPositionEngine.setDpi( renderContext.scaleFactor() * 25.4 );
 
-  std::list<pal::LabelPosition*>* resultLabelList = mPositionEngine.labeller( renderContext.rendererScale(), bbox, &stat, false );
-  delete stat;
+  std::list<pal::LabelPosition*>* resultLabelList = mPositionEngine.labeller( renderContext.rendererScale(), bbox, NULL, false );
 
   //and read the positions back to the overlay objects
   if ( !resultLabelList )



More information about the QGIS-commit mailing list