OrcaSlicer latest
OrcaSlicer
Loading...
Searching...
No Matches
Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog Class Reference
Inheritance diagram for Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog:
Collaboration diagram for Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog:

Public Member Functions

 SceneBenchmarkDialog ()
 ~SceneBenchmarkDialog () override
bool is_running () const
void EndModal (int retCode) override
float scale_factor () const
float prev_scale_factor () const
void set_scale_factor (float v)
void set_prev_scale_factor (float v)
void set_em_unit (int v)
bool force_rescale () const
int em_unit () const
const wxFont & normal_font () const
void enable_force_rescale ()
int ShowModal ()

Protected Member Functions

void on_dpi_changed (const wxRect &suggested_rect) override
virtual void on_sys_color_changed ()

Private Types

enum class  Stage {
  Loading , Prepare , Slicing , Preview ,
  Layers , Done
}

Private Member Functions

void on_timer (wxTimerEvent &evt)
void on_idle (wxIdleEvent &evt)
void on_first_frame ()
void begin_scene (GLCanvas3D *canvas, Stage stage)
void end_scene ()
void stop_scene ()
void start_slicing ()
void set_camera (size_t pass_frame)
void set_top_layer (size_t pass_frame)
void set_status (const wxString &status)
void finish (const wxString &error=wxString())
void show_report (const wxString &error)
std::string report () const
void update_em_unit ()
bool is_new_scale_factor () const
void rescale (const wxRect &suggested_rect)

Private Attributes

Stage m_stage { Stage::Loading }
std::unique_ptr< wxWindowDisabler > m_disabler
wxTimer m_timer
int m_polls { 0 }
Label * m_status { nullptr }
ProgressBar * m_progress { nullptr }
GLCanvas3D * m_canvas { nullptr }
Camera m_saved_camera
Vec3d m_target { Vec3d::Zero() }
double m_zoom { 1.0 }
size_t m_frame { 0 }
std::chrono::steady_clock::time_point m_last_frame
int m_saved_top_layer { -1 }
int m_swap_interval { wxGLCanvas::DefaultSwapInterval }
bool m_restore_swap_interval { false }
std::vector< SceneResult > m_results
std::string m_vsync
int m_msaa_samples { 0 }
int m_viewport_width { 0 }
int m_viewport_height { 0 }
std::string m_camera_type
float m_scale_factor
int m_em_unit
wxFont m_normal_font
float m_prev_scale_factor
bool m_can_rescale
bool m_force_rescale
int m_new_font_point_size

Detailed Description

Member Enumeration Documentation

◆ Stage

enum class Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::Stage
strongprivate
Enumerator
Loading 
Prepare 
Slicing 
Preview 
Layers 
Done 
115{ Loading, Prepare, Slicing, Preview, Layers, Done };
@ Loading
Definition PluginStatus.hpp:16
@ Preview
Definition Shortcuts.hpp:21
std::vector< std::vector< Contour > > Layers
Definition SeamContour.hpp:23
@ Slicing
Definition TriangleMeshSlicer.cpp:243

Constructor & Destructor Documentation

◆ SceneBenchmarkDialog()

Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::SceneBenchmarkDialog ( )
161 : DPIDialog(static_cast<wxWindow*>(wxGetApp().mainframe), wxID_ANY, _L("Benchmark 3D Scene"), wxDefaultPosition, wxDefaultSize,
162 wxCAPTION | wxCLOSE_BOX)
163 , m_timer(this)
164{
165 s_benchmark = this;
166 SetBackgroundColour(*wxWHITE);
167 SetFont(Label::Body_14);
168
169 auto* sizer = new wxBoxSizer(wxVERTICAL);
170 sizer->SetMinSize(wxSize(FromDIP(360), -1));
171 m_status = new Label(this, _L("Loading the benchmark model") + dots);
172 m_progress = new ProgressBar(this, wxID_ANY, 100);
173 m_progress->SetHeight(FromDIP(8));
174 m_progress->SetMaxSize(wxSize(-1, FromDIP(8)));
175 m_progress->SetProgressForedColour(StateColor::darkModeColorFor(wxColour("#DFDFDF")));
176 sizer->Add(m_status, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, FromDIP(15));
177 sizer->Add(m_progress, 0, wxEXPAND | wxALL, FromDIP(15));
178 auto* buttons = new DialogButtons(this, {"Cancel"});
179 buttons->GetCANCEL()->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { Close(); });
180 sizer->Add(buttons, 0, wxEXPAND);
181 SetSizerAndFit(sizer);
182 wxGetApp().UpdateDlgDarkUI(this);
183
184 Bind(wxEVT_TIMER, &SceneBenchmarkDialog::on_timer, this);
185 Bind(wxEVT_IDLE, &SceneBenchmarkDialog::on_idle, this);
186 Bind(wxEVT_CHAR_HOOK, [this](wxKeyEvent& evt) {
187 if (evt.GetKeyCode() == WXK_ESCAPE)
188 Close();
189 else
190 evt.Skip();
191 });
192 Bind(wxEVT_CLOSE_WINDOW, [this](wxCloseEvent&) {
193 m_timer.Stop();
194 stop_scene();
195 m_disabler.reset();
196 Destroy();
197 });
198
199 // A corner of the 3D view, away from the model.
200 const wxRect view = wxGetApp().plater()->get_current_canvas3D()->get_wxglcanvas()->GetScreenRect();
201 SetPosition(wxPoint(view.GetLeft() + FromDIP(20), view.GetBottom() - GetSize().GetHeight() - FromDIP(20)));
202
203 m_disabler = std::make_unique<wxWindowDisabler>(this);
204 m_timer.Start(100);
205}
#define _L(s)
Definition OBJ.cpp:34
static wxFont Body_14
Definition Label.hpp:53
void on_timer(wxTimerEvent &evt)
Definition SceneBenchmark.cpp:222
std::unique_ptr< wxWindowDisabler > m_disabler
Definition SceneBenchmark.cpp:132
void on_idle(wxIdleEvent &evt)
Definition SceneBenchmark.cpp:258
static wxColour darkModeColorFor(wxColour const &color)
Definition StateColor.cpp:219
SceneBenchmarkDialog * s_benchmark
Definition SceneBenchmark.cpp:158
static wxString dots("...", wxConvUTF8)
@ ProgressBar
Definition NotificationManager.hpp:112

