Skip to content
Permalink
Browse files
hackfest commit from timlinux:
- more API cleanups
- single click (instead of drag) to select a feature (fixes #1154)
- fixes for topological editing


git-svn-id: http://svn.osgeo.org/qgis/trunk/qgis@9471 c8812cc2-4d05-0410-92ff-de0c093fc19c
  • Loading branch information
jef committed Oct 10, 2008
1 parent 381cab7 commit c152dfa8b034a3b39de8022697cbd06b0119c403
Showing with 1,183 additions and 1,151 deletions.
  1. +1 −1 INSTALL
  2. +1 −1 doc/INSTALL.t2t
  3. +13 −13 python/core/qgis.sip
  4. +1 −1 python/core/qgscontinuouscolorrenderer.sip
  5. +2 −11 python/core/qgscoordinatereferencesystem.sip
  6. +1 −1 python/core/qgsdistancearea.sip
  7. +3 −3 python/core/qgsgeometry.sip
  8. +1 −1 python/core/qgsgraduatedsymbolrenderer.sip
  9. +2 −2 python/core/qgsmaprenderer.sip
  10. +4 −4 python/core/qgsscalecalculator.sip
  11. +1 −1 python/core/qgssinglesymbolrenderer.sip
  12. +3 −3 python/core/qgssymbol.sip
  13. +1 −1 python/core/qgsuniquevaluerenderer.sip
  14. +1 −1 python/core/qgsvectordataprovider.sip
  15. +1 −1 python/core/qgsvectorfilewriter.sip
  16. +2 −2 python/core/qgsvectorlayer.sip
  17. +2 −2 python/gui/qgsmapcanvas.sip
  18. +1 −1 python/plugins/plugin_installer/installer_data.py
  19. +2 −2 python/plugins/plugin_installer/installer_plugin.py
  20. +1 −1 src/app/legend/qgslegendlayer.cpp
  21. +18 −21 src/app/qgisapp.cpp
  22. +8 −8 src/app/qgscontinuouscolordialog.cpp
  23. +3 −3 src/app/qgscustomprojectiondialog.cpp
  24. +2 −2 src/app/qgscustomprojectiondialog.h
  25. +5 −5 src/app/qgsdbtablemodel.cpp
  26. +3 −3 src/app/qgsdbtablemodel.h
  27. +1 −1 src/app/qgsgeomtypedialog.cpp
  28. +1 −1 src/app/qgsgeomtypedialog.h
  29. +8 −8 src/app/qgsgraduatedsymboldialog.cpp
  30. +1 −1 src/app/qgsmapserverexport.cpp
  31. +4 −4 src/app/qgsmaptooladdfeature.cpp
  32. +4 −4 src/app/qgsmaptoolidentify.cpp
  33. +37 −13 src/app/qgsmaptoolselect.cpp
  34. +7 −7 src/app/qgsmeasuredialog.cpp
  35. +12 −12 src/app/qgsprojectproperties.cpp
  36. +2 −2 src/app/qgsprojectproperties.h
  37. +6 −6 src/app/qgssinglesymboldialog.cpp
  38. +8 −8 src/app/qgsuniquevaluedialog.cpp
  39. +4 −4 src/app/qgsvectorlayerproperties.cpp
  40. +2 −2 src/core/composer/qgscomposerlegend.cpp
  41. +1 −1 src/core/composer/qgscomposermap.cpp
  42. +6 −6 src/core/composer/qgscomposerpicture.cpp
  43. +1 −1 src/core/composer/qgscomposerpicture.h
  44. +2 −2 src/core/composer/qgslegendmodel.cpp
  45. +4 −4 src/core/qgis.cpp
  46. +22 −20 src/core/qgis.h
  47. +3 −1 src/core/qgsapplication.cpp
  48. +4 −4 src/core/qgsclipper.cpp
  49. +27 −26 src/core/qgsclipper.h
  50. +29 −14 src/core/qgscoordinatereferencesystem.cpp
  51. +17 −16 src/core/qgscoordinatereferencesystem.h
  52. +5 −5 src/core/qgsdistancearea.cpp
  53. +1 −1 src/core/qgsdistancearea.h
  54. +37 −36 src/core/qgsgeometry.cpp
  55. +2 −2 src/core/qgsgeometry.h
  56. +3 −3 src/core/qgslabel.cpp
  57. +1 −1 src/core/qgsmaplayer.cpp
  58. +13 −13 src/core/qgsmaprenderer.cpp
  59. +3 −3 src/core/qgsmaprenderer.h
  60. +8 −8 src/core/qgsproject.cpp
  61. +6 −6 src/core/qgsscalecalculator.cpp
  62. +5 −5 src/core/qgsscalecalculator.h
  63. +1 −1 src/core/qgssearchstringlexer.ll
  64. +1 −1 src/core/qgssearchstringparser.yy
  65. +4 −4 src/core/qgsvectordataprovider.h
  66. +2 −2 src/core/qgsvectorfilewriter.cpp
  67. +3 −3 src/core/qgsvectorfilewriter.h
  68. +26 −25 src/core/qgsvectorlayer.cpp
  69. +3 −3 src/core/qgsvectorlayer.h
  70. +1 −1 src/core/raster/qgscolorrampshader.cpp
  71. +0 −5 src/core/raster/qgsrasterlayer.cpp
  72. +10 −10 src/core/renderer/qgscontinuouscolorrenderer.cpp
  73. +1 −1 src/core/renderer/qgscontinuouscolorrenderer.h
  74. +12 −12 src/core/renderer/qgsgraduatedsymbolrenderer.cpp
  75. +1 −1 src/core/renderer/qgsgraduatedsymbolrenderer.h
  76. +1 −1 src/core/renderer/qgsrenderer.cpp
  77. +1 −1 src/core/renderer/qgsrenderer.h
  78. +11 −11 src/core/renderer/qgssinglesymbolrenderer.cpp
  79. +1 −1 src/core/renderer/qgssinglesymbolrenderer.h
  80. +12 −12 src/core/renderer/qgsuniquevaluerenderer.cpp
  81. +1 −1 src/core/renderer/qgsuniquevaluerenderer.h
  82. +1 −1 src/core/sqlite3/sqlite3.c
  83. +2 −2 src/core/symbology/qgssymbol.cpp
  84. +4 −4 src/core/symbology/qgssymbol.h
  85. +1 −1 src/gui/qgsgenericprojectionselector.h
  86. +2 −2 src/gui/qgsmapcanvas.cpp
  87. +2 −2 src/gui/qgsmapcanvas.h
  88. +3 −3 src/gui/qgsprojectionselector.cpp
  89. +2 −2 src/gui/qgsprojectionselector.h
  90. +5 −5 src/gui/qgsquickprint.cpp
  91. +6 −6 src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.cpp
  92. +1 −1 src/plugins/dxf2shp_converter/dxflib/src/dl_dxf.h
  93. +15 −15 src/plugins/grass/qgsgrassmodule.cpp
  94. +3 −3 src/plugins/grass/qgsgrassmodule.h
  95. +5 −5 src/plugins/grass/qgsgrassnewmapset.cpp
  96. +3 −3 src/plugins/grass/qgsgrassnewmapset.h
  97. +2 −2 src/plugins/grass/qgsgrassshell.cpp
  98. +1 −1 src/plugins/interpolation/qgsinterpolationdialog.cpp
  99. +1 −1 src/plugins/interpolation/qgsinterpolator.cpp
  100. +5 −5 src/plugins/scale_bar/plugin.cpp
  101. +1 −1 src/providers/delimitedtext/qgsdelimitedtextprovider.cpp
  102. +1 −1 src/providers/delimitedtext/qgsdelimitedtextprovider.h
  103. +148 −148 src/providers/gpx/qgsgpxprovider.cpp
  104. +1 −1 src/providers/gpx/qgsgpxprovider.h
  105. +1 −1 src/providers/grass/qgsgrassprovider.cpp
  106. +3 −3 src/providers/grass/qgsgrassprovider.h
  107. +4 −4 src/providers/memory/memoryprovider.cpp
  108. +5 −5 src/providers/memory/memoryprovider.h
  109. +6 −6 src/providers/ogr/qgsogrprovider.cpp
  110. +4 −4 src/providers/ogr/qgsogrprovider.h
  111. +2 −2 src/providers/postgres/qgspostgresprovider.cpp
  112. +5 −5 src/providers/postgres/qgspostgresprovider.h
  113. +8 −8 src/providers/wfs/qgswfsdata.cpp
  114. +2 −2 src/providers/wfs/qgswfsdata.h
  115. +9 −9 src/providers/wfs/qgswfsprovider.cpp
  116. +9 −9 src/providers/wfs/qgswfsprovider.h
  117. +1 −1 tests/algorithms/projections/main.cpp
  118. +128 −126 tests/algorithms/projections/projectioncshandlingtest.h
  119. +195 −195 tests/algorithms/qgsproject/projecttest.h
  120. +113 −113 tests/src/core/testqgsgeometry.cpp
  121. +1 −1 tests/testdata/tenbytenraster.asc
@@ -494,7 +494,7 @@ change

/!\ Note this doesnt seem to be needed since version 4.2.3

QT_EDITION_UNKNOWN to QT_EDITION_OPENSOURCE
QT_EDITION_Unknown to QT_EDITION_OPENSOURCE

Second change the default mkspec symlink so that it points to macx-g++:

@@ -396,7 +396,7 @@ change

/!\ Note this doesnt seem to be needed since version 4.2.3

``QT_EDITION_UNKNOWN`` to ``QT_EDITION_OPENSOURCE``
``QT_EDITION_Unknown`` to ``QT_EDITION_OPENSOURCE``

Second change the default mkspec symlink so that it points to macx-g++:

@@ -28,20 +28,20 @@ public:
// Version constants
//
// Version string
static const char* qgisVersion;
static const char* QGIS_VERSION;
// Version number used for comparing versions using the "Check QGIS Version" function
static const int qgisVersionInt;
static const int QGIS_VERSION_INT;
// Release name
static const char* qgisReleaseName;
static const char* QGIS_RELEASE_NAME;
// The subversion version
static const char* qgisSvnVersion;
static const char* QGIS_SVN_VERSION;

// Enumerations
//

//! Used for symbology operations
// Feature types
enum WKBTYPE
enum WkbType
{
WKBPoint = 1,
WKBLineString,
@@ -51,12 +51,12 @@ public:
WKBMultiPolygon,
WKBUnknown
};
enum VectorType
enum GeometryType
{
Point,
Line,
Polygon,
Unknown
UnknownGeometry
};

// TODO:
@@ -65,12 +65,12 @@ public:
//static const char *qgisFeatureTypes[];

//! map units that qgis supports
enum units
enum UnitType
{
METERS,
FEET,
DEGREES,
UNKNOWN
Meters,
Feet,
Degrees,
UnknownUnit
};

//! User defined event types
@@ -106,7 +106,7 @@ public:
const int ELLPS_PREFIX_LEN;
/** Magick number that determins whether a projection srsid is a system (srs.db)
* or user (~/.qgis.qgis.db) defined projection. */
const int USER_PROJECTION_START_ID;
const int USER_CRS_START_ID;

//
// Constants for point symbols
@@ -7,7 +7,7 @@ class QgsContinuousColorRenderer : QgsRenderer
%End

public:
QgsContinuousColorRenderer(QGis::VectorType type);
QgsContinuousColorRenderer(QGis::GeometryType type);
QgsContinuousColorRenderer(const QgsContinuousColorRenderer& other);
virtual ~QgsContinuousColorRenderer();
/**Renders the feature using the minimum and maximum value of the classification field*/
@@ -147,15 +147,6 @@ class QgsCoordinateReferenceSystem
*/
long findMatchingProj();

/*! A string based associative array used for passing records around */
typedef QMap<QString, QString> RecordMap;
/*! Get a record from the srs.db or qgis.db backends, given an sql statment.
* @note only handles queries that return a single record.
* @note it will first try the system srs.db then the users qgis.db!
* @param QString The sql query to execute
* @return QMap An associative array of field name <-> value pairs
*/
RecordMap getRecord(QString theSql);
/*! Overloaded == operator used to compare to CRS's.
* Internally it will delegate to the equals method described below
*/
@@ -246,9 +237,9 @@ class QgsCoordinateReferenceSystem
*/
bool geographicFlag () const;
/*! Get the units that the projection is in
* @return QGis::units that gives the units for the coordinate system
* @return QGis::UnitType that gives the units for the coordinate system
*/
QGis::units mapUnits() const;
QGis::UnitType mapUnits() const;

/*! Set the postgis srid for this srs
* @return long theSRID the Postgis spatial_ref_sys identifier for this srs (defaults to 0)
@@ -58,6 +58,6 @@ class QgsDistanceArea
//! compute bearing - in radians
double getBearing(const QgsPoint& p1, const QgsPoint& p2);

static QString textUnit(double value, int decimals, QGis::units u, bool isArea);
static QString textUnit(double value, int decimals, QGis::UnitType u, bool isArea);

};
@@ -73,7 +73,7 @@ class QgsGeometry
*/
SIP_PYOBJECT wkbBuffer();
%MethodCode
sipRes = PyString_FromStringAndSize(sipCpp->wkbBuffer(), sipCpp->wkbSize());
sipRes = PyString_FromStringAndSize((const char *)sipCpp->wkbBuffer(), sipCpp->wkbSize());
%End

/**
@@ -82,10 +82,10 @@ class QgsGeometry
size_t wkbSize();

/** Returns type of wkb (point / linestring / polygon etc.) */
QGis::WKBTYPE wkbType();
QGis::WkbType wkbType();

/** Returns type of the vector */
QGis::VectorType vectorType();
QGis::GeometryType type();

/** Returns true if wkb of the geometry is of WKBMulti* type */
bool isMultipart();
@@ -6,7 +6,7 @@ class QgsGraduatedSymbolRenderer : QgsRenderer
%End

public:
QgsGraduatedSymbolRenderer(QGis::VectorType type);
QgsGraduatedSymbolRenderer(QGis::GeometryType type);
QgsGraduatedSymbolRenderer(const QgsGraduatedSymbolRenderer& other);
virtual ~QgsGraduatedSymbolRenderer();
/**Adds a new item
@@ -40,8 +40,8 @@ class QgsMapRenderer : QObject
//! Recalculate the map scale
void updateScale();

QGis::units mapUnits() const;
void setMapUnits(QGis::units u);
QGis::UnitType mapUnits() const;
void setMapUnits(QGis::UnitType u);

//! sets whether map image will be for overview
void setOverview(bool isOverview = true);
@@ -16,10 +16,10 @@ class QgsScaleCalculator
* Constructor
* @param dpi Monitor resolution in dots per inch
* @param mapUnits Units of the data on the map. Must match a value from the
* QGis::units enum (METERS, FEET, DEGREES)
* QGis::UnitType enum (Meters, Feet, Degrees)
*/
QgsScaleCalculator(int dpi = 0,
QGis::units mapUnits = QGis::METERS);
QGis::UnitType mapUnits = QGis::Meters);

