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

Public Member Functions

 TreeSupportProfiler ()
void stage_start (TreeSupportStage stage)
void stage_finish (TreeSupportStage stage)
void tic ()
uint32_t toc ()
void stage_add (TreeSupportStage stage)
std::string report ()

Public Attributes

uint32_t stage_durations [NUM_STAGES] = { 0 }
uint32_t stage_index = 0
boost::posix_time::ptime tic_time
boost::posix_time::ptime toc_time

Private Attributes

boost::posix_time::ptime m_stage_start_times [NUM_STAGES]

Detailed Description

Constructor & Destructor Documentation

◆ TreeSupportProfiler()

Slic3r::TreeSupportProfiler::TreeSupportProfiler ( )
inline
172 {
173 for (uint32_t& item : stage_durations) {
174 item = 0;
175 }
176 }
uint32_t stage_durations[NUM_STAGES]
Definition TreeSupport.cpp:166

References stage_durations.

Member Function Documentation

◆ report()

std::string Slic3r::TreeSupportProfiler::report ( )
inline
208 {
209 std::stringstream ss;
210 ss << "total overhange cost: " << stage_durations[STAGE_total]
211 << "; STAGE_DETECT_OVERHANGS: " << stage_durations[STAGE_DETECT_OVERHANGS]
212 << "; STAGE_GENERATE_CONTACT_NODES: " << stage_durations[STAGE_GENERATE_CONTACT_NODES]
213 << "; STAGE_DROP_DOWN_NODES: " << stage_durations[STAGE_DROP_DOWN_NODES]
214 << "; STAGE_DRAW_CIRCLES: " << stage_durations[STAGE_DRAW_CIRCLES]
215 << "; STAGE_GENERATE_TOOLPATHS: " << stage_durations[STAGE_GENERATE_TOOLPATHS]
216 << "; STAGE_MinimumSpanningTree: " << stage_durations[STAGE_MinimumSpanningTree]
217 << "; STAGE_GET_AVOIDANCE: " << stage_durations[STAGE_GET_AVOIDANCE]
218 << "; STAGE_projection_onto_ex: " << stage_durations[STAGE_projection_onto_ex]
219 << "; STAGE_get_collision: " << stage_durations[STAGE_get_collision]
220 << "; STAGE_intersection_ln: " << stage_durations[STAGE_intersection_ln];
221
222 return ss.str();
223 }
@ STAGE_DETECT_OVERHANGS
Definition TreeSupport.cpp:149
@ STAGE_intersection_ln
Definition TreeSupport.cpp:158
@ STAGE_DROP_DOWN_NODES
Definition TreeSupport.cpp:151
@ STAGE_MinimumSpanningTree
Definition TreeSupport.cpp:154
@ STAGE_projection_onto_ex
Definition TreeSupport.cpp:156
@ STAGE_GENERATE_TOOLPATHS
Definition TreeSupport.cpp:153
@ STAGE_DRAW_CIRCLES
Definition TreeSupport.cpp:152
@ STAGE_get_collision
Definition TreeSupport.cpp:157
@ STAGE_GET_AVOIDANCE
Definition TreeSupport.cpp:155
@ STAGE_total
Definition TreeSupport.cpp:159
@ STAGE_GENERATE_CONTACT_NODES
Definition TreeSupport.cpp:150

References Slic3r::STAGE_DETECT_OVERHANGS, Slic3r::STAGE_DRAW_CIRCLES, Slic3r::STAGE_DROP_DOWN_NODES, stage_durations, Slic3r::STAGE_GENERATE_CONTACT_NODES, Slic3r::STAGE_GENERATE_TOOLPATHS, Slic3r::STAGE_GET_AVOIDANCE, Slic3r::STAGE_get_collision, Slic3r::STAGE_intersection_ln, Slic3r::STAGE_MinimumSpanningTree, Slic3r::STAGE_projection_onto_ex, and Slic3r::STAGE_total.

◆ stage_add()

void Slic3r::TreeSupportProfiler::stage_add ( TreeSupportStage stage)
inline
201 {
202 if (stage > NUM_STAGES)
203 return;
204 stage_durations[stage] += toc();
205 }
uint32_t toc()
Definition TreeSupport.cpp:196
@ NUM_STAGES
Definition TreeSupport.cpp:160

References Slic3r::NUM_STAGES, stage_durations, and toc().

Here is the call graph for this function:

◆ stage_finish()

void Slic3r::TreeSupportProfiler::stage_finish ( TreeSupportStage stage)
inline
187 {
188 if (stage > NUM_STAGES)
189 return;
190
191 boost::posix_time::ptime time = boost::posix_time::microsec_clock::local_time();
192 stage_durations[stage] = (time - m_stage_start_times[stage]).total_milliseconds();
193 }
boost::posix_time::ptime m_stage_start_times[NUM_STAGES]
Definition TreeSupport.cpp:225

References m_stage_start_times, Slic3r::NUM_STAGES, and stage_durations.

◆ stage_start()

void Slic3r::TreeSupportProfiler::stage_start ( TreeSupportStage stage)
inline
179 {
180 if (stage > NUM_STAGES)
181 return;
182
183 m_stage_start_times[stage] = boost::posix_time::microsec_clock::local_time();
184 }

References m_stage_start_times, and Slic3r::NUM_STAGES.

◆ tic()

void Slic3r::TreeSupportProfiler::tic ( )
inline
195{ tic_time = boost::posix_time::microsec_clock::local_time(); }
boost::posix_time::ptime tic_time
Definition TreeSupport.cpp:168

References tic_time.

◆ toc()

uint32_t Slic3r::TreeSupportProfiler::toc ( )
inline
196 {
197 toc_time = boost::posix_time::microsec_clock::local_time();
198 return (toc_time - tic_time).total_milliseconds();
199 }
boost::posix_time::ptime toc_time
Definition TreeSupport.cpp:169

References tic_time, and toc_time.

Referenced by stage_add().

Here is the caller graph for this function:

Member Data Documentation

◆ m_stage_start_times

boost::posix_time::ptime Slic3r::TreeSupportProfiler::m_stage_start_times[NUM_STAGES]
private

Referenced by stage_finish(), and stage_start().

◆ stage_durations

uint32_t Slic3r::TreeSupportProfiler::stage_durations[NUM_STAGES] = { 0 }
166{ 0 };

Referenced by TreeSupportProfiler(), report(), stage_add(), and stage_finish().

◆ stage_index

uint32_t Slic3r::TreeSupportProfiler::stage_index = 0

◆ tic_time

boost::posix_time::ptime Slic3r::TreeSupportProfiler::tic_time

Referenced by tic(), and toc().

◆ toc_time

boost::posix_time::ptime Slic3r::TreeSupportProfiler::toc_time

Referenced by toc().


The documentation for this class was generated from the following file:
  • /home/runner/work/OrcaSlicer/OrcaSlicer/src/libslic3r/Support/TreeSupport.cpp