Fixing compilation issues.
This commit is contained in:
parent
812cbade4d
commit
db05f00860
@ -17,9 +17,9 @@ typedef std::vector<ExPolygon> ExPolygons;
|
|||||||
class ExPolygon
|
class ExPolygon
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
ExPolygon() {}
|
ExPolygon() = default;
|
||||||
ExPolygon(const ExPolygon &other) : contour(other.contour), holes(other.holes) {}
|
ExPolygon(const ExPolygon &other) = default;
|
||||||
ExPolygon(ExPolygon &&other) noexcept : contour(std::move(other.contour)), holes(std::move(other.holes)) {}
|
ExPolygon(ExPolygon &&other) = default;
|
||||||
explicit ExPolygon(const Polygon &contour) : contour(contour) {}
|
explicit ExPolygon(const Polygon &contour) : contour(contour) {}
|
||||||
explicit ExPolygon(Polygon &&contour) : contour(std::move(contour)) {}
|
explicit ExPolygon(Polygon &&contour) : contour(std::move(contour)) {}
|
||||||
explicit ExPolygon(const Points &contour) : contour(contour) {}
|
explicit ExPolygon(const Points &contour) : contour(contour) {}
|
||||||
@ -31,8 +31,8 @@ public:
|
|||||||
ExPolygon(std::initializer_list<Point> contour) : contour(contour) {}
|
ExPolygon(std::initializer_list<Point> contour) : contour(contour) {}
|
||||||
ExPolygon(std::initializer_list<Point> contour, std::initializer_list<Point> hole) : contour(contour), holes({ hole }) {}
|
ExPolygon(std::initializer_list<Point> contour, std::initializer_list<Point> hole) : contour(contour), holes({ hole }) {}
|
||||||
|
|
||||||
ExPolygon& operator=(const ExPolygon &other) { contour = other.contour; holes = other.holes; return *this; }
|
ExPolygon& operator=(const ExPolygon &other) = default;
|
||||||
ExPolygon& operator=(ExPolygon &&other) noexcept { contour = std::move(other.contour); holes = std::move(other.holes); return *this; }
|
ExPolygon& operator=(ExPolygon &&other) = default;
|
||||||
|
|
||||||
Polygon contour;
|
Polygon contour;
|
||||||
Polygons holes;
|
Polygons holes;
|
||||||
|
@ -137,7 +137,7 @@ void Fill3DHoneycomb::_fill_surface_single(
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out)
|
Polylines &polylines_out)
|
||||||
{
|
{
|
||||||
// no rotation is supported for this infill pattern
|
// no rotation is supported for this infill pattern
|
||||||
|
@ -23,7 +23,7 @@ protected:
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out) override;
|
Polylines &polylines_out) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -1253,7 +1253,7 @@ void Filler::_fill_surface_single(
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out)
|
Polylines &polylines_out)
|
||||||
{
|
{
|
||||||
assert (this->adapt_fill_octree);
|
assert (this->adapt_fill_octree);
|
||||||
|
@ -64,7 +64,7 @@ protected:
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out) override;
|
Polylines &polylines_out) override;
|
||||||
bool no_sort() const override { return true; }
|
bool no_sort() const override { return true; }
|
||||||
};
|
};
|
||||||
|
@ -120,7 +120,7 @@ protected:
|
|||||||
const FillParams & /* params */,
|
const FillParams & /* params */,
|
||||||
unsigned int /* thickness_layers */,
|
unsigned int /* thickness_layers */,
|
||||||
const std::pair<float, Point> & /* direction */,
|
const std::pair<float, Point> & /* direction */,
|
||||||
ExPolygon & /* expolygon */,
|
ExPolygon /* expolygon */,
|
||||||
Polylines & /* polylines_out */) {};
|
Polylines & /* polylines_out */) {};
|
||||||
|
|
||||||
virtual float _layer_angle(size_t idx) const { return (idx & 1) ? float(M_PI/2.) : 0; }
|
virtual float _layer_angle(size_t idx) const { return (idx & 1) ? float(M_PI/2.) : 0; }
|
||||||
|
@ -10,7 +10,7 @@ void FillConcentric::_fill_surface_single(
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out)
|
Polylines &polylines_out)
|
||||||
{
|
{
|
||||||
// no rotation is supported for this infill pattern
|
// no rotation is supported for this infill pattern
|
||||||
|
@ -16,7 +16,7 @@ protected:
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out) override;
|
Polylines &polylines_out) override;
|
||||||
|
|
||||||
bool no_sort() const override { return true; }
|
bool no_sort() const override { return true; }
|
||||||
|
@ -37,12 +37,12 @@ static inline Polyline make_wave(
|
|||||||
double period = points.back()(0);
|
double period = points.back()(0);
|
||||||
if (width != period) // do not extend if already truncated
|
if (width != period) // do not extend if already truncated
|
||||||
{
|
{
|
||||||
points.reserve(one_period.size() * floor(width / period));
|
points.reserve(one_period.size() * size_t(floor(width / period)));
|
||||||
points.pop_back();
|
points.pop_back();
|
||||||
|
|
||||||
int n = points.size();
|
size_t n = points.size();
|
||||||
do {
|
do {
|
||||||
points.emplace_back(Vec2d(points[points.size()-n](0) + period, points[points.size()-n](1)));
|
points.emplace_back(points[points.size()-n].x() + period, points[points.size()-n].y());
|
||||||
} while (points.back()(0) < width - EPSILON);
|
} while (points.back()(0) < width - EPSILON);
|
||||||
|
|
||||||
points.emplace_back(Vec2d(width, f(width, z_sin, z_cos, vertical, flip)));
|
points.emplace_back(Vec2d(width, f(width, z_sin, z_cos, vertical, flip)));
|
||||||
@ -67,7 +67,7 @@ static std::vector<Vec2d> make_one_period(double width, double scaleFactor, doub
|
|||||||
std::vector<Vec2d> points;
|
std::vector<Vec2d> points;
|
||||||
double dx = M_PI_2; // exact coordinates on main inflexion lobes
|
double dx = M_PI_2; // exact coordinates on main inflexion lobes
|
||||||
double limit = std::min(2*M_PI, width);
|
double limit = std::min(2*M_PI, width);
|
||||||
points.reserve(ceil(limit / tolerance / 3));
|
points.reserve(coord_t(ceil(limit / tolerance / 3)));
|
||||||
|
|
||||||
for (double x = 0.; x < limit - EPSILON; x += dx) {
|
for (double x = 0.; x < limit - EPSILON; x += dx) {
|
||||||
points.emplace_back(Vec2d(x, f(x, z_sin, z_cos, vertical, flip)));
|
points.emplace_back(Vec2d(x, f(x, z_sin, z_cos, vertical, flip)));
|
||||||
@ -152,10 +152,10 @@ void FillGyroid::_fill_surface_single(
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out)
|
Polylines &polylines_out)
|
||||||
{
|
{
|
||||||
float infill_angle = this->angle + (CorrectionAngle * 2*M_PI) / 360.;
|
auto infill_angle = float(this->angle + (CorrectionAngle * 2*M_PI) / 360.);
|
||||||
if(std::abs(infill_angle) >= EPSILON)
|
if(std::abs(infill_angle) >= EPSILON)
|
||||||
expolygon.rotate(-infill_angle);
|
expolygon.rotate(-infill_angle);
|
||||||
|
|
||||||
|
@ -32,7 +32,7 @@ protected:
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out) override;
|
Polylines &polylines_out) override;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,7 +10,7 @@ void FillHoneycomb::_fill_surface_single(
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out)
|
Polylines &polylines_out)
|
||||||
{
|
{
|
||||||
// cache hexagons math
|
// cache hexagons math
|
||||||
|
@ -20,7 +20,7 @@ protected:
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out) override;
|
Polylines &polylines_out) override;
|
||||||
|
|
||||||
// Caching the
|
// Caching the
|
||||||
|
@ -10,7 +10,7 @@ void FillPlanePath::_fill_surface_single(
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out)
|
Polylines &polylines_out)
|
||||||
{
|
{
|
||||||
expolygon.rotate(- direction.first);
|
expolygon.rotate(- direction.first);
|
||||||
|
@ -23,7 +23,7 @@ protected:
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out) override;
|
Polylines &polylines_out) override;
|
||||||
|
|
||||||
float _layer_angle(size_t idx) const override { return 0.f; }
|
float _layer_angle(size_t idx) const override { return 0.f; }
|
||||||
|
@ -11,7 +11,7 @@ void FillLine::_fill_surface_single(
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out)
|
Polylines &polylines_out)
|
||||||
{
|
{
|
||||||
// rotate polygons so that we can work with vertical lines here
|
// rotate polygons so that we can work with vertical lines here
|
||||||
|
@ -20,7 +20,7 @@ protected:
|
|||||||
const FillParams ¶ms,
|
const FillParams ¶ms,
|
||||||
unsigned int thickness_layers,
|
unsigned int thickness_layers,
|
||||||
const std::pair<float, Point> &direction,
|
const std::pair<float, Point> &direction,
|
||||||
ExPolygon &expolygon,
|
ExPolygon expolygon,
|
||||||
Polylines &polylines_out) override;
|
Polylines &polylines_out) override;
|
||||||
|
|
||||||
coord_t _min_spacing;
|
coord_t _min_spacing;
|
||||||
|
@ -21,7 +21,7 @@ public:
|
|||||||
Point& operator[](Points::size_type idx) { return this->points[idx]; }
|
Point& operator[](Points::size_type idx) { return this->points[idx]; }
|
||||||
const Point& operator[](Points::size_type idx) const { return this->points[idx]; }
|
const Point& operator[](Points::size_type idx) const { return this->points[idx]; }
|
||||||
|
|
||||||
Polygon() {}
|
Polygon() = default;
|
||||||
virtual ~Polygon() = default;
|
virtual ~Polygon() = default;
|
||||||
explicit Polygon(const Points &points) : MultiPoint(points) {}
|
explicit Polygon(const Points &points) : MultiPoint(points) {}
|
||||||
Polygon(std::initializer_list<Point> points) : MultiPoint(points) {}
|
Polygon(std::initializer_list<Point> points) : MultiPoint(points) {}
|
||||||
|
Loading…
Reference in New Issue
Block a user