Prusa Slicer 2.6.0
Loading...
Searching...
No Matches
Slic3r::Arachne::PathsPointIndex< Paths > Class Template Reference

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

+ Inheritance diagram for Slic3r::Arachne::PathsPointIndex< Paths >:

Public Member Functions

 PathsPointIndex ()
 
 PathsPointIndex (const Paths *polygons, unsigned int poly_idx, unsigned int point_idx)
 
 PathsPointIndex (const PathsPointIndex &original)=default
 
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= (const PathsPointIndex &other)
 
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

template<typename Paths>
class Slic3r::Arachne::PathsPointIndex< Paths >

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

Constructor & Destructor Documentation

◆ PathsPointIndex() [1/3]

template<typename Paths >
Slic3r::Arachne::PathsPointIndex< Paths >::PathsPointIndex ( )
inline

Constructs an empty point index to no polygon.

This is used as a placeholder for when there is a zero-construction needed. Since the polygons field is const you can't ever make this initialisation useful.

42: polygons(nullptr), poly_idx(0), point_idx(0) {}
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

◆ PathsPointIndex() [2/3]

template<typename Paths >
Slic3r::Arachne::PathsPointIndex< Paths >::PathsPointIndex ( const Paths *  polygons,
unsigned int  poly_idx,
unsigned int  point_idx 
)
inline

Constructs a new point index to a vertex of a polygon.

Parameters
polygonsThe Polygons instance to which this index points.
poly_idxThe index of the sub-polygon to point to.
point_idxThe index of the vertex in the sub-polygon.

◆ PathsPointIndex() [3/3]

template<typename Paths >
Slic3r::Arachne::PathsPointIndex< Paths >::PathsPointIndex ( const PathsPointIndex< Paths > &  original)
default

Copy constructor to copy these indices.

Member Function Documentation

◆ getPolygon()

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

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
inline

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
inline

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 Slic3r::Arachne::PolygonsSegmentIndex::to().

+ Here is the caller graph for this function:

◆ operator!=()

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

◆ operator++()

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

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-- ( )
inline

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
inline
90 {
91 return this->p() < other.p();
92 }
Point p() const
Definition PolygonsPointIndex.hpp:57

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

+ Here is the call graph for this function:

◆ operator=()

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

◆ operator==()

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

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
inline
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(), Slic3r::Arachne::PolygonsSegmentIndex::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 Slic3r::Arachne::PolygonsSegmentIndex::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
inline

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:

Member Data Documentation

◆ point_idx

◆ poly_idx

◆ polygons


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