Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::Arachne::PolygonsSegmentIndex Class Reference

#include <src/libslic3r/Arachne/utils/PolygonsSegmentIndex.hpp>

+ Inheritance diagram for Slic3r::Arachne::PolygonsSegmentIndex:
+ Collaboration diagram for Slic3r::Arachne::PolygonsSegmentIndex:

Public Member Functions

 PolygonsSegmentIndex ()
 
 PolygonsSegmentIndex (const Polygons *polygons, unsigned int poly_idx, unsigned int point_idx)
 
Point from () const
 
Point to () const
 
Point p () const
 
bool initialized () const
 Returns whether this point is initialised.
 
const PolygongetPolygon () const
 
bool operator== (const PathsPointIndex &other) const
 
bool operator!= (const PathsPointIndex &other) const
 
bool operator< (const PathsPointIndex &other) const
 
PathsPointIndexoperator++ ()
 move the iterator forward (and wrap around at the end)
 
PathsPointIndexoperator-- ()
 move the iterator backward (and wrap around at the beginning)
 
PathsPointIndex next () const
 move the iterator forward (and wrap around at the end)
 
PathsPointIndex prev () const
 move the iterator backward (and wrap around at the beginning)
 

Public Attributes

const Paths * polygons
 
unsigned int poly_idx
 The index of the polygon in PolygonsPointIndex::polygons.
 
unsigned int point_idx
 The index of the point in the polygon in PolygonsPointIndex::polygons.
 

Detailed Description

A class for iterating over the points in one of the polygons in a Polygons object

Constructor & Destructor Documentation

◆ PolygonsSegmentIndex() [1/2]

Slic3r::Arachne::PolygonsSegmentIndex::PolygonsSegmentIndex ( )
inline
PathsPointIndex< Polygons > PolygonsPointIndex
Definition PolygonsPointIndex.hpp:130

◆ PolygonsSegmentIndex() [2/2]

Slic3r::Arachne::PolygonsSegmentIndex::PolygonsSegmentIndex ( const Polygons polygons,
unsigned int  poly_idx,
unsigned int  point_idx 
)
inline
unsigned int point_idx
The index of the point in the polygon in PolygonsPointIndex::polygons.
Definition PolygonsPointIndex.hpp:33
unsigned int poly_idx
The index of the polygon in PolygonsPointIndex::polygons.
Definition PolygonsPointIndex.hpp:31
const Paths * polygons
Definition PolygonsPointIndex.hpp:29

Member Function Documentation

◆ from()

Point Slic3r::Arachne::PolygonsSegmentIndex::from ( ) const
inline
23{ return PolygonsPointIndex::p(); }
Point p() const
Definition PolygonsPointIndex.hpp:57

References Slic3r::Arachne::PathsPointIndex< Paths >::p().

Referenced by Slic3r::Arachne::SkeletalTrapezoidation::computeSegmentCellRange(), Slic3r::Arachne::detect_missing_voronoi_vertex(), and Slic3r::Geometry::get_parabolic_segment().

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

◆ getPolygon()

template<typename Paths >
const Polygon & Slic3r::Arachne::PathsPointIndex< Paths >::getPolygon ( ) const
inlineinherited

Get the polygon to which this PolygonsPointIndex refers

73{ return (*polygons)[poly_idx]; }

References Slic3r::Arachne::PathsPointIndex< Paths >::poly_idx, and Slic3r::Arachne::PathsPointIndex< Paths >::polygons.

◆ initialized()

template<typename Paths >
bool Slic3r::Arachne::PathsPointIndex< Paths >::initialized ( ) const
inlineinherited

Returns whether this point is initialised.

68{ return polygons; }

References Slic3r::Arachne::PathsPointIndex< Paths >::polygons.

Referenced by Slic3r::Arachne::PolylineStitcher< Paths, Path, Junction >::stitch().

+ Here is the caller graph for this function:

◆ next()

template<typename Paths >
PathsPointIndex Slic3r::Arachne::PathsPointIndex< Paths >::next ( ) const
inlineinherited

move the iterator forward (and wrap around at the end)

116 {
117 PathsPointIndex ret(*this);
118 ++ret;
119 return ret;
120 }
PathsPointIndex()
Definition PolygonsPointIndex.hpp:42

Referenced by Slic3r::Arachne::SkeletalTrapezoidation::computePointCellRange(), boost::polygon::segment_traits< Slic3r::Arachne::PolygonsSegmentIndex >::get(), and to().

+ Here is the caller graph for this function:

◆ operator!=()

template<typename Paths >
bool Slic3r::Arachne::PathsPointIndex< Paths >::operator!= ( const PathsPointIndex< Paths > &  other) const
inlineinherited
86 {
87 return !(*this == other);
88 }

