Visual Computing Library
All Classes Functions Variables Typedefs Enumerations Friends Modules Pages Concepts
vcl::SphereConcept Concept Reference

Concept for types representing spheres in Euclidean space. More...

#include <vclib/concepts/space/sphere.h>

Concept definition

template<typename T>
concept vcl::SphereConcept = requires (
T&& obj,
typename RemoveRef<T>::ScalarType s,
typename RemoveRef<T>::PointType p,
typename RemoveRef<T>::BoxType b) {
typename RemoveRef<T>::ScalarType;
typename RemoveRef<T>::PointType;
typename RemoveRef<T>::BoxType;
RemoveRef<T>();
RemoveRef<T>(p, s);
{ obj.center() } -> Point3Concept;
{ obj.radius() } -> std::convertible_to<decltype(s)>;
{ obj.diameter() } -> std::same_as<decltype(s)>;
{ obj.circumference() } -> std::same_as<decltype(s)>;
{ obj.surfaceArea() } -> std::same_as<decltype(s)>;
{ obj.volume() } -> std::same_as<decltype(s)>;
{ obj.isInside(p) } -> std::same_as<bool>;
{ obj.intersects(b) } -> std::same_as<bool>;
}
A class representing a line segment in n-dimensional space. The class is parameterized by a PointConc...
Definition segment.h:43
Concept for points in three-dimensional space.
Definition point.h:130
Concept for types representing spheres in Euclidean space.
Definition sphere.h:64

Detailed Description

Concept for types representing spheres in Euclidean space.

A type T models the SphereConcept if it provides the following:

  • typename T::PointType: a type that represents a point in Euclidean space.
  • typename T::ScalarType: a type that represents the scalar used for the coordinates of the sphere's points.
  • typename T::BoxType: a type that represents a box in Euclidean space.
  • o.center(): a member function that returns a mutable reference to the center of the sphere.
  • co.center(): a member function that returns a constant reference to the center of the sphere.
  • o.radius(): a member function that returns a mutable reference to the radius of the sphere.
  • co.radius(): a member function that returns a constant reference to the radius of the sphere.
  • co.diameter(): a member function that returns the diameter of the sphere.
  • co.circumference(): a member function that returns the circumference of the sphere.
  • co.surfaceArea(): a member function that returns the surface area of the sphere.
  • co.volume(): a member function that returns the volume of the sphere.
  • co.isInside(p): a member function that returns true if the point p is inside the sphere, false otherwise.
  • co.intersects(b): a member function that returns true if the sphere intersects the box b, false otherwise.

The PointType type should be a model of the PointConcept. The BoxType type should be a model of the BoxConcept.

Template Parameters
TThe type to be tested for conformity to the SphereConcept.