References SceneBenchmarkDialog(), _L, Label::Body_14, StateColor::darkModeColorFor(), Slic3r::GUI::dots(), Slic3r::GUI::DialogButtons::GetCANCEL(), m_disabler, m_progress, m_status, m_timer, on_idle(), on_timer(), Slic3r::GUI::ProgressBar, Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::s_benchmark, and stop_scene().

Referenced by SceneBenchmarkDialog().

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

◆ ~SceneBenchmarkDialog()

Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::~SceneBenchmarkDialog ( )
override
208{
209 // At shutdown the windows it disabled may be gone already.
210 if (wxGetApp().is_closing())
211 (void) m_disabler.release();
212 if (s_benchmark == this)
213 s_benchmark = nullptr;
214}

References m_disabler, and Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::s_benchmark.

Member Function Documentation

◆ begin_scene()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::begin_scene ( GLCanvas3D * canvas,
Stage stage )
private
322{
323 m_stage = stage;
324 m_canvas = canvas;
325 m_saved_camera = wxGetApp().plater()->get_camera();
326 m_frame = 0;
328 m_results.push_back({stage == Stage::Prepare ? "Prepare" : stage == Stage::Preview ? "Preview" : "Layers", {}, {}});
329 m_results.back().frame_ms.reserve(PASS_FRAMES);
330 set_status(stage == Stage::Prepare ? _L("Turning the camera in Prepare") :
331 stage == Stage::Preview ? _L("Turning the camera in Preview") :
332 _L("Moving through the layers in Preview"));
333 if (stage == Stage::Layers) {
334 m_saved_top_layer = canvas->get_gcode_viewer().get_layers_slider()->GetHigherValue();
335 set_camera(0);
336 }
337 canvas->set_benchmarking(true);
338}
void set_camera(size_t pass_frame)
Definition SceneBenchmark.cpp:387
std::vector< SceneResult > m_results
Definition SceneBenchmark.cpp:148
void set_status(const wxString &status)
Definition SceneBenchmark.cpp:409
constexpr size_t PASS_FRAMES
Definition SceneBenchmark.cpp:93

References _L, Slic3r::GUI::GLCanvas3D::get_gcode_viewer(), Slic3r::GUI::GCodeViewer::get_layers_slider(), Slic3r::GUI::IMSlider::GetHigherValue(), Layers, m_canvas, m_frame, m_restore_swap_interval, m_results, m_saved_camera, m_saved_top_layer, m_stage, Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::PASS_FRAMES, Prepare, Preview, Slic3r::GUI::GLCanvas3D::set_benchmarking(), set_camera(), and set_status().

Referenced by end_scene(), and on_timer().

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

◆ em_unit()

int Slic3r::GUI::DPIAware< wxDialog >::em_unit ( ) const
inlineinherited
203{ return m_em_unit; }
Definition GUI_Utils.hpp:107

Referenced by Slic3r::GUI::AuxiliaryDialog::AuxiliaryDialog(), Slic3r::GUI::CopyrightsDialog::CopyrightsDialog(), Slic3r::GUI::DesignTextDialog::DesignTextDialog(), Slic3r::GUI::EditGCodeDialog::EditGCodeDialog(), Slic3r::GUI::FileArchiveDialog::FileArchiveDialog(), Slic3r::GUI::MsgNoUpdates::MsgNoUpdates(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::OAuthDialog::OAuthDialog(), Slic3r::GUI::ParamsDialog::ParamsDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::SettingsDialog::SettingsDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), anonymous_namespace{3DPrinterOS.cpp}::UploadOptionsDialog::UploadOptionsDialog(), Slic3r::GUI::PublishSettingsDialog::add_row_ui(), Slic3r::GUI::DiffPresetDialog::complete_dialog_creation(), Slic3r::GUI::DiffPresetDialog::create_edit_sizer(), Slic3r::GUI::DiffPresetDialog::create_presets_sizer(), Slic3r::GUI::DiffPresetDialog::create_tree(), Slic3r::GUI::ElegooPrintHostSendDialog::init(), Slic3r::GUI::FlashforgePrintHostSendDialog::init(), Slic3r::GUI::PrintHostSendDialog::init(), Slic3r::GUI::AboutDialog::on_dpi_changed(), Slic3r::GUI::AuxiliaryDialog::on_dpi_changed(), Slic3r::GUI::BedShapeDialog::on_dpi_changed(), Slic3r::GUI::ConfigWizard::on_dpi_changed(), Slic3r::GUI::CopyrightsDialog::on_dpi_changed(), Slic3r::GUI::DiffPresetDialog::on_dpi_changed(), Slic3r::GUI::EditGCodeDialog::on_dpi_changed(), Slic3r::GUI::FileArchiveDialog::on_dpi_changed(), Slic3r::GUI::OAuthDialog::on_dpi_changed(), Slic3r::GUI::ObjectTableDialog::on_dpi_changed(), Slic3r::GUI::ParamsDialog::on_dpi_changed(), Slic3r::GUI::PhysicalPrinterDialog::on_dpi_changed(), Slic3r::GUI::PrintHostQueueDialog::on_dpi_changed(), Slic3r::GUI::PurgeModeDialog::on_dpi_changed(), Slic3r::GUI::SavePresetDialog::on_dpi_changed(), Slic3r::GUI::SendSystemInfoDialog::on_dpi_changed(), Slic3r::GUI::SettingsDialog::on_dpi_changed(), and Slic3r::GUI::UnsavedChangesDialog::on_dpi_changed().

Here is the caller graph for this function:

◆ enable_force_rescale()

void Slic3r::GUI::DPIAware< wxDialog >::enable_force_rescale ( )
inlineinherited
206{ m_force_rescale = true; }

◆ end_scene()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::end_scene ( )
private
341{
342 const Stage stage = m_stage;
343 GLCanvas3D* canvas = m_canvas;
344 stop_scene();
345 if (stage == Stage::Prepare)
347 else if (stage == Stage::Preview)
348 begin_scene(canvas, Stage::Layers);
349 else
350 finish();
351}
void begin_scene(GLCanvas3D *canvas, Stage stage)
Definition SceneBenchmark.cpp:321
void finish(const wxString &error=wxString())
Definition SceneBenchmark.cpp:415

References begin_scene(), finish(), Layers, m_canvas, m_stage, Prepare, Preview, start_slicing(), and stop_scene().

Referenced by on_idle().

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

◆ EndModal()

