OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GCodeProcessor::UsedFilaments Struct Reference
Collaboration diagram for Slic3r::GCodeProcessor::UsedFilaments:

Public Member Functions

void reset ()
void increase_support_caches (double extruded_volume)
void increase_model_caches (double extruded_volume)
void increase_wipe_tower_caches (double extruded_volume)
void process_color_change_cache ()
void process_model_cache (GCodeProcessor *processor)
void process_wipe_tower_cache (GCodeProcessor *processor)
void process_support_cache (GCodeProcessor *processor)
void process_total_volume_cache (GCodeProcessor *processor)
void update_flush_per_filament (size_t extrude_id, float flush_length)
void process_role_cache (GCodeProcessor *processor)
void process_caches (GCodeProcessor *processor)

Public Attributes

double color_change_cache
std::vector< double > volumes_per_color_change
double model_extrude_cache
std::map< size_t, double > model_volumes_per_filament
double wipe_tower_cache
std::map< size_t, double > wipe_tower_volumes_per_filament
double support_volume_cache
std::map< size_t, double > support_volumes_per_filament
std::map< size_t, double > flush_per_filament
double total_volume_cache
std::map< size_t, double > total_volumes_per_filament
double role_cache
std::map< ExtrusionRole, std::pair< double, double > > filaments_per_role

Friends

class GCodeProcessor

Detailed Description

Member Function Documentation

◆ increase_model_caches()

void Slic3r::GCodeProcessor::UsedFilaments::increase_model_caches ( double extruded_volume)
2561{
2562 color_change_cache += extruded_volume;
2563 model_extrude_cache += extruded_volume;
2564 role_cache += extruded_volume;
2565 total_volume_cache += extruded_volume;
2566}
double model_extrude_cache
Definition GCodeProcessor.hpp:868
double color_change_cache
Definition GCodeProcessor.hpp:865
double total_volume_cache
Definition GCodeProcessor.hpp:880
double role_cache
Definition GCodeProcessor.hpp:883

References color_change_cache, model_extrude_cache, role_cache, and total_volume_cache.

◆ increase_support_caches()

void Slic3r::GCodeProcessor::UsedFilaments::increase_support_caches ( double extruded_volume)
2554{
2555 support_volume_cache += extruded_volume;
2556 role_cache += extruded_volume;
2557 total_volume_cache += extruded_volume;
2558}
double support_volume_cache
Definition GCodeProcessor.hpp:874

References role_cache, support_volume_cache, and total_volume_cache.

◆ increase_wipe_tower_caches()

void Slic3r::GCodeProcessor::UsedFilaments::increase_wipe_tower_caches ( double extruded_volume)
2569{
2570 wipe_tower_cache += extruded_volume;
2571 role_cache += extruded_volume;
2572 total_volume_cache += extruded_volume;
2573}
double wipe_tower_cache
Definition GCodeProcessor.hpp:871

References role_cache, total_volume_cache, and wipe_tower_cache.

◆ process_caches()

void Slic3r::GCodeProcessor::UsedFilaments::process_caches ( GCodeProcessor * processor)
2668{
2670 process_model_cache(processor);
2671 process_role_cache(processor);
2672 process_wipe_tower_cache(processor);
2673 process_support_cache(processor);
2674 process_total_volume_cache(processor);
2675}
void process_model_cache(GCodeProcessor *processor)
Definition GCodeProcessor.cpp:2596
void process_role_cache(GCodeProcessor *processor)
Definition GCodeProcessor.cpp:2647
void process_color_change_cache()
Definition GCodeProcessor.cpp:2575
void process_wipe_tower_cache(GCodeProcessor *processor)
Definition GCodeProcessor.cpp:2608
void process_support_cache(GCodeProcessor *processor)
Definition GCodeProcessor.cpp:2620
void process_total_volume_cache(GCodeProcessor *processor)
Definition GCodeProcessor.cpp:2584

References GCodeProcessor, process_color_change_cache(), process_model_cache(), process_role_cache(), process_support_cache(), process_total_volume_cache(), and process_wipe_tower_cache().

Here is the call graph for this function:

◆ process_color_change_cache()

