Skip to content
Permalink
Browse files

Merge pull request #3324 from nyalldawson/qgis

QGis class rename and cleanup
  • Loading branch information
nyalldawson committed Jul 22, 2016
2 parents 39da9d1 + 8f203c9 commit 791b2c391982ffa61d3452de308d436d6186fe15
Showing 513 changed files with 3,508 additions and 3,511 deletions.
@@ -41,6 +41,15 @@ This page tries to maintain a list with incompatible changes that happened in pr

</ul>

\subsection qgis_api_break_3_0_Qgis Qgis

<ul>
<li>The QGis class was renamed to Qgis for capitalisation consistency with other class names</li>
<li>permissiveToDouble() and permissiveToInt() where moved out of the QGis class and renamed to qgsPermissiveToDouble() and
qgsPermissiveToInt()</li>
<li>The constants DEFAULT_IDENTIFY_RADIUS and MINIMUM_POINT_SIZE were removed</li>
</ul>

\subsection qgis_api_break_3_0_QgsAuthConfigUriEdit QgsAuthConfigUriEdit

<ul>
@@ -1,5 +1,5 @@
/** \ingroup analysis
* The QGis class provides vector geometry analysis functions
* The Qgis class provides vector geometry analysis functions
*/

class QgsGeometryAnalyzer
@@ -1,6 +1,6 @@

/** \ingroup analysis
* The QGis class provides vector overlay analysis functions
* The Qgis class provides vector overlay analysis functions
*/

class QgsOverlayAnalyzer
@@ -1,5 +1,5 @@
/** \ingroup analysis
* The QGis class that calculates raster statistics (count, sum, mean) for
* The Qgis class that calculates raster statistics (count, sum, mean) for
* a polygon or multipolygon layer and appends the results as attributes
*/

@@ -63,14 +63,14 @@ class QgsDxfExport
* Set map units
* @param u unit
*/
void setMapUnits( QGis::UnitType u );
void setMapUnits( Qgis::UnitType u );

/**
* Retrieve map units
* @returns unit
* @see setMapUnits
*/
QGis::UnitType mapUnits() const;
Qgis::UnitType mapUnits() const;

/**
* Set symbology export mode
@@ -327,7 +327,7 @@ class QgsDxfExport
//! @note added in 2.15
void writeMText( const QString &layer, const QString &text, const QgsPointV2 &pt, double width, double angle, const QColor& color );

static double mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, QGis::UnitType mapUnits );
static double mapUnitScaleFactor( double scaleDenominator, QgsSymbolV2::OutputUnit symbolUnits, Qgis::UnitType mapUnits );

//! Return cleaned layer name for use in DXF
static QString dxfLayerName( const QString &name );
@@ -126,12 +126,12 @@ class QgsGeometry
/** Returns type of the geometry as a WKB type (point / linestring / polygon etc.)
* @see type
*/
QGis::WkbType wkbType() const;
Qgis::WkbType wkbType() const;

/** Returns type of the geometry as a QGis::GeometryType
/** Returns type of the geometry as a Qgis::GeometryType
* @see wkbType
*/
QGis::GeometryType type() const;
Qgis::GeometryType type() const;

/** Returns true if WKB of the geometry is of WKBMulti* type */
bool isMultipart() const;
@@ -312,7 +312,7 @@ class QgsGeometry
* not disjoint with existing polygons of the feature
*/
// TODO QGIS 3.0 returns an enum instead of a magic constant
int addPart( const QList<QgsPoint> &points, QGis::GeometryType geomType = QGis::UnknownGeometry );
int addPart( const QList<QgsPoint> &points, Qgis::GeometryType geomType = Qgis::UnknownGeometry );

/** Adds a new part to a the geometry.
* @param points points describing part to add
@@ -321,7 +321,7 @@ class QgsGeometry
* not disjoint with existing polygons of the feature
*/
// TODO QGIS 3.0 returns an enum instead of a magic constant
int addPart( const QList<QgsPointV2> &points, QGis::GeometryType geomType = QGis::UnknownGeometry );
int addPart( const QList<QgsPointV2> &points, Qgis::GeometryType geomType = Qgis::UnknownGeometry );

