OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
GenericFlushPredictor Class Reference

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

Collaboration diagram for GenericFlushPredictor:

Public Member Functions

 GenericFlushPredictor (const int dataset_value)
bool predict (const RGB &from, const RGB &to, float &flush)
int get_min_flush_volume ()

Private Types

using RGB = FlushPredict::RGBColor

Private Attributes

FlushVolPredictor * predictor { nullptr }

Detailed Description

Member Typedef Documentation

◆ RGB

Constructor & Destructor Documentation

◆ GenericFlushPredictor()

GenericFlushPredictor::GenericFlushPredictor ( const int dataset_value)
explicit
323{
324 auto iter = predictor_instances.find(dataset_value);
325 if (iter != predictor_instances.end())
326 predictor = &iter->second;
327 else {
328 std::string path = Slic3r::resources_dir();
329 if (dataset_value == 0)
330 path += "/flush/flush_data_standard.txt";
331 else if (dataset_value == 1)
332 path += "/flush/flush_data_dual_standard.txt";
333 else if (dataset_value == 2)
334 path += "/flush/flush_data_dual_highflow.txt";
335 predictor_instances[dataset_value] = FlushVolPredictor(path);
336
337 predictor = &predictor_instances[dataset_value];
338 }
339}
static std::unordered_map< int, FlushVolPredictor > predictor_instances
Definition FlushVolPredictor.cpp:320
FlushVolPredictor * predictor
Definition FlushVolPredictor.hpp:48
const std::string & resources_dir()
Definition utils.cpp:296

References predictor, predictor_instances, and Slic3r::resources_dir().

Here is the call graph for this function:

Member Function Documentation

◆ get_min_flush_volume()

int GenericFlushPredictor::get_min_flush_volume ( )
350{
351 if (!predictor)
352 return std::numeric_limits<int>::max();
353 return predictor->get_min_flush_volume();
354}

References predictor.

Referenced by WipingDialog::BuildTableObjStr().

Here is the caller graph for this function:

◆ predict()

bool GenericFlushPredictor::predict ( const RGB & from,
const RGB & to,
float & flush )
343{
344 if (!predictor)
345 return false;
346 return predictor->predict(from, to, flush);
347}

References predictor.

Referenced by Slic3r::FlushVolCalculator::get_flush_vol_from_data().

Here is the caller graph for this function:

Member Data Documentation

◆ predictor

FlushVolPredictor* GenericFlushPredictor::predictor { nullptr }
private
48{ nullptr };

Referenced by GenericFlushPredictor(), get_min_flush_volume(), and predict().


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