Definition of sphere.
It is centered in its canonical frame with the given radius.
#include <drake/geometry/shape_specification.h>
Public Member Functions | |
| Sphere (double radius) | |
Constructs a sphere with the given radius. More... | |
| ~Sphere () final | |
| double | radius () const |
Implements CopyConstructible, CopyAssignable, MoveConstructible, MoveAssignable | |
| Sphere (const Sphere &)=default | |
| Sphere & | operator= (const Sphere &)=default |
| Sphere (Sphere &&)=default | |
| Sphere & | operator= (Sphere &&)=default |
Public Member Functions inherited from Shape | |
| virtual | ~Shape () |
| void | Reify (ShapeReifier *reifier, void *user_data=nullptr) const |
Causes this description to be reified in the given reifier. More... | |
| std::unique_ptr< Shape > | Clone () const |
| Creates a unique copy of this shape. More... | |
| std::string_view | type_name () const |
| Returns the (unqualified) type name of this Shape, e.g., "Box". More... | |
| std::string | to_string () const |
| Returns a string representation of this shape. More... | |
| template<typename ReturnType = void, typename Visitor > | |
| decltype(auto) | Visit (Visitor &&visitor) const |
Calls the given visitor function with *this as the sole argument, but with *this downcast to be the shape's concrete subclass. More... | |
Additional Inherited Members | |
Protected Types inherited from Shape | |
| using | VariantShapeConstPtr = std::variant< const Box *, const Capsule *, const Convex *, const Cylinder *, const Ellipsoid *, const HalfSpace *, const Mesh *, const MeshcatCone *, const Sphere * > |
| (Internal use only) All concrete subclasses, as const pointers. More... | |
Protected Member Functions inherited from Shape | |
| Shape () | |
| (Internal use only) Constructor for use by derived classes. More... | |
| Shape (const Shape &)=default | |
| (Internal use only) For derived classes. More... | |
| Shape & | operator= (const Shape &)=default |
| (Internal use only) For derived classes. More... | |
| Shape (Shape &&)=default | |
| (Internal use only) For derived classes. More... | |
| Shape & | operator= (Shape &&)=default |
| (Internal use only) For derived classes. More... | |
Constructs a sphere with the given radius.
| std::exception | if radius is not finite non-negative. Note that a zero radius is considered valid. |
|
final |
| double radius | ( | ) | const |