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

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

Collaboration diagram for Slic3r::LayerTools:

Classes

struct  MixedSubLayerGroup

Public Member Functions

 LayerTools (const coordf_t z)
bool operator< (const LayerTools &rhs) const
bool operator== (const LayerTools &rhs) const
bool is_extruder_order (unsigned int a, unsigned int b) const
bool has_extruder (unsigned int extruder) const
unsigned int wall_extruder_id (const PrintRegion &region) const
unsigned int sparse_infill_filament_id (const PrintRegion &region) const
unsigned int internal_solid_filament_id (const PrintRegion &region) const
unsigned int extruder (const ExtrusionEntityCollection &extrusions, const PrintRegion &region) const
unsigned int resolve_mixed (unsigned int filament_0based) const
const MixedSubLayerGroup * mixed_group_by_slot (unsigned int slot_id) const
bool is_mixed_slot (unsigned int slot_id) const
WipingExtrusions & wiping_extrusions ()

Public Attributes

coordf_t print_z = 0.
bool has_object = false
bool has_support = false
std::vector< unsigned int > extruders
unsigned int extruder_override = 0
bool has_skirt = false
bool has_wipe_tower = false
size_t wipe_tower_partitions = 0
coordf_t wipe_tower_layer_height = 0.
const CustomGCode::Item * custom_gcode = nullptr
std::map< unsigned int, unsigned int > mixed_filament_resolution
std::vector< MixedSubLayerGroup > mixed_sub_layer_groups

Private Attributes

WipingExtrusions m_wiping_extrusions

Detailed Description


Class Documentation

◆ Slic3r::LayerTools::MixedSubLayerGroup

struct Slic3r::LayerTools::MixedSubLayerGroup
Collaboration diagram for Slic3r::LayerTools::MixedSubLayerGroup:
Class Members
typedef ObjectGradient VolumeGradient ObjectGradient
Class Members
vector< unsigned int > components_0based
int gradient_first_sorted_idx = 0
bool is_gradient = false
double layer_height = 0.
unsigned int mixed_slot_0based
map< const PrintObject *, ObjectGradient > per_object_gradient
map< VolumeKey, VolumeGradient > per_volume_gradient
vector< double > sub_heights

Constructor & Destructor Documentation

◆ LayerTools()

Slic3r::LayerTools::LayerTools ( const coordf_t z)
inline
154: print_z(z) {}
coordf_t print_z
Definition ToolOrdering.hpp:171

References print_z.

Referenced by operator<(), and operator==().

Here is the caller graph for this function:

Member Function Documentation

◆ extruder()

unsigned int Slic3r::LayerTools::extruder ( const ExtrusionEntityCollection & extrusions,
const PrintRegion & region ) const
168{
169 assert(region.config().outer_wall_filament_id.value > 0);
170 assert(region.config().sparse_infill_filament_id.value > 0);
171 assert(region.config().internal_solid_filament_id.value > 0);
172 assert(region.config().top_surface_filament_id.value > 0);
173 assert(region.config().bottom_surface_filament_id.value > 0);
174 // 1 based extruder ID.
175 const unsigned int extruder = this->extruder_override == 0 ? region_filament(extrusions, region.config()) : this->extruder_override;
176 unsigned int result = (extruder == 0) ? 0 : extruder - 1;
177 return resolve_mixed(result);
178}
unsigned int extruder_override
Definition ToolOrdering.hpp:178
unsigned int resolve_mixed(unsigned int filament_0based) const
Definition ToolOrdering.hpp:197
unsigned int extruder(const ExtrusionEntityCollection &extrusions, const PrintRegion &region) const
Definition ToolOrdering.cpp:167
static unsigned int region_filament(const ExtrusionEntityCollection &extrusions, const PrintRegionConfig &config)
Definition ToolOrdering.cpp:144

References Slic3r::PrintRegion::config(), extruder(), extruder_override, Slic3r::region_filament(), and resolve_mixed().

Referenced by extruder(), has_extruder(), is_extruder_order(), and Slic3r::GCode::process_layer().

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

◆ has_extruder()

bool Slic3r::LayerTools::has_extruder ( unsigned int extruder) const
inline
162{ return std::find(this->extruders.begin(), this->extruders.end(), extruder) != this->extruders.end(); }
std::vector< unsigned int > extruders
Definition ToolOrdering.hpp:175

References extruder(), and extruders.

Referenced by Slic3r::WipingExtrusions::ensure_perimeters_infills_order(), and Slic3r::GCode::process_layer().

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

◆ internal_solid_filament_id()

unsigned int Slic3r::LayerTools::internal_solid_filament_id ( const PrintRegion & region) const
137{
138 assert(region.config().internal_solid_filament_id.value > 0);
139 unsigned int result = ((this->extruder_override == 0) ? region.config().internal_solid_filament_id.value : this->extruder_override) - 1;
140 return resolve_mixed(result);
141}
unsigned int internal_solid_filament_id(const PrintRegion &region) const
Definition ToolOrdering.cpp:136

References Slic3r::PrintRegion::config(), extruder_override, internal_solid_filament_id(), and resolve_mixed().

Referenced by internal_solid_filament_id().

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

◆ is_extruder_order()

bool Slic3r::LayerTools::is_extruder_order ( unsigned int a,
unsigned int b ) const
88{
89 if (a == b)
90 return false;
91
92 for (auto extruder : extruders) {
93 if (extruder == a)
94 return true;
95 if (extruder == b)
96 return false;
97 }
98
99 return false;
100}

References extruder(), and extruders.

Referenced by Slic3r::WipingExtrusions::ensure_perimeters_infills_order().

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

◆ is_mixed_slot()

bool Slic3r::LayerTools::is_mixed_slot ( unsigned int slot_id) const
inline
248 {
249 return mixed_group_by_slot(slot_id) != nullptr;
250 }
const MixedSubLayerGroup * mixed_group_by_slot(unsigned int slot_id) const
Definition ToolOrdering.hpp:241

References mixed_group_by_slot().

Referenced by Slic3r::GCode::process_layer().

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

◆ mixed_group_by_slot()

const MixedSubLayerGroup * Slic3r::LayerTools::mixed_group_by_slot ( unsigned int slot_id) const
inline
241 {
242 for (const auto &g : mixed_sub_layer_groups)
243 if (g.mixed_slot_0based == slot_id)
244 return &g;
245 return nullptr;
246 }
std::vector< MixedSubLayerGroup > mixed_sub_layer_groups
Definition ToolOrdering.hpp:239

References mixed_sub_layer_groups.

Referenced by is_mixed_slot().

Here is the caller graph for this function:

◆ operator<()

bool Slic3r::LayerTools::operator< ( const LayerTools & rhs) const
inline
158{ return print_z < rhs.print_z; }

References LayerTools(), and print_z.

Here is the call graph for this function:

◆ operator==()

bool Slic3r::LayerTools::operator== ( const LayerTools & rhs) const
inline
159{ return print_z == rhs.print_z; }

References LayerTools(), and print_z.

Here is the call graph for this function:

◆ resolve_mixed()

unsigned int Slic3r::LayerTools::resolve_mixed ( unsigned int filament_0based) const
inline
197 {
198 auto it = mixed_filament_resolution.find(filament_0based);
199 return (it != mixed_filament_resolution.end()) ? it->second : filament_0based;
200 }
std::map< unsigned int, unsigned int > mixed_filament_resolution
Definition ToolOrdering.hpp:195

References mixed_filament_resolution.

Referenced by extruder(), internal_solid_filament_id(), sparse_infill_filament_id(), and wall_extruder_id().

Here is the caller graph for this function:

◆ sparse_infill_filament_id()

unsigned int Slic3r::LayerTools::sparse_infill_filament_id ( const PrintRegion & region) const
130{
131 assert(region.config().sparse_infill_filament_id.value > 0);
132 unsigned int result = ((this->extruder_override == 0) ? region.config().sparse_infill_filament_id.value : this->extruder_override) - 1;
133 return resolve_mixed(result);
134}
unsigned int sparse_infill_filament_id(const PrintRegion &region) const
Definition ToolOrdering.cpp:129

References Slic3r::PrintRegion::config(), extruder_override, resolve_mixed(), and sparse_infill_filament_id().

Referenced by Slic3r::WipingExtrusions::ensure_perimeters_infills_order(), and sparse_infill_filament_id().

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

◆ wall_extruder_id()

unsigned int Slic3r::LayerTools::wall_extruder_id ( const PrintRegion & region) const
123{
124 assert(region.config().outer_wall_filament_id.value > 0);
125 unsigned int result = ((this->extruder_override == 0) ? region.config().outer_wall_filament_id.value : this->extruder_override) - 1;
126 return resolve_mixed(result);
127}

References Slic3r::PrintRegion::config(), extruder_override, and resolve_mixed().

Referenced by Slic3r::WipingExtrusions::ensure_perimeters_infills_order().

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

◆ wiping_extrusions()

WipingExtrusions & Slic3r::LayerTools::wiping_extrusions ( )
inline
252 {
253 m_wiping_extrusions.set_layer_tools_ptr(this);
254 return m_wiping_extrusions;
255 }
WipingExtrusions m_wiping_extrusions
Definition ToolOrdering.hpp:259

References m_wiping_extrusions.

Member Data Documentation

◆ custom_gcode

const CustomGCode::Item* Slic3r::LayerTools::custom_gcode = nullptr

◆ extruder_override

unsigned int Slic3r::LayerTools::extruder_override = 0

◆ extruders

◆ has_object

bool Slic3r::LayerTools::has_object = false

◆ has_skirt

◆ has_support

bool Slic3r::LayerTools::has_support = false

◆ has_wipe_tower

◆ m_wiping_extrusions

WipingExtrusions Slic3r::LayerTools::m_wiping_extrusions
private

Referenced by wiping_extrusions().

◆ mixed_filament_resolution

std::map<unsigned int, unsigned int> Slic3r::LayerTools::mixed_filament_resolution

Referenced by resolve_mixed().

◆ mixed_sub_layer_groups

std::vector<MixedSubLayerGroup> Slic3r::LayerTools::mixed_sub_layer_groups

◆ print_z

◆ wipe_tower_layer_height

coordf_t Slic3r::LayerTools::wipe_tower_layer_height = 0.

◆ wipe_tower_partitions

size_t Slic3r::LayerTools::wipe_tower_partitions = 0

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