Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
79 changes: 79 additions & 0 deletions src/pstack/gui/controls.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ void controls::initialize(main_window* parent) {
section_view_checkbox = new wxCheckBox(parent, wxID_ANY, "");
progress_bar = new wxGauge(parent, wxID_ANY, 100);
stack_button = new wxButton(parent, wxID_ANY, "Stack");
stack_button->SetToolTip("Start and stop the stacking process");

std::tie(notebook, notebook_panels) = make_tab_panels(parent, {
"Parts",
Expand All @@ -49,6 +50,12 @@ void controls::initialize(main_window* parent) {
mirror_part_button = new wxButton(panel, wxID_ANY, "Mirror");
mirror_part_button->Disable();

import_part_button->SetToolTip("Import parts from mesh files");
delete_part_button->SetToolTip("Delete selected parts");
reload_part_button->SetToolTip("Reload selected parts from their files");
copy_part_button->SetToolTip("Make a copy of selected parts");
mirror_part_button->SetToolTip("Make a mirrored copy of selected parts");

quantity_text = new wxStaticText(panel, wxID_ANY, "Quantity:");
min_hole_text = new wxStaticText(panel, wxID_ANY, "Minimum hole:");
minimize_text = new wxStaticText(panel, wxID_ANY, "Minimize box:");
Expand All @@ -71,10 +78,42 @@ void controls::initialize(main_window* parent) {
preview_voxelization_button->Disable();
preview_bounding_box_button = new wxButton(panel, wxID_ANY, "Preview bounding box");
preview_bounding_box_button->Disable();

const wxString quantity_tooltip = "How many copies of the selected parts should be included in the stacking";
const wxString min_hole_tooltip =
"This setting defines the minimum hole in the selected parts through which another part can pass. "
"This typically applies when you have hollow or loop-shaped parts. "
"It may not be possible to remove a part from inside another part without a big enough hole.\n\n"
"The application starts with a solid cube the size of your part and then uses a cube the"
"size of the minimum hole to *carve* away from the other cube until it cannot go any further.\n\n"
"(Not yet implemented) Click the \"Preview voxelization\" button to see how changing minimum hole affects the voxelization.";
const wxString minimize_tooltip =
"This setting chooses whether the parts are first rotated to a more optimal orientation before performing any other steps. "
"The application will attempt to minimizes their axis-aligned bounding boxes.\n\n"
"Do not select this option for cosmetic parts where you care about surface finish, as this setting could apply any arbitrary rotation.";
const wxString rotation_tooltip =
"This setting chooses the set of rotations the stacking algorithm will try on the selected parts.\n\n"
"None = The parts will always be oriented exactly as they are imported.\n\n"
"Cubic = The parts will be rotated by some multiple of 90 degrees from their starting orientations.\n\n"
"Arbitrary = The parts will be oriented in one of 32 random possible rotations. The rotations are constant for the duration of the application, and will be re-randomized next time the application is launched.";
const wxString preview_voxelization_tooltip = "*NOT YET IMPLEMENTED*\nShows a preview of the voxelization. Used to check if there are any open holes into the internal volume of the part.";
const wxString preview_bounding_box_tooltip = "*NOT YET IMPLEMENTED*\nShows a preview of the bounding box. Used to check the part's orientation.";

quantity_text->SetToolTip(quantity_tooltip);
min_hole_text->SetToolTip(min_hole_tooltip);
minimize_text->SetToolTip(minimize_tooltip);
quantity_spinner->SetToolTip(quantity_tooltip);
min_hole_spinner->SetToolTip(min_hole_tooltip);
minimize_checkbox->SetToolTip(minimize_tooltip);
rotation_text->SetToolTip(rotation_tooltip);
rotation_dropdown->SetToolTip(rotation_tooltip);
preview_voxelization_button->SetToolTip(preview_voxelization_tooltip);
preview_bounding_box_button->SetToolTip(preview_bounding_box_tooltip);
}

{
const auto panel = notebook_panels[1];

initial_x_text = new wxStaticText(panel, wxID_ANY, "Initial X:");
initial_y_text = new wxStaticText(panel, wxID_ANY, "Initial Y:");
initial_z_text = new wxStaticText(panel, wxID_ANY, "Initial Z:");
Expand All @@ -97,6 +136,28 @@ void controls::initialize(main_window* parent) {
min_clearance_spinner->SetDigits(2);
min_clearance_spinner->SetIncrement(0.05);
min_clearance_spinner->SetRange(0.5, 2);

constexpr auto make_tooltip = [](const char* state, char dir) {
return wxString::Format("%s size of the bounding box %c direction", state, dir);
};
initial_x_text->SetToolTip(make_tooltip("Initial", 'X'));
initial_y_text->SetToolTip(make_tooltip("Initial", 'Y'));
initial_z_text->SetToolTip(make_tooltip("Initial", 'Z'));
maximum_x_text->SetToolTip(make_tooltip("Maximum", 'X'));
maximum_y_text->SetToolTip(make_tooltip("Maximum", 'Y'));
maximum_z_text->SetToolTip(make_tooltip("Maximum", 'Z'));
initial_x_spinner->SetToolTip(make_tooltip("Initial", 'X'));
initial_y_spinner->SetToolTip(make_tooltip("Initial", 'Y'));
initial_z_spinner->SetToolTip(make_tooltip("Initial", 'Z'));
maximum_x_spinner->SetToolTip(make_tooltip("Maximum", 'X'));
maximum_y_spinner->SetToolTip(make_tooltip("Maximum", 'Y'));
maximum_z_spinner->SetToolTip(make_tooltip("Maximum", 'Z'));

const wxString min_clearance_tooltip =
"The minimum distance maintained between stacked parts. "
"Also the voxel size fed into the stacking algorithm.";
min_clearance_text->SetToolTip(min_clearance_tooltip);
min_clearance_spinner->SetToolTip(min_clearance_tooltip);
}

{
Expand All @@ -107,6 +168,11 @@ void controls::initialize(main_window* parent) {
delete_result_button->Disable();
sinterbox_result_button = new wxButton(panel, wxID_ANY, "Add sinterbox");
sinterbox_result_button->Disable();

export_result_button->SetToolTip("Export selected result");
delete_result_button->SetToolTip("Delete selected results");
sinterbox_result_button->SetToolTip("Add sinterbox to selected result, using the below settings, only if it does not already have a sinterbox");

clearance_text = new wxStaticText(panel, wxID_ANY, "Clearance:");
spacing_text = new wxStaticText(panel, wxID_ANY, "Spacing:");
thickness_text = new wxStaticText(panel, wxID_ANY, "Thickness:");
Expand All @@ -121,6 +187,19 @@ void controls::initialize(main_window* parent) {
spacing_spinner = make_spinner(1, 20, 0.5);
thickness_spinner = make_spinner(0.1, 4, 0.1);
width_spinner = make_spinner(0.1, 4, 0.1);

const wxString clearance_tooltip = "Distance from the result's bounding box to the inner wall of the sinterbox";
const wxString spacing_tooltip = "Average distance between parallel bars/wires of the sinterbox";
const wxString thickness_tooltip = "Depth from the outer wall to the inner wall of the sinterbox";
const wxString width_tooltip = "Width of the bars/wires of the sinterbox";
clearance_text->SetToolTip(clearance_tooltip);
spacing_text->SetToolTip(spacing_tooltip);
thickness_text->SetToolTip(thickness_tooltip);
width_text->SetToolTip(width_tooltip);
clearance_spinner->SetToolTip(clearance_tooltip);
spacing_spinner->SetToolTip(spacing_tooltip);
thickness_spinner->SetToolTip(thickness_tooltip);
width_spinner->SetToolTip(width_tooltip);
}

reset_values();
Expand Down
26 changes: 13 additions & 13 deletions src/pstack/gui/controls.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,9 +32,7 @@ struct controls {
wxButton* delete_result_button;
wxButton* sinterbox_result_button;

wxStaticText* min_clearance_text;
wxStaticText* section_view_text;
wxSpinCtrlDouble* min_clearance_spinner;
wxCheckBox* section_view_checkbox;
wxButton* stack_button;
wxGauge* progress_bar;
Expand All @@ -54,17 +52,7 @@ struct controls {
wxButton* preview_voxelization_button;
wxButton* preview_bounding_box_button;

// Sinterbox tab
wxStaticText* clearance_text;
wxStaticText* spacing_text;
wxStaticText* thickness_text;
wxStaticText* width_text;
wxSpinCtrlDouble* clearance_spinner;
wxSpinCtrlDouble* spacing_spinner;
wxSpinCtrlDouble* thickness_spinner;
wxSpinCtrlDouble* width_spinner;

// Bounding box tab
// Stack settings tab
wxStaticText* initial_x_text;
wxStaticText* initial_y_text;
wxStaticText* initial_z_text;
Expand All @@ -77,6 +65,18 @@ struct controls {
wxSpinCtrl* maximum_x_spinner;
wxSpinCtrl* maximum_y_spinner;
wxSpinCtrl* maximum_z_spinner;
wxStaticText* min_clearance_text;
wxSpinCtrlDouble* min_clearance_spinner;

// Sinterbox tab
wxStaticText* clearance_text;
wxStaticText* spacing_text;
wxStaticText* thickness_text;
wxStaticText* width_text;
wxSpinCtrlDouble* clearance_spinner;
wxSpinCtrlDouble* spacing_spinner;
wxSpinCtrlDouble* thickness_spinner;
wxSpinCtrlDouble* width_spinner;
};

} // namespace pstack::gui
Expand Down
2 changes: 1 addition & 1 deletion src/pstack/gui/main_window.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ void main_window::enable_on_stacking(const bool starting) {
_results_list.get_selected(selected);
_controls.export_result_button->Enable(selected.size() == 1);
_controls.delete_result_button->Enable(selected.size() != 0);
_controls.sinterbox_result_button->Enable(selected.size() != 0);
_controls.sinterbox_result_button->Enable(selected.size() == 1);
} else {
_controls.import_part_button->Disable();
_controls.delete_part_button->Disable();
Expand Down