Visual Computing Library
Loading...
Searching...
No Matches
wedge_tex_coords.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_MESH_COMPONENTS_WEDGE_TEX_COORDS_H
24#define VCL_CONCEPTS_MESH_COMPONENTS_WEDGE_TEX_COORDS_H
25
26#include "component.h"
27
28#include <vclib/concepts/const_correctness.h>
29#include <vclib/concepts/iterators.h>
30#include <vclib/concepts/ranges/range.h>
31#include <vclib/concepts/space/tex_coord.h>
32
33#include <vector>
34
35namespace vcl::comp {
36
51template<typename T>
52concept HasWedgeTexCoords = requires (
53 T&& obj,
54 typename RemoveRef<T>::WedgeTexCoordType t,
55 std::vector<typename RemoveRef<T>::WedgeTexCoordType> vec) {
56 RemoveRef<T>::WEDGE_TEX_COORD_NUMBER;
57 typename RemoveRef<T>::WedgeTexCoordType;
58 typename RemoveRef<T>::WedgeTexCoordsIterator;
59 typename RemoveRef<T>::ConstWedgeTexCoordsIterator;
60
61 { obj.wedgeTexCoord(uint()) } -> TexCoordConcept;
62 { obj.wedgeTexCoordMod(int()) } -> TexCoordConcept;
63
64 { obj.textureIndex() } -> std::convertible_to<ushort>;
65
66 { obj.wedgeTexCoordBegin() } -> InputIterator<decltype(t)>;
67 { obj.wedgeTexCoordEnd() } -> InputIterator<decltype(t)>;
68
69 { obj.wedgeTexCoords() } -> InputRange<decltype(t)>;
70
71 // non const requirements
72 requires IsConst<T> || requires {
73 { obj.setWedgeTexCoord(uint(), t) } -> std::same_as<void>;
74 { obj.setWedgeTexCoords(vec) } -> std::same_as<void>;
75
76 { obj.textureIndex() } -> std::same_as<ushort&>;
77
78 { obj.wedgeTexCoordBegin() } -> OutputIterator<decltype(t)>;
79 { obj.wedgeTexCoordEnd() } -> OutputIterator<decltype(t)>;
80
81 { obj.wedgeTexCoords() } -> OutputRange<decltype(t)>;
82 };
83};
84
92template<typename T>
96
107template<typename T>
109 RemoveRef<T>::VERTEX_NUMBER == RemoveRef<T>::WEDGE_TEX_COORD_NUMBER;
110
123template<typename T>
126
127} // namespace vcl::comp
128
129#endif // VCL_CONCEPTS_MESH_COMPONENTS_WEDGE_TEX_COORDS_H
The InputIterator concept is satisfied if T is an input iterator that implements the operator* return...
Definition iterators.h:46
Utility concept that is evaluated true the Range R is an Input Range and has a value_type that is con...
Definition range.h:89
The IsConst concept is satisfied if T satisfies one of the following conditions:
Definition const_correctness.h:43
The OutputIterator concept is satisfied if T is an output iterator that implements the operator* retu...
Definition iterators.h:60
Utility concept that is evaluated true the Range R is an Output Range and has a value_type that is T.
Definition range.h:113
A concept representing a Texture Coordinate.
Definition tex_coord.h:37
HasOptionalWedgeTexCoords concept is satisfied only if a class satisfied the vcl::comp::HasWedgeTexCo...
Definition wedge_tex_coords.h:93
HasRightNumberOfWedgeTexCoords concept.
Definition wedge_tex_coords.h:108
HasWedgeTexCoords concept is satisfied only if a Element class provides the types and member function...
Definition wedge_tex_coords.h:52
Evaluates to true if the type T is a component that is stored vertically in its element container,...
Definition component.h:72
SanityCheckWedgeTexCoords concept.
Definition wedge_tex_coords.h:124