OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::ExPolygonCollection Class Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/ExPolygonCollection.hpp>

Collaboration diagram for Slic3r::ExPolygonCollection:

Public Member Functions

 ExPolygonCollection ()
 ExPolygonCollection (const ExPolygon &expolygon)
 ExPolygonCollection (const ExPolygons &expolygons)
 operator Points () const
 operator Polygons () const
 operator ExPolygons & ()
void scale (double factor)
void translate (double x, double y)
void rotate (double angle, const Point &center)
template<class T>
bool contains (const T &item) const
bool contains_b (const Point &point) const
void simplify (double tolerance)
Polygon convex_hull () const
Lines lines () const
Polygons contours () const
void append (const ExPolygons &expolygons)

Public Attributes

ExPolygons expolygons

Detailed Description

Constructor & Destructor Documentation

◆ ExPolygonCollection() [1/3]

Slic3r::ExPolygonCollection::ExPolygonCollection ( )
inline
22{}

◆ ExPolygonCollection() [2/3]

Slic3r::ExPolygonCollection::ExPolygonCollection ( const ExPolygon & expolygon)
explicit
8{
9 this->expolygons.push_back(expolygon);
10}
ExPolygons expolygons
Definition ExPolygonCollection.hpp:20

References expolygons.

◆ ExPolygonCollection() [3/3]

Slic3r::ExPolygonCollection::ExPolygonCollection ( const ExPolygons & expolygons)
inlineexplicit

References expolygons.

Member Function Documentation

◆ append()

void Slic3r::ExPolygonCollection::append ( const ExPolygons & expolygons)
127{
128 this->expolygons.insert(this->expolygons.end(), expp.begin(), expp.end());
129}

References expolygons.

◆ contains()

template<class T>
template bool Slic3r::ExPolygonCollection::contains< Polyline > ( const T & item) const
66{
67 for (const ExPolygon &poly : this->expolygons)
68 if (poly.contains(item))
69 return true;
70 return false;
71}
void poly(std::vector< std::pair< Vec2d, Vec2d > > &out, std::initializer_list< Vec2d > p)
Definition DesignSketchTool.cpp:7751

References expolygons.

◆ contains_b()

bool Slic3r::ExPolygonCollection::contains_b ( const Point & point) const
78{
79 for (ExPolygons::const_iterator it = this->expolygons.begin(); it != this->expolygons.end(); ++it) {
80 if (it->contains_b(point)) return true;
81 }
82 return false;
83}

References expolygons.

◆ contours()

Polygons Slic3r::ExPolygonCollection::contours ( ) const
117{
119 contours.reserve(this->expolygons.size());
120 for (ExPolygons::const_iterator it = this->expolygons.begin(); it != this->expolygons.end(); ++it)
121 contours.push_back(it->contour);
122 return contours;
123}
Polygons contours() const
Definition ExPolygonCollection.cpp:116
std::vector< Polygon, PointsAllocator< Polygon > > Polygons
Definition Polygon.hpp:22

References contours(), and expolygons.

Referenced by contours().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ convex_hull()

Polygon Slic3r::ExPolygonCollection::convex_hull ( ) const
97{
98 Points pp;
99 for (ExPolygons::const_iterator it = this->expolygons.begin(); it != this->expolygons.end(); ++it)
100 pp.insert(pp.end(), it->contour.points.begin(), it->contour.points.end());
102}
Polygon convex_hull(Points pts)
Definition ConvexHull.cpp:21
std::vector< Point, PointsAllocator< Point > > Points
Definition Point.hpp:73

References Slic3r::Geometry::convex_hull(), and expolygons.

Here is the call graph for this function:

◆ lines()

Lines Slic3r::ExPolygonCollection::lines ( ) const
106{
107 Lines lines;
108 for (ExPolygons::const_iterator it = this->expolygons.begin(); it != this->expolygons.end(); ++it) {
109 Lines ex_lines = it->lines();
110 lines.insert(lines.end(), ex_lines.begin(), ex_lines.end());
111 }
112 return lines;
113}
Lines lines() const
Definition ExPolygonCollection.cpp:105
std::vector< Line > Lines
Definition Line.hpp:20

References expolygons, and lines().

Referenced by lines().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ operator ExPolygons &()

Slic3r::ExPolygonCollection::operator ExPolygons & ( )
explicit
36{
37 return this->expolygons;
38}

References expolygons.

◆ operator Points()

Slic3r::ExPolygonCollection::operator Points ( ) const
explicit
13{
14 Points points;
15 Polygons pp = (Polygons)*this;
16 for (Polygons::const_iterator poly = pp.begin(); poly != pp.end(); ++poly) {
17 for (Points::const_iterator point = poly->points.begin(); point != poly->points.end(); ++point)
18 points.push_back(*point);
19 }
20 return points;
21}

◆ operator Polygons()

Slic3r::ExPolygonCollection::operator Polygons ( ) const
explicit
24{
25 Polygons polygons;
26 for (ExPolygons::const_iterator it = this->expolygons.begin(); it != this->expolygons.end(); ++it) {
27 polygons.push_back(it->contour);
28 for (Polygons::const_iterator ith = it->holes.begin(); ith != it->holes.end(); ++ith) {
29 polygons.push_back(*ith);
30 }
31 }
32 return polygons;
33}

References expolygons.

◆ rotate()

void Slic3r::ExPolygonCollection::rotate ( double angle,
const Point & center )
58{
59 for (ExPolygons::iterator it = expolygons.begin(); it != expolygons.end(); ++it) {
60 (*it).rotate(angle, center);
61 }
62}
void center(ExPolygonsWithIds &e)
Definition Emboss.cpp:1382
double angle(const Eigen::MatrixBase< Derived > &v1, const Eigen::MatrixBase< Derived2 > &v2)
Definition Point.hpp:138

References Slic3r::angle(), Slic3r::center(), and expolygons.

Here is the call graph for this function:

◆ scale()

void Slic3r::ExPolygonCollection::scale ( double factor)
42{
43 for (ExPolygons::iterator it = expolygons.begin(); it != expolygons.end(); ++it) {
44 (*it).scale(factor);
45 }
46}

References expolygons.

◆ simplify()

void Slic3r::ExPolygonCollection::simplify ( double tolerance)
87{
88 ExPolygons expp;
89 for (ExPolygons::const_iterator it = this->expolygons.begin(); it != this->expolygons.end(); ++it) {
90 it->simplify(tolerance, &expp);
91 }
92 this->expolygons = expp;
93}
std::vector< ExPolygon > ExPolygons
Definition ExPolygon.hpp:20

References expolygons.

◆ translate()

void Slic3r::ExPolygonCollection::translate ( double x,
double y )
50{
51 for (ExPolygons::iterator it = expolygons.begin(); it != expolygons.end(); ++it) {
52 (*it).translate(x, y);
53 }
54}

References expolygons.

Member Data Documentation

◆ expolygons


The documentation for this class was generated from the following files: