SLA support points improvements

- semi-intelligent algorithm to place support points
- enhanced ImGui dialog with editing/non-editing mode
- support points can have different head diameter (only implemented in GUI so far)
- autogenerated points supporting emerging islands are annotated and the info is kept
This commit is contained in:
Lukas Matena 2019-01-30 08:26:23 +01:00
parent f4243c694f
commit 21026ec9a8
16 changed files with 433 additions and 495 deletions

View file

@ -125,6 +125,12 @@ bool ImGuiWrapper::button(const wxString &label)
return ImGui::Button(label_utf8.c_str());
}
bool ImGuiWrapper::radio_button(const wxString &label, bool active)
{
auto label_utf8 = into_u8(label);
return ImGui::RadioButton(label_utf8.c_str(), active);
}
bool ImGuiWrapper::input_double(const std::string &label, const double &value, const std::string &format)
{
return ImGui::InputDouble(label.c_str(), const_cast<double*>(&value), 0.0f, 0.0f, format.c_str());
@ -161,6 +167,26 @@ void ImGuiWrapper::text(const wxString &label)
ImGui::Text(label_utf8.c_str(), NULL);
}
void ImGuiWrapper::combo(const wxString& label, const std::vector<wxString>& options, wxString& selection)
{
const char* selection_u8 = into_u8(selection).c_str();
// this is to force the label to the left of the widget:
text(label);
ImGui::SameLine();
if (ImGui::BeginCombo("", selection_u8)) {
for (const wxString& option : options) {
const char* option_u8 = into_u8(option).c_str();
bool is_selected = (selection_u8 == nullptr) ? false : strcmp(option_u8, selection_u8) == 0;
if (ImGui::Selectable(option_u8, is_selected))
selection = option_u8;
}
ImGui::EndCombo();
}
}
void ImGuiWrapper::disabled_begin(bool disabled)
{
wxCHECK_RET(!m_disabled, "ImGUI: Unbalanced disabled_begin() call");