//! Destructor
~QgsScaleCalculator();
@@ -40,10 +40,10 @@ class QgsScaleCalculator
* Set the map units
* @param mapUnits Units of the data on the map. Must match a value from the
*/
void setMapUnits(QGis::units mapUnits);
void setMapUnits(QGis::UnitType mapUnits);

/** Returns current map units */
QGis::units mapUnits() const;
QGis::UnitType mapUnits() const;

/**
* Calculate the scale
@@ -6,7 +6,7 @@ class QgsSingleSymbolRenderer : QgsRenderer
%End

public:
QgsSingleSymbolRenderer(QGis::VectorType type);
QgsSingleSymbolRenderer(QGis::GeometryType type);
QgsSingleSymbolRenderer(const QgsSingleSymbolRenderer& other);
virtual ~QgsSingleSymbolRenderer();
/**Replaces the current mSymbol by sy*/
@@ -7,9 +7,9 @@ class QgsSymbol

public:
/**Constructor*/
QgsSymbol(QGis::VectorType t, QString lvalue="", QString uvalue="", QString label="");
QgsSymbol(QGis::GeometryType t, QString lvalue="", QString uvalue="", QString label="");
/**Constructor*/
QgsSymbol(QGis::VectorType t, QString lvalue, QString uvalue, QString label, QColor c);
QgsSymbol(QGis::GeometryType t, QString lvalue, QString uvalue, QString label, QColor c);
QgsSymbol(const QgsSymbol&);
/**old constructors*/
QgsSymbol();
@@ -75,7 +75,7 @@ class QgsSymbol
@ return true in case of success*/
virtual bool readXML( QDomNode & symbol );
/**Returns if this symbol is point/ line or polygon*/
QGis::VectorType type() const;
QGis::GeometryType type() const;

};

