src/Screens/SimulatorScreen.cpp
// draw all active 3D viewers
//
// the user can (de)activate 3D viewers in the "Window" tab
draw all active 3D viewers
the user can (de)activate 3D viewers in the "Window" tab
draw all active 3D viewers the user can ( de ) activate 3D viewers in the " Window " tab
void drawAll3DViewers(SimulatorScreen::Impl& impl) {
        UiSimulation* maybeSim = impl.mes->getFocusedSim();
        if (!maybeSim) {
            if (ImGui::Begin("render")) {
                ImGui::TextDisabled("(no simulation selected)");
            }
            ImGui::End();
            return;
        }
        UiSimulation& sim = *maybeSim;
        Report const& report = selectReportBasedOnScrubbing(sim, impl.mes->focusedSimulationScrubbingTime);
        MainEditorState& st = *impl.mes;
        for (size_t i = 0; i < st.viewers.size(); ++i) {
            auto& maybeViewer = st.viewers[i];
            if (!maybeViewer) {
                continue;
            }
            UiModelViewer& viewer = *maybeViewer;
            char buf[64];
            std::snprintf(buf, sizeof(buf), "viewer%zu", i);
            bool isOpen = draw3DViewer(sim, report, viewer, buf);
            if (!isOpen) {
                maybeViewer.reset();
            }
        }
    }
void drawAll3DViewers ( SimulatorScreen :: Impl & impl ) { UiSimulation * maybeSim = impl . mes -> getFocusedSim ( ) ; if ( ! maybeSim ) { if ( ImGui :: Begin ( " " ) ) { ImGui :: TextDisabled ( " " ) ; } ImGui :: End ( ) ; return ; } UiSimulation & sim = * maybeSim ; Report const & report = selectReportBasedOnScrubbing ( sim , impl . mes -> focusedSimulationScrubbingTime ) ; MainEditorState & st = * impl . mes ; for ( size_t i = 0 ; i < st . viewers . size ( ) ; ++ i ) { auto & maybeViewer = st . viewers [ i ] ; if ( ! maybeViewer ) { continue ; } UiModelViewer & viewer = * maybeViewer ; char buf [ 64 ] ; std :: snprintf ( buf , sizeof ( buf ) , " " , i ) ; bool isOpen = draw3DViewer ( sim , report , viewer , buf ) ; if ( ! isOpen ) { maybeViewer . reset ( ) ; } } }
draw all active 3D viewers
the user can (de)activate 3D viewers in the "Window" tab
draw all active 3D viewers the user can ( de ) activate 3D viewers in the " Window " tab