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

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

Collaboration diagram for Slic3r::LinesBucketQueue:

Public Member Functions

void emplace_back_bucket (ExtrusionLayers &&els, const void *objPtr, Point offset)
bool valid () const
float getCurrBottomZ ()
LineWithIDs getCurLines () const

Public Attributes

std::vector< LinesBucket > line_buckets
std::priority_queue< LinesBucket *, std::vector< LinesBucket * >, LinesBucketPtrComp > line_bucket_ptr_queue

Detailed Description

Member Function Documentation

◆ emplace_back_bucket()

void Slic3r::LinesBucketQueue::emplace_back_bucket ( ExtrusionLayers && els,
const void * objPtr,
Point offset )
108{
109 auto oldSize = line_buckets.capacity();
110 line_buckets.emplace_back(std::move(els), objPtr, offset);
111 auto newSize = line_buckets.capacity();
112 // Since line_bucket_ptr_queue is storing pointers into line_buckets,
113 // we need to handle the case where the capacity changes since that makes
114 // the existing pointers invalid
115 if (oldSize == newSize) {
117 }
118 else { // pointers change, create a new queue from scratch
119 decltype(line_bucket_ptr_queue) newQueue;
120 for (LinesBucket &bucket : line_buckets) { newQueue.push(&bucket); }
121 std::swap(line_bucket_ptr_queue, newQueue);
122 }
123}
std::vector< LinesBucket > line_buckets
Definition ConflictChecker.hpp:122
std::priority_queue< LinesBucket *, std::vector< LinesBucket * >, LinesBucketPtrComp > line_bucket_ptr_queue
Definition ConflictChecker.hpp:123
Slic3r::Polygons offset(const Slic3r::Polygon &polygon, const float delta, JoinType joinType, double miterLimit)
Definition ClipperUtils.cpp:582

References line_bucket_ptr_queue, line_buckets, and Slic3r::offset().

Referenced by Slic3r::ConflictChecker::find_inter_of_lines_in_diff_objs().

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

◆ getCurLines()

LineWithIDs Slic3r::LinesBucketQueue::getCurLines ( ) const
149{
150 LineWithIDs lines;
151 for (const LinesBucket &bucket : line_buckets) {
152 if (bucket.valid()) {
153 LineWithIDs tmpLines = bucket.curLines();
154 lines.insert(lines.end(), tmpLines.begin(), tmpLines.end());
155 }
156 }
157 return lines;
158}
std::vector< LineWithID > LineWithIDs
Definition ConflictChecker.hpp:33

References line_buckets.

Referenced by Slic3r::ConflictChecker::find_inter_of_lines_in_diff_objs().

Here is the caller graph for this function:

◆ getCurrBottomZ()

float Slic3r::LinesBucketQueue::getCurrBottomZ ( )
127{
128 auto lowest = line_bucket_ptr_queue.top();
130 float layerBottomZ = lowest->curBottomZ();
131 std::vector<LinesBucket *> lowests;
132 lowests.push_back(lowest);
133
134 while (line_bucket_ptr_queue.empty() == false && std::abs(line_bucket_ptr_queue.top()->curBottomZ() - lowest->curBottomZ()) < EPSILON) {
135 lowests.push_back(line_bucket_ptr_queue.top());
137 }
138
139 for (LinesBucket *bp : lowests) {
140 float prevZ = bp->curBottomZ();
141 bp->raise();
142 if (bp->curBottomZ() == prevZ) continue;
143 if (bp->valid()) { line_bucket_ptr_queue.push(bp); }
144 }
145 return layerBottomZ;
146}
#define EPSILON
Definition ColorUtils.cpp:64

References EPSILON, and line_bucket_ptr_queue.

Referenced by Slic3r::ConflictChecker::find_inter_of_lines_in_diff_objs().

Here is the caller graph for this function:

◆ valid()

bool Slic3r::LinesBucketQueue::valid ( ) const
inline
127{ return line_bucket_ptr_queue.empty() == false; }

References line_bucket_ptr_queue.

Referenced by Slic3r::ConflictChecker::find_inter_of_lines_in_diff_objs().

Here is the caller graph for this function:

Member Data Documentation

◆ line_bucket_ptr_queue

std::priority_queue<LinesBucket *, std::vector<LinesBucket *>, LinesBucketPtrComp> Slic3r::LinesBucketQueue::line_bucket_ptr_queue

◆ line_buckets

std::vector<LinesBucket> Slic3r::LinesBucketQueue::line_buckets

Referenced by emplace_back_bucket(), and getCurLines().


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