void Slic3r::GCodeProcessor::UsedFilaments::process_color_change_cache ( )
2576{
2577 if (color_change_cache != 0.0f) {
2579 color_change_cache = 0.0f;
2580 }
2581}
std::vector< double > volumes_per_color_change
Definition GCodeProcessor.hpp:866

References color_change_cache, and volumes_per_color_change.

Referenced by process_caches().

Here is the caller graph for this function:

◆ process_model_cache()

void Slic3r::GCodeProcessor::UsedFilaments::process_model_cache ( GCodeProcessor * processor)
2597{
2598 size_t active_filament_id = processor->get_filament_id();
2599 if (model_extrude_cache != 0.0f) {
2600 if (model_volumes_per_filament.find(active_filament_id) != model_volumes_per_filament.end())
2601 model_volumes_per_filament[active_filament_id] += model_extrude_cache;
2602 else
2603 model_volumes_per_filament[active_filament_id] = model_extrude_cache;
2604 model_extrude_cache = 0.0f;
2605 }
2606}
std::map< size_t, double > model_volumes_per_filament
Definition GCodeProcessor.hpp:869

References GCodeProcessor, Slic3r::GCodeProcessor::get_filament_id(), model_extrude_cache, and model_volumes_per_filament.

Referenced by process_caches().

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

◆ process_role_cache()

void Slic3r::GCodeProcessor::UsedFilaments::process_role_cache ( GCodeProcessor * processor)
2648{
2649 if (role_cache != 0.0f) {
2650 std::pair<double, double> filament = { 0.0f, 0.0f };
2651
2652 double s = PI * sqr(0.5 * processor->m_result.filament_diameters[processor->get_filament_id()]);
2653 filament.first = role_cache / s * 0.001;
2654 filament.second = role_cache * processor->m_result.filament_densities[processor->get_filament_id()] * 0.001;
2655
2656 ExtrusionRole active_role = processor->m_extrusion_role;
2657 if (filaments_per_role.find(active_role) != filaments_per_role.end()) {
2658 filaments_per_role[active_role].first += filament.first;
2659 filaments_per_role[active_role].second += filament.second;
2660 }
2661 else
2662 filaments_per_role[active_role] = filament;
2663 role_cache = 0.0f;
2664 }
2665}
static constexpr double PI
Definition libslic3r.h:81
ExtrusionRole
Definition ExtrusionEntity.hpp:26
constexpr T sqr(T x)
Definition libslic3r.h:301
std::map< ExtrusionRole, std::pair< double, double > > filaments_per_role
Definition GCodeProcessor.hpp:884

References Slic3r::GCodeProcessorResult::filament_densities, Slic3r::GCodeProcessorResult::filament_diameters, filaments_per_role, GCodeProcessor, Slic3r::GCodeProcessor::get_filament_id(), Slic3r::GCodeProcessor::m_extrusion_role, Slic3r::GCodeProcessor::m_result, PI, role_cache, and Slic3r::sqr().

Referenced by process_caches().

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

◆ process_support_cache()

void Slic3r::GCodeProcessor::UsedFilaments::process_support_cache ( GCodeProcessor * processor)
2621{
2622 size_t active_filament_id = processor->get_filament_id();
2623 if (support_volume_cache != 0.0f){
2624 if (support_volumes_per_filament.find(active_filament_id) != support_volumes_per_filament.end())
2626 else
2628 support_volume_cache = 0.0f;
2629 }
2630}
std::map< size_t, double > support_volumes_per_filament
Definition GCodeProcessor.hpp:875

References GCodeProcessor, Slic3r::GCodeProcessor::get_filament_id(), support_volume_cache, and support_volumes_per_filament.

Referenced by process_caches().

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

◆ process_total_volume_cache()

void Slic3r::GCodeProcessor::UsedFilaments::process_total_volume_cache ( GCodeProcessor * processor)
2585{
2586 size_t active_filament_id = processor->get_filament_id();
2587 if (total_volume_cache!= 0.0f) {
2588 if (total_volumes_per_filament.find(active_filament_id) != total_volumes_per_filament.end())
2589 total_volumes_per_filament[active_filament_id] += total_volume_cache;
2590 else
2591 total_volumes_per_filament[active_filament_id] = total_volume_cache;
2592 total_volume_cache = 0.0f;
2593 }
2594}
std::map< size_t, double > total_volumes_per_filament
Definition GCodeProcessor.hpp:881