/** Adds a new part to this geometry.
* @param part part to add (ownership is transferred)
@@ -330,7 +330,7 @@ class QgsGeometry
* not disjoint with existing polygons of the feature
*/
// TODO QGIS 3.0 returns an enum instead of a magic constant
int addPart( QgsAbstractGeometryV2* part /Transfer/, QGis::GeometryType geomType = QGis::UnknownGeometry );
int addPart( QgsAbstractGeometryV2* part /Transfer/, Qgis::GeometryType geomType = Qgis::UnknownGeometry );

/** Adds a new island polygon to a multipolygon feature
* @param newPart part to add. Ownership is NOT transferred.
@@ -514,7 +514,7 @@ class QgsGeometry
* @return the converted geometry or nullptr if the conversion fails.
* @note added in 2.2
*/
QgsGeometry* convertToType( QGis::GeometryType destType, bool destMultipart = false ) const /Factory/;
QgsGeometry* convertToType( Qgis::GeometryType destType, bool destMultipart = false ) const /Factory/;

/* Accessor functions for getting geometry data */

@@ -19,9 +19,9 @@


/** \ingroup core
* The QGis class provides global constants for use throughout the application.
* The Qgis class provides global constants for use throughout the application.
*/
class QGis
class Qgis
{
%TypeHeaderCode
#include <qgis.h>
@@ -93,10 +93,10 @@ class QGis
static int wkbDimensions( WkbType type );

//! Converts from old (pre 2.10) WKB type (OGR) to new WKB type
static QgsWKBTypes::Type fromOldWkbType( QGis::WkbType type );
static QgsWKBTypes::Type fromOldWkbType( Qgis::WkbType type );

//! Converts from new (post 2.10) WKB type (OGC) to old WKB type
static QGis::WkbType fromNewWkbType( QgsWKBTypes::Type type );
static Qgis::WkbType fromNewWkbType( QgsWKBTypes::Type type );

enum GeometryType
{
@@ -162,43 +162,23 @@ class QGis

//! Provides the canonical name of the type value
//! @deprecated use QgsUnitTypes::encodeUnit() instead
static QString toLiteral( QGis::UnitType unit ) /Deprecated/;
static QString toLiteral( Qgis::UnitType unit ) /Deprecated/;

//! Converts from the canonical name to the type value
//! @deprecated use QgsUnitTypes::decodeDistanceUnit() instead
static UnitType fromLiteral( const QString& literal, QGis::UnitType defaultType = UnknownUnit ) /Deprecated/;
static UnitType fromLiteral( const QString& literal, Qgis::UnitType defaultType = UnknownUnit ) /Deprecated/;

//! Provides translated version of the type value
//! @deprecated use QgsUnitTypes::toString() instead
static QString tr( QGis::UnitType unit ) /Deprecated/;
static QString tr( Qgis::UnitType unit ) /Deprecated/;

//! Provides type value from translated version
//! @deprecated use QgsUnitTypes::stringToDistanceUnit() instead
static UnitType fromTr( const QString& literal, QGis::UnitType defaultType = UnknownUnit ) /Deprecated/;
static UnitType fromTr( const QString& literal, Qgis::UnitType defaultType = UnknownUnit ) /Deprecated/;

//! Returns the conversion factor between the specified units
//! @deprecated use QgsUnitTyoes::fromUnitToUnitFactor() instead
static double fromUnitToUnitFactor( QGis::UnitType fromUnit, QGis::UnitType toUnit ) /Deprecated/;

/** Converts a string to a double in a permissive way, eg allowing for incorrect
* numbers of digits between thousand separators
* @param string string to convert
* @param ok will be set to true if conversion was successful
* @returns string converted to double if possible
* @note added in version 2.9
* @see permissiveToInt
*/
static double permissiveToDouble( QString string, bool& ok );

/** Converts a string to an integer in a permissive way, eg allowing for incorrect
* numbers of digits between thousand separators
* @param string string to convert
* @param ok will be set to true if conversion was successful
* @returns string converted to int if possible
* @note added in version 2.9
* @see permissiveToDouble
*/
static int permissiveToInt( QString string, bool& ok );
static double fromUnitToUnitFactor( Qgis::UnitType fromUnit, Qgis::UnitType toUnit ) /Deprecated/;

//! User defined event types
enum UserEvent
@@ -212,10 +192,6 @@ class QGis
ProviderCountCalcEvent
};

/** Old search radius in % of canvas width
* @deprecated since 2.3, use DEFAULT_SEARCH_RADIUS_MM */
static const double DEFAULT_IDENTIFY_RADIUS;

/** Identify search radius in mm
* @note added in 2.3 */
static const double DEFAULT_SEARCH_RADIUS_MM;
@@ -243,6 +219,27 @@ class QGis
static double SCALE_PRECISION;
};


