Removed default parameters.

This commit is contained in:
Leonardo Zide 2023-06-18 18:37:59 -07:00
parent 7eb6142b3c
commit eade4bcb5f
3 changed files with 12 additions and 12 deletions

View file

@ -263,7 +263,7 @@ void lcModel::UpdatePieceInfo(std::vector<lcModel*>& UpdatedModels)
mPieceInfo->SetBoundingBox(Min, Max); mPieceInfo->SetBoundingBox(Min, Max);
} }
void lcModel::SaveLDraw(QTextStream& Stream, bool SelectedOnly, lcStep CurrentStep) const void lcModel::SaveLDraw(QTextStream& Stream, bool SelectedOnly, lcStep LastStep) const
{ {
const QLatin1String LineEnding("\r\n"); const QLatin1String LineEnding("\r\n");
@ -273,14 +273,14 @@ void lcModel::SaveLDraw(QTextStream& Stream, bool SelectedOnly, lcStep CurrentSt
lcStep Step = 1; lcStep Step = 1;
int CurrentLine = 0; int CurrentLine = 0;
int AddedSteps = 0; int AddedSteps = 0;
bool Saved = false; bool SavedStep = false;
for (lcPiece* Piece : mPieces) for (lcPiece* Piece : mPieces)
{ {
if (SelectedOnly && !Piece->IsSelected()) if (SelectedOnly && !Piece->IsSelected())
continue; continue;
if ((Saved = CurrentStep && Piece->GetStepShow() > CurrentStep)) if (SavedStep = (LastStep != 0 && Piece->GetStepShow() > LastStep))
break; break;
while (Piece->GetFileLine() > CurrentLine && CurrentLine < mFileLines.size()) while (Piece->GetFileLine() > CurrentLine && CurrentLine < mFileLines.size())
@ -395,7 +395,7 @@ void lcModel::SaveLDraw(QTextStream& Stream, bool SelectedOnly, lcStep CurrentSt
Stream << QLatin1String("0 !LEOCAD SYNTH END\r\n"); Stream << QLatin1String("0 !LEOCAD SYNTH END\r\n");
} }
while ( !Saved && CurrentLine < mFileLines.size()) while (!SavedStep && CurrentLine < mFileLines.size())
{ {
QString Line = mFileLines[CurrentLine]; QString Line = mFileLines[CurrentLine];
QTextStream LineStream(&Line, QIODevice::ReadOnly); QTextStream LineStream(&Line, QIODevice::ReadOnly);
@ -1107,7 +1107,7 @@ void lcModel::Copy()
QByteArray File; QByteArray File;
QTextStream Stream(&File, QIODevice::WriteOnly); QTextStream Stream(&File, QIODevice::WriteOnly);
SaveLDraw(Stream, true); SaveLDraw(Stream, true, 0);
gApplication->ExportClipboard(File); gApplication->ExportClipboard(File);
} }
@ -1301,7 +1301,7 @@ QImage lcModel::GetPartsListImage(int MaxWidth, lcStep Step, quint32 BackgroundC
if (Step == 0) if (Step == 0)
GetPartsList(gDefaultColor, true, false, PartsList); GetPartsList(gDefaultColor, true, false, PartsList);
else else
GetPartsListForStep(Step, gDefaultColor, PartsList); GetPartsListForStep(Step, gDefaultColor, PartsList, false);
if (PartsList.empty()) if (PartsList.empty())
return QImage(); return QImage();
@ -1629,7 +1629,7 @@ void lcModel::SaveCheckpoint(const QString& Description)
ModelHistoryEntry->Description = Description; ModelHistoryEntry->Description = Description;
QTextStream Stream(&ModelHistoryEntry->File); QTextStream Stream(&ModelHistoryEntry->File);
SaveLDraw(Stream, false); SaveLDraw(Stream, false, 0);
mUndoHistory.insert(mUndoHistory.begin(), ModelHistoryEntry); mUndoHistory.insert(mUndoHistory.begin(), ModelHistoryEntry);
for (lcModelHistoryEntry* Entry : mRedoHistory) for (lcModelHistoryEntry* Entry : mRedoHistory)

View file

@ -205,7 +205,7 @@ public:
void RemoveFocusPieceFromGroup(); void RemoveFocusPieceFromGroup();
void ShowEditGroupsDialog(); void ShowEditGroupsDialog();
void SaveLDraw(QTextStream& Stream, bool SelectedOnly, lcStep CurrentStep = 0) const; void SaveLDraw(QTextStream& Stream, bool SelectedOnly, lcStep LastStep) const;
void LoadLDraw(QIODevice& Device, Project* Project); void LoadLDraw(QIODevice& Device, Project* Project);
bool LoadBinary(lcFile* File); bool LoadBinary(lcFile* File);
bool LoadLDD(const QString& FileData); bool LoadLDD(const QString& FileData);
@ -263,7 +263,7 @@ public:
bool GetVisiblePiecesBoundingBox(lcVector3& Min, lcVector3& Max) const; bool GetVisiblePiecesBoundingBox(lcVector3& Min, lcVector3& Max) const;
std::vector<lcVector3> GetPiecesBoundingBoxPoints() const; std::vector<lcVector3> GetPiecesBoundingBoxPoints() const;
void GetPartsList(int DefaultColorIndex, bool ScanSubModels, bool AddSubModels, lcPartsList& PartsList) const; void GetPartsList(int DefaultColorIndex, bool ScanSubModels, bool AddSubModels, lcPartsList& PartsList) const;
void GetPartsListForStep(lcStep Step, int DefaultColorIndex, lcPartsList& PartsList, bool Cumulative = false) const; void GetPartsListForStep(lcStep Step, int DefaultColorIndex, lcPartsList& PartsList, bool Cumulative) const;
void GetModelParts(const lcMatrix44& WorldMatrix, int DefaultColorIndex, std::vector<lcModelPartsEntry>& ModelParts) const; void GetModelParts(const lcMatrix44& WorldMatrix, int DefaultColorIndex, std::vector<lcModelPartsEntry>& ModelParts) const;
void GetSelectionInformation(int* Flags, lcArray<lcObject*>& Selection, lcObject** Focus) const; void GetSelectionInformation(int* Flags, lcArray<lcObject*>& Selection, lcObject** Focus) const;
lcArray<lcObject*> GetSelectionModePieces(const lcPiece* SelectedPiece) const; lcArray<lcObject*> GetSelectionModePieces(const lcPiece* SelectedPiece) const;

View file

@ -299,7 +299,7 @@ void Project::ShowModelListDialog()
QByteArray File; QByteArray File;
QTextStream SaveStream(&File); QTextStream SaveStream(&File);
Source->SaveLDraw(SaveStream, false); Source->SaveLDraw(SaveStream, false, 0);
SaveStream.flush(); SaveStream.flush();
QBuffer Buffer(&File); QBuffer Buffer(&File);
@ -517,7 +517,7 @@ bool Project::Save(QTextStream& Stream)
if (MPD) if (MPD)
Stream << QLatin1String("0 FILE ") << Model->GetProperties().mFileName << QLatin1String("\r\n"); Stream << QLatin1String("0 FILE ") << Model->GetProperties().mFileName << QLatin1String("\r\n");
Model->SaveLDraw(Stream, false); Model->SaveLDraw(Stream, false, 0);
Model->SetSaved(); Model->SetSaved();
if (MPD) if (MPD)
@ -767,7 +767,7 @@ bool Project::ExportModel(const QString& FileName, lcModel* Model) const
QTextStream Stream(&File); QTextStream Stream(&File);
Model->SaveLDraw(Stream, false); Model->SaveLDraw(Stream, false, 0);
return true; return true;
} }