QGIS API Documentation
3.14.0-Pi (9f7028fd23)
|
Go to the documentation of this file.
18 #ifndef QGSREGULARPOLYGON_H
19 #define QGSREGULARPOLYGON_H
23 #include "qgis_core.h"
105 double radius()
const {
return mRadius; }
118 double apothem()
const {
return mRadius * std::cos( M_PI / mNumberSides ); }
131 void setCenter(
const QgsPoint ¢er );
138 void setRadius(
double radius );
145 void setFirstVertex(
const QgsPoint &firstVertex );
152 void setNumberSides(
unsigned int numberSides );
195 QString toString(
int pointPrecision = 17,
int radiusPrecision = 17,
int anglePrecision = 2 ) const;
200 double interiorAngle() const;
205 double centralAngle() const;
217 double perimeter() const;
223 double length() const;
228 unsigned int mNumberSides = 0;
229 double mRadius = 0.0;
234 double apothemToRadius(
double apothem,
unsigned int numberSides ) const;
239 double interiorAngle(
unsigned int nbSides ) const;
244 double centralAngle(
unsigned int nbSides ) const;
248 #endif // QGSREGULARPOLYGON_H
double radius() const
Returns the radius.
bool operator==(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
Point geometry type, with support for z-dimension and m-values.
unsigned int numberSides() const
Returns the number of sides of the regular polygon.
QgsPoint center() const
Returns the center point of the regular polygon.
Line string geometry type, with support for z-dimension and m-values.
bool operator!=(const QgsFeatureIterator &fi1, const QgsFeatureIterator &fi2)
CORE_EXPORT std::unique_ptr< QgsPolygon > toPolygon(const QgsMeshFace &face, const QVector< QgsMeshVertex > &vertices)
Returns face as polygon geometry, caller is responsible for delete.
ConstructionOption
A regular polygon can be constructed inscribed in a circle or circumscribed about a circle.
This document describes what qgis_wms supports does not support use feature geometry circle
QVector< QgsPoint > QgsPointSequence
Regular Polygon geometry type.
double apothem() const
Returns the apothem of the regular polygon.
QgsPoint firstVertex() const
Returns the first vertex (corner) of the regular polygon.