Visual Computing Library
Loading...
Searching...
No Matches
texture_paths.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_TEXTURE_PATHS_H
24#define VCL_CONCEPTS_MESH_COMPONENTS_TEXTURE_PATHS_H
25
26#include <vclib/concepts/const_correctness.h>
27#include <vclib/concepts/iterators.h>
28#include <vclib/concepts/ranges/range.h>
29
30#include <string>
31
32namespace vcl::comp {
33
46template<typename T>
47concept HasTexturePaths = requires (T&& obj) {
48 typename RemoveRef<T>::TexFileNamesIterator;
49 typename RemoveRef<T>::ConstTexFileNamesIterator;
50
51 { obj.textureNumber() } -> std::same_as<uint>;
52 { obj.texturePath(uint()) } -> std::convertible_to<std::string>;
53
54 { obj.meshBasePath() } -> std::convertible_to<std::string>;
55
56 { obj.texturePathBegin() } -> InputIterator<std::string>;
57 { obj.texturePathEnd() } -> InputIterator<std::string>;
58 { obj.texturePaths() } -> InputRange<std::string>;
59
60 // non const requirements
61 requires IsConst<T> || requires {
62 { obj.texturePath(uint()) } -> std::same_as<std::string&>;
63 { obj.meshBasePath() } -> std::same_as<std::string&>;
64
65 { obj.clearTexturePaths() } -> std::same_as<void>;
66 { obj.pushTexturePath(std::string()) } -> std::same_as<void>;
67
68 { obj.texturePathBegin() } -> OutputIterator<std::string>;
69 { obj.texturePathEnd() } -> OutputIterator<std::string>;
70 { obj.texturePaths() } -> OutputRange<std::string>;
71 };
72};
73
74} // namespace vcl::comp
75
76#endif // VCL_CONCEPTS_MESH_COMPONENTS_TEXTURE_PATHS_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
HasTexturePaths concept is satisfied only if a Mesh class provides the member functions specified in ...
Definition texture_paths.h:47