ComputationalBiomechanicsLab / opensim-creator

A UI for building OpenSim models
https://opensimcreator.com
Apache License 2.0
150 stars 17 forks source link

Add `initallyOpenPanels` to `osc::PanelManager::registerSpawnablePanel` #692

Closed adamkewley closed 1 year ago

adamkewley commented 1 year ago

Because, otherwise, there's code redundancy (e.g. in the model editor):

m_PanelManager->registerSpawnablePanel(
            "viewer",
            [this](std::string_view panelName)
            {
                return std::make_shared<ModelEditorViewerPanel>(panelName, m_Parent, this, m_Model);
            }
        );
m_PanelManager->pushDynamicPanel(
            "viewer",
            std::make_shared<ModelEditorViewerPanel>(
                m_PanelManager->computeSuggestedDynamicPanelName("viewer"),
                m_Parent,
                this,
                m_Model
            )
        );