QGIS API Documentation  2.14.0-Essen
qgssurfacev2.h
Go to the documentation of this file.
1 /***************************************************************************
2  qgssurfacev2.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 QGSSURFACEV2_H
19 #define QGSSURFACEV2_H
20 
21 #include "qgsabstractgeometryv2.h"
22 #include "qgspointv2.h"
23 
24 class QgsPolygonV2;
25 
26 class CORE_EXPORT QgsSurfaceV2: public QgsAbstractGeometryV2
27 {
28  public:
29 
30  virtual QgsPolygonV2* surfaceToPolygon() const = 0;
31 
34  virtual QgsRectangle boundingBox() const override
35  {
36  if ( mBoundingBox.isNull() )
37  {
38  mBoundingBox = calculateBoundingBox();
39  }
40  return mBoundingBox;
41  }
42 
43  protected:
44 
45  virtual void clearCache() const override { mBoundingBox = QgsRectangle(); mCoordinateSequence.clear(); QgsAbstractGeometryV2::clearCache(); }
46 
49 };
50 
51 #endif // QGSSURFACEV2_H
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QgsRectangle mBoundingBox
Definition: qgssurfacev2.h:48
Abstract base class for all geometries.
virtual void clearCache() const override
Clears any cached parameters associated with the geometry, eg bounding boxes.
Definition: qgssurfacev2.h:45
Polygon geometry type.
Definition: qgspolygonv2.h:29
virtual QgsRectangle calculateBoundingBox() const
Default calculator for the minimal bounding box for the geometry.
QgsCoordinateSequenceV2 mCoordinateSequence
Definition: qgssurfacev2.h:47
virtual void clearCache() const
Clears any cached parameters associated with the geometry, eg bounding boxes.
virtual QgsRectangle boundingBox() const override
Returns the minimal bounding box for the geometry.
Definition: qgssurfacev2.h:34