/** Converts a string to a double in a permissive way, eg allowing for incorrect
* numbers of digits between thousand separators
* @param string string to convert
* @param ok will be set to true if conversion was successful
* @returns string converted to double if possible
* @note added in version 2.9
* @see permissiveToInt
*/
double qgsPermissiveToDouble( QString string, bool& ok );

/** Converts a string to an integer in a permissive way, eg allowing for incorrect
* numbers of digits between thousand separators
* @param string string to convert
* @param ok will be set to true if conversion was successful
* @returns string converted to int if possible
* @note added in version 2.9
* @see permissiveToDouble
*/
int qgsPermissiveToInt( QString string, bool& ok );

//! Compares two QVariant values and returns whether the first is less than the second.
//! Useful for sorting lists of variants, correctly handling sorting of the various
//! QVariant data types (such as strings, numeric values, dates and times)
@@ -288,8 +285,6 @@ const QString GEO_NONE;
// Constants for point symbols
//

/** Magic number that determines the minimum allowable point size for point symbols */
const double MINIMUM_POINT_SIZE;
/** Magic number that determines the default point size for point symbols */
const double DEFAULT_POINT_SIZE;
const double DEFAULT_LINE_WIDTH;
@@ -446,7 +446,7 @@ class QgsCoordinateReferenceSystem

/** Returns the units for the projection used by the CRS.
*/
QGis::UnitType mapUnits() const;
Qgis::UnitType mapUnits() const;


// Mutators -----------------------------------
@@ -165,14 +165,14 @@ class QgsDataSourceURI

/** The (old) wkb type.
@deprecated Will return QgsWKBTypes::Type in 3.0. Prefer newWkbType() in the meantime */
QGis::WkbType wkbType() const /Deprecated/;
Qgis::WkbType wkbType() const /Deprecated/;

/** The wkb type.
@note Will be removed in 3.0 */
QgsWKBTypes::Type newWkbType() const;

//! @deprecated See setWkbType( QgsWKBTypes::Type )
void setWkbType( QGis::WkbType type ) /Deprecated/;
void setWkbType( Qgis::WkbType type ) /Deprecated/;

//! Sets the wkb type
void setWkbType( QgsWKBTypes::Type type );
@@ -155,7 +155,7 @@ class QgsDistanceArea
* @note added in QGIS 2.14
* @see areaUnits()
*/
QGis::UnitType lengthUnits() const;
Qgis::UnitType lengthUnits() const;

/** Returns the units of area for areal calculations made by this object.
* @note added in QGIS 2.14
@@ -179,7 +179,7 @@ class QgsDistanceArea
* @return formatted measurement string
* @deprecated use formatDistance() or formatArea() instead
*/
static QString textUnit( double value, int decimals, QGis::UnitType u, bool isArea, bool keepBaseUnit = false ) /Deprecated/;
static QString textUnit( double value, int decimals, Qgis::UnitType u, bool isArea, bool keepBaseUnit = false ) /Deprecated/;

