Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions SofaImGui/src/SofaImGui/windows/MouseManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@
namespace windows
{



void showManagerMouseWindow(const char *const & windowNameMouseManager,
WindowState& winManagerMouse,
sofaglfw::SofaGLFWBaseGUI* baseGUI)
Expand All @@ -56,6 +54,9 @@ void showManagerMouseWindow(const char *const & windowNameMouseManager,
if (ImGui::CollapsingHeader(buttonNames.at(button).c_str()))
{
auto* operation = pickHandler->getOperation(button);

if(!operation) continue;

std::string currentOperationDescription;

for (const auto& [label, creator] : OperationFactory::getInstance()->registry)
Expand All @@ -73,6 +74,9 @@ void showManagerMouseWindow(const char *const & windowNameMouseManager,
if (ImGui::Selectable(creator->getDescription().c_str(), isSelected))
{
pickHandler->changeOperation(button, label);
operation = pickHandler->getOperation(button); // Re-fetch the operation after call to changeOperation()

if (!operation) continue;
}
if (isSelected)
ImGui::SetItemDefaultFocus();
Expand Down Expand Up @@ -108,7 +112,7 @@ void showManagerMouseWindow(const char *const & windowNameMouseManager,
float stiffness = fixOperation->getStiffness();
if (ImGui::SliderFloat("Stiffness", &stiffness, 0.0f, 100000.0f))
{
attachOperation->setStiffness(stiffness);
fixOperation->setStiffness(stiffness);
}
}
else if (auto* inciseOperation = dynamic_cast<InciseOperation*>(operation))
Expand Down
Loading