Commit: e66c59129c3e211125d67699d17e71c23993e0a4
Author: Howard Trickey
Date: Sun Aug 9 07:24:50 2020 -0400
Branches: newboolean
https://developer.blender.org/rBe66c59129c3e211125d67699d17e71c23993e0a4
Merge branch 'master' into newboolean
===================================================================
===================================================================
diff --cc build_files/cmake/platform/platform_unix.cmake
index a75bd4eec95,83909a0cf66..df7feba2752
--- a/build_files/cmake/platform/platform_unix.cmake
+++ b/build_files/cmake/platform/platform_unix.cmake
@@@ -427,17 -427,8 +427,17 @@@ if(WITH_TBB
find_package_wrapper(TBB)
endif()
+if(WITH_GMP)
+ find_package(GMP)
+
+ if(NOT GMP_FOUND)
+ set(WITH_GMP OFF)
+ message(STATUS "GMP not found")
+ endif()
+endif()
+
if(WITH_XR_OPENXR)
- find_package(XR-OpenXR-SDK)
+ find_package(XR_OpenXR_SDK)
if(NOT XR_OPENXR_SDK_FOUND)
message(WARNING "OpenXR-SDK not found, disabling WITH_XR_OPENXR")
set(WITH_XR_OPENXR OFF)
diff --cc source/blender/blenlib/BLI_delaunay_2d.h
index d5b5e8f59db,a826a6b2677..cd5838d9b29
--- a/source/blender/blenlib/BLI_delaunay_2d.h
+++ b/source/blender/blenlib/BLI_delaunay_2d.h
@@@ -202,70 -207,4 +201,68 @@@ void BLI_delaunay_2d_cdt_free(CDT_resul
#ifdef __cplusplus
}
-#endif
+
+/* C++ Interface. */
+
+# include "BLI_array.hh"
+# include "BLI_double2.hh"
+# include "BLI_math_mpq.hh"
+# include "BLI_mpq2.hh"
+# include "BLI_vector.hh"
+
+namespace blender::meshintersect {
+
+/* vec2<Arith_t> is a 2d vector with Arith_t as the type for coordinates. */
+template<typename Arith_t> struct vec2_impl;
+template<> struct vec2_impl<double> {
+ typedef double2 type;
+};
+
+# ifdef WITH_GMP
+template<> struct vec2_impl<mpq_class> {
+ typedef mpq2 type;
+};
+# endif
+
+template<typename Arith_t> using vec2 = typename vec2_impl<Arith_t>::type;
+
+template<typename Arith_t> class CDT_input {
+ public:
+ Array<vec2<Arith_t>> vert;
+ Array<std::pair<int, int>> edge;
+ Array<Vector<int>> face;
+ Arith_t epsilon{0};
+};
+
+template<typename Arith_t> class CDT_result {
+ public:
+ Array<vec2<Arith_t>> vert;
+ Array<std::pair<int, int>> edge;
+ Array<Vector<int>> face;
+ /* For each output vert, which input verts correspond to it? */
+ Array<Vector<int>> vert_orig;
+ /* For each output edge, which input edges does it overlap?
+ * The input edge ids are encoded as follows:
+ * if the value is less than face_edge_offset, then it is
+ * an index into the input edge[] array.
+ * else let (a, b) = the quotient and remainder of dividing
+ * the edge index by face_edge_offset; "a" will be the input face + 1,
+ * and "b" will be a position within that face.
+ */
+ Array<Vector<int>> edge_orig;
+ /* For each output face, which original faces does it overlap? */
+ Array<Vector<int>> face_orig;
+ /* Used to encode edge_orig (see above). */
+ int face_edge_offset;
+};
+
+CDT_result<double> delaunay_2d_calc(const CDT_input<double> &input,
CDT_output_type output_type);
+
+# ifdef WITH_GMP
+CDT_result<mpq_class> delaunay_2d_calc(const CDT_input<mpq_class> &input,
+ CDT_output_type output_type);
+# endif
+
+} /* namespace blender::meshintersect */
+
- #endif /* __cplusplus */
-
- #endif /* __BLI_DELAUNAY_2D_H__ */
++#endif /* __cplusplus */
diff --cc source/blender/bmesh/tools/bmesh_edgesplit.h
index 63916efdcd9,4b8c07fc992..4d3db67ef5f
--- a/source/blender/bmesh/tools/bmesh_edgesplit.h
+++ b/source/blender/bmesh/tools/bmesh_edgesplit.h
@@@ -29,9 -24,3 +28,7 @@@ void BM_mesh_edgesplit(BMesh *bm
const bool use_verts,
const bool tag_only,
const bool copy_select);
+
+#ifdef __cplusplus
+}
+#endif
-
- #endif /* __BMESH_EDGESPLIT_H__ */
_______________________________________________
Bf-blender-cvs mailing list
[email protected]
https://lists.blender.org/mailman/listinfo/bf-blender-cvs