diff --git a/build/bin/imgui.ini b/build/bin/imgui.ini index fb66849..e4db645 100644 --- a/build/bin/imgui.ini +++ b/build/bin/imgui.ini @@ -24,8 +24,8 @@ Pos=68,96 Size=740,472 [Window][Set data position] -Pos=0,732 -Size=924,30 +Pos=0,670 +Size=800,30 [Window][Dear ImGui Demo/ResizableChild_478B81A3] IsChild=1 @@ -40,10 +40,10 @@ Pos=60,60 Size=353,1005 [Window][Set visualization plane] -Pos=524,0 +Pos=400,0 Size=400,30 [Window][Set time multiplier] -Pos=524,702 +Pos=400,640 Size=400,30 diff --git a/build/bin/mainV10 b/build/bin/mainV10 new file mode 100755 index 0000000..d8233ee Binary files /dev/null and b/build/bin/mainV10 differ diff --git a/src/collections/headers/collection_interface.hpp b/src/collections/headers/collection_interface.hpp index 3d9226f..237fe80 100644 --- a/src/collections/headers/collection_interface.hpp +++ b/src/collections/headers/collection_interface.hpp @@ -17,11 +17,17 @@ class CollectionInterface{ public: virtual collection create(ReferencePlane plane) = 0; virtual void update(sf::Clock cl, float multiplier) = 0; - virtual bool setTransparency(float alpha) = 0; + virtual bool setTransparency(float alpha) { + if (alpha < 0 || alpha > 1) return false; + transparency = alpha; + return true; + }; float getTransparency() { return transparency; } - virtual bool setVisibility(bool c); + virtual void setVisibility(bool c) { + isVisible = c; + } virtual ~CollectionInterface(){}; }; diff --git a/src/collections/headers/gamba.hpp b/src/collections/headers/gamba.hpp index 2905913..0900fc4 100644 --- a/src/collections/headers/gamba.hpp +++ b/src/collections/headers/gamba.hpp @@ -14,7 +14,6 @@ class Gamba : public CollectionInterface { collection create(ReferencePlane plane) override; PieceInterface* getJointPiece(); void setDirection(Direction dir); - bool setTransparency(float alpha) override; void update(sf::Clock cl, float multiplier)override {}; float getZ_Acc(); }; diff --git a/src/collections/headers/lower_body.hpp b/src/collections/headers/lower_body.hpp index 5fa7a1c..a9aab9a 100644 --- a/src/collections/headers/lower_body.hpp +++ b/src/collections/headers/lower_body.hpp @@ -34,8 +34,6 @@ public: Lower_Body(rb::Vector3 pos, std::vector data); ~Lower_Body(); void update(sf::Clock cl, float multiplier) override; - bool setVisibility(bool c) override; - bool setTransparency(float alpha) override; collection create(ReferencePlane plane) override; }; diff --git a/src/collections/methods/gamba.cpp b/src/collections/methods/gamba.cpp index c5cce6b..a7168d8 100644 --- a/src/collections/methods/gamba.cpp +++ b/src/collections/methods/gamba.cpp @@ -32,9 +32,11 @@ Gamba::Gamba(rb::Vector3 pos, unsigned int* dataPos, std::string cosciaData, std collection Gamba::create(ReferencePlane plane){ collection coll; for(auto e : pezzi){ + e->setTransparency(transparency); coll.pieces.push_back(e); } for(auto e : sensori){ + e->setTransparency(transparency); coll.pieces.push_back(e); } @@ -58,16 +60,6 @@ void Gamba::setDirection(Direction dir){ } } -bool Gamba::setTransparency(float alpha){ - for (auto i : pezzi){ - if (!i->setTransparency(alpha)) return false; - } - for (auto i : sensori){ - if (!i->setTransparency(alpha)) return false; - } - return true; -} - float Gamba::getZ_Acc(){ float totZ_Acc = 0; diff --git a/src/collections/methods/lower_body.cpp b/src/collections/methods/lower_body.cpp index 638a472..d2d1755 100644 --- a/src/collections/methods/lower_body.cpp +++ b/src/collections/methods/lower_body.cpp @@ -66,15 +66,6 @@ Lower_Body::~Lower_Body(){ delete jsx; } -bool Lower_Body::setVisibility(bool c){ - -} - -bool Lower_Body::setTransparency(float alpha){ - if (alpha < 0 || alpha > 1) return false; - transparency = alpha; - return true; -} void Lower_Body::update(sf::Clock cl, float multiplier){ float sxAcc = sx->getZ_Acc() ;