void Slic3r::GUI::DPIDialog::EndModal ( int retCode)
inlineoverrideinherited
306 {
307 if (!dialogStack.empty() && dialogStack.front() != this) {
308 // This is a bug in wxWidgets
309 // when the dialog is not top modal dialog, EndModal() just hide dialog without quit
310 // the modal event loop. And the modal event loop blocks us from bottom widgets.
311 // Solution: let user click it manually or close outside. FIXME
312 BOOST_LOG_TRIVIAL(warning) << "DPIAware::EndModal Error: dialogStack is not empty, but top dialog is not this one. retCode=" << retCode;
313 return;
314 }
315
316 return wxDialog::EndModal(retCode);
317 }
std::deque< wxDialog * > dialogStack
Definition GUI_Utils.cpp:549

References Slic3r::GUI::dialogStack.

Referenced by Slic3r::GUI::CloneDialog::CloneDialog(), Slic3r::GUI::ConfigWizard::ConfigWizard(), Slic3r::GUI::CreatePresetSuccessfulDialog::CreatePresetSuccessfulDialog(), Slic3r::GUI::DeleteConfirmDialog::DeleteConfirmDialog(), Slic3r::GUI::DesignVariableDialog::DesignVariableDialog(), Slic3r::GUI::anonymous_namespace{PrintHostDialogs.cpp}::FlashforgeSlotDialog::FlashforgeSlotDialog(), Slic3r::GUI::GuideFrame::GuideFrame(), Slic3r::GUI::InputIpAddressDialog::InputIpAddressDialog(), Slic3r::GUI::ManualNozzleCountDialog::ManualNozzleCountDialog(), Slic3r::GUI::MsgUpdateConfig::MsgUpdateConfig(), Slic3r::GUI::MsgUpdateForced::MsgUpdateForced(), Slic3r::GUI::MultiChoiceDialog::MultiChoiceDialog(), Slic3r::GUI::NetworkErrorDialog::NetworkErrorDialog(), Slic3r::GUI::NetworkPluginRestartDialog::NetworkPluginRestartDialog(), Slic3r::GUI::PartSkipConfirmDialog::PartSkipConfirmDialog(), Slic3r::GUI::PhysicalPrinterDialog::PhysicalPrinterDialog(), Slic3r::GUI::PlateNameEditDialog::PlateNameEditDialog(), Slic3r::GUI::PlateSettingsDialog::PlateSettingsDialog(), Slic3r::GUI::PublishSettingsDialog::PublishSettingsDialog(), Slic3r::GUI::SelectMachineDialog::SelectMachineDialog(), Slic3r::GUI::SendFailedConfirm::SendFailedConfirm(), Slic3r::GUI::SendSystemInfoDialog::SendSystemInfoDialog(), Slic3r::GUI::ShortcutCaptureDialog::ShortcutCaptureDialog(), Slic3r::GUI::SingleChoiceDialog::SingleChoiceDialog(), StepMeshDialog::StepMeshDialog(), Slic3r::GUI::SyncAmsInfoDialog::SyncAmsInfoDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::TokenAuthDialog(), Slic3r::GUI::UpdatePluginDialog::UpdatePluginDialog(), Slic3r::GUI::UpdateVersionDialog::UpdateVersionDialog(), Slic3r::GUI::wgtDeviceNozzleRackUpgradeDlg::wgtDeviceNozzleRackUpgradeDlg(), Slic3r::GUI::SavePresetDialog::accept(), Slic3r::GUI::MsgDialog::add_button(), Slic3r::GUI::TipsDialog::add_button(), Slic3r::GUI::FilamentPickerDialog::BindEvents(), Slic3r::GUI::PluginPickerDialog::build_capability_ui(), Slic3r::GUI::BedShapeDialog::build_dialog(), Slic3r::GUI::PluginPickerDialog::build_ui(), Slic3r::GUI::UnsavedChangesDialog::close(), Slic3r::GUI::FileArchiveDialog::create_btn_sizer(), Slic3r::GUI::ColorDecomposeDialog::create_button_panel(), Slic3r::GUI::MixedFilamentDialog::create_button_panel(), Slic3r::GUI::CreateFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::CreatePresetForPrinterDialog::create_dialog_buttons(), Slic3r::GUI::EditFilamentPresetDialog::create_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::create_dialog_buttons(), Slic3r::GUI::PreferencesDialog::create_item_language_combobox(), Slic3r::GUI::PreferencesDialog::create_item_region_combobox(), Slic3r::GUI::PreferencesDialog::create_items(), Slic3r::GUI::CreatePrinterPresetDialog::create_page1_dialog_buttons(), Slic3r::GUI::CreatePrinterPresetDialog::create_page2_dialog_buttons(), Slic3r::GUI::ExportConfigsDialog::data_init(), Slic3r::GUI::WebDialog::destroy_silently(), Slic3r::GUI::EditFilamentPresetDialog::edit_preset(), Slic3r::GUI::ConnectPrinterDialog::end_modal(), Slic3r::GUI::PrintHostSendDialog::EndModal(), Slic3r::GUI::ColorPickerDialog::finish(), Slic3r::GUI::WebDialog::finish(), Slic3r::GUI::Newer3mfVersionDialog::get_btn_sizer(), Slic3r::GUI::ScoreDialog::get_button_sizer(), Slic3r::GUI::WebViewHostDialog::handle_common_script_command(), Slic3r::GUI::ExportPresetBundleDialog::InitExportData(), Slic3r::GUI::SelectMachineDialog::navigate_to_timelapse_page(), Slic3r::GUI::BindMachineDialog::on_bind_success(), Slic3r::GUI::ConnectPrinterDialog::on_button_confirm(), Slic3r::GUI::RecenterDialog::on_button_confirm(), Slic3r::GUI::BindMachineDialog::on_cancel(), Slic3r::GUI::EditCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::InputIpAddressDialog::on_cancel(), Slic3r::GUI::NewCalibrationHistoryDialog::on_cancel(), Slic3r::GUI::OAuthDialog::on_cancel(), Slic3r::GUI::PingCodeBindDialog::on_cancel(), Slic3r::GUI::SelectMachineDialog::on_cancel(), Slic3r::GUI::SendToPrinterDialog::on_cancel(), Slic3r::GUI::SyncAmsInfoDialog::on_cancel(), Slic3r::GUI::UnBindMachineDialog::on_cancel(), Slic3r::GUI::WebDialog::on_close_window(), Slic3r::GUI::NetworkPluginDownloadDialog::on_dont_ask(), Slic3r::GUI::NetworkPluginDownloadDialog::on_download(), Slic3r::GUI::EditDevNameDialog::on_edit_name(), Slic3r::GUI::ConfirmBeforeSendDialog::on_hide(), Slic3r::GUI::PrivacyUpdateDialog::on_hide(), Slic3r::GUI::ShortcutCaptureDialog::on_key(), Slic3r::GUI::TextureImportDialog::on_ok_clicked(), Slic3r::GUI::FileArchiveDialog::on_open_button(), Slic3r::GUI::NetworkPluginDownloadDialog::on_remind_later(), Slic3r::GUI::ProjectDropDialog::on_select_cancel(), Slic3r::GUI::SavePresetDialog::on_select_cancel(), Slic3r::GUI::ProjectDropDialog::on_select_ok(), Slic3r::GUI::SendMultiMachinePage::on_send(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip(), Slic3r::GUI::TextureImportDialog::on_skip_clicked(), Slic3r::GUI::NetworkPluginDownloadDialog::on_skip_version(), Slic3r::GUI::Cornering_Test_Dlg::on_start(), Slic3r::GUI::FlowRateCalibrationDialog::on_start(), Slic3r::GUI::Input_Shaping_Damp_Test_Dlg::on_start(), Slic3r::GUI::Input_Shaping_Freq_Test_Dlg::on_start(), Slic3r::GUI::MaxVolumetricSpeed_Test_Dlg::on_start(), Slic3r::GUI::PA_Calibration_Dlg::on_start(), Slic3r::GUI::Retraction_Test_Dlg::on_start(), Slic3r::GUI::Temp_Calibration_Dlg::on_start(), Slic3r::GUI::VFA_Test_Dlg::on_start(), Slic3r::GUI::CalibrationDialog::on_start_calibration(), Slic3r::GUI::UnBindMachineDialog::on_unbind_printer(), Slic3r::GUI::PartSkipDialog::OnApplyDialog(), anonymous_namespace{3DPrinterOS.cpp}::TokenAuthDialog::OnCancel(), Slic3r::GUI::AboutDialog::onCloseDialog(), Slic3r::GUI::CopyrightsDialog::onCloseDialog(), Slic3r::GUI::MultiNozzleSyncDialog::OnRackStatusReadingFinished(), Slic3r::GUI::GuideFrame::OnScriptMessage(), Slic3r::GUI::InputIpAddressDialog::OnTimer(), Slic3r::GUI::KBShortcutsDialog::open_mouse_preferences(), Slic3r::GUI::TroubleshootDialog::PackAll(), Slic3r::GUI::TroubleshootDialog::RebuildSystemProfiles(), Slic3r::GUI::SpeedDialWebDialog::run_action(), Slic3r::GUI::OAuthDialog::Show(), Slic3r::GUI::MultiNozzleSyncDialog::UpdateButton(), and Slic3r::GUI::CreatePrinterPresetDialog::validate_input_valid().

◆ finish()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::finish ( const wxString & error = wxString())
private
416{
417 m_timer.Stop();
418 stop_scene();
419 m_disabler.reset();
421 show_report(error);
422}
void show_report(const wxString &error)
Definition SceneBenchmark.cpp:424

References Done, m_disabler, m_stage, m_timer, show_report(), and stop_scene().

Referenced by end_scene(), on_idle(), and on_timer().

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

◆ force_rescale()

bool Slic3r::GUI::DPIAware< wxDialog >::force_rescale ( ) const
inlineinherited
201{ return m_force_rescale; }

◆ is_new_scale_factor()

bool Slic3r::GUI::DPIAware< wxDialog >::is_new_scale_factor ( ) const
inlineprivateinherited
262{ return fabs(m_scale_factor - m_prev_scale_factor) > 0.001; }

◆ is_running()

bool Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::is_running ( ) const
inline
109{ return m_stage != Stage::Done; }

References Done, and m_stage.

Referenced by Slic3r::GUI::run_scene_benchmark().

Here is the caller graph for this function:

◆ normal_font()

◆ on_dpi_changed()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::on_dpi_changed ( const wxRect & suggested_rect)
overrideprotectedvirtual

Implements Slic3r::GUI::DPIAware< wxDialog >.

217{
218 Fit();
219 Refresh();
220}

◆ on_first_frame()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::on_first_frame ( )
private
300{
301 // A benchmark measures the frames the GPU can draw, not the display refresh rate.
302 wxGLCanvas* glcanvas = m_canvas->get_wxglcanvas();
303 m_swap_interval = glcanvas->GetSwapInterval();
304 const bool known = m_swap_interval != wxGLCanvas::DefaultSwapInterval;
305 if (known && m_swap_interval != 0)
306 m_restore_swap_interval = glcanvas->SetSwapInterval(0) != wxGLCanvas::SwapInterval::NotSet;
307 if (m_results.size() > 1)
308 return;
309
310 m_vsync = !known ? "unknown" : m_swap_interval == 0 || m_restore_swap_interval ? "off" : "on";
311 GLint samples = 0;
313 m_msaa_samples = samples;
314 const Camera& camera = wxGetApp().plater()->get_camera();
315 const std::array<int, 4>& viewport = camera.get_viewport();
316 m_viewport_width = viewport[2];
317 m_viewport_height = viewport[3];
318 m_camera_type = camera.get_type_as_string();
319}
#define glsafe(cmd)
Definition OpenGLUtils.hpp:25
#define GL_SAMPLES
Definition gl.h:1536
int GLint
Definition gl.h:2062
#define glGetIntegerv
Definition gl.h:3873
@ Camera
Definition Shortcuts.hpp:72

References Slic3r::GUI::Camera::get_type_as_string(), Slic3r::GUI::Camera::get_viewport(), GL_SAMPLES, glGetIntegerv, glsafe, m_camera_type, m_canvas, m_msaa_samples, m_restore_swap_interval, m_results, m_swap_interval, m_viewport_height, m_viewport_width, and m_vsync.

Referenced by on_idle().

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

◆ on_idle()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::on_idle ( wxIdleEvent & evt)
private
259{
260 evt.Skip();
261 if (m_canvas == nullptr || wxGetApp().is_closing())
262 return;
263 if (!m_canvas->get_wxglcanvas()->IsShownOnScreen()) {
264 finish(_L("The benchmark stopped because the 3D view was hidden."));
265 return;
266 }
267
268 const std::chrono::steady_clock::time_point now = std::chrono::steady_clock::now();
270 m_results.back().frame_ms.push_back(std::chrono::duration<double, std::milli>(now - m_last_frame).count());
271 m_last_frame = now;
272
273 FrameProfiler& profiler = m_canvas->get_frame_profiler();
275 profiler.start_averaging();
276 if (m_stage == Stage::Layers)
277 // The warm-up ends where the path starts, so the slider moves in every frame.
279 else
281 m_canvas->render();
282 if (m_frame == 0)
284
285 if (++m_frame == SCENE_FRAMES) {
286 m_results.back().sections = profiler.finish_averaging(true);
287 end_scene();
288 // The next scene starts right away, with no timer to bring the next idle event.
289 if (m_canvas != nullptr)
290 evt.RequestMore();
291 return;
292 }
293 const int scene = m_stage == Stage::Prepare ? 0 : m_stage == Stage::Preview ? 1 : 2;
294 if (m_frame % 30 == 0)
295 m_progress->SetValue(int(100 * (scene * SCENE_FRAMES + m_frame) / (3 * SCENE_FRAMES)));
296 evt.RequestMore();
297}
static unsigned int count
Definition AuxiliaryDataViewModel.cpp:246
std::chrono::steady_clock::time_point m_last_frame
Definition SceneBenchmark.cpp:143
void set_top_layer(size_t pass_frame)
Definition SceneBenchmark.cpp:400
constexpr size_t SCENE_FRAMES
Definition SceneBenchmark.cpp:94
constexpr size_t WARMUP_FRAMES
Definition SceneBenchmark.cpp:91
TreeSupportProfiler profiler
Definition TreeSupport.cpp:227

References _L, count, end_scene(), finish(), Layers, m_canvas, m_frame, m_last_frame, m_progress, m_results, m_stage, on_first_frame(), Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::PASS_FRAMES, Prepare, Preview, Slic3r::profiler, Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SCENE_FRAMES, set_camera(), set_top_layer(), and Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::WARMUP_FRAMES.

Referenced by SceneBenchmarkDialog().

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

◆ on_sys_color_changed()

◆ on_timer()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::on_timer ( wxTimerEvent & evt)
private
223{
224 Plater* plater = wxGetApp().plater();
225 if (wxGetApp().is_closing() || plater == nullptr) {
226 m_timer.Stop();
227 return;
228 }
229
230 if (m_stage == Stage::Loading) {
232 return;
233 m_timer.Stop();
234 GLCanvas3D* canvas = plater->get_view3D_canvas3D();
235 const BoundingBoxf3 box = canvas->volumes_bounding_box(true);
236 if (!box.defined) {
237 finish(_L("The benchmark model could not be loaded."));
238 return;
239 }
240 m_target = box.center();
241 const Size size = canvas->get_canvas_size();
242 m_zoom = double(std::min(size.get_width(), size.get_height())) / (1.1 * box.size().norm());
245 } else if (m_stage == Stage::Slicing) {
247 return;
248 GLCanvas3D* canvas = plater->get_preview_canvas3D();
249 if (canvas->get_gcode_viewer().has_data() && canvas->get_wxglcanvas()->IsShownOnScreen()) {
250 m_timer.Stop();
253 } else if (++m_polls > 30)
254 finish(_L("Slicing failed, so only Prepare was measured."));
255 }
256}
BoundingBoxf3 volumes_bounding_box(bool current_plate_only=false) const
Definition GLCanvas3D.cpp:2209
void set_slicing_progress_hidden()
Definition NotificationManager.cpp:2929
const NotificationManager * get_notification_manager() const
Definition Plater.cpp:23864
void deselect_all()
Definition Plater.cpp:19182
Worker & get_ui_job_worker()
Definition Plater.cpp:19110
bool is_background_process_slicing() const
Definition Plater.cpp:23583
GLCanvas3D * get_view3D_canvas3D()
Definition Plater.cpp:22082
GLCanvas3D * get_preview_canvas3D()
Definition Plater.cpp:22087
virtual bool is_idle() const =0
static Plater * plater()
Definition GUI_Factories.cpp:400
@ Plater
Definition Shortcuts.hpp:21

References _L, begin_scene(), Slic3r::BoundingBox3Base< PointType >::center(), Slic3r::BoundingBoxBase< PointType, std::vector< PointType > >::defined, finish(), Slic3r::GUI::GLCanvas3D::get_canvas_size(), Slic3r::GUI::GLCanvas3D::get_gcode_viewer(), Slic3r::GUI::Size::get_height(), Slic3r::GUI::Size::get_width(), Slic3r::GUI::GLCanvas3D::get_wxglcanvas(), Slic3r::GUI::GCodeViewer::has_data(), Loading, m_polls, m_stage, m_target, m_timer, m_zoom, Slic3r::GUI::plater(), Prepare, Preview, Slic3r::BoundingBox3Base< PointType >::size(), Slicing, and Slic3r::GUI::GLCanvas3D::volumes_bounding_box().

Referenced by SceneBenchmarkDialog().

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

◆ prev_scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::prev_scale_factor ( ) const
inlineinherited
196{ return m_prev_scale_factor; }

◆ report()

std::string Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::report ( ) const
private
470{
471 const AppConfig& config = *wxGetApp().app_config;
472 const OpenGLManager::GLInfo& gl = OpenGLManager::get_gl_info();
473 auto on_off = [](bool on) { return on ? "on" : "off"; };
474
475 std::ostringstream out;
476 out << SLIC3R_APP_NAME << " 3D scene benchmark\n"
477 << "Version: " << SoftFever_VERSION << " (" << build_commit_label << ")\n"
478 << "GPU: " << gl.get_renderer() << '\n'
479 << "OpenGL: " << gl.get_version() << '\n'
480 << "Viewport: " << m_viewport_width << " x " << m_viewport_height << " px, " << m_camera_type << " camera\n"
481 << "Settings: MSAA " << (m_msaa_samples > 1 ? std::to_string(m_msaa_samples) + "x" : "off")
482 << ", FXAA " << on_off(config.get_bool(SETTING_OPENGL_FXAA_ENABLED))
483 << ", scene cache " << on_off(config.get_bool(SETTING_OPENGL_SCENE_CACHE)) << ", VSync " << m_vsync << '\n'
484 << "Realistic: ";
485 if (config.get_bool(SETTING_OPENGL_REALISTIC_MODE))
486 out << "on, Phong " << on_off(config.get_bool(SETTING_OPENGL_REALISTIC_PHONG)) << ", SSAO "
487 << on_off(config.get_bool(SETTING_OPENGL_PHONG_SSAO)) << ", shadows " << config.get(SETTING_OPENGL_REALISTIC_SHADOWS)
488 << ", in Preview " << on_off(config.get_bool(SETTING_OPENGL_REALISTIC_PREVIEW)) << '\n';
489 else
490 out << "off\n";
491 // The Preview scenes depend on the toolpaths, which depend on the presets it was sliced with.
492 const PresetBundle& presets = *wxGetApp().preset_bundle;
493 auto preset_name = [](const PresetCollection& collection) {
494 return collection.get_selected_preset_name() + (collection.get_edited_preset().is_dirty ? " (modified)" : "");
495 };
496 out << "Presets: " << preset_name(presets.printers) << ", " << preset_name(presets.prints) << '\n'
497 << "Scene: OrcaSliced Combo, " << PASS_FRAMES << " frames per pass\n";
498 const GCodeViewer& gcode_viewer = wxGetApp().plater()->get_preview_canvas3D()->get_gcode_viewer();
499 if (gcode_viewer.has_data())
500 out << "Toolpaths: " << gcode_viewer.get_vertices_count() << " vertices, " << gcode_viewer.get_layers_count() << " layers\n";
501 out << '\n';
502
503 std::vector<FrameTimeStats> stats;
504 for (const SceneResult& result : m_results)
505 stats.push_back(frame_time_stats(result.frame_ms));
506 auto row = [&out, &stats](const char* label, double FrameTimeStats::*value) {
507 out << std::left << std::setw(22) << label << std::right;
508 for (const FrameTimeStats& s : stats)
509 out << std::setw(10) << s.*value;
510 out << '\n';
511 };
512
513 out << std::fixed << std::setprecision(1) << std::setw(22) << "";
514 for (const SceneResult& result : m_results)
515 out << std::right << std::setw(10) << result.name;
516 out << '\n';
517 row("Average FPS", &FrameTimeStats::fps);
518 out << std::setprecision(2) << "Frame time (ms)\n";
519 row(" average", &FrameTimeStats::average_ms);
520 row(" median", &FrameTimeStats::median_ms);
521 row(" 95th percentile", &FrameTimeStats::p95_ms);
522 row(" 99th percentile", &FrameTimeStats::p99_ms);
523 row(" maximum", &FrameTimeStats::max_ms);
524
525 for (const SceneResult& result : m_results) {
526 out << "\nRender timings, " << result.name << " (ms per frame)\n";
527 if (result.sections.empty()) {
528 out << " not supported by the graphics driver\n";
529 continue;
530 }
531 out << std::setw(22) << "" << std::setw(10) << "CPU" << std::setw(10) << "GPU" << '\n';
532 double cpu_ms = 0.0;
533 double gpu_ms = 0.0;
534 for (const FrameProfiler::Section& section : result.sections) {
535 out << " " << std::left << std::setw(20) << section.name << std::right << std::setw(10) << section.cpu_ms << std::setw(10)
536 << section.gpu_ms << '\n';
537 cpu_ms += section.cpu_ms;
538 gpu_ms += section.gpu_ms;
539 }
540 out << " " << std::left << std::setw(20) << "total" << std::right << std::setw(10) << cpu_ms << std::setw(10) << gpu_ms << '\n';
541 }
542 return out.str();
543}
#define SETTING_OPENGL_PHONG_SSAO
Definition AppConfig.hpp:47
#define SETTING_OPENGL_FXAA_ENABLED
Definition AppConfig.hpp:35
#define SETTING_OPENGL_SCENE_CACHE
Definition AppConfig.hpp:37
#define SETTING_OPENGL_REALISTIC_SHADOWS
Definition AppConfig.hpp:46
#define SETTING_OPENGL_REALISTIC_PREVIEW
Definition AppConfig.hpp:49
#define SETTING_OPENGL_REALISTIC_MODE
Definition AppConfig.hpp:41
#define SETTING_OPENGL_REALISTIC_PHONG
Definition AppConfig.hpp:42
static const GLInfo & get_gl_info()
Definition OpenGLManager.hpp:106
const char *const build_commit_label
Definition BuildCommit.cpp:7
double fps
Definition SceneBenchmark.hpp:10
double median_ms
Definition SceneBenchmark.hpp:12
FrameTimeStats frame_time_stats(std::vector< double > frame_ms)
Definition SceneBenchmark.cpp:68
double p99_ms
Definition SceneBenchmark.hpp:14
double max_ms
Definition SceneBenchmark.hpp:15
@ GCodeViewer
Definition Process.cpp:38
double average_ms
Definition SceneBenchmark.hpp:11
double p95_ms
Definition SceneBenchmark.hpp:13

References Slic3r::GUI::FrameTimeStats::average_ms, Slic3r::GUI::build_commit_label, Slic3r::GUI::FrameProfiler::Section::cpu_ms, Slic3r::GUI::FrameTimeStats::fps, Slic3r::GUI::frame_time_stats(), Slic3r::AppConfig::get(), Slic3r::AppConfig::get_bool(), Slic3r::GUI::OpenGLManager::get_gl_info(), Slic3r::GUI::GCodeViewer::get_layers_count(), Slic3r::GUI::OpenGLManager::GLInfo::get_renderer(), Slic3r::GUI::OpenGLManager::GLInfo::get_version(), Slic3r::GUI::GCodeViewer::get_vertices_count(), Slic3r::GUI::FrameProfiler::Section::gpu_ms, Slic3r::GUI::GCodeViewer::has_data(), m_camera_type, m_msaa_samples, m_results, m_viewport_height, m_viewport_width, m_vsync, Slic3r::GUI::FrameTimeStats::max_ms, Slic3r::GUI::FrameTimeStats::median_ms, Slic3r::GUI::FrameProfiler::Section::name, Slic3r::GUI::FrameTimeStats::p95_ms, Slic3r::GUI::FrameTimeStats::p99_ms, Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::PASS_FRAMES, Slic3r::PresetBundle::printers, Slic3r::PresetBundle::prints, SETTING_OPENGL_FXAA_ENABLED, SETTING_OPENGL_PHONG_SSAO, SETTING_OPENGL_REALISTIC_MODE, SETTING_OPENGL_REALISTIC_PHONG, SETTING_OPENGL_REALISTIC_PREVIEW, SETTING_OPENGL_REALISTIC_SHADOWS, and SETTING_OPENGL_SCENE_CACHE.

Referenced by show_report().

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

◆ rescale()

void Slic3r::GUI::DPIAware< wxDialog >::rescale ( const wxRect & suggested_rect)
inlineprivateinherited
265 {
266 this->Freeze();
267
268 m_force_rescale = false;
269
270 // set normal application font as a current window font
271 m_normal_font = this->GetFont();
272
274
275 // rescale missed controls sizes and images
277
278 this->Layout();
279 this->Thaw();
280
281 // reset previous scale factor from current scale factor value
283 }
virtual void on_dpi_changed(const wxRect &suggested_rect)=0
void update_em_unit()
Definition GUI_Utils.hpp:249

◆ scale_factor()

float Slic3r::GUI::DPIAware< wxDialog >::scale_factor ( ) const
inlineinherited
195{ return m_scale_factor; }

◆ set_camera()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::set_camera ( size_t pass_frame)
private
388{
389 // Two turns around the model while the view goes three times from below the plate to nearly
390 // straight above it, zooming in and out twice.
391 const double t = double(pass_frame) / double(PASS_FRAMES);
392 const double azimuth = (-0.75 + 4.0 * t) * PI;
393 const double elevation = (30.0 + 55.0 * std::sin(6.0 * PI * t)) * PI / 180.0;
394 const Vec3d dir(std::cos(elevation) * std::cos(azimuth), std::cos(elevation) * std::sin(azimuth), std::sin(elevation));
395 Camera& camera = wxGetApp().plater()->get_camera();
396 camera.look_at(m_target + Camera::DefaultDistance * dir, m_target, Vec3d::UnitZ());
397 camera.set_zoom(m_zoom * (1.0 + 0.4 * std::sin(4.0 * PI * t)));
398}
static constexpr double PI
Definition libslic3r.h:81
Eigen::Matrix< double, 3, 1, Eigen::DontAlign > Vec3d
Definition Point.hpp:68
static const double DefaultDistance
Definition Camera.hpp:27

References Slic3r::GUI::Camera::DefaultDistance, Slic3r::GUI::Camera::look_at(), m_target, m_zoom, Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::PASS_FRAMES, PI, and Slic3r::GUI::Camera::set_zoom().

Referenced by begin_scene(), and on_idle().

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

◆ set_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::set_em_unit ( int v)
inlineinherited
200{ m_em_unit = v; }

◆ set_prev_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_prev_scale_factor ( float v)
inlineinherited

◆ set_scale_factor()

void Slic3r::GUI::DPIAware< wxDialog >::set_scale_factor ( float v)
inlineinherited
198{ m_scale_factor = v; }

◆ set_status()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::set_status ( const wxString & status)
private
410{
411 m_status->SetLabel(status + dots);
412 Fit();
413}

References Slic3r::GUI::dots(), and m_status.

Referenced by begin_scene(), and start_slicing().

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

◆ set_top_layer()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::set_top_layer ( size_t pass_frame)
private
401{
402 // Down to the first layer and back up, as dragging the top of the layer slider does.
403 IMSlider* slider = m_canvas->get_gcode_viewer().get_layers_slider();
404 const double t = double(pass_frame) / double(PASS_FRAMES);
405 const int span = slider->GetMaxValue() - slider->GetMinValue();
406 slider->SetHigherValue(slider->GetMinValue() + int(std::lround(span * std::abs(1.0 - 2.0 * t))));
407}

References Slic3r::GUI::IMSlider::GetMaxValue(), Slic3r::GUI::IMSlider::GetMinValue(), m_canvas, Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::PASS_FRAMES, and Slic3r::GUI::IMSlider::SetHigherValue().

Referenced by on_idle().

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

◆ show_report()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::show_report ( const wxString & error)
private
425{
426 DestroyChildren();
427 m_status = nullptr;
428 m_progress = nullptr;
429
430 auto* sizer = new wxBoxSizer(wxVERTICAL);
431 if (!error.IsEmpty()) {
432 auto* message = new Label(this, error);
433 message->Wrap(FromDIP(500));
434 sizer->Add(message, 0, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, FromDIP(15));
435 }
436
437 std::string text;
438 if (!m_results.empty()) {
439 text = report();
440 auto* content = new wxTextCtrl(this, wxID_ANY, from_u8(text), wxDefaultPosition, wxDefaultSize,
441 wxTE_MULTILINE | wxTE_READONLY | wxTE_DONTWRAP | wxBORDER_SIMPLE);
442 content->SetFont(wxGetApp().code_font());
443 wxClientDC dc(content);
444 dc.SetFont(content->GetFont());
445 const wxSize extent = dc.GetMultiLineTextExtent(content->GetValue()) + FromDIP(wxSize(40, 20));
446 content->SetMinSize(wxSize(extent.GetWidth(), std::min(extent.GetHeight(), FromDIP(560))));
447 sizer->Add(content, 1, wxEXPAND | wxLEFT | wxRIGHT | wxTOP, FromDIP(15));
448 }
449
450 auto* buttons = new DialogButtons(this, text.empty() ? std::vector<wxString>{"OK"} : std::vector<wxString>{"Copy", "OK"});
451 if (Button* copy = buttons->GetButtonFromID(wxID_COPY)) {
452 copy->SetToolTip(_L("Copy the results to the clipboard"));
453 copy->Bind(wxEVT_BUTTON, [text](wxCommandEvent&) {
454 wxClipboardLocker lock;
455 if (!lock)
456 return;
457 wxTheClipboard->SetData(new wxTextDataObject(from_u8(text)));
458 });
459 }
460 buttons->GetOK()->Bind(wxEVT_BUTTON, [this](wxCommandEvent&) { Close(); });
461 sizer->Add(buttons, 0, wxEXPAND);
462
463 SetSizerAndFit(sizer);
464 CenterOnParent();
465 wxGetApp().UpdateDlgDarkUI(this);
466 Raise();
467}
std::string report() const
Definition SceneBenchmark.cpp:469
wxString from_u8(const std::string &str)
Definition GUI.cpp:544
@ lock
Definition GLGizmoEmboss.cpp:209

References _L, Slic3r::GUI::from_u8(), m_progress, m_results, m_status, and report().

Referenced by finish().

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

◆ ShowModal()

◆ start_slicing()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::start_slicing ( )
private
375{
377 set_status(_L("Slicing"));
378 m_progress->SetValue(33);
379 Plater* plater = wxGetApp().plater();
380 plater->reslice();
381 plater->select_view_3D("Preview", false);
382 wxGetApp().mainframe->select_tab(TAB_ID_PREVIEW);
383 m_polls = 0;
384 m_timer.Start(100);
385}
#define TAB_ID_PREVIEW
Definition MainFrame.hpp:61
void reslice()
Definition Plater.cpp:20752
void select_view_3D(const std::string &name, bool no_slice=true)
Definition Plater.cpp:19119

References _L, m_polls, m_progress, m_stage, m_timer, Slic3r::GUI::plater(), set_status(), Slicing, and TAB_ID_PREVIEW.

Referenced by end_scene().

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

◆ stop_scene()

void Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::stop_scene ( )
private
354{
355 if (m_canvas == nullptr)
356 return;
357 if (m_frame < SCENE_FRAMES)
358 m_results.pop_back();
359 FrameProfiler& profiler = m_canvas->get_frame_profiler();
360 if (profiler.is_averaging())
361 profiler.finish_averaging(false);
362 if (m_restore_swap_interval && m_canvas->make_current_for_postinit())
363 m_canvas->get_wxglcanvas()->SetSwapInterval(m_swap_interval);
364 if (m_saved_top_layer >= 0) {
365 m_canvas->get_gcode_viewer().get_layers_slider()->SetHigherValue(m_saved_top_layer);
367 }
368 m_canvas->set_benchmarking(false);
369 m_canvas->set_as_dirty();
370 wxGetApp().plater()->get_camera() = m_saved_camera;
371 m_canvas = nullptr;
372}

References m_canvas, m_frame, m_restore_swap_interval, m_results, m_saved_camera, m_saved_top_layer, m_swap_interval, Slic3r::profiler, and Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SCENE_FRAMES.

Referenced by SceneBenchmarkDialog(), end_scene(), and finish().

Here is the caller graph for this function:

◆ update_em_unit()

void Slic3r::GUI::DPIAware< wxDialog >::update_em_unit ( )
inlineprivateinherited
250 {
251 // Linux specific issue : get_dpi_for_window(this) still doesn't responce to the Display's scale in new wxWidgets(3.1.3).
252 // So, calculate the m_em_unit value from the font size, as before
253#if !defined(__WXGTK__)
255#else
256 // initialize default width_unit according to the width of the one symbol ("m") of the currently active font of this window.
257 m_em_unit = std::max<size_t>(10, this->GetTextExtent("m").x - 1);
258#endif // __WXGTK__
259 }

Member Data Documentation

◆ m_camera_type

std::string Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_camera_type
private

Referenced by on_first_frame(), and report().

◆ m_can_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_can_rescale
privateinherited
235{ true };

◆ m_canvas

GLCanvas3D* Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_canvas { nullptr }
private

◆ m_disabler

std::unique_ptr<wxWindowDisabler> Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_disabler
private

◆ m_em_unit

int Slic3r::GUI::DPIAware< wxDialog >::m_em_unit
privateinherited

◆ m_force_rescale

bool Slic3r::GUI::DPIAware< wxDialog >::m_force_rescale
privateinherited
236{ false };

◆ m_frame

size_t Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_frame { 0 }
private
142{ 0 };

Referenced by begin_scene(), on_idle(), and stop_scene().

◆ m_last_frame

std::chrono::steady_clock::time_point Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_last_frame
private

Referenced by on_idle().

◆ m_msaa_samples

int Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_msaa_samples { 0 }
private
152{ 0 };

Referenced by on_first_frame(), and report().

◆ m_new_font_point_size

int Slic3r::GUI::DPIAware< wxDialog >::m_new_font_point_size
privateinherited

◆ m_normal_font

wxFont Slic3r::GUI::DPIAware< wxDialog >::m_normal_font
privateinherited

◆ m_polls

int Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_polls { 0 }
private
134{ 0 };

Referenced by on_timer(), and start_slicing().

◆ m_prev_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_prev_scale_factor
privateinherited

◆ m_progress

ProgressBar* Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_progress { nullptr }
private
136{ nullptr };

Referenced by SceneBenchmarkDialog(), on_idle(), show_report(), and start_slicing().

◆ m_restore_swap_interval

bool Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_restore_swap_interval { false }
private
147{ false };

Referenced by begin_scene(), on_first_frame(), and stop_scene().

◆ m_results

std::vector<SceneResult> Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_results
private

◆ m_saved_camera

Camera Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_saved_camera
private

Referenced by begin_scene(), and stop_scene().

◆ m_saved_top_layer

int Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_saved_top_layer { -1 }
private
145{ -1 };

Referenced by begin_scene(), and stop_scene().

◆ m_scale_factor

float Slic3r::GUI::DPIAware< wxDialog >::m_scale_factor
privateinherited

◆ m_stage

Stage Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_stage { Stage::Loading }
private

◆ m_status

Label* Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_status { nullptr }
private
135{ nullptr };

Referenced by SceneBenchmarkDialog(), set_status(), and show_report().

◆ m_swap_interval

int Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_swap_interval { wxGLCanvas::DefaultSwapInterval }
private
146{ wxGLCanvas::DefaultSwapInterval };

Referenced by on_first_frame(), and stop_scene().

◆ m_target

Vec3d Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_target { Vec3d::Zero() }
private
140{ Vec3d::Zero() };

Referenced by on_timer(), and set_camera().

◆ m_timer

wxTimer Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_timer
private

◆ m_viewport_height

int Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_viewport_height { 0 }
private
154{ 0 };

Referenced by on_first_frame(), and report().

◆ m_viewport_width

int Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_viewport_width { 0 }
private
153{ 0 };

Referenced by on_first_frame(), and report().

◆ m_vsync

std::string Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_vsync
private

Referenced by on_first_frame(), and report().

◆ m_zoom

double Slic3r::GUI::anonymous_namespace{SceneBenchmark.cpp}::SceneBenchmarkDialog::m_zoom { 1.0 }
private
141{ 1.0 };

Referenced by on_timer(), and set_camera().


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