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