Visual Computing Library
Loading...
Searching...
No Matches
wedge_colors.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_COLORS_H
24#define VCL_CONCEPTS_MESH_COMPONENTS_WEDGE_COLORS_H
25
26#include "component.h"
27
28#include <vclib/concepts/iterators.h>
29#include <vclib/concepts/ranges/range.h>
30#include <vclib/concepts/space/color.h>
31
32#include <vector>
33
34namespace vcl::comp {
35
50template<typename T>
51concept HasWedgeColors = requires (
52 T&& obj,
53 typename RemoveRef<T>::WedgeColorType c,
54 std::vector<typename RemoveRef<T>::WedgeColorType> vec) {
55 RemoveRef<T>::WEDGE_COLOR_NUMBER;
56 typename RemoveRef<T>::WedgeColorType;
57 typename RemoveRef<T>::WedgeColorsIterator;
58 typename RemoveRef<T>::ConstWedgeColorsIterator;
59
60 { obj.wedgeColor(uint()) } -> ColorConcept;
61 { obj.wedgeColorMod(int()) } -> ColorConcept;
62
63 { obj.wedgeColorBegin() } -> InputIterator<decltype(c)>;
64 { obj.wedgeColorEnd() } -> InputIterator<decltype(c)>;
65
66 { obj.wedgeColors() } -> InputRange<decltype(c)>;
67
68 // non const requirements
69 requires IsConst<T> || requires {
70 { obj.setWedgeColor(uint(), c) } -> std::same_as<void>;
71 { obj.setWedgeColors(vec) } -> std::same_as<void>;
72
73 { obj.wedgeColorBegin() } -> OutputIterator<decltype(c)>;
74 { obj.wedgeColorEnd() } -> OutputIterator<decltype(c)>;
75
76 { obj.wedgeColors() } -> OutputRange<decltype(c)>;
77 };
78};
79
87template<typename T>
91
102template<typename T>
103concept HasRightNumberOfWedgeColors = T::VERTEX_NUMBER == T::WEDGE_COLOR_NUMBER;
104
117template<typename T>
120
121} // namespace vcl::comp
122
123#endif // VCL_CONCEPTS_MESH_COMPONENTS_WEDGE_COLORS_H
ColorConcept is satisfied only if a class provides the member functions specified in this concept....
Definition color.h:41
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
HasOptionalWedgeColors concept is satisfied only if a class satisfies the vcl::comp::HasWedgeColors c...
Definition wedge_colors.h:88
HasRightNumberOfWedgeColors concept.
Definition wedge_colors.h:103
HasWedgeColors concept is satisfied only if a Element class provides the types and member functions s...
Definition wedge_colors.h:51
Evaluates to true if the type T is a component that is stored vertically in its element container,...
Definition component.h:72
SanityCheckWedgeColors concept.
Definition wedge_colors.h:118