Visual Computing Library
Loading...
Searching...
No Matches
sphere.h
1/*****************************************************************************
2 * VCLib *
3 * Visual Computing Library *
4 * *
5 * Copyright(C) 2021-2025 *
6 * Visual Computing Lab *
7 * ISTI - Italian National Research Council *
8 * *
9 * All rights reserved. *
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the Mozilla Public License Version 2.0 as published *
13 * by the Mozilla Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 * This program is distributed in the hope that it will be useful, *
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
19 * Mozilla Public License Version 2.0 *
20 * (https://www.mozilla.org/en-US/MPL/2.0/) for more details. *
21 ****************************************************************************/
22
23#ifndef VCL_CONCEPTS_SPACE_SPHERE_H
24#define VCL_CONCEPTS_SPACE_SPHERE_H
25
26#include "point.h"
27
28namespace vcl {
29
63template<typename T>
64concept SphereConcept = requires (
65 T&& obj,
66 typename RemoveRef<T>::ScalarType s,
67 typename RemoveRef<T>::PointType p,
68 typename RemoveRef<T>::BoxType b) {
69 typename RemoveRef<T>::ScalarType;
70 typename RemoveRef<T>::PointType;
71 typename RemoveRef<T>::BoxType;
72
74
75 RemoveRef<T>();
76 RemoveRef<T>(p, s);
77
78 { obj.center() } -> Point3Concept;
79 { obj.radius() } -> std::convertible_to<decltype(s)>;
80
81 { obj.diameter() } -> std::same_as<decltype(s)>;
82 { obj.circumference() } -> std::same_as<decltype(s)>;
83 { obj.surfaceArea() } -> std::same_as<decltype(s)>;
84 { obj.volume() } -> std::same_as<decltype(s)>;
85
86 { obj.isInside(p) } -> std::same_as<bool>;
87 { obj.intersects(b) } -> std::same_as<bool>;
88};
89
90} // namespace vcl
91
92#endif // VCL_CONCEPTS_SPACE_SPHERE_H
Concept for points in three-dimensional space.
Definition point.h:130
Concept for types representing spheres in Euclidean space.
Definition sphere.h:64