OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::ClipperZUtils::ClipperZIntersectionVisitor Class Reference

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

Collaboration diagram for Slic3r::ClipperZUtils::ClipperZIntersectionVisitor:

Public Types

using Intersection = std::pair<coord_t, coord_t>
using Intersections = std::vector<Intersection>

Public Member Functions

 ClipperZIntersectionVisitor (Intersections &intersections)
void reset ()
void operator() (const ZPoint &e1bot, const ZPoint &e1top, const ZPoint &e2bot, const ZPoint &e2top, ZPoint &pt)
ZFillCallback clipper_callback ()
const std::vector< std::pair< coord_t, coord_t > > & intersections () const

Private Attributes

std::vector< std::pair< coord_t, coord_t > > & m_intersections

Detailed Description

Member Typedef Documentation

◆ Intersection

◆ Intersections

Constructor & Destructor Documentation

◆ ClipperZIntersectionVisitor()

Slic3r::ClipperZUtils::ClipperZIntersectionVisitor::ClipperZIntersectionVisitor ( Intersections & intersections)
inline
const std::vector< std::pair< coord_t, coord_t > > & intersections() const
Definition ClipperZUtils.hpp:151
std::vector< std::pair< coord_t, coord_t > > & m_intersections
Definition ClipperZUtils.hpp:154

References intersections(), and m_intersections.

Here is the call graph for this function:

Member Function Documentation

◆ clipper_callback()

ZFillCallback Slic3r::ClipperZUtils::ClipperZIntersectionVisitor::clipper_callback ( )
inline
145 {
146 return [this](const ZPoint &e1bot, const ZPoint &e1top,
147 const ZPoint &e2bot, const ZPoint &e2top, ZPoint &pt)
148 { return (*this)(e1bot, e1top, e2bot, e2top, pt); };
149 }
Vec3crd ZPoint
Definition ClipperZUtils.hpp:22

Referenced by Slic3r::Algorithm::wave_seeds().

Here is the caller graph for this function:

◆ intersections()

const std::vector< std::pair< coord_t, coord_t > > & Slic3r::ClipperZUtils::ClipperZIntersectionVisitor::intersections ( ) const
inline
151{ return m_intersections; }

References m_intersections.

Referenced by ClipperZIntersectionVisitor().

Here is the caller graph for this function:

◆ operator()()

void Slic3r::ClipperZUtils::ClipperZIntersectionVisitor::operator() ( const ZPoint & e1bot,
const ZPoint & e1top,
const ZPoint & e2bot,
const ZPoint & e2top,
ZPoint & pt )
inline
126 {
127 coord_t srcs[4]{ e1bot.z(), e1top.z(), e2bot.z(), e2top.z() };
128 coord_t *begin = srcs;
129 coord_t *end = srcs + 4;
130 //FIXME bubble sort manually?
131 std::sort(begin, end);
132 end = std::unique(begin, end);
133 if (begin + 1 == end) {
134 // Self intersection may happen on source contour. Just copy the Z value.
135 pt.z() = *begin;
136 } else {
137 assert(begin + 2 == end);
138 if (begin + 2 <= end) {
139 // store a -1 based negative index into the "intersections" vector here.
140 m_intersections.emplace_back(srcs[0], srcs[1]);
141 pt.z() = -coord_t(m_intersections.size());
142 }
143 }
144 }
int64_t coord_t
Definition libslic3r.h:48
T * begin(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:838
T * end(Slic3r::Mat< N, M, T > &mat)
Definition Point.hpp:841

References m_intersections.

◆ reset()

void Slic3r::ClipperZUtils::ClipperZIntersectionVisitor::reset ( )
inline
125{ m_intersections.clear(); }

References m_intersections.

Member Data Documentation

◆ m_intersections

std::vector<std::pair<coord_t, coord_t> >& Slic3r::ClipperZUtils::ClipperZIntersectionVisitor::m_intersections
private

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