OpenVDB: openvdb/Types.h File Reference

OpenVDB 12.1.1

Loading...
Searching...
No Matches
Types.h File Reference
`#include "version.h"`
`#include "Platform.h"`
`#include "TypeList.h"`
`#include <openvdb/math/Half.h>`
`#include <openvdb/math/Math.h>`
`#include <openvdb/math/BBox.h>`
`#include <openvdb/math/Quat.h>`
`#include <openvdb/math/Vec2.h>`
`#include <openvdb/math/Vec3.h>`
`#include <openvdb/math/Vec4.h>`
`#include <openvdb/math/Mat3.h>`
`#include <openvdb/math/Mat4.h>`
`#include <openvdb/math/Coord.h>`
`#include <cstdint>`
`#include <memory>`
`#include <type_traits>`

Go to the source code of this file.

## Classes
class | ValueMask
struct | PointIndex< IntType_, Kind >
| Integer wrapper, required to distinguish PointIndexGrid and PointDataGrid from Int32Grid and Int64Grid. More...
struct | IsSpecializationOf< T, Template >
| Helper metafunction used to determine if the first template parameter is a specialization of the class template given in the second template parameter. More...
struct | IsSpecializationOf< Template< Args... >, Template >
struct | index_sequence< Ns >
| Re-implementation of C++17's index_sequence and the helper alias make_index_sequence. This was introduced to fix an issue with clang's builtin implementation which treats template specializations of builtin templates differently when a subsequent parameter is dependent. The result is a resolution failure during partial specialization selection. For example, the following will fail to specialize: More...
struct | VecTraits< T, bool >
struct | VecTraits< T, false >
struct | QuatTraits< T, bool >
struct | QuatTraits< T, false >
struct | MatTraits< T, bool >
struct | MatTraits< T, false >
struct | ValueTraits< T, bool >
struct | ValueTraits< T, false >
struct | ConvertElementType< T, SubT >
| Conversion classes for changing the underlying type of VDB types. More...
struct | ConvertElementType< math::Vec2< T >, SubT >
struct | ConvertElementType< math::Vec3< T >, SubT >
struct | ConvertElementType< math::Vec4< T >, SubT >
struct | ConvertElementType< math::Quat< T >, SubT >
struct | ConvertElementType< math::Mat3< T >, SubT >
struct | ConvertElementType< math::Mat4< T >, SubT >
struct | int_t< 8ul, true >
struct | int_t< 16ul, true >
struct | int_t< 32ul, true >
struct | int_t< 64ul, true >
struct | int_t< 8ul, false >
struct | int_t< 16ul, false >
struct | int_t< 32ul, false >
struct | int_t< 64ul, false >
struct | flt_t< 16ul >
struct | flt_t< 32ul >
struct | flt_t< 64ul >
struct | PromoteType< T >
| Promotion classes which provide an interface for elevating and demoting a scalar or VDB type to a higher or lower precision. Integer types preserve their sign. Types promotion are only valid between 8 to 64 bits (long doubles are not supported). More...
struct | PromoteContainerType< T, ContainerT >
struct | PromoteType< math::Vec2< T > >
struct | PromoteType< math::Vec3< T > >
struct | PromoteType< math::Vec4< T > >
struct | PromoteType< math::Quat< T > >
struct | PromoteType< math::Mat3< T > >
struct | PromoteType< math::Mat4< T > >
struct | CanConvertType< FromType, ToType >
| CanConvertType<FromType, ToType>::value is `true` if a value of type ToType can be constructed from a value of type FromType. More...
struct | CanConvertType< T, math::Vec2< T > >
struct | CanConvertType< T, math::Vec3< T > >
struct | CanConvertType< T, math::Vec4< T > >
struct | CanConvertType< math::Vec2< T >, math::Vec2< T > >
struct | CanConvertType< math::Vec3< T >, math::Vec3< T > >
struct | CanConvertType< math::Vec4< T >, math::Vec4< T > >
struct | CanConvertType< T0, math::Vec2< T1 > >
struct | CanConvertType< T0, math::Vec3< T1 > >
struct | CanConvertType< T0, math::Vec4< T1 > >
struct | CanConvertType< PointIndex32, PointDataIndex32 >
struct | CanConvertType< PointDataIndex32, PointIndex32 >
struct | CanConvertType< T, ValueMask >
struct | CanConvertType< ValueMask, T >
struct | CopyConstness< FromType, ToType >
| CopyConstness<T1, T2>::Type is either const T2 or `T2` with no `const` qualifier, depending on whether `T1` is `const`. More...
class | CombineArgs< AValueType, BValueType >
| This struct collects both input and output arguments to "grid combiner" functors used with the tree::TypedGrid::combineExtended() and combine2Extended() methods. AValueType and BValueType are the value types of the two grids being combined. More...
struct | SwappedCombineOp< ValueType, CombineOp >
class | ShallowCopy
| Tag dispatch class that distinguishes shallow copy constructors from deep copy constructors. More...
class | TopologyCopy
| Tag dispatch class that distinguishes topology copy constructors from deep copy constructors. More...
class | DeepCopy
| Tag dispatch class that distinguishes constructors that deep copy. More...
class | Steal
| Tag dispatch class that distinguishes constructors that steal. More...
class | PartialCreate
| Tag dispatch class that distinguishes constructors during file input. More...
class | Coord
| Signed (x, y, z) 32-bit integer coordinates. More...
class | CoordBBox
| Axis-aligned bounding box of signed integer coordinates. More...

