Skip to content

Commit

Permalink
Code style updates.
Browse files Browse the repository at this point in the history
  • Loading branch information
leozide committed May 11, 2024
1 parent 63272bc commit 51be79a
Showing 1 changed file with 11 additions and 21 deletions.
32 changes: 11 additions & 21 deletions common/lc_model.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1752,19 +1752,15 @@ void lcModel::LoadCheckPoint(lcModelHistoryEntry* CheckPoint)
const lcStep CurrentStep = mCurrentStep;

// Remember the camera names
std::vector<QString> CameraNames;
if (gMainWindow)
std::vector<lcView*> Views = lcView::GetModelViews(this);
std::vector<QString> CameraNames(Views.size());

for (size_t ViewIndex = 0; ViewIndex < Views.size(); ViewIndex++)
{
std::vector<lcView*> Views = lcView::GetModelViews(this);
CameraNames.resize( Views.size() );
for (unsigned int i = 0; i < Views.size(); i++)
{
lcCamera* Camera = Views[i]->GetCamera();
if (!Camera->IsSimple() && mCameras.FindIndex(Camera) != -1)
CameraNames[i] = Camera->GetName();
else
CameraNames[i] = "";
}
lcCamera* Camera = Views[ViewIndex]->GetCamera();

if (!Camera->IsSimple())
CameraNames[ViewIndex] = Camera->GetName();
}

DeleteModel();
Expand All @@ -1778,15 +1774,9 @@ void lcModel::LoadCheckPoint(lcModelHistoryEntry* CheckPoint)
CalculateStep(CurrentStep);

// Reset the cameras
if (gMainWindow)
{
std::vector<lcView*> Views = lcView::GetModelViews(this);
for (unsigned int i = 0; i < CameraNames.size(); i++)
{
if (CameraNames[i] != "")
Views[i]->SetCamera(CameraNames[i]);
}
}
for (size_t ViewIndex = 0; ViewIndex < Views.size() && ViewIndex < CameraNames.size(); ViewIndex++)
if (!CameraNames[ViewIndex].isEmpty())
Views[ViewIndex]->SetCamera(CameraNames[ViewIndex]);

gMainWindow->UpdateTimeline(true, false);
gMainWindow->UpdateCurrentStep();
Expand Down

0 comments on commit 51be79a

Please sign in to comment.