MeshLib C++ Docs
Loading...
Searching...
No Matches
MROpenVDB.h
Go to the documentation of this file.
1#pragma once
2
3#include <MRPch/MRSuppressWarning.h>
4#include <MRPch/MRTBB.h>
5
6#ifndef M_PI
7#define M_PI 3.1415926535897932384626433832795
8#endif
9
10#ifndef M_PI_2
11#define M_PI_2 1.5707963267948966192313216916398
12#endif
13
14MR_SUPPRESS_WARNING_PUSH
15
16#ifdef _MSC_VER
17#pragma warning(disable:4005) // 'M_PI': macro redefinition
18#pragma warning(disable:4127)
19#pragma warning(disable:4146)
20#pragma warning(disable:4180) // qualifier applied to function type has no meaning; ignored
21#pragma warning(disable:4242) // '=': conversion from 'int' to 'char', possible loss of data
22#pragma warning(disable:4244)
23#pragma warning(disable:4251)
24#pragma warning(disable:4275)
25#pragma warning(disable:4355) //'this': used in base member initializer list
26#pragma warning(disable:4459) //declaration of 'compare' hides global declaration
27#pragma warning(disable:4464) //relative include path contains '..'
28#pragma warning(disable:4701) //potentially uninitialized local variable 'inv' used
29#pragma warning(disable:4702) //unreachable code
30#pragma warning(disable:4800) // Implicit conversion from '_Ty' to bool.
31#pragma warning(disable:4868) //compiler may not enforce left-to-right evaluation order in braced initializer list
32
33#pragma warning(disable:6297) //Arithmetic overflow: 32-bit value is shifted, then cast to 64-bit value. Results might not be an expected value.
34#pragma warning(disable:26451) //Arithmetic overflow: Using operator '-' on a 4 byte value and then casting the result to a 8 byte value. Cast the value to the wider type before calling operator '-' to avoid overflow (io.2).
35#pragma warning(disable:26495) //Variable 'openvdb::v7_1::math::Tuple<4,int>::mm' is uninitialized. Always initialize a member variable (type.6).
36#pragma warning(disable:26812) //The enum type 'openvdb::v7_1::GridClass' is unscoped. Prefer 'enum class' over 'enum' (Enum.3).
37#pragma warning(disable:26815) //The pointer is dangling because it points at a temporary instance which was destroyed.
38
39// unknown pragmas
40#pragma warning(disable:4068)
41#endif
42
43#if defined(__GNUC__)
44#pragma GCC diagnostic ignored "-Wdeprecated-declarations"
45#if __GNUC__ == 12 || __GNUC__ == 13
46#pragma GCC diagnostic ignored "-Wmissing-template-keyword"
47#endif
48#endif
49
50#if __clang_major__ >= 19 || __apple_build_version__ >= 17000000
51#pragma clang diagnostic ignored "-Wmissing-template-arg-list-after-template-kw"
52#endif
53
54#ifdef __EMSCRIPTEN__
55#pragma clang diagnostic ignored "-Wabsolute-value"
56#endif
57
58#define IMATH_HALF_NO_LOOKUP_TABLE // fix for unresolved external symbol "imath_half_to_float_table"
59
60
61// Forward-declare some classes with default visibility. Otherwise on Mac the `dynamic_cast` to `openvdb::FloatGrid` can return null even if the type is correct.
62// All those types are the components of the `openvdb::FloatGrid` typedef (including the template arguments...).
63#ifdef __APPLE__
64#include <openvdb/version.h> // For `OPENVDB_VERSION_NAME`, `OPENVDB_USE_VERSION_NAMESPACE`.
65#include <openvdb/Types.h> // For `Index`.
66namespace openvdb
67{
68OPENVDB_USE_VERSION_NAMESPACE
69namespace OPENVDB_VERSION_NAME
70{
71 template <typename _TreeType>
72 class __attribute__((__visibility__("default"))) Grid;
73
74 namespace tree
75 {
76 template <typename _RootNodeType>
77 class __attribute__((__visibility__("default"))) Tree;
78 template<typename ChildType>
79 class __attribute__((__visibility__("default"))) RootNode;
80 template<typename _ChildNodeType, Index Log2Dim>
81 class __attribute__((__visibility__("default"))) InternalNode;
82 template<typename T, Index Log2Dim>
83 class __attribute__((__visibility__("default"))) LeafNode;
84 } // namespace tree
85} // namespace OPENVDB_VERSION_NAME
86} // namespace openvdb
87#endif
88
89
90#include <openvdb/openvdb.h>
91#include <openvdb/io/Stream.h>
92#include <openvdb/tools/Composite.h>
93#include <openvdb/tools/GridTransformer.h>
94#include <openvdb/tools/MeshToVolume.h>
95#include <openvdb/tools/VolumeToMesh.h>
96#include <openvdb/tools/Dense.h>
97
98MR_SUPPRESS_WARNING_POP
99
100#ifdef _WIN32
101//clean up after windows.h
102#undef small
103#undef APIENTRY
104#undef M_PI
105#undef M_PI_2
106#endif