## Namespaces
namespace | openvdb
namespace | openvdb::v12_1
namespace | openvdb::v12_1::math
namespace | openvdb::v12_1::types_internal

## Macros
#define | OPENVDB_INIT_INVOKABLE_MEMBER_FUNCTION(F)
| Macros to help determine whether or not a class has a particular member function.
#define | OPENVDB_HAS_INVOKABLE_MEMBER_FUNCTION(T, F, ...)
#define | OPENVDB_INIT_MEMBER_FUNCTION(F)
#define | OPENVDB_HAS_MEMBER_FUNCTION(T, F, S)
#define | OPENVDB_TARGET_BITS(SHIFT, PROMOTE)

## Typedefs
using | half = internal::half
using | Index32 = uint32_t
using | Index64 = uint64_t
using | Index = Index32
using | Int16 = int16_t
using | Int32 = int32_t
using | Int64 = int64_t
using | Int = Int32
using | Byte = unsigned char
using | Real = double
using | Vec2R = math::Vec2<Real>
using | Vec2I = math::Vec2<Index32>
using | Vec2f = math::Vec2<float>
using | Vec2H = math::Vec2<math::half>
using | Vec3R = math::Vec3<Real>
using | Vec3I = math::Vec3<Index32>
using | Vec3f = math::Vec3<float>
using | Vec3H = math::Vec3<math::half>
using | Vec3U8 = math::Vec3<uint8_t>
using | Vec3U16 = math::Vec3<uint16_t>
using | BBoxd = math::BBox<Vec3d>
using | Vec4R = math::Vec4<Real>
using | Vec4I = math::Vec4<Index32>
using | Vec4f = math::Vec4<float>
using | Vec4H = math::Vec4<math::half>
using | Mat3R = math::Mat3<Real>
using | Mat4R = math::Mat4<Real>
using | QuatR = math::Quat<Real>
template<typename T>
using | SharedPtr = std::shared_ptr<T>
template<typename T>
using | WeakPtr = std::weak_ptr<T>
using | PointIndex32 = PointIndex<Index32, 0>
using | PointIndex64 = PointIndex<Index64, 0>
using | PointDataIndex32 = PointIndex<Index32, 1>
using | PointDataIndex64 = PointIndex<Index64, 1>
template<std::size_t N>
using | make_index_sequence
using | Vec2i
using | Vec2s
using | Vec2d
using | Vec3i
using | Vec3s
using | Vec3d
using | Vec4i
using | Vec4s
using | Vec4d
using | Mat3s
using | Mat3d
using | Mat4s
using | Mat4d
using | Quats
using | Quatd

## Enumerations
enum | GridClass { GRID_UNKNOWN = 0 , GRID_LEVEL_SET , GRID_FOG_VOLUME , GRID_STAGGERED }
enum | { NUM_GRID_CLASSES = GRID_STAGGERED + 1 }
enum | VecType { VEC_INVARIANT = 0 , VEC_COVARIANT , VEC_COVARIANT_NORMALIZE , VEC_CONTRAVARIANT_RELATIVE , VEC_CONTRAVARIANT_ABSOLUTE }
enum | { NUM_VEC_TYPES = VEC_CONTRAVARIANT_ABSOLUTE + 1 }
enum | MergePolicy { MERGE_ACTIVE_STATES = 0 , MERGE_NODES , MERGE_ACTIVE_STATES_AND_NODES }

## Functions
template<typename T, typename U>
SharedPtr< T > | ConstPtrCast (const SharedPtr< U > &ptr)
| Return a new shared pointer that points to the same object as the given pointer but with possibly different const-ness.
template<typename T, typename U>
SharedPtr< T > | DynamicPtrCast (const SharedPtr< U > &ptr)
| Return a new shared pointer that is either null or points to the same object as the given pointer after a `dynamic_cast`.
template<typename T, typename U>
SharedPtr< T > | StaticPtrCast (const SharedPtr< U > &ptr)
| Return a new shared pointer that points to the same object as the given pointer after a `static_cast`.
template<std::size_t N, std::size_t... Is>
auto | make_index_sequence_impl ()
template<typename T>
const char * | typeNameAsString ()
template<>
const char * | typeNameAsString< bool > ()
template<>
const char * | typeNameAsString< ValueMask > ()
template<>
const char * | typeNameAsString< math::half > ()
template<>
const char * | typeNameAsString< float > ()
template<>
const char * | typeNameAsString< double > ()
template<>
const char * | typeNameAsString< int8_t > ()
template<>
const char * | typeNameAsString< uint8_t > ()
template<>
const char * | typeNameAsString< int16_t > ()
template<>
const char * | typeNameAsString< uint16_t > ()
template<>
const char * | typeNameAsString< int32_t > ()
template<>
const char * | typeNameAsString< uint32_t > ()
template<>
const char * | typeNameAsString< int64_t > ()
template<>
const char * | typeNameAsString< Vec2i > ()
template<>
const char * | typeNameAsString< Vec2s > ()
template<>
const char * | typeNameAsString< Vec2d > ()
template<>
const char * | typeNameAsString< Vec3U8 > ()
template<>
const char * | typeNameAsString< Vec3U16 > ()
template<>
const char * | typeNameAsString< Vec3i > ()
template<>
const char * | typeNameAsString< Vec3f > ()
template<>
const char * | typeNameAsString< Vec3d > ()
template<>
const char * | typeNameAsString< Vec4i > ()
template<>
const char * | typeNameAsString< Vec4f > ()
template<>
const char * | typeNameAsString< Vec4d > ()
template<>
const char * | typeNameAsString< std::string > ()
template<>
const char * | typeNameAsString< Mat3s > ()
template<>
const char * | typeNameAsString< Mat3d > ()
template<>
const char * | typeNameAsString< Mat4s > ()
template<>
const char * | typeNameAsString< Mat4d > ()
template<>
const char * | typeNameAsString< math::Quats > ()
template<>
const char * | typeNameAsString< math::Quatd > ()
template<>
const char * | typeNameAsString< PointIndex32 > ()
template<>
const char * | typeNameAsString< PointIndex64 > ()
template<>
const char * | typeNameAsString< PointDataIndex32 > ()
template<>
const char * | typeNameAsString< PointDataIndex64 > ()
template<>
auto | cwiseAdd (const math::Vec3< math::half > &v, const float s)

## Variables
static const Real | LEVEL_SET_HALF_WIDTH = 3

## Macro Definition Documentation

## ◆ OPENVDB_HAS_INVOKABLE_MEMBER_FUNCTION

#define OPENVDB_HAS_INVOKABLE_MEMBER_FUNCTION | ( |  | T,
|  |  | F,
|  |  | ... )

Value:
HasInvokableMemberFunction_##F<T, __VA_ARGS__>::value

