Developer Documentation
|
Base class for all smart range types. More...
#include <OpenFlipper/libs_required/OpenMesh/src/OpenMesh/Core/Mesh/SmartRange.hh>
Public Member Functions | |
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 | max (Functor &&f) -> typename std::decay< decltype(f(std::declval< HandleT >()))>::type |
Compute maximum. 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... | |
Base class for all smart range types.
Definition at line 70 of file SmartRange.hh.
|
inline |
Check if all elements fulfil condition.
Checks if functor f
returns true for all of the elements in the range. Returns true if that is the case, false otherwise.
f | Functor that is evaluated for all elements. |
Definition at line 145 of file SmartRange.hh.
|
inline |
Check if any element fulfils condition.
Checks if functor f
returns true for any of the elements in the range. Returns true if that is the case, false otherwise.
f | Functor that is evaluated for all elements. |
Definition at line 128 of file SmartRange.hh.
|
inline |
Computes the average of elements.
Computes the average of all elements in the range after applying the functor f
.
f | Functor that is applied to all elements before computing the average. |
Definition at line 102 of file SmartRange.hh.
|
inline |
Get the first element that fulfills a condition.
Finds the first element of the range for which the functor f
evaluates to true. Returns an invalid handle if none evaluates to true
f | Functor that is applied to all elements before putting them into the set. If no functor is provided the set will contain the handles. |
Definition at line 219 of file SmartRange.hh.
|
inline |
Compute maximum.
Computes the maximum of all objects returned by functor f
.
f | Functor that is applied to all elements before computing maximum. |
Definition at line 260 of file SmartRange.hh.
|
inline |
Compute minimum.
Computes the minimum of all objects returned by functor f
.
f | Functor that is applied to all elements before computing minimum. |
Definition at line 235 of file SmartRange.hh.
|
inline |
Computes minimum and maximum.
Computes the minimum and maximum of all objects returned by functor f
. Result is returned as std::pair containing minimum as first and maximum as second element.
f | Functor that is applied to all elements before computing maximum. |
Definition at line 286 of file SmartRange.hh.
|
inline |
Computes the sum of elements.
Computes the sum of all elements in the range after applying the functor f
.
f | Functor that is applied to all elements before computing the sum |
Definition at line 81 of file SmartRange.hh.
|
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.
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. |
Definition at line 164 of file SmartRange.hh.
|
inline |
Convert range to set.
Converts the range of elements into a set of objects returned by functor f
.
f | Functor that is applied to all elements before putting them into the set. If no functor is provided the set will contain the handles. |
Definition at line 201 of file SmartRange.hh.
|
inline |
Convert range to vector.
Converts the range of elements into a vector of objects returned by functor f
.
f | Functor that is applied to all elements before putting them into the vector. If no functor is provided the vector will contain the handles. |
Definition at line 184 of file SmartRange.hh.