QGIS API Documentation 3.41.0-Master (45a0abf3bec)
|
A spherical geometry object. More...
#include <qgssphere.h>
Public Member Functions | |
QgsSphere ()=default | |
Constructor for an invalid QgsSphere. | |
QgsSphere (double x, double y, double z, double radius) | |
Constructor for QgsSphere with the specified center (x, y, z) and radius. | |
QgsBox3D | boundingBox () const |
Returns the 3-dimensional bounding box containing the sphere. | |
QgsPoint | center () const |
Returns the center point of the sphere. | |
QgsVector3D | centerVector () const |
Returns the vector to the center of the sphere. | |
double | centerX () const |
Returns the x-coordinate of the center of the sphere. | |
double | centerY () const |
Returns the y-coordinate of the center of the sphere. | |
double | centerZ () const |
Returns the z-coordinate of the center of the sphere. | |
double | diameter () const |
Returns the diameter of the sphere. | |
bool | isEmpty () const |
Returns true if the sphere is considered empty, i.e. | |
bool | isNull () const |
Returns true if the sphere is a null (default constructed) sphere. | |
bool | operator!= (const QgsSphere &other) const |
bool | operator== (const QgsSphere &other) const |
double | radius () const |
Returns the radius of the sphere. | |
void | setCenter (const QgsPoint ¢er) |
Sets the center point of the sphere. | |
void | setCenter (double x, double y, double z) |
Sets the center point of the sphere to (x, y, z). | |
void | setRadius (double radius) |
Sets the radius of the sphere. | |
double | surfaceArea () const |
Returns the surface area of the sphere. | |
QgsCircle | toCircle () const |
Converts the sphere to a 2-dimensional circle. | |
double | volume () const |
Returns the volume of the sphere. | |
A spherical geometry object.
Represents a simple 3-dimensional sphere.
Definition at line 40 of file qgssphere.h.
|
default |
Constructor for an invalid QgsSphere.
QgsSphere::QgsSphere | ( | double | x, |
double | y, | ||
double | z, | ||
double | radius | ||
) |
Constructor for QgsSphere with the specified center (x, y, z) and radius.
Definition at line 24 of file qgssphere.cpp.
QgsBox3D QgsSphere::boundingBox | ( | ) | const |
Returns the 3-dimensional bounding box containing the sphere.
Definition at line 78 of file qgssphere.cpp.
QgsPoint QgsSphere::center | ( | ) | const |
Returns the center point of the sphere.
Definition at line 43 of file qgssphere.cpp.
QgsVector3D QgsSphere::centerVector | ( | ) | const |
Returns the vector to the center of the sphere.
Definition at line 48 of file qgssphere.cpp.
|
inline |
Returns the x-coordinate of the center of the sphere.
Definition at line 99 of file qgssphere.h.
|
inline |
Returns the y-coordinate of the center of the sphere.
Definition at line 109 of file qgssphere.h.
|
inline |
Returns the z-coordinate of the center of the sphere.
Definition at line 119 of file qgssphere.h.
|
inline |
bool QgsSphere::isEmpty | ( | ) | const |
Returns true
if the sphere is considered empty, i.e.
it has a radius of 0.
Definition at line 38 of file qgssphere.cpp.
bool QgsSphere::isNull | ( | ) | const |
Returns true
if the sphere is a null (default constructed) sphere.
Definition at line 33 of file qgssphere.cpp.
|
inline |
Definition at line 59 of file qgssphere.h.
|
inline |
Definition at line 55 of file qgssphere.h.
|
inline |
Returns the radius of the sphere.
Definition at line 139 of file qgssphere.h.
void QgsSphere::setCenter | ( | const QgsPoint & | center | ) |
|
inline |
Sets the center point of the sphere to (x, y, z).
Definition at line 131 of file qgssphere.h.
|
inline |
double QgsSphere::surfaceArea | ( | ) | const |
Returns the surface area of the sphere.
Definition at line 65 of file qgssphere.cpp.
QgsCircle QgsSphere::toCircle | ( | ) | const |
Converts the sphere to a 2-dimensional circle.
Definition at line 70 of file qgssphere.cpp.
double QgsSphere::volume | ( | ) | const |
Returns the volume of the sphere.
Definition at line 60 of file qgssphere.cpp.