MCPcopy Create free account
hub / github.com/MeshInspector/MeshLib / updateAll_

Method updateAll_

source/MRMesh/MRObjectGcode.cpp:234–264  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

232}
233
234void ObjectGcode::updateAll_()
235{
236 if ( !gcodeSource_ )
237 {
238 polyline_ = std::make_shared<Polyline3>();
239 setDirtyFlags( DIRTY_ALL );
240 return;
241 }
242 MR_TIMER;
243 GcodeProcessor executor;
244 executor.setCNCMachineSettings( cncMachineSettings_ );
245 executor.setGcodeSource( *gcodeSource_ );
246 actionList_ = executor.processSource();
247
248 maxFeedrate_ = 0.f;
249 std::shared_ptr<Polyline3> polyline = std::make_shared<Polyline3>();
250 for ( int i = 0; i < actionList_.size(); ++i )
251 {
252 const auto& part = actionList_[i];
253 if ( part.action.path.empty() )
254 continue;
255 polyline->addFromPoints( part.action.path.data(), part.action.path.size(), false );
256 segmentToSourceLineMap_.insert( segmentToSourceLineMap_.end(), part.action.path.size() - 1, i );
257 if ( !part.idle && part.feedrate > maxFeedrate_ )
258 maxFeedrate_ = part.feedrate;
259 }
260 polyline_ = polyline;
261 updateColors_();
262 updateHeapUsageCache_();
263 setDirtyFlags( DIRTY_ALL );
264}
265
266} //namespace MR

Callers

nothing calls this directly

Calls 9

processSourceMethod · 0.80
addFromPointsMethod · 0.80
insertMethod · 0.80
setCNCMachineSettingsMethod · 0.45
setGcodeSourceMethod · 0.45
sizeMethod · 0.45
emptyMethod · 0.45
dataMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected