Visual Computing Library
Loading...
Searching...
No Matches
plane.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_PLANE_H
24#define VCL_CONCEPTS_SPACE_PLANE_H
25
26#include "point.h"
27
28#include <vclib/types.h>
29
30namespace vcl {
31
56template<typename T>
57concept PlaneConcept = requires (
58 T&& obj,
59 typename RemoveRef<T>::PointType p,
60 typename RemoveRef<T>::ScalarType s) {
61 // inner types
62 typename RemoveRef<T>::ScalarType;
63 typename RemoveRef<T>::PointType;
64
65 // constructors
66 RemoveRef<T>();
67 RemoveRef<T>(p, s);
68 RemoveRef<T>(p, p);
69 RemoveRef<T>(p, p, p);
70
71 { obj.direction() } -> Point3Concept;
72 { obj.offset() } -> std::same_as<decltype(s)>;
73
74 { obj.projectPoint(p) } -> Point3Concept;
75 { obj.mirrorPoint(p) } -> Point3Concept;
76
77 { obj == obj } -> std::same_as<bool>;
78 { obj != obj } -> std::same_as<bool>;
79};
80
81} // namespace vcl
82
83#endif // VCL_CONCEPTS_SPACE_PLANE_H
A C++ concept that requires a type to represent a plane in 3D space.
Definition plane.h:57
Concept for points in three-dimensional space.
Definition point.h:130