Skip to content

Commit

Permalink
hackfest commit from timlinux:
Browse files Browse the repository at this point in the history
- 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 c152dfa
Show file tree
Hide file tree
Showing 121 changed files with 1,183 additions and 1,151 deletions.
2 changes: 1 addition & 1 deletion INSTALL
Expand Up @@ -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++:

Expand Down
2 changes: 1 addition & 1 deletion doc/INSTALL.t2t
Expand Up @@ -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++:

Expand Down
26 changes: 13 additions & 13 deletions python/core/qgis.sip
Expand Up @@ -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,
Expand All @@ -51,12 +51,12 @@ public:
WKBMultiPolygon,
WKBUnknown
};
enum VectorType
enum GeometryType
{
Point,
Line,
Polygon,
Unknown
UnknownGeometry
};

// TODO:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgscontinuouscolorrenderer.sip
Expand Up @@ -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*/
Expand Down
13 changes: 2 additions & 11 deletions python/core/qgscoordinatereferencesystem.sip
Expand Up @@ -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
*/
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsdistancearea.sip
Expand Up @@ -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);

};
6 changes: 3 additions & 3 deletions python/core/qgsgeometry.sip
Expand Up @@ -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

/**
Expand All @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsgraduatedsymbolrenderer.sip
Expand Up @@ -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
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsmaprenderer.sip
Expand Up @@ -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);
Expand Down
8 changes: 4 additions & 4 deletions python/core/qgsscalecalculator.sip
Expand Up @@ -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();
Expand All @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgssinglesymbolrenderer.sip
Expand Up @@ -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*/
Expand Down
6 changes: 3 additions & 3 deletions python/core/qgssymbol.sip
Expand Up @@ -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();
Expand Down Expand Up @@ -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;

};

Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsuniquevaluerenderer.sip
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsvectordataprovider.sip
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion python/core/qgsvectorfilewriter.sip
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions python/core/qgsvectorlayer.sip
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions python/gui/qgsmapcanvas.sip
Expand Up @@ -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();
Expand Down
2 changes: 1 addition & 1 deletion python/plugins/plugin_installer/installer_data.py
Expand Up @@ -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])


# ----------------------------------------- #
Expand Down
4 changes: 2 additions & 2 deletions python/plugins/plugin_installer/installer_plugin.py
Expand Up @@ -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
Expand All @@ -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:
Expand Down
2 changes: 1 addition & 1 deletion src/app/legend/qgslegendlayer.cpp
Expand Up @@ -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" );
Expand Down

0 comments on commit c152dfa

Please sign in to comment.