QGIS API Documentation  2.12.0-Lyon
qgsgeometryfactory.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgsgeometryfactory.h
3  -----------------------
4  begin : September 2014
5  copyright : (C) 2014 by Marco Hugentobler
6  email : marco at sourcepole dot ch
7  ***************************************************************************/
8 
9 /***************************************************************************
10  * *
11  * This program is free software; you can redistribute it and/or modify *
12  * it under the terms of the GNU General Public License as published by *
13  * the Free Software Foundation; either version 2 of the License, or *
14  * (at your option) any later version. *
15  * *
16  ***************************************************************************/
17 
18 #ifndef QGSGEOMETRYFACTORY_H
19 #define QGSGEOMETRYFACTORY_H
20 
21 #include "qgsrectangle.h"
22 #include "qgswkbtypes.h"
23 #include <QString>
24 
27 
28 //compatibility with old classes
29 #include "qgspoint.h"
35 
42 class CORE_EXPORT QgsGeometryFactory
43 {
44  public:
47  static QgsAbstractGeometryV2* geomFromWkb( const unsigned char* wkb );
48 
51  static QgsAbstractGeometryV2* geomFromWkt( const QString& text );
52 
54  static QgsAbstractGeometryV2* fromPoint( const QgsPoint& point );
56  static QgsAbstractGeometryV2* fromMultiPoint( const QgsMultiPoint& multipoint );
58  static QgsAbstractGeometryV2* fromPolyline( const QgsPolyline& polyline );
60  static QgsAbstractGeometryV2* fromMultiPolyline( const QgsMultiPolyline& multiline );
62  static QgsAbstractGeometryV2* fromPolygon( const QgsPolygon& polygon );
64  static QgsAbstractGeometryV2* fromMultiPolygon( const QgsMultiPolygon& multipoly );
66  static QgsAbstractGeometryV2* fromRect( const QgsRectangle& rect );
68  static QgsAbstractGeometryV2* geomFromWkbType( QgsWKBTypes::Type t );
69 
70  private:
71  static QgsLineStringV2* linestringFromPolyline( const QgsPolyline& polyline );
72 };
73 
74 #endif // QGSGEOMETRYFACTORY_H
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QVector< QgsPoint > QgsPolyline
Abstract base class for all geometries.
Contains geometry creation routines.
QVector< QgsPoint > QgsMultiPoint
Line string geometry type.
QVector< QgsPolygon > QgsMultiPolygon
QVector< QgsPolyline > QgsMultiPolyline
A class to represent a point.
Definition: qgspoint.h:63
QVector< QgsPolyline > QgsPolygon