QGIS API Documentation  2.3.0-Master
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
Public Types | Static Public Member Functions | Static Public Attributes | Static Private Attributes | List of all members
QGis Class Reference

The QGis class provides global constants for use throughout the application. More...

#include <qgis.h>

Public Types

enum  WkbType {
  WKBUnknown = 0, WKBPoint = 1, WKBLineString, WKBPolygon,
  WKBMultiPoint, WKBMultiLineString, WKBMultiPolygon, WKBNoGeometry = 100,
  WKBPoint25D = 0x80000001, WKBLineString25D, WKBPolygon25D, WKBMultiPoint25D,
  WKBMultiLineString25D, WKBMultiPolygon25D
}
 Used for symbology operations. More...
 
enum  GeometryType {
  Point, Line, Polygon, UnknownGeometry,
  NoGeometry
}
 
enum  DataType {
  UnknownDataType = 0, Byte = 1, UInt16 = 2, Int16 = 3,
  UInt32 = 4, Int32 = 5, Float32 = 6, Float64 = 7,
  CInt16 = 8, CInt32 = 9, CFloat32 = 10, CFloat64 = 11,
  ARGB32 = 12, ARGB32_Premultiplied = 13
}
 Raster data types. More...
 
enum  UnitType {
  Meters = 0, Feet = 1, Degrees = 2, UnknownUnit = 3,
  DecimalDegrees = 2, DegreesMinutesSeconds = 2, DegreesDecimalMinutes = 2, NauticalMiles = 7
}
 Map units that qgis supports. More...
 
enum  UserEvent { ProviderExtentCalcEvent = ( QEvent::User + 1 ), ProviderCountCalcEvent }
 User defined event types. More...
 

Static Public Member Functions

static WkbType singleType (WkbType type)
 
static WkbType multiType (WkbType type)
 
static WkbType flatType (WkbType type)
 
static bool isSingleType (WkbType type)
 
static bool isMultiType (WkbType type)
 
static int wkbDimensions (WkbType type)
 
static const char * vectorGeometryType (GeometryType type)
 description strings for geometry types More...
 
static const char * featureType (WkbType type)
 description strings for feature types More...
 
static QString toLiteral (QGis::UnitType unit)
 Provides the canonical name of the type value. More...
 
static UnitType fromLiteral (QString literal, QGis::UnitType defaultType=UnknownUnit)
 Converts from the canonical name to the type value. More...
 
static QString tr (QGis::UnitType unit)
 Provides translated version of the type value. More...
 
static double fromUnitToUnitFactor (QGis::UnitType fromUnit, QGis::UnitType toUnit)
 Returns the conversion factor between the specified units. More...
 

Static Public Attributes

static const char * QGIS_VERSION = VERSION
 
static const int QGIS_VERSION_INT = VERSION_INT
 
static const char * QGIS_RELEASE_NAME = RELEASE_NAME
 
static const char * QGIS_DEV_VERSION = QGSVERSION
 
static const double DEFAULT_IDENTIFY_RADIUS = 0.5
 Old search radius in % of canvas width. More...
 
static const double DEFAULT_SEARCH_RADIUS_MM = 2.
 Identify search radius in mm. More...
 
static const float DEFAULT_MAPTOPIXEL_THRESHOLD = 1.0f
 Default threshold between map coordinates and device coordinates for map2pixel simplification. More...
 
static const QColor DEFAULT_HIGHLIGHT_COLOR = QColor( 255, 0, 0, 128 )
 Default highlight color. More...
 
static double DEFAULT_HIGHLIGHT_BUFFER_MM = 0.5
 Default highlight buffer in mm. More...
 
static double DEFAULT_HIGHLIGHT_MIN_WIDTH_MM = 1.0
 Default highlight line/outline minimum width in mm. More...
 

Static Private Attributes

static const char * qgisUnitTypes []
 

Detailed Description

The QGis class provides global constants for use throughout the application.

Definition at line 34 of file qgis.h.

Member Enumeration Documentation

Raster data types.

This is modified and extended copy of GDALDataType.

Enumerator
UnknownDataType 

Unknown or unspecified type

Byte 

Eight bit unsigned integer (quint8)

UInt16 

Sixteen bit unsigned integer (quint16)

Int16 

Sixteen bit signed integer (qint16)

UInt32 

Thirty two bit unsigned integer (quint32)

Int32 

Thirty two bit signed integer (qint32)

Float32 

Thirty two bit floating point (float)

Float64 

Sixty four bit floating point (double)

CInt16 

Complex Int16

CInt32 

Complex Int32

CFloat32 

Complex Float32

CFloat64 

Complex Float64

ARGB32 

Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32

ARGB32_Premultiplied 

Color, alpha, red, green, blue, 4 bytes the same as QImage::Format_ARGB32_Premultiplied

Definition at line 204 of file qgis.h.

Enumerator
Point 
Line 
Polygon 
UnknownGeometry 
NoGeometry 

Definition at line 155 of file qgis.h.

Map units that qgis supports.

Note
that QGIS < 1.4 api had only Meters, Feet, Degrees and UnknownUnit
and QGIS >1.8 returns to that
Enumerator
Meters 
Feet 
Degrees 
UnknownUnit 
DecimalDegrees 
DegreesMinutesSeconds 
DegreesDecimalMinutes 
NauticalMiles 

Definition at line 229 of file qgis.h.

User defined event types.

Enumerator
ProviderExtentCalcEvent 

The extents have been calculated by a provider of a layer.

ProviderCountCalcEvent 

The row count has been calculated by a provider of a layer.

