src/Screens/ModelEditorScreen.cpp
// draw contextual actions (buttons, sliders) for a selected joint
draw contextual actions (buttons, sliders) for a selected joint
draw contextual actions ( buttons sliders ) for a selected joint
void drawJointContextualActions(UndoableUiModel& uim) {
        OpenSim::Joint const* selection = uim.getSelectedAs<OpenSim::Joint>();
        if (!selection) {
            return;
        }
        ImGui::Columns(2);
        drawSelectionJointTypeSwitcher(uim);
        {
            ImGui::Text("add offset frame");
            ImGui::NextColumn();
            if (ImGui::Button("parent")) {
                auto pf = std::make_unique<OpenSim::PhysicalOffsetFrame>();
                pf->setParentFrame(selection->getParentFrame());
                uim.updSelectedAs<OpenSim::Joint>()->addFrame(pf.release());
            }
            ImGui::SameLine();
            if (ImGui::Button("child")) {
                auto pf = std::make_unique<OpenSim::PhysicalOffsetFrame>();
                pf->setParentFrame(selection->getChildFrame());
                uim.updSelectedAs<OpenSim::Joint>()->addFrame(pf.release());
            }
            ImGui::NextColumn();
        }
        ImGui::Columns();
    }
void drawJointContextualActions ( UndoableUiModel & uim ) { OpenSim :: Joint const * selection = uim . getSelectedAs < OpenSim :: Joint > ( ) ; if ( ! selection ) { return ; } ImGui :: Columns ( 2 ) ; drawSelectionJointTypeSwitcher ( uim ) ; { ImGui :: Text ( " " ) ; ImGui :: NextColumn ( ) ; if ( ImGui :: Button ( " " ) ) { auto pf = std :: make_unique < OpenSim :: PhysicalOffsetFrame > ( ) ; pf -> setParentFrame ( selection -> getParentFrame ( ) ) ; uim . updSelectedAs < OpenSim :: Joint > ( ) -> addFrame ( pf . release ( ) ) ; } ImGui :: SameLine ( ) ; if ( ImGui :: Button ( " " ) ) { auto pf = std :: make_unique < OpenSim :: PhysicalOffsetFrame > ( ) ; pf -> setParentFrame ( selection -> getChildFrame ( ) ) ; uim . updSelectedAs < OpenSim :: Joint > ( ) -> addFrame ( pf . release ( ) ) ; } ImGui :: NextColumn ( ) ; } ImGui :: Columns ( ) ; }
draw contextual actions (buttons, sliders) for a selected joint
draw contextual actions ( buttons sliders ) for a selected joint
// BEWARE: broke