|
template<typename Functor > |
auto | sum (Functor &&f) -> typename std::decay< decltype(f(std::declval< HandleT >()))>::type |
| Computes the sum of elements. More...
|
|
template<typename Functor > |
auto | avg (Functor &&f) -> typename std::decay< decltype(f(std::declval< HandleT >()))>::type |
| Computes the average of elements. More...
|
|
template<typename Functor > |
auto | any_of (Functor &&f) -> bool |
| Check if any element fulfils condition. More...
|
|
template<typename Functor > |
auto | all_of (Functor &&f) -> bool |
| Check if all elements fulfil condition. More...
|
|
template<int n, typename Functor = Identity> |
auto | to_array (Functor &&f={}) -> std::array< typename std::decay< decltype(f(std::declval< HandleT >()))>::type, n > |
| Convert range to array. More...
|
|
template<typename Functor = Identity> |
auto | to_vector (Functor &&f={}) -> std::vector< typename std::decay< decltype(f(std::declval< HandleT >()))>::type > |
| Convert range to vector. More...
|
|
template<typename Functor = Identity> |
auto | to_set (Functor &&f={}) -> std::set< typename std::decay< decltype(f(std::declval< HandleT >()))>::type > |
| Convert range to set. More...
|
|
template<typename Functor > |
auto | first (Functor &&f={}) -> HandleT |
| Get the first element that fulfills a condition. More...
|
|
template<typename Functor > |
auto | min (Functor &&f) -> typename std::decay< decltype(f(std::declval< HandleT >()))>::type |
| Compute minimum. More...
|
|
template<typename Functor > |
auto | argmin (Functor &&f) -> HandleT |
| Compute minimal element. More...
|
|
template<typename Functor > |
auto | max (Functor &&f) -> typename std::decay< decltype(f(std::declval< HandleT >()))>::type |
| Compute maximum. More...
|
|
template<typename Functor > |
auto | argmax (Functor &&f) -> HandleT |
| Compute maximal element. More...
|
|
template<typename Functor > |
auto | minmax (Functor &&f) -> std::pair< typename std::decay< decltype(f(std::declval< HandleT >()))>::type, typename std::decay< decltype(f(std::declval< HandleT >()))>::type > |
| Computes minimum and maximum. More...
|
|
template<typename Functor > |
auto | count_if (Functor &&f) -> int |
| Compute number of elements that satisfy a given predicate. More...
|
|
template<typename Functor > |
auto | for_each (Functor &&f) -> void |
| Apply a functor to each element. More...
|
|
template<typename Functor > |
auto | filtered (Functor &&f) -> FilteredSmartRangeT< SmartRange, Handle, typename std::decay< Functor >::type > |
| Only iterate over a subset of elements. More...
|
|
template<typename RangeT, typename HandleT>
struct OpenMesh::SmartRangeT< RangeT, HandleT >
Base class for all smart range types.
template<typename RangeT, typename HandleT>
template<int n, typename Functor = Identity>
auto OpenMesh::SmartRangeT< RangeT, HandleT >::to_array |
( |
Functor && |
f = {} | ) |
-> std::array<typename std::decay<decltype (f(std::declval<HandleT>()))>::type, n>
|
|
inline |
Convert range to array.
Converts the range of elements into an array of objects returned by functor f
. The size of the array needs to be provided by the user. If the size is larger than the number of elements in the range, the remaining entries of the array will be uninitialized.
- Parameters
-
f | Functor that is applied to all elements before putting them into the array. If no functor is provided the array will contain the handles. |