35 return std::isnan( mCenterX ) || std::isnan( mCenterY ) || std::isnan( mCenterZ );
45 return QgsPoint( mCenterX, mCenterY, mCenterZ );
62 return 4.0 / 3.0 * M_PI * std::pow( mRadius, 3 );
67 return 4.0 * M_PI * std::pow( mRadius, 2 );
83 return QgsBox3D( mCenterX - mRadius, mCenterY - mRadius, mCenterZ - mRadius,
84 mCenterX + mRadius, mCenterY + mRadius, mCenterZ + mRadius );
A 3-dimensional box composed of x, y, z coordinates.
Point geometry type, with support for z-dimension and m-values.
QgsCircle toCircle() const
Converts the sphere to a 2-dimensional circle.
void setCenter(const QgsPoint ¢er)
Sets the center point of the sphere.
double surfaceArea() const
Returns the surface area of the sphere.
QgsVector3D centerVector() const
Returns the vector to the center of the sphere.
bool isNull() const
Returns true if the sphere is a null (default constructed) sphere.
QgsPoint center() const
Returns the center point of the sphere.
QgsSphere()=default
Constructor for an invalid QgsSphere.
QgsBox3D boundingBox() const
Returns the 3-dimensional bounding box containing the sphere.
bool isEmpty() const
Returns true if the sphere is considered empty, i.e.
double volume() const
Returns the volume of the sphere.
Class for storage of 3D vectors similar to QVector3D, with the difference that it uses double precisi...
bool qgsDoubleNear(double a, double b, double epsilon=4 *std::numeric_limits< double >::epsilon())
Compare two doubles (but allow some difference)