## ◆ OPENVDB_HAS_MEMBER_FUNCTION

#define OPENVDB_HAS_MEMBER_FUNCTION | ( |  | T,
|  |  | F,
|  |  | S )

Value:
HasMemberFunction_##F<T, S>::value

## ◆ OPENVDB_INIT_INVOKABLE_MEMBER_FUNCTION

#define OPENVDB_INIT_INVOKABLE_MEMBER_FUNCTION | ( |  | F | ) |

Value:
template <typename ClassT, typename... Args> \
struct HasInvokableMemberFunction_##F { \
private: \
template <typename T> \
static auto check(T*) -> \
decltype(std::declval<T>(). \
F(std::declval<Args>()...), std::true_type()); \
template <typename T> \
static auto check(...) -> std::false_type; \
public: \
static constexpr bool value = \
decltype(check<ClassT>(nullptr))::value; \
};

Macros to help determine whether or not a class has a particular member function.

These macros work by instantiating unique templated instances of helper structs for a particular member function signature and name which can then be queried.

- The first macro, INVOKABLE, defines a helper struct which determines if a member function can be called with a given set of argument types. Note that the return type is not provided.
- The second macro defines a helper struct which determines if the member function exists with the exact same signature, including all argument and function attributes (const-ness, noexcept, etc)

Use the first solution if all you want to determine is whether a given method can be called, and the second if you need exact resolution.

// example class
struct MyClass { int test(double) { return 0; } };
// The following examples work from the struct type created by:
OPENVDB_INIT_INVOKABLE_MEMBER_FUNCTION(test);
// Will assert true!
static_assert(OPENVDB_HAS_INVOKABLE_MEMBER_FUNCTION(MyClass, test, double));
// Will assert true, int can be converted to double
static_assert(OPENVDB_HAS_INVOKABLE_MEMBER_FUNCTION(MyClass, test, int));
// Will assert false, needs at least one argument
static_assert(OPENVDB_HAS_INVOKABLE_MEMBER_FUNCTION(MyClass, test);
// The following examples work from the struct type created by:
OPENVDB_INIT_MEMBER_FUNCTION(test);
// Will assert fail
static_assert(OPENVDB_HAS_MEMBER_FUNCTION(MyClass, test, void(MyClass::*)(double)));
// Only case where this assert true
static_assert(OPENVDB_HAS_MEMBER_FUNCTION(MyClass, test, int(MyClass::*)(double)));
OPENVDB_HAS_MEMBER_FUNCTION
#define OPENVDB_HAS_MEMBER_FUNCTION(T, F, S)
Definition Types.h:252
OPENVDB_INIT_MEMBER_FUNCTION
#define OPENVDB_INIT_MEMBER_FUNCTION(F)
Definition Types.h:242
OPENVDB_HAS_INVOKABLE_MEMBER_FUNCTION
#define OPENVDB_HAS_INVOKABLE_MEMBER_FUNCTION(T, F,...)
Definition Types.h:239
OPENVDB_INIT_INVOKABLE_MEMBER_FUNCTION
#define OPENVDB_INIT_INVOKABLE_MEMBER_FUNCTION(F)
Macros to help determine whether or not a class has a particular member function.
Definition Types.h:225

## ◆ OPENVDB_INIT_MEMBER_FUNCTION

#define OPENVDB_INIT_MEMBER_FUNCTION | ( |  | F | ) |

Value:
template<typename ClassT, typename Signature> \
struct HasMemberFunction_##F { \
template <typename U, U> struct sigmatch; \
template <typename U> static std::true_type \
check(sigmatch<Signature, &U::F>*); \
template <typename> static std::false_type check(...); \
static const bool value = std::is_same<std::true_type, \
decltype(check<ClassT>(nullptr))>::value; \
};

## ◆ OPENVDB_TARGET_BITS

#define OPENVDB_TARGET_BITS | ( |  | SHIFT,
|  |  | PROMOTE )

Value:
std::max(size_t(8), \
std::min(size_t(64), (PROMOTE ? size_t(8)*(sizeof(T)<<SHIFT) : \
size_t(8)*(sizeof(T)>>SHIFT))))