@@ -5,7 +5,7 @@ class QgsUniqueValueRenderer : QgsRenderer
%End

public:
QgsUniqueValueRenderer(QGis::VectorType type);
QgsUniqueValueRenderer(QGis::GeometryType type);
QgsUniqueValueRenderer(const QgsUniqueValueRenderer& other);
virtual ~QgsUniqueValueRenderer();
/** Determines if a feature will be rendered or not
@@ -86,7 +86,7 @@ class QgsVectorDataProvider : QgsDataProvider
* Get feature type.
* @return int representing the feature type
*/
virtual QGis::WKBTYPE geometryType() const = 0;
virtual QGis::WkbType geometryType() const = 0;

/**
* Number of features in the layer
@@ -36,7 +36,7 @@ public:
QgsVectorFileWriter(const QString& shapefileName,
const QString& fileEncoding,
const QMap<int, QgsField>& fields,
QGis::WKBTYPE geometryType,
QGis::WkbType geometryType,
const QgsCoordinateReferenceSystem* srs);

/** checks whether there were any errors in constructor */
@@ -95,10 +95,10 @@ public:
void setRenderer(QgsRenderer * r /Transfer/);

/** Returns point, line or polygon */
QGis::VectorType vectorType() const;
QGis::GeometryType type() const;

