From d902246e3ff1136a61a4fa05a95968c7ca5a2291 Mon Sep 17 00:00:00 2001 From: Pascal <engelerp@phys.ethz.ch> Date: Thu, 27 Jul 2023 11:54:00 +0200 Subject: [PATCH] Added opacity slider, updated drawcalls to new signature --- gui/src/main.cpp | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/gui/src/main.cpp b/gui/src/main.cpp index 249b8e3..60b86df 100644 --- a/gui/src/main.cpp +++ b/gui/src/main.cpp @@ -7,6 +7,7 @@ #include <input_state.hpp> #include <selection_manager.hpp> #include <metadata_manager.hpp> +#include <visibility_manager.hpp> #include <screendefs.hpp> @@ -314,6 +315,11 @@ int main(int argc, char** argv) { //push data to GPU bottom_drums.setAllObjectStates(MetadataManager::getLayerData(bottom_drums.name())); } + + ImGui::Separator(); + ImGui::Separator(); + + ImGui::SliderFloat("Opacity Mixer", &VisibilityManager::opacityMixer, 0.f, 1.f); ImGui::End(); //Draw Window @@ -339,10 +345,10 @@ int main(int argc, char** argv) { //Wafer if (InputState::space_pressed) { //highlight selection int tempDrawingMode = 7; - bottom_silicon.draw(projection, view, model, tempDrawingMode, -1); + bottom_silicon.draw(projection, view, model, tempDrawingMode, -1, VisibilityManager::bottomOpacity()); } else { - bottom_silicon.draw(projection, view, model, 0, -1); + bottom_silicon.draw(projection, view, model, 0, -1, VisibilityManager::bottomOpacity()); } //Drum layer int selected_index = -1; @@ -351,10 +357,10 @@ int main(int argc, char** argv) { } if (InputState::space_pressed) { //highlight selection int tempDrawingMode = 7; - bottom_drums.draw(projection, view, model, tempDrawingMode, selected_index); + bottom_drums.draw(projection, view, model, tempDrawingMode, selected_index, VisibilityManager::bottomOpacity()); } else { - bottom_drums.draw(projection, view, model, draw_mode, selected_index); + bottom_drums.draw(projection, view, model, draw_mode, selected_index, VisibilityManager::bottomOpacity()); } //Metal layer selected_index = -1; @@ -363,10 +369,10 @@ int main(int argc, char** argv) { } if (InputState::space_pressed) { //highlight selection int tempDrawingMode = 7; - bottom_metal.draw(projection, view, model, tempDrawingMode, selected_index); + bottom_metal.draw(projection, view, model, tempDrawingMode, selected_index, VisibilityManager::bottomOpacity()); } else { - bottom_metal.draw(projection, view, model, draw_mode, selected_index); + bottom_metal.draw(projection, view, model, draw_mode, selected_index, VisibilityManager::bottomOpacity()); } -- GitLab