src/Screens/ModelEditorScreen.cpp
// draw breadcrumbs for current selection
//
// eg: Model > Joint > PhysicalFrame
draw breadcrumbs for current selection
eg: Model > Joint > PhysicalFrame
draw breadcrumbs for current selection eg : Model > Joint > PhysicalFrame
void drawSelectionBreadcrumbs(UndoableUiModel& uim) {
        OpenSim::Component const* selection = uim.getSelected();
        if (!selection) {
            return;
        }
        auto lst = osc::path_to(*selection);
        if (lst.empty()) {
            return;  
        }
        float indent = 0.0f;
        for (auto it = lst.begin(); it != lst.end() - 1; ++it) {
            ImGui::Dummy(ImVec2{indent, 0.0f});
            ImGui::SameLine();
            if (ImGui::Button((*it)->getName().c_str())) {
                uim.setSelected(*it);
            }
            if (ImGui::IsItemHovered()) {
                uim.setHovered(*it);
                ImGui::BeginTooltip();
                ImGui::PushTextWrapPos(ImGui::GetFontSize() * 35.0f);
                ImGui::Text("OpenSim::%s", (*it)->getConcreteClassName().c_str());
                ImGui::PopTextWrapPos();
                ImGui::EndTooltip();
            }
            ImGui::SameLine();
            ImGui::TextDisabled("(%s)", (*it)->getConcreteClassName().c_str());
            indent += 15.0f;
        }
        ImGui::Dummy(ImVec2{indent, 0.0f});
        ImGui::SameLine();
        ImGui::TextUnformatted((*(lst.end() - 1))->getName().c_str());
        ImGui::SameLine();
        ImGui::TextDisabled("(%s)", (*(lst.end() - 1))->getConcreteClassName().c_str());
    }
void drawSelectionBreadcrumbs ( UndoableUiModel & uim ) { OpenSim :: Component const * selection = uim . getSelected ( ) ; if ( ! selection ) { return ; } auto lst = osc :: path_to ( * selection ) ; if ( lst . empty ( ) ) { return ; } float indent = 0.0f ; for ( auto it = lst . begin ( ) ; it != lst . end ( ) - 1 ; ++ it ) { ImGui :: Dummy ( ImVec2 { indent , 0.0f } ) ; ImGui :: SameLine ( ) ; if ( ImGui :: Button ( ( * it ) -> getName ( ) . c_str ( ) ) ) { uim . setSelected ( * it ) ; } if ( ImGui :: IsItemHovered ( ) ) { uim . setHovered ( * it ) ; ImGui :: BeginTooltip ( ) ; ImGui :: PushTextWrapPos ( ImGui :: GetFontSize ( ) * 35.0f ) ; ImGui :: Text ( " " , ( * it ) -> getConcreteClassName ( ) . c_str ( ) ) ; ImGui :: PopTextWrapPos ( ) ; ImGui :: EndTooltip ( ) ; } ImGui :: SameLine ( ) ; ImGui :: TextDisabled ( " " , ( * it ) -> getConcreteClassName ( ) . c_str ( ) ) ; indent += 15.0f ; } ImGui :: Dummy ( ImVec2 { indent , 0.0f } ) ; ImGui :: SameLine ( ) ; ImGui :: TextUnformatted ( ( * ( lst . end ( ) - 1 ) ) -> getName ( ) . c_str ( ) ) ; ImGui :: SameLine ( ) ; ImGui :: TextDisabled ( " " , ( * ( lst . end ( ) - 1 ) ) -> getConcreteClassName ( ) . c_str ( ) ) ; }
draw breadcrumbs for current selection
eg: Model > Joint > PhysicalFrame
draw breadcrumbs for current selection eg : Model > Joint > PhysicalFrame
// this shouldn't happen, but you never know...