From 3b86cb3a3cc268fd0d85b6f8cfbb045d08152474 Mon Sep 17 00:00:00 2001 From: Vojtech Bubnik Date: Thu, 22 Apr 2021 09:26:07 +0200 Subject: [PATCH] Added missing files --- src/libslic3r/clipper.cpp | 13 +++++++++++++ src/libslic3r/clipper.hpp | 26 ++++++++++++++++++++++++++ 2 files changed, 39 insertions(+) create mode 100644 src/libslic3r/clipper.cpp create mode 100644 src/libslic3r/clipper.hpp diff --git a/src/libslic3r/clipper.cpp b/src/libslic3r/clipper.cpp new file mode 100644 index 000000000..8f38ba621 --- /dev/null +++ b/src/libslic3r/clipper.cpp @@ -0,0 +1,13 @@ +// Hackish wrapper around the ClipperLib library to compile the Clipper library using Slic3r::Point. + +#include "clipper.hpp" + +// Don't include for the second time. +#define clipper_hpp + +// Override ClipperLib namespace to Slic3r::ClipperLib +#define CLIPPERLIB_NAMESPACE_PREFIX Slic3r +// Override Slic3r::ClipperLib::IntPoint to Slic3r::Point +#define CLIPPERLIB_INTPOINT_TYPE Slic3r::Point + +#include diff --git a/src/libslic3r/clipper.hpp b/src/libslic3r/clipper.hpp new file mode 100644 index 000000000..b0dd51a4f --- /dev/null +++ b/src/libslic3r/clipper.hpp @@ -0,0 +1,26 @@ +// Hackish wrapper around the ClipperLib library to compile the Clipper library using Slic3r's own Point type. + +#ifndef slic3r_clipper_hpp + +#ifdef clipper_hpp +#error "You should include the libslic3r/clipper.hpp before clipper/clipper.hpp" +#endif + +#ifdef CLIPPERLIB_USE_XYZ +#error "Something went wrong. Using clipper.hpp with Slic3r Point type, but CLIPPERLIB_USE_XYZ is defined." +#endif + +#define slic3r_clipper_hpp + +#include "Point.hpp" + +#define CLIPPERLIB_NAMESPACE_PREFIX Slic3r +#define CLIPPERLIB_INTPOINT_TYPE Slic3r::Point + +#include + +#undef clipper_hpp +#undef CLIPPERLIB_NAMESPACE_PREFIX +#undef CLIPPERLIB_INTPOINT_TYPE + +#endif // slic3r_clipper_hpp