38 #include <geogram/basic/geometry.h> 39 #include <geogram/basic/numeric.h> 56 using GEO::Numeric::float32;
57 using GEO::Numeric::float64;
59 using GEO::Numeric::max_float32;
60 using GEO::Numeric::min_float32;
61 using GEO::Numeric::max_float64;
62 using GEO::Numeric::min_float64;
64 static const double global_epsilon = 1E-8;
65 static const double global_epsilon_sq = global_epsilon * global_epsilon;
66 static const double global_epsilon_3 = global_epsilon_sq * global_epsilon;
71 using GEO::signed_index_t;
73 template < index_t DIMENSION >
74 using vecn = GEO::vecng< DIMENSION, double >;
81 static const index_t NO_ID = index_t( -1 );
113 template <
typename Enum >
115 typename std::underlying_type< Enum >::type
117 return static_cast< typename std::underlying_type< Enum >::type
>( e );
120 template <
typename Enum >
123 static const bool enable =
false;
126 template <
typename Enum >
127 typename std::enable_if< EnableBitMaskOperators< Enum >::enable,
131 using underlying =
typename std::underlying_type< Enum >::type;
132 return static_cast< Enum
>(
static_cast< underlying
>( lhs )
133 | static_cast< underlying >( rhs ) );
136 template <
typename Enum >
137 typename std::enable_if< EnableBitMaskOperators< Enum >::enable,
141 using underlying =
typename std::underlying_type< Enum >::type;
142 return static_cast< Enum
>(
static_cast< underlying
>( lhs )
143 & static_cast< underlying >( rhs ) );
146 template <
typename Enum >
147 typename std::enable_if< EnableBitMaskOperators< Enum >::enable,
151 using underlying =
typename std::underlying_type< Enum >::type;
152 return static_cast< Enum
>(
static_cast< underlying
>( lhs )
153 ^ static_cast< underlying >( rhs ) );
156 template <
typename Enum >
162 #define ENABLE_BITMASK_OPERATORS( Enum ) \ 164 struct EnableBitMaskOperators< Enum > \ 166 static const bool enable = true; \ GEO::vecng< DIMENSION, double > vecn
std::enable_if< EnableBitMaskOperators< Enum >::enable, Enum >::type operator^(Enum lhs, Enum rhs)
auto to_underlying_type(Enum e) -> typename std::underlying_type< Enum >::type
bool enum_contains(Enum lhs, Enum rhs)
std::enable_if< EnableBitMaskOperators< Enum >::enable, Enum >::type operator|(Enum lhs, Enum rhs)
Classes to build GeoModel from various inputs.
std::enable_if< EnableBitMaskOperators< Enum >::enable, Enum >::type operator &(Enum lhs, Enum rhs)