Skip to content

Commit

Permalink
Fix merge issues from the IPanel --> Panel refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
adamkewley committed Nov 19, 2024
1 parent 1bfae78 commit a1f0205
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/OpenSimCreator/UI/ModelWarperV3/ModelWarperV3Tab.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -373,15 +373,15 @@ namespace
};

// source model 3D viewer
class ModelWarperV3SourceModelViewerPanel : public ModelViewerPanel {
class ModelWarperV3SourceModelViewerPanel final : public ModelViewerPanel {
public:
ModelWarperV3SourceModelViewerPanel(std::string_view label, std::shared_ptr<ModelWarperV3UIState> state) :
ModelViewerPanel{label, ModelViewerPanelParameters{state->sourceModel()}, ModelViewerPanelFlag::NoHittest},
m_State{std::move(state)}
{}

private:
void impl_on_draw() final
void impl_draw_content() final
{
if (m_State->isCameraLinked()) {
if (m_State->isOnlyCameraRotationLinked()) {
Expand All @@ -396,7 +396,7 @@ namespace
}

setModelState(m_State->sourceModel());
ModelViewerPanel::impl_on_draw();
ModelViewerPanel::impl_draw_content();

// draw may have updated the camera, so flash is back
if (m_State->isCameraLinked()) {
Expand All @@ -416,15 +416,15 @@ namespace
};

// result model 3D viewer
class ModelWarperV3ResultModelViewerPanel : public ModelViewerPanel {
class ModelWarperV3ResultModelViewerPanel final : public ModelViewerPanel {
public:
ModelWarperV3ResultModelViewerPanel(std::string_view label, std::shared_ptr<ModelWarperV3UIState> state) :
ModelViewerPanel{label, ModelViewerPanelParameters{state->sourceModel()}, ModelViewerPanelFlag::NoHittest},
m_State{std::move(state)}
{}

private:
void impl_on_draw()
void impl_draw_content() final
{
if (auto warped = m_State->scaledModel()) {
// handle camera linking
Expand All @@ -441,7 +441,7 @@ namespace
}

setModelState(warped);
ModelViewerPanel::impl_on_draw();
ModelViewerPanel::impl_draw_content();

// draw may have updated the camera, so flash is back
if (m_State->isCameraLinked()) {
Expand Down Expand Up @@ -512,10 +512,10 @@ namespace
};

// control panel (design, set parameters, etc.)
class ModelWarperV3ControlPanel final : public StandardPanelImpl {
class ModelWarperV3ControlPanel final : public Panel {
public:
ModelWarperV3ControlPanel(std::string_view panelName, std::shared_ptr<ModelWarperV3UIState> state) :
StandardPanelImpl{panelName},
Panel{nullptr, panelName},
m_State{std::move(state)}
{}

Expand Down Expand Up @@ -756,7 +756,8 @@ class osc::ModelWarperV3Tab::Impl final : public TabPrivate {
m_PanelManager.on_tick();
}

void on_draw_main_menu() {}
void on_draw_main_menu()
{}

void on_draw()
{
Expand Down

0 comments on commit a1f0205

Please sign in to comment.