src/Screens/ModelEditorScreen.cpp
// draw contextual actions (buttons, sliders) for a selected path actuator
draw contextual actions (buttons, sliders) for a selected path actuator
draw contextual actions ( buttons sliders ) for a selected path actuator
void drawPathActuatorContextualParams(UndoableUiModel& uim) {
        OpenSim::PathActuator const* pa = uim.getSelectedAs<OpenSim::PathActuator>();
        if (!pa) {
            return;
        }
        ImGui::Columns(2);
        char const* modalName = "select physical frame";
        ImGui::TextUnformatted("add path point to end");
        ImGui::NextColumn();
        if (ImGui::Button("add")) {
            ImGui::OpenPopup(modalName);
        }
        if (ImGui::IsItemHovered()) {
            ImGui::BeginTooltip();
            ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
            ImGui::TextUnformatted(
                "Add a new path point, attached to an OpenSim::PhysicalFrame in the model, to the end of the sequence of path points in this OpenSim::PathActuator");
            ImGui::PopTextWrapPos();
            ImGui::EndTooltip();
        }
        {
            OpenSim::PhysicalFrame const* pf = Select1PFPopup{}.draw(modalName, uim.getModel());
            if (pf) {
                int n = pa->getGeometryPath().getPathPointSet().getSize();
                char buf[128];
                std::snprintf(buf, sizeof(buf), "%s-P%i", pa->getName().c_str(), n + 1);
                std::string name{buf};
                SimTK::Vec3 pos{0.0f, 0.0f, 0.0f};
                uim.updSelectedAs<OpenSim::PathActuator>()->addNewPathPoint(name, *pf, pos);
            }
        }
        ImGui::NextColumn();
        ImGui::Columns();
    }
void drawPathActuatorContextualParams ( UndoableUiModel & uim ) { OpenSim :: PathActuator const * pa = uim . getSelectedAs < OpenSim :: PathActuator > ( ) ; if ( ! pa ) { return ; } ImGui :: Columns ( 2 ) ; char const * modalName = " " ; ImGui :: TextUnformatted ( " " ) ; ImGui :: NextColumn ( ) ; if ( ImGui :: Button ( " " ) ) { ImGui :: OpenPopup ( modalName ) ; } if ( ImGui :: IsItemHovered ( ) ) { ImGui :: BeginTooltip ( ) ; ImGui :: PushTextWrapPos ( ImGui :: GetFontSize ( ) * 35.0f ) ; ImGui :: TextUnformatted ( " " ) ; ImGui :: PopTextWrapPos ( ) ; ImGui :: EndTooltip ( ) ; } { OpenSim :: PhysicalFrame const * pf = Select1PFPopup { } . draw ( modalName , uim . getModel ( ) ) ; if ( pf ) { int n = pa -> getGeometryPath ( ) . getPathPointSet ( ) . getSize ( ) ; char buf [ 128 ] ; std :: snprintf ( buf , sizeof ( buf ) , " " , pa -> getName ( ) . c_str ( ) , n + 1 ) ; std :: string name { buf } ; SimTK :: Vec3 pos { 0.0f , 0.0f , 0.0f } ; uim . updSelectedAs < OpenSim :: PathActuator > ( ) -> addNewPathPoint ( name , * pf , pos ) ; } } ImGui :: NextColumn ( ) ; ImGui :: Columns ( ) ; }
draw contextual actions (buttons, sliders) for a selected path actuator
draw contextual actions ( buttons sliders ) for a selected path actuator
// handle popup