VTK-m
2.0
|
Represent a sphere of the given Dimension. More...
#include <Geometry.h>
Public Types | |
using | Vector = vtkm::Vec< CoordType, Dim > |
Public Member Functions | |
VTKM_EXEC_CONT | Sphere () |
Construct a default sphere (unit radius at the origin). More... | |
VTKM_EXEC_CONT | Sphere (const Vector ¢er, CoordType radius) |
Construct a sphere from a center point and radius. More... | |
VTKM_EXEC_CONT bool | IsValid () const |
Return true if the sphere is valid (i.e., has a strictly positive radius). More... | |
VTKM_EXEC_CONT bool | Contains (const Vector &point, CoordType tol2=0.f) const |
Return whether the point lies strictly inside the sphere. More... | |
VTKM_EXEC_CONT int | Classify (const Vector &point, CoordType tol2=0.f) const |
Classify a point as inside (-1), on (0), or outside (+1) of the sphere. More... | |
VTKM_EXEC_CONT | Sphere () |
Construct sphere with center at (0,0,0) and radius = 0.5. More... | |
VTKM_EXEC_CONT | Sphere (Scalar radius) |
Construct a sphere with center at (0,0,0) and the given radius. More... | |
VTKM_EXEC_CONT | Sphere (Vector center, Scalar radius) |
VTKM_CONT void | SetRadius (Scalar radius) |
VTKM_CONT void | SetCenter (const Vector ¢er) |
VTKM_EXEC_CONT Scalar | GetRadius () const |
const VTKM_EXEC_CONT Vector & | GetCenter () const |
VTKM_EXEC_CONT Scalar | Value (const Vector &point) const |
VTKM_EXEC_CONT Vector | Gradient (const Vector &point) const |
Public Attributes | |
Vector | Center |
CoordType | Radius |
Static Public Attributes | |
static constexpr int | Dimension = Dim |
Private Attributes | |
Scalar | Radius |
Represent a sphere of the given Dimension.
Implicit function for a sphere.
If a constructor is given an invalid specification, then the Radius of the resulting sphere will be -1.
A sphere is defined by its center and a radius.
The value of the sphere implicit function is the square of the distance from the center biased by the radius (so the surface of the sphere is at value 0).
using vtkm::Sphere::Vector = vtkm::Vec<CoordType, Dim> |
VTKM_EXEC_CONT vtkm::Sphere::Sphere | ( | ) |
Construct a default sphere (unit radius at the origin).
VTKM_EXEC_CONT vtkm::Sphere::Sphere | ( | const Vector & | center, |
CoordType | radius | ||
) |
Construct a sphere from a center point and radius.
|
inline |
Construct sphere with center at (0,0,0) and radius = 0.5.
|
inlineexplicit |
Construct a sphere with center at (0,0,0) and the given radius.
|
inline |
VTKM_EXEC_CONT int vtkm::Sphere::Classify | ( | const Vector & | point, |
CoordType | tol2 = 0.f |
||
) | const |
Classify a point as inside (-1), on (0), or outside (+1) of the sphere.
The tolerance tol2 is the maximum allowable difference in squared magnitude between the squared radius and the squared distance between the point and Center.
VTKM_EXEC_CONT bool vtkm::Sphere::Contains | ( | const Vector & | point, |
CoordType | tol2 = 0.f |
||
) | const |
Return whether the point lies strictly inside the sphere.
|
inline |
|
inline |
|
inline |
|
inline |
Return true if the sphere is valid (i.e., has a strictly positive radius).
|
inline |
|
inline |
Vector vtkm::Sphere::Center |
|
staticconstexpr |
CoordType vtkm::Sphere::Radius |
|
private |