Skip to content

Commit 4680d0b

Browse files
authored
Merge pull request #56 from PartStackerCommunity/tooltips
Add tooltips
2 parents f1e4f2a + 7839c5b commit 4680d0b

File tree

3 files changed

+93
-14
lines changed

3 files changed

+93
-14
lines changed

src/pstack/gui/controls.cpp

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ void controls::initialize(main_window* parent) {
2929
section_view_checkbox = new wxCheckBox(parent, wxID_ANY, "");
3030
progress_bar = new wxGauge(parent, wxID_ANY, 100);
3131
stack_button = new wxButton(parent, wxID_ANY, "Stack");
32+
stack_button->SetToolTip("Start and stop the stacking process");
3233

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

53+
import_part_button->SetToolTip("Import parts from mesh files");
54+
delete_part_button->SetToolTip("Delete selected parts");
55+
reload_part_button->SetToolTip("Reload selected parts from their files");
56+
copy_part_button->SetToolTip("Make a copy of selected parts");
57+
mirror_part_button->SetToolTip("Make a mirrored copy of selected parts");
58+
5259
quantity_text = new wxStaticText(panel, wxID_ANY, "Quantity:");
5360
min_hole_text = new wxStaticText(panel, wxID_ANY, "Minimum hole:");
5461
minimize_text = new wxStaticText(panel, wxID_ANY, "Minimize box:");
@@ -71,10 +78,42 @@ void controls::initialize(main_window* parent) {
7178
preview_voxelization_button->Disable();
7279
preview_bounding_box_button = new wxButton(panel, wxID_ANY, "Preview bounding box");
7380
preview_bounding_box_button->Disable();
81+
82+
const wxString quantity_tooltip = "How many copies of the selected parts should be included in the stacking";
83+
const wxString min_hole_tooltip =
84+
"This setting defines the minimum hole in the selected parts through which another part can pass. "
85+
"This typically applies when you have hollow or loop-shaped parts. "
86+
"It may not be possible to remove a part from inside another part without a big enough hole.\n\n"
87+
"The application starts with a solid cube the size of your part and then uses a cube the"
88+
"size of the minimum hole to *carve* away from the other cube until it cannot go any further.\n\n"
89+
"(Not yet implemented) Click the \"Preview voxelization\" button to see how changing minimum hole affects the voxelization.";
90+
const wxString minimize_tooltip =
91+
"This setting chooses whether the parts are first rotated to a more optimal orientation before performing any other steps. "
92+
"The application will attempt to minimizes their axis-aligned bounding boxes.\n\n"
93+
"Do not select this option for cosmetic parts where you care about surface finish, as this setting could apply any arbitrary rotation.";
94+
const wxString rotation_tooltip =
95+
"This setting chooses the set of rotations the stacking algorithm will try on the selected parts.\n\n"
96+
"None = The parts will always be oriented exactly as they are imported.\n\n"
97+
"Cubic = The parts will be rotated by some multiple of 90 degrees from their starting orientations.\n\n"
98+
"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.";
99+
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.";
100+
const wxString preview_bounding_box_tooltip = "*NOT YET IMPLEMENTED*\nShows a preview of the bounding box. Used to check the part's orientation.";
101+
102+
quantity_text->SetToolTip(quantity_tooltip);
103+
min_hole_text->SetToolTip(min_hole_tooltip);
104+
minimize_text->SetToolTip(minimize_tooltip);
105+
quantity_spinner->SetToolTip(quantity_tooltip);
106+
min_hole_spinner->SetToolTip(min_hole_tooltip);
107+
minimize_checkbox->SetToolTip(minimize_tooltip);
108+
rotation_text->SetToolTip(rotation_tooltip);
109+
rotation_dropdown->SetToolTip(rotation_tooltip);
110+
preview_voxelization_button->SetToolTip(preview_voxelization_tooltip);
111+
preview_bounding_box_button->SetToolTip(preview_bounding_box_tooltip);
74112
}
75113

76114
{
77115
const auto panel = notebook_panels[1];
116+
78117
initial_x_text = new wxStaticText(panel, wxID_ANY, "Initial X:");
79118
initial_y_text = new wxStaticText(panel, wxID_ANY, "Initial Y:");
80119
initial_z_text = new wxStaticText(panel, wxID_ANY, "Initial Z:");
@@ -97,6 +136,28 @@ void controls::initialize(main_window* parent) {
97136
min_clearance_spinner->SetDigits(2);
98137
min_clearance_spinner->SetIncrement(0.05);
99138
min_clearance_spinner->SetRange(0.5, 2);
139+
140+
constexpr auto make_tooltip = [](const char* state, char dir) {
141+
return wxString::Format("%s size of the bounding box %c direction", state, dir);
142+
};
143+
initial_x_text->SetToolTip(make_tooltip("Initial", 'X'));
144+
initial_y_text->SetToolTip(make_tooltip("Initial", 'Y'));
145+
initial_z_text->SetToolTip(make_tooltip("Initial", 'Z'));
146+
maximum_x_text->SetToolTip(make_tooltip("Maximum", 'X'));
147+
maximum_y_text->SetToolTip(make_tooltip("Maximum", 'Y'));
148+
maximum_z_text->SetToolTip(make_tooltip("Maximum", 'Z'));
149+
initial_x_spinner->SetToolTip(make_tooltip("Initial", 'X'));
150+
initial_y_spinner->SetToolTip(make_tooltip("Initial", 'Y'));
151+
initial_z_spinner->SetToolTip(make_tooltip("Initial", 'Z'));
152+
maximum_x_spinner->SetToolTip(make_tooltip("Maximum", 'X'));
153+
maximum_y_spinner->SetToolTip(make_tooltip("Maximum", 'Y'));
154+
maximum_z_spinner->SetToolTip(make_tooltip("Maximum", 'Z'));
155+
156+
const wxString min_clearance_tooltip =
157+
"The minimum distance maintained between stacked parts. "
158+
"Also the voxel size fed into the stacking algorithm.";
159+
min_clearance_text->SetToolTip(min_clearance_tooltip);
160+
min_clearance_spinner->SetToolTip(min_clearance_tooltip);
100161
}
101162

102163
{
@@ -107,6 +168,11 @@ void controls::initialize(main_window* parent) {
107168
delete_result_button->Disable();
108169
sinterbox_result_button = new wxButton(panel, wxID_ANY, "Add sinterbox");
109170
sinterbox_result_button->Disable();
171+
172+
export_result_button->SetToolTip("Export selected result");
173+
delete_result_button->SetToolTip("Delete selected results");
174+
sinterbox_result_button->SetToolTip("Add sinterbox to selected result, using the below settings, only if it does not already have a sinterbox");
175+
110176
clearance_text = new wxStaticText(panel, wxID_ANY, "Clearance:");
111177
spacing_text = new wxStaticText(panel, wxID_ANY, "Spacing:");
112178
thickness_text = new wxStaticText(panel, wxID_ANY, "Thickness:");
@@ -121,6 +187,19 @@ void controls::initialize(main_window* parent) {
121187
spacing_spinner = make_spinner(1, 20, 0.5);
122188
thickness_spinner = make_spinner(0.1, 4, 0.1);
123189
width_spinner = make_spinner(0.1, 4, 0.1);
190+
191+
const wxString clearance_tooltip = "Distance from the result's bounding box to the inner wall of the sinterbox";
192+
const wxString spacing_tooltip = "Average distance between parallel bars/wires of the sinterbox";
193+
const wxString thickness_tooltip = "Depth from the outer wall to the inner wall of the sinterbox";
194+
const wxString width_tooltip = "Width of the bars/wires of the sinterbox";
195+
clearance_text->SetToolTip(clearance_tooltip);
196+
spacing_text->SetToolTip(spacing_tooltip);
197+
thickness_text->SetToolTip(thickness_tooltip);
198+
width_text->SetToolTip(width_tooltip);
199+
clearance_spinner->SetToolTip(clearance_tooltip);
200+
spacing_spinner->SetToolTip(spacing_tooltip);
201+
thickness_spinner->SetToolTip(thickness_tooltip);
202+
width_spinner->SetToolTip(width_tooltip);
124203
}
125204

126205
reset_values();

src/pstack/gui/controls.hpp

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,7 @@ struct controls {
3232
wxButton* delete_result_button;
3333
wxButton* sinterbox_result_button;
3434

35-
wxStaticText* min_clearance_text;
3635
wxStaticText* section_view_text;
37-
wxSpinCtrlDouble* min_clearance_spinner;
3836
wxCheckBox* section_view_checkbox;
3937
wxButton* stack_button;
4038
wxGauge* progress_bar;
@@ -54,17 +52,7 @@ struct controls {
5452
wxButton* preview_voxelization_button;
5553
wxButton* preview_bounding_box_button;
5654

57-
// Sinterbox tab
58-
wxStaticText* clearance_text;
59-
wxStaticText* spacing_text;
60-
wxStaticText* thickness_text;
61-
wxStaticText* width_text;
62-
wxSpinCtrlDouble* clearance_spinner;
63-
wxSpinCtrlDouble* spacing_spinner;
64-
wxSpinCtrlDouble* thickness_spinner;
65-
wxSpinCtrlDouble* width_spinner;
66-
67-
// Bounding box tab
55+
// Stack settings tab
6856
wxStaticText* initial_x_text;
6957
wxStaticText* initial_y_text;
7058
wxStaticText* initial_z_text;
@@ -77,6 +65,18 @@ struct controls {
7765
wxSpinCtrl* maximum_x_spinner;
7866
wxSpinCtrl* maximum_y_spinner;
7967
wxSpinCtrl* maximum_z_spinner;
68+
wxStaticText* min_clearance_text;
69+
wxSpinCtrlDouble* min_clearance_spinner;
70+
71+
// Sinterbox tab
72+
wxStaticText* clearance_text;
73+
wxStaticText* spacing_text;
74+
wxStaticText* thickness_text;
75+
wxStaticText* width_text;
76+
wxSpinCtrlDouble* clearance_spinner;
77+
wxSpinCtrlDouble* spacing_spinner;
78+
wxSpinCtrlDouble* thickness_spinner;
79+
wxSpinCtrlDouble* width_spinner;
8080
};
8181

8282
} // namespace pstack::gui

src/pstack/gui/main_window.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -259,7 +259,7 @@ void main_window::enable_on_stacking(const bool starting) {
259259
_results_list.get_selected(selected);
260260
_controls.export_result_button->Enable(selected.size() == 1);
261261
_controls.delete_result_button->Enable(selected.size() != 0);
262-
_controls.sinterbox_result_button->Enable(selected.size() != 0);
262+
_controls.sinterbox_result_button->Enable(selected.size() == 1);
263263
} else {
264264
_controls.import_part_button->Disable();
265265
_controls.delete_part_button->Disable();

0 commit comments

Comments
 (0)