Definition at line 256 of file qgis.h.

Used for symbology operations.

Enumerator
WKBUnknown 
WKBPoint 
WKBLineString 
WKBPolygon 
WKBMultiPoint 
WKBMultiLineString 
WKBMultiPolygon 
WKBNoGeometry 
WKBPoint25D 
WKBLineString25D 
WKBPolygon25D 
WKBMultiPoint25D 
WKBMultiLineString25D 
WKBMultiPolygon25D 

Definition at line 53 of file qgis.h.

Member Function Documentation

static const char* QGis::featureType ( WkbType  type)
inlinestatic

description strings for feature types

Definition at line 179 of file qgis.h.

static WkbType QGis::flatType ( WkbType  type)
inlinestatic
QGis::UnitType QGis::fromLiteral ( QString  literal,
QGis::UnitType  defaultType = UnknownUnit 
)
static

Converts from the canonical name to the type value.

Definition at line 101 of file qgis.cpp.

References qgisUnitTypes.

double QGis::fromUnitToUnitFactor ( QGis::UnitType  fromUnit,
QGis::UnitType  toUnit 
)
static

Returns the conversion factor between the specified units.

Definition at line 123 of file qgis.cpp.

References DecimalDegrees, DEGREE_TO_METER, Degrees, DegreesDecimalMinutes, DegreesMinutesSeconds, Feet, FEET_TO_METER, Meters, NauticalMiles, NMILE_TO_METER, and UnknownUnit.

Referenced by QgsDistanceArea::convertMeasurement(), and QgsComposerScaleBar::mapWidth().

static bool QGis::isMultiType ( WkbType  type)
inlinestatic

Definition at line 126 of file qgis.h.

Referenced by QgsGeometry::isMultipart().

static bool QGis::isSingleType ( WkbType  type)
inlinestatic

Definition at line 113 of file qgis.h.

static WkbType QGis::multiType ( WkbType  type)
inlinestatic

Definition at line 85 of file qgis.h.

static WkbType QGis::singleType ( WkbType  type)
inlinestatic
QString QGis::toLiteral ( QGis::UnitType  unit)
static

Provides the canonical name of the type value.

Definition at line 113 of file qgis.cpp.

References qgisUnitTypes.

Referenced by QgsDistanceArea::convertMeasurement(), and tr().

QString QGis::tr ( QGis::UnitType  unit)
static

Provides translated version of the type value.

Definition at line 118 of file qgis.cpp.

References toLiteral().

static const char* QGis::vectorGeometryType ( GeometryType  type)
inlinestatic

description strings for geometry types

Definition at line 165 of file qgis.h.

Referenced by QgsVectorLayer::metadata(), and QgsVectorLayer::writeXml().

static int QGis::wkbDimensions ( WkbType  type)
inlinestatic

Member Data Documentation

double QGis::DEFAULT_HIGHLIGHT_BUFFER_MM = 0.5
static

Default highlight buffer in mm.

Note
added in 2.3

Definition at line 285 of file qgis.h.

const QColor QGis::DEFAULT_HIGHLIGHT_COLOR = QColor( 255, 0, 0, 128 )
static

Default highlight color.

The transparency is expected to only be applied to polygon fill. Lines and outlines are rendered opaque.

Note
added in 2.3

Definition at line 281 of file qgis.h.

double QGis::DEFAULT_HIGHLIGHT_MIN_WIDTH_MM = 1.0
static

Default highlight line/outline minimum width in mm.

Note
added in 2.3

Definition at line 289 of file qgis.h.

const double QGis::DEFAULT_IDENTIFY_RADIUS = 0.5
static

Old search radius in % of canvas width.

Deprecated:
since 2.3, use DEFAULT_SEARCH_RADIUS_MM

Definition at line 269 of file qgis.h.

const float QGis::DEFAULT_MAPTOPIXEL_THRESHOLD = 1.0f
static

Default threshold between map coordinates and device coordinates for map2pixel simplification.

Definition at line 276 of file qgis.h.

const double QGis::DEFAULT_SEARCH_RADIUS_MM = 2.
static

Identify search radius in mm.

Note
added in 2.3

Definition at line 273 of file qgis.h.

Referenced by QgsMapTool::searchRadiusMM().

const char * QGis::QGIS_DEV_VERSION = QGSVERSION
static

Definition at line 46 of file qgis.h.

Referenced by QgsError::message().

const char * QGis::QGIS_RELEASE_NAME = RELEASE_NAME
static

Definition at line 44 of file qgis.h.

const char * QGis::QGIS_VERSION = VERSION
static
const int QGis::QGIS_VERSION_INT = VERSION_INT
static

Definition at line 42 of file qgis.h.

Referenced by QgsApplication::init().

const char * QGis::qgisUnitTypes
staticprivate
Initial value:
=
{
QT_TRANSLATE_NOOP( "QGis::UnitType", "meters" ),
QT_TRANSLATE_NOOP( "QGis::UnitType", "feet" ),
QT_TRANSLATE_NOOP( "QGis::UnitType", "degrees" ),
QT_TRANSLATE_NOOP( "QGis::UnitType", "<unknown>" ),
QT_TRANSLATE_NOOP( "QGis::UnitType", "degrees" ),
QT_TRANSLATE_NOOP( "QGis::UnitType", "degrees" ),
QT_TRANSLATE_NOOP( "QGis::UnitType", "degrees" ),
}

Definition at line 293 of file qgis.h.

Referenced by fromLiteral(), and toLiteral().


The documentation for this class was generated from the following files: