OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::BedShape Struct Reference

#include </home/runner/work/OrcaSlicer/OrcaSlicer/src/slic3r/GUI/BedShapeDialog.hpp>

Collaboration diagram for Slic3r::GUI::BedShape:

Public Types

enum class  PageType { Rectangle , Circle , Custom }
enum class  Parameter { RectSize , RectOrigin , Diameter }

Public Member Functions

 BedShape (const Pointfs &points)
bool is_custom ()
PageType get_page_type ()
wxString get_full_name_with_params ()
void apply_optgroup_values (ConfigOptionsGroupShp optgroup)

Static Public Member Functions

static void append_option_line (ConfigOptionsGroupShp optgroup, Parameter param)
static wxString get_name (PageType type)

Private Attributes

BuildVolume m_build_volume

Detailed Description

Member Enumeration Documentation

◆ PageType

Enumerator
Rectangle 
Circle 
Custom 
36 {
38 Circle,
39 Custom
40 };
@ Circle
Definition Button.hpp:37
@ Custom
Definition CustomGCode.hpp:23
@ Rectangle
Definition BuildVolume.hpp:23

◆ Parameter

Enumerator
RectSize 
RectOrigin 
Diameter 
42 {
43 RectSize,
44 RectOrigin,
46 };
@ Diameter
Definition SketchEngine.hpp:105

Constructor & Destructor Documentation

◆ BedShape()

Slic3r::GUI::BedShape::BedShape ( const Pointfs & points)
52{
53 m_build_volume = { points, 0.f, {}, {} };
54}
BuildVolume m_build_volume
Definition BedShapeDialog.hpp:61

References m_build_volume.

Member Function Documentation

◆ append_option_line()

void Slic3r::GUI::BedShape::append_option_line ( ConfigOptionsGroupShp optgroup,
Parameter param )
static
67{
68 ConfigOptionDef def;
70 switch (param) {
72 def.type = coPoints;
73 def.set_default_value(new ConfigOptionPoints{ Vec2d(200, 200) });
74 def.min = 0;
75 def.max = 214700;
76 def.width = 10; // increase width for large scale printers with 4 digit values
77 def.sidetext = L("mm"); // millimeters, CIS languages need translation
78 def.label = get_option_label(param);
79 def.tooltip = L("Size in X and Y of the rectangular plate.");
80 key = "rect_size";
81 break;
83 def.type = coPoints;
84 def.set_default_value(new ConfigOptionPoints{ Vec2d(0, 0) });
85 def.min = -107350;
86 def.max = 107350;
87 def.width = 10; // increase width for large scale printers with 4 digit values
88 def.sidetext = L("mm"); // millimeters, CIS languages need translation
89 def.label = get_option_label(param);
90 def.tooltip = L("Distance of the 0,0 G-code coordinate from the front left corner of the rectangle.");
91 key = "rect_origin";
92 break;
94 def.type = coFloat;
95 def.set_default_value(new ConfigOptionFloat(200));
96 def.width = 10; // match size
97 def.sidetext = L("mm"); // millimeters, CIS languages need translation
98 def.label = get_option_label(param);
99 def.tooltip = L("Diameter of the print bed. It is assumed that origin (0,0) is located in the center.");
100 key = "diameter";
101 break;
102 default:
103 assert(false);
104 }
105
106 optgroup->append_single_option_line({ def, std::move(key) });
107}
#define L(s)
Definition ExtrusionEntity.cpp:25
static std::string get_option_label(BedShape::Parameter param)
Definition BedShapeDialog.cpp:56
zaa_minimize_perimeter_height ConfigOptionFloat
Definition PrintConfig.hpp:1954
std::string t_config_option_key
Definition Config.hpp:96
@ coPoints
Definition Config.hpp:206
@ coFloat
Definition Config.hpp:184
Eigen::Matrix< double, 2, 1, Eigen::DontAlign > Vec2d
Definition Point.hpp:67
@ RectOrigin
Definition BedShapeDialog.hpp:44
@ RectSize
Definition BedShapeDialog.hpp:43
@ Diameter
Definition BedShapeDialog.hpp:45

References Slic3r::coFloat, Slic3r::ConfigOptionFloat, Slic3r::coPoints, Diameter, Slic3r::GUI::get_option_label(), L, Slic3r::ConfigOptionDef::label, Slic3r::ConfigOptionDef::max, Slic3r::ConfigOptionDef::min, RectOrigin, RectSize, Slic3r::ConfigOptionDef::set_default_value(), Slic3r::ConfigOptionDef::sidetext, Slic3r::ConfigOptionDef::tooltip, Slic3r::ConfigOptionDef::type, and Slic3r::ConfigOptionDef::width.

Referenced by Slic3r::GUI::BedShapePanel::build_panel().

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

◆ apply_optgroup_values()

void Slic3r::GUI::BedShape::apply_optgroup_values ( ConfigOptionsGroupShp optgroup)
152{
153 switch (m_build_volume.type()) {
155 optgroup->set_value("diameter", double_to_string(2. * unscaled<double>(m_build_volume.circle().radius)));
156 break;
157 default:
158 // rectangle, convex, concave...
159 optgroup->set_value("rect_size" , new ConfigOptionPoints{ to_2d(m_build_volume.bounding_volume().size()) });
160 optgroup->set_value("rect_origin" , new ConfigOptionPoints{ - to_2d(m_build_volume.bounding_volume().min) });
161 }
162}
wxString double_to_string(double const value, const int max_precision)
Definition Field.cpp:99
Eigen::Matrix< typename Derived::Scalar, 2, 1, Eigen::DontAlign > to_2d(const Eigen::MatrixBase< Derived > &ptN)
Definition Point.hpp:147
@ Circle
Definition BuildVolume.hpp:25
constexpr Eigen::Matrix< Tout, 2, EigenArgs... > unscaled(const Slic3r::Point &v) noexcept
Definition Arrange.cpp:81

References Slic3r::Circle, Slic3r::GUI::double_to_string(), m_build_volume, Slic3r::to_2d(), and Slic3r::unscaled().

Referenced by Slic3r::GUI::BedShapePanel::set_shape().

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

◆ get_full_name_with_params()

wxString Slic3r::GUI::BedShape::get_full_name_with_params ( )
136{
137 wxString out = _L("Shape") + ": " + get_name(this->get_page_type());
138 switch (m_build_volume.type()) {
140 out += "\n" + _L(get_option_label(Parameter::Diameter)) + ": [" + double_to_string(2. * unscaled<double>(m_build_volume.circle().radius)) + "]";
141 break;
142 default:
143 // rectangle, convex, concave...
144 out += "\n" + _(get_option_label(Parameter::RectSize)) + ": [" + ConfigOptionPoint(to_2d(m_build_volume.bounding_volume().size())).serialize() + "]";
145 out += "\n" + _(get_option_label(Parameter::RectOrigin)) + ": [" + ConfigOptionPoint(- to_2d(m_build_volume.bounding_volume().min)).serialize() + "]";
146 break;
147 }
148 return out;
149}
#define _(s)
Definition 3mf.cpp:306
#define _L(s)
Definition OBJ.cpp:34
PageType get_page_type()
Definition BedShapeDialog.cpp:121
static wxString get_name(PageType type)
Definition BedShapeDialog.cpp:109

References _, _L, Slic3r::Circle, Diameter, Slic3r::GUI::double_to_string(), get_name(), Slic3r::GUI::get_option_label(), get_page_type(), m_build_volume, RectOrigin, RectSize, Slic3r::ConfigOptionPoint::serialize(), Slic3r::to_2d(), and Slic3r::unscaled().

Here is the call graph for this function:

◆ get_name()

wxString Slic3r::GUI::BedShape::get_name ( PageType type)
static
110{
111 switch (type) {
112 case PageType::Rectangle: return _L("Rectangular");
113 case PageType::Circle: return _L("Circular");
114 case PageType::Custom: return _L("Custom");
115 }
116 // make visual studio happy
117 assert(false);
118 return {};
119}
@ Circle
Definition BedShapeDialog.hpp:38
@ Custom
Definition BedShapeDialog.hpp:39
@ Rectangle
Definition BedShapeDialog.hpp:37

References _L, Circle, Custom, and Rectangle.

Referenced by Slic3r::GUI::BedShapePanel::build_panel(), and get_full_name_with_params().

Here is the caller graph for this function:

◆ get_page_type()

BedShape::PageType Slic3r::GUI::BedShape::get_page_type ( )
122{
123 switch (m_build_volume.type()) {
129 }
130 // make visual studio happy
131 assert(false);
132 return PageType::Rectangle;
133}
@ Invalid
Definition BuildVolume.hpp:21
@ Convex
Definition BuildVolume.hpp:27
@ Custom
Definition BuildVolume.hpp:29

References Slic3r::Circle, Circle, Slic3r::Convex, Slic3r::Custom, Custom, Slic3r::Invalid, m_build_volume, Slic3r::Rectangle, and Rectangle.

Referenced by get_full_name_with_params(), and Slic3r::GUI::BedShapePanel::set_shape().

Here is the caller graph for this function:

◆ is_custom()

bool Slic3r::GUI::BedShape::is_custom ( )
inline

References Slic3r::Convex, Slic3r::Custom, and m_build_volume.

Referenced by Slic3r::GUI::BedShapePanel::set_shape().

Here is the caller graph for this function:

Member Data Documentation

◆ m_build_volume

BuildVolume Slic3r::GUI::BedShape::m_build_volume
private

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