/**Returns the WKBType or WKBUnknown in case of error*/
QGis::WKBTYPE geometryType() const;
QGis::WkbType geometryType() const;

/** Return the provider type for this layer */
QString providerType() const;
@@ -138,10 +138,10 @@ class QgsMapCanvas : QGraphicsView
bool isDirty() const;

//! Set map units (needed by project properties dialog)
void setMapUnits(QGis::units mapUnits);
void setMapUnits(QGis::UnitType mapUnits);
//! Get the current canvas map units

QGis::units mapUnits() const;
QGis::UnitType mapUnits() const;

//! Get the current coordinate transform
const QgsMapToPixel * getCoordinateTransform();
@@ -93,7 +93,7 @@ def __init__(self):
QObject.__init__(self)
self.mRepositories = {}
self.httpId = {} # {httpId : repoName}
self.QGISver = int(str(QGis.qgisVersion)[0])
self.QGISver = int(str(QGis.QGIS_VERSION)[0])


# ----------------------------------------- #
@@ -25,7 +25,7 @@ class InstallerPlugin:
# ----------------------------------------- #
def __init__(self, iface):
self.iface = iface
if str(QGis.qgisVersion)[0] == "0": # old plugin API
if str(QGis.QGIS_VERSION)[0] == "0": # old plugin API
self.mainWindow = self.iface.getMainWindow
else: # new plugin API
self.mainWindow = self.iface.mainWindow
@@ -36,7 +36,7 @@ def initGui(self):
self.action = QAction(QIcon(":/plugins/installer/PluginInstaller.png"), QCoreApplication.translate("QgsPluginInstaller","Fetch Python Plugins..."), self.mainWindow())
self.action.setWhatsThis(QCoreApplication.translate("QgsPluginInstaller","Install more plugins from remote repositories"))
self.action.setStatusTip(QCoreApplication.translate("QgsPluginInstaller","Install more plugins from remote repositories"))
if str(QGis.qgisVersion)[0] == "0":
if str(QGis.QGIS_VERSION)[0] == "0":
nextAction = self.mainWindow().menuBar().actions()[4].menu().actions()[1]
self.mainWindow().menuBar().actions()[4].menu().insertAction(nextAction,self.action)
else:
@@ -439,7 +439,7 @@ QPixmap QgsLegendLayer::getOriginalPixmap() const
if ( firstLayer->type() == QgsMapLayer::VECTOR )
{
QgsVectorLayer* vlayer = dynamic_cast<QgsVectorLayer*>( firstLayer );
switch ( vlayer->vectorType() )
switch ( vlayer->type() )
{
case QGis::Point:
return QgisApp::getThemePixmap( "/mIconPointLayer.png" );
Loading

0 comments on commit c152dfa

Please sign in to comment.