diff --git a/build/bin/imgui.ini b/build/bin/imgui.ini index e4db645..a785099 100644 --- a/build/bin/imgui.ini +++ b/build/bin/imgui.ini @@ -44,6 +44,10 @@ Pos=400,0 Size=400,30 [Window][Set time multiplier] -Pos=400,640 +Pos=400,639 Size=400,30 +[Window][Set overlap] +Pos=500,31 +Size=300,70 + diff --git a/build/bin/mainV10 b/build/bin/mainV10 index d8233ee..67429c6 100755 Binary files a/build/bin/mainV10 and b/build/bin/mainV10 differ diff --git a/src/collections/headers/collection_interface.hpp b/src/collections/headers/collection_interface.hpp index 237fe80..e608818 100644 --- a/src/collections/headers/collection_interface.hpp +++ b/src/collections/headers/collection_interface.hpp @@ -22,9 +22,13 @@ class CollectionInterface{ transparency = alpha; return true; }; - float getTransparency() { + virtual bool getVisibility(){ + return isVisible; + } + virtual float getTransparency() { return transparency; } + virtual void setVisibility(bool c) { isVisible = c; } diff --git a/src/collections/methods/gamba.cpp b/src/collections/methods/gamba.cpp index a7168d8..0d95302 100644 --- a/src/collections/methods/gamba.cpp +++ b/src/collections/methods/gamba.cpp @@ -63,13 +63,7 @@ void Gamba::setDirection(Direction dir){ float Gamba::getZ_Acc(){ float totZ_Acc = 0; - /* - for (auto i : sensori){ - totZ_Acc += i->getZ_Acc(); - }*/ - totZ_Acc = sensori[0]->getZ_Acc() + sensori[1]->getZ_Acc(); - //printf("TotAccGamba %f\n", totZ_Acc); return totZ_Acc; } \ No newline at end of file diff --git a/src/sfml_util.cpp b/src/sfml_util.cpp index 2b7118e..3b52c95 100644 --- a/src/sfml_util.cpp +++ b/src/sfml_util.cpp @@ -5,6 +5,7 @@ #include "collections/headers/collection_interface.hpp" #include #include +#include template double dist(sf::Vector2 p1, sf::Vector2 p2) @@ -300,7 +301,9 @@ void doGUI(State &gs) ImGuiWindowFlags_NoScrollbar| ImGuiWindowFlags_NoCollapse| ImGuiWindowFlags_NoTitleBar; - + + + // Finestra gestione posizione dati ImGui::Begin("Set data position", 0,sdp_flags); ImGui::SetNextItemWidth(ImGui::GetContentRegionAvail().x * 0.3); ImGui::SliderScalar("Start", ImGuiDataType_U32 ,gs.intervalMinLimit,&zero,gs.intervalMajLimit); @@ -345,9 +348,29 @@ void doGUI(State &gs) *gs.tMul = TimeMul[Timeid]; ImGui::End(); - //Finestra controllo sovrapposizione - - + //Finestra controllo sovrapposizione (solo su collezioni) + ImGui::Begin("Set overlap", 0,sdp_flags); + int c = 0; + for (auto i : gs.collections){ + std::stringstream s; + s <<"Collezione :" << c; + ImGui::Text(s.str().c_str()); + float tmpTr = i->getTransparency(); + if (ImGui::SliderFloat("Transparency ", &tmpTr,0.0,1.0)) { + gs.updateCollections(); + i->setTransparency(tmpTr); + } + bool tmpVs = i->getVisibility(); + if (ImGui::Checkbox("is visible", &tmpVs)) { + i->setVisibility(tmpVs); + gs.updateCollections(); + } + + + c++; + ImGui::Separator(); + } + ImGui::End(); sf::Vector2u wsize = gs.window.getSize(); @@ -355,8 +378,11 @@ void doGUI(State &gs) ImGui::SetWindowSize("Set data position",ImVec2(wsize.x,30)); ImGui::SetWindowPos("Set visualization plane",ImVec2(wsize.x-400,0)); ImGui::SetWindowSize("Set visualization plane",ImVec2(400,30)); - ImGui::SetWindowPos("Set time multiplier",ImVec2(wsize.x-400,wsize.y - 60)); + ImGui::SetWindowPos("Set time multiplier",ImVec2(wsize.x-400,wsize.y - 61)); ImGui::SetWindowSize("Set time multiplier",ImVec2(400,30)); + ImGui::SetWindowPos("Set overlap",ImVec2(wsize.x-300,31)); + ImGui::SetWindowSize("Set overlap",ImVec2(300,70*gs.collections.size())); + ImGui::SFML::Render(gs.window); }