QGIS API Documentation  2.18.21-Las Palmas (9fba24a)
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 
29 class CORE_EXPORT QgsSurfaceV2: public QgsAbstractGeometryV2
30 {
31  public:
32 
33  virtual QgsPolygonV2* surfaceToPolygon() const = 0;
34 
37  virtual QgsRectangle boundingBox() const override
38  {
39  if ( mBoundingBox.isNull() )
40  {
41  mBoundingBox = calculateBoundingBox();
42  }
43  return mBoundingBox;
44  }
45 
46  protected:
47 
48  virtual void clearCache() const override { mBoundingBox = QgsRectangle(); mCoordinateSequence.clear(); QgsAbstractGeometryV2::clearCache(); }
49 
52 };
53 
54 #endif // QGSSURFACEV2_H
A rectangle specified with double values.
Definition: qgsrectangle.h:35
QgsRectangle mBoundingBox
Definition: qgssurfacev2.h:51
Abstract base class for all geometries.
virtual void clearCache() const
Clears any cached parameters associated with the geometry, eg bounding boxes.
virtual void clearCache() const override
Clears any cached parameters associated with the geometry, eg bounding boxes.
Definition: qgssurfacev2.h:48
Polygon geometry type.
Definition: qgspolygonv2.h:29
QgsCoordinateSequenceV2 mCoordinateSequence
Definition: qgssurfacev2.h:50
virtual QgsRectangle calculateBoundingBox() const
Default calculator for the minimal bounding box for the geometry.
virtual QgsRectangle boundingBox() const override
Returns the minimal bounding box for the geometry.
Definition: qgssurfacev2.h:37