ENH:Add button linkage display when gap_area is valid
jira: STUDIO-10042 Change-Id: Ia2b60d735a61cbd2a71a840d3db27e60239c8fcf
This commit is contained in:
parent
7745c29c51
commit
742efe2e3d
|
@ -845,6 +845,13 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
|
|
||||||
if (m_current_tool == ImGui::GapFillIcon) {
|
if (m_current_tool == ImGui::GapFillIcon) {
|
||||||
|
m_imgui->disabled_begin(!(TriangleSelectorPatch::exist_gap_area));
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Button, m_is_dark_mode ? ImVec4(0 / 255.0, 174 / 255.0, 66 / 255.0, 1.0) : ImVec4(0 / 255.0, 174 / 255.0, 66 / 255.0, 1.0));
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_ButtonHovered,
|
||||||
|
m_is_dark_mode ? ImVec4(50 / 255.0f, 238 / 255.0f, 61 / 255.0f, 1.00f) : ImVec4(50 / 255.0f, 238 / 255.0f, 61 / 255.0f, 1.00f));
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_ButtonActive,
|
||||||
|
m_is_dark_mode ? ImVec4(206 / 255.0f, 206 / 255.0f, 206 / 255.0f, 1.00f) : ImVec4(206 / 255.0f, 206 / 255.0f, 206 / 255.0f, 1.00f));
|
||||||
|
ImGui::PushStyleColor(ImGuiCol_Text, m_is_dark_mode ? ImVec4(255 / 255.0f, 255 / 255.0f, 255 / 255.0f, 1.00f) : ImVec4(255 / 255.0f, 255 / 255.0f, 255 / 255.0f, 1.00f));
|
||||||
if (m_imgui->button(m_desc.at("perform"))) {
|
if (m_imgui->button(m_desc.at("perform"))) {
|
||||||
Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Gap fill", UndoRedo::SnapshotType::GizmoAction);
|
Plater::TakeSnapshot snapshot(wxGetApp().plater(), "Gap fill", UndoRedo::SnapshotType::GizmoAction);
|
||||||
|
|
||||||
|
@ -856,7 +863,8 @@ void GLGizmoMmuSegmentation::on_render_input_window(float x, float y, float bott
|
||||||
update_model_object();
|
update_model_object();
|
||||||
m_parent.set_as_dirty();
|
m_parent.set_as_dirty();
|
||||||
}
|
}
|
||||||
|
ImGui::PopStyleColor(4);
|
||||||
|
m_imgui->disabled_end();
|
||||||
ImGui::SameLine();
|
ImGui::SameLine();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1328,6 +1328,7 @@ bool TrianglePatch::is_fragment() const
|
||||||
}
|
}
|
||||||
|
|
||||||
float TriangleSelectorPatch::gap_area = TriangleSelectorPatch::GapAreaMin;
|
float TriangleSelectorPatch::gap_area = TriangleSelectorPatch::GapAreaMin;
|
||||||
|
bool TriangleSelectorPatch::exist_gap_area = false;
|
||||||
|
|
||||||
void TriangleSelectorPatch::render(ImGuiWrapper* imgui)
|
void TriangleSelectorPatch::render(ImGuiWrapper* imgui)
|
||||||
{
|
{
|
||||||
|
@ -1359,7 +1360,7 @@ void TriangleSelectorPatch::render(ImGuiWrapper* imgui)
|
||||||
shader->set_uniform("show_wireframe", false);
|
shader->set_uniform("show_wireframe", false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
TriangleSelectorPatch::exist_gap_area = false;
|
||||||
for (size_t buffer_idx = 0; buffer_idx < m_triangle_patches.size(); ++buffer_idx) {
|
for (size_t buffer_idx = 0; buffer_idx < m_triangle_patches.size(); ++buffer_idx) {
|
||||||
if (this->has_VBOs(buffer_idx)) {
|
if (this->has_VBOs(buffer_idx)) {
|
||||||
const TrianglePatch& patch = m_triangle_patches[buffer_idx];
|
const TrianglePatch& patch = m_triangle_patches[buffer_idx];
|
||||||
|
@ -1368,6 +1369,7 @@ void TriangleSelectorPatch::render(ImGuiWrapper* imgui)
|
||||||
size_t color_idx = (size_t)*patch.neighbor_types.begin();
|
size_t color_idx = (size_t)*patch.neighbor_types.begin();
|
||||||
color = m_ebt_colors[color_idx];
|
color = m_ebt_colors[color_idx];
|
||||||
color[3] = 0.85;
|
color[3] = 0.85;
|
||||||
|
TriangleSelectorPatch::exist_gap_area = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
size_t color_idx = (size_t)patch.type;
|
size_t color_idx = (size_t)patch.type;
|
||||||
|
|
|
@ -150,6 +150,7 @@ public:
|
||||||
|
|
||||||
// BBS: fix me
|
// BBS: fix me
|
||||||
static float gap_area;
|
static float gap_area;
|
||||||
|
static bool exist_gap_area;
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
// Release the geometry data, release OpenGL VBOs.
|
// Release the geometry data, release OpenGL VBOs.
|
||||||
|
|
Loading…
Reference in New Issue