/** Returns an distance formatted as a friendly string.
* @param distance distance to format
@@ -191,7 +191,7 @@ class QgsDistanceArea
* @note added in QGIS 2.16
* @see formatArea()
*/
static QString formatDistance( double distance, int decimals, QGis::UnitType unit, bool keepBaseUnit = false );
static QString formatDistance( double distance, int decimals, Qgis::UnitType unit, bool keepBaseUnit = false );

/** Returns an area formatted as a friendly string.
* @param area area to format
@@ -208,7 +208,7 @@ class QgsDistanceArea

//! Helper for conversion between physical units
// TODO QGIS 3.0 - remove this method, as its behaviour is non-intuitive.
void convertMeasurement( double &measure /In,Out/, QGis::UnitType &measureUnits /In,Out/, QGis::UnitType displayUnits, bool isArea ) const;
void convertMeasurement( double &measure /In,Out/, Qgis::UnitType &measureUnits /In,Out/, Qgis::UnitType displayUnits, bool isArea ) const;

/** Takes a length measurement calculated by this QgsDistanceArea object and converts it to a
* different distance unit.
@@ -219,7 +219,7 @@ class QgsDistanceArea
* @see convertAreaMeasurement()
* @note added in QGIS 2.14
*/
double convertLengthMeasurement( double length, QGis::UnitType toUnits ) const;
double convertLengthMeasurement( double length, Qgis::UnitType toUnits ) const;

/** Takes an area measurement calculated by this QgsDistanceArea object and converts it to a
* different areal unit.
@@ -167,14 +167,14 @@ class QgsExpression
* @note added in QGIS 2.14
* @see setDistanceUnits()
*/
QGis::UnitType distanceUnits() const;
Qgis::UnitType distanceUnits() const;

/** Sets the desired distance units for calculations involving geomCalculator(), eg "$length" and "$perimeter".
* @note distances are only converted when a geomCalculator() has been set
* @note added in QGIS 2.14
* @see distanceUnits()
*/
void setDistanceUnits( QGis::UnitType unit );
void setDistanceUnits( Qgis::UnitType unit );

/** Returns the desired areal units for calculations involving geomCalculator(), eg "$area".
* @note areas are only converted when a geomCalculator() has been set
@@ -24,7 +24,7 @@ class QgsGml: QObject
* @note available in python as getFeaturesUri
*/
int getFeatures( const QString& uri,
QGis::WkbType* wkbType,
Qgis::WkbType* wkbType,
QgsRectangle* extent = 0,
const QString& userName = QString(),
const QString& password = QString(),
@@ -33,7 +33,7 @@ class QgsGml: QObject
/** Read from GML data. Constructor uri param is ignored
* Supports only UTF-8, UTF-16, ISO-8859-1, ISO-8859-1 XML encodings.
*/
int getFeatures( const QByteArray &data, QGis::WkbType* wkbType, QgsRectangle* extent = 0 );
int getFeatures( const QByteArray &data, Qgis::WkbType* wkbType, QgsRectangle* extent = 0 );

/** Get parsed features for given type name */
QMap<qint64, QgsFeature* > featuresMap() const;
@@ -178,8 +178,8 @@ class QgsMapRenderer : QObject
//! Recalculate the map scale
void updateScale();

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

//! sets whether map image will be for overview
void enableOverviewMode( bool isOverview = true );
@@ -91,9 +91,9 @@ class QgsMapSettings
QgsCoordinateReferenceSystem destinationCrs() const;

//! Get units of map's geographical coordinates - used for scale calculation
QGis::UnitType mapUnits() const;
Qgis::UnitType mapUnits() const;
//! Set units of map's geographical coordinates - used for scale calculation
void setMapUnits( QGis::UnitType u );
void setMapUnits( Qgis::UnitType u );

//! Set the background color of the map
void setBackgroundColor( const QColor& color );
@@ -246,7 +246,7 @@ class QgsProject : QObject
* @note added in QGIS 2.14
* @see areaUnits()
*/
QGis::UnitType distanceUnits() const;
Qgis::UnitType distanceUnits() const;

/** Convenience function to query default area measurement units for project.
* @note added in QGIS 2.14

0 comments on commit 791b2c3

Please sign in to comment.
You can’t perform that action at this time.