References GCodeProcessor, Slic3r::GCodeProcessor::get_filament_id(), total_volume_cache, and total_volumes_per_filament.

Referenced by process_caches().

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

◆ process_wipe_tower_cache()

void Slic3r::GCodeProcessor::UsedFilaments::process_wipe_tower_cache ( GCodeProcessor * processor)
2609{
2610 size_t active_filament_id = processor->get_filament_id();
2611 if (wipe_tower_cache != 0.0f) {
2612 if (wipe_tower_volumes_per_filament.find(active_filament_id) != wipe_tower_volumes_per_filament.end())
2614 else
2616 wipe_tower_cache = 0.0f;
2617 }
2618}
std::map< size_t, double > wipe_tower_volumes_per_filament
Definition GCodeProcessor.hpp:872

References GCodeProcessor, Slic3r::GCodeProcessor::get_filament_id(), wipe_tower_cache, and wipe_tower_volumes_per_filament.

Referenced by process_caches().

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

◆ reset()

void Slic3r::GCodeProcessor::UsedFilaments::reset ( )

◆ update_flush_per_filament()

void Slic3r::GCodeProcessor::UsedFilaments::update_flush_per_filament ( size_t extrude_id,
float flush_length )
2633{
2634 if (flush_volume != 0.f) {
2635 if (flush_per_filament.find(filament_id) != flush_per_filament.end())
2636 flush_per_filament[filament_id] += flush_volume;
2637 else
2638 flush_per_filament[filament_id] = flush_volume;
2639
2640 if (total_volumes_per_filament.find(filament_id) != total_volumes_per_filament.end())
2641 total_volumes_per_filament[filament_id] += flush_volume;
2642 else
2643 total_volumes_per_filament[filament_id] = flush_volume;
2644 }
2645}

References flush_per_filament, and total_volumes_per_filament.

◆ GCodeProcessor

Member Data Documentation

◆ color_change_cache

double Slic3r::GCodeProcessor::UsedFilaments::color_change_cache

◆ filaments_per_role

std::map<ExtrusionRole, std::pair<double, double> > Slic3r::GCodeProcessor::UsedFilaments::filaments_per_role

Referenced by process_role_cache(), and reset().

◆ flush_per_filament

std::map<size_t, double> Slic3r::GCodeProcessor::UsedFilaments::flush_per_filament

Referenced by reset(), and update_flush_per_filament().

◆ model_extrude_cache

double Slic3r::GCodeProcessor::UsedFilaments::model_extrude_cache

◆ model_volumes_per_filament

std::map<size_t, double> Slic3r::GCodeProcessor::UsedFilaments::model_volumes_per_filament

Referenced by process_model_cache(), and reset().

◆ role_cache

double Slic3r::GCodeProcessor::UsedFilaments::role_cache

◆ support_volume_cache

double Slic3r::GCodeProcessor::UsedFilaments::support_volume_cache

◆ support_volumes_per_filament

std::map<size_t, double> Slic3r::GCodeProcessor::UsedFilaments::support_volumes_per_filament

Referenced by process_support_cache(), and reset().

◆ total_volume_cache

double Slic3r::GCodeProcessor::UsedFilaments::total_volume_cache

◆ total_volumes_per_filament

std::map<size_t, double> Slic3r::GCodeProcessor::UsedFilaments::total_volumes_per_filament

◆ volumes_per_color_change

std::vector<double> Slic3r::GCodeProcessor::UsedFilaments::volumes_per_color_change

◆ wipe_tower_cache

double Slic3r::GCodeProcessor::UsedFilaments::wipe_tower_cache

◆ wipe_tower_volumes_per_filament

std::map<size_t, double> Slic3r::GCodeProcessor::UsedFilaments::wipe_tower_volumes_per_filament

Referenced by process_wipe_tower_cache(), and reset().


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