Visual Computing Library
Loading...
Searching...
No Matches
tex_coord.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_TEX_COORD_H
24#define VCL_CONCEPTS_SPACE_TEX_COORD_H
25
26#include <vclib/concepts/const_correctness.h>
27#include <vclib/types.h>
28
29namespace vcl {
30
36template<typename T>
37concept TexCoordConcept = requires (
38 T&& obj,
39 typename RemoveRef<T>::ScalarType s,
40 typename RemoveRef<T>::ScalarType& sR) {
41 typename RemoveRef<T>::ScalarType;
42
43 RemoveRef<T>();
44 RemoveRef<T>(s, s);
45
46 { obj.u() } -> std::convertible_to<decltype(s)>;
47 { obj.v() } -> std::convertible_to<decltype(s)>;
48
49 { obj <=> obj } -> std::convertible_to<std::partial_ordering>;
50
51 { obj(uint()) } -> std::convertible_to<decltype(s)>;
52 { obj[uint()] } -> std::convertible_to<decltype(s)>;
53
54 // non const requirements
55 requires IsConst<T> || requires {
56 { obj.u() } -> std::same_as<decltype(sR)>;
57 { obj.v() } -> std::same_as<decltype(sR)>;
58 { obj.setU(s) } -> std::same_as<void>;
59 { obj.setV(s) } -> std::same_as<void>;
60 { obj.set(s, s) } -> std::same_as<void>;
61
62 { obj(uint()) } -> std::same_as<decltype(sR)>;
63 { obj[uint()] } -> std::same_as<decltype(sR)>;
64 };
65};
66
67} // namespace vcl
68
69#endif // VCL_CONCEPTS_SPACE_TEX_COORD_H
The IsConst concept is satisfied if T satisfies one of the following conditions:
Definition const_correctness.h:43
A concept representing a Texture Coordinate.
Definition tex_coord.h:37