◆ operator++()

template<typename Paths >
PathsPointIndex & Slic3r::Arachne::PathsPointIndex< Paths >::operator++ ( )
inlineinherited

move the iterator forward (and wrap around at the end)

102 {
103 point_idx = (point_idx + 1) % (*polygons)[poly_idx].size();
104 return *this;
105 }

References Slic3r::Arachne::PathsPointIndex< Paths >::point_idx, Slic3r::Arachne::PathsPointIndex< Paths >::poly_idx, and Slic3r::Arachne::PathsPointIndex< Paths >::polygons.

◆ operator--()

template<typename Paths >
PathsPointIndex & Slic3r::Arachne::PathsPointIndex< Paths >::operator-- ( )
inlineinherited

move the iterator backward (and wrap around at the beginning)

108 {
109 if (point_idx == 0)
110 point_idx = (*polygons)[poly_idx].size();
111 point_idx--;
112 return *this;
113 }

References Slic3r::Arachne::PathsPointIndex< Paths >::point_idx, and Slic3r::Arachne::PathsPointIndex< Paths >::poly_idx.

◆ operator<()

template<typename Paths >
bool Slic3r::Arachne::PathsPointIndex< Paths >::operator< ( const PathsPointIndex< Paths > &  other) const
inlineinherited
90 {
91 return this->p() < other.p();
92 }

References Slic3r::Arachne::PathsPointIndex< Paths >::p().

+ Here is the call graph for this function:

◆ operator==()

template<typename Paths >
bool Slic3r::Arachne::PathsPointIndex< Paths >::operator== ( const PathsPointIndex< Paths > &  other) const
inlineinherited

Test whether two iterators refer to the same polygon in the same polygon list.

Parameters
otherThe PolygonsPointIndex to test for equality
Returns
Wether the right argument refers to the same polygon in the same ListPolygon as the left argument.
82 {
83 return polygons == other.polygons && poly_idx == other.poly_idx && point_idx == other.point_idx;
84 }

References Slic3r::Arachne::PathsPointIndex< Paths >::point_idx, Slic3r::Arachne::PathsPointIndex< Paths >::poly_idx, and Slic3r::Arachne::PathsPointIndex< Paths >::polygons.

◆ p()

template<typename Paths >
Point Slic3r::Arachne::PathsPointIndex< Paths >::p ( ) const
inlineinherited
58 {
59 if (!polygons)
60 return {0, 0};
61
63 }
const Point & make_point(const ExtrusionJunction &ej)
Definition ExtrusionJunction.hpp:51

References Slic3r::Arachne::make_point(), Slic3r::Arachne::PathsPointIndex< Paths >::point_idx, Slic3r::Arachne::PathsPointIndex< Paths >::poly_idx, and Slic3r::Arachne::PathsPointIndex< Paths >::polygons.

Referenced by Slic3r::Arachne::SkeletalTrapezoidation::computePointCellRange(), from(), boost::polygon::segment_traits< Slic3r::Arachne::PolygonsSegmentIndex >::get(), Slic3r::Arachne::PathsPointIndexLocator< Paths >::operator()(), std::hash< Slic3r::Arachne::PolygonsPointIndex >::operator()(), Slic3r::Arachne::PathsPointIndex< Paths >::operator<(), Slic3r::Arachne::PolylineStitcher< Paths, Path, Junction >::stitch(), and to().

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

◆ prev()

template<typename Paths >
PathsPointIndex Slic3r::Arachne::PathsPointIndex< Paths >::prev ( ) const
inlineinherited

move the iterator backward (and wrap around at the beginning)

123 {
124 PathsPointIndex ret(*this);
125 --ret;
126 return ret;
127 }

Referenced by Slic3r::Arachne::SkeletalTrapezoidation::computePointCellRange().

+ Here is the caller graph for this function:

◆ to()

Point Slic3r::Arachne::PolygonsSegmentIndex::to ( ) const
inline
25{ return PolygonsSegmentIndex::next().p(); }
PathsPointIndex next() const
move the iterator forward (and wrap around at the end)
Definition PolygonsPointIndex.hpp:115

References Slic3r::Arachne::PathsPointIndex< Paths >::next(), and Slic3r::Arachne::PathsPointIndex< Paths >::p().

Referenced by Slic3r::Arachne::SkeletalTrapezoidation::computeSegmentCellRange(), Slic3r::Arachne::detect_missing_voronoi_vertex(), and Slic3r::Geometry::get_parabolic_segment().

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

Member Data Documentation

◆ point_idx

◆ poly_idx

◆ polygons


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