mirror of
https://github.com/leozide/leocad
synced 2025-02-07 08:45:49 +01:00
Removed gNumUserColors.
This commit is contained in:
parent
3553de5a58
commit
99a0011764
4 changed files with 8 additions and 12 deletions
|
@ -6,7 +6,6 @@
|
||||||
|
|
||||||
std::vector<lcColor> gColorList;
|
std::vector<lcColor> gColorList;
|
||||||
lcColorGroup gColorGroups[LC_NUM_COLORGROUPS];
|
lcColorGroup gColorGroups[LC_NUM_COLORGROUPS];
|
||||||
int gNumUserColors;
|
|
||||||
int gEdgeColor;
|
int gEdgeColor;
|
||||||
int gDefaultColor;
|
int gDefaultColor;
|
||||||
|
|
||||||
|
@ -486,8 +485,6 @@ bool lcLoadColorFile(lcFile& File, lcStudStyle StudStyle)
|
||||||
gEdgeColor = ColorIndex;
|
gEdgeColor = ColorIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
gNumUserColors = (int)Colors.size() - 2;
|
|
||||||
|
|
||||||
return Valid;
|
return Valid;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,7 +45,6 @@ enum lcInterfaceColor
|
||||||
extern lcVector4 gInterfaceColors[LC_NUM_INTERFACECOLORS];
|
extern lcVector4 gInterfaceColors[LC_NUM_INTERFACECOLORS];
|
||||||
extern std::vector<lcColor> gColorList;
|
extern std::vector<lcColor> gColorList;
|
||||||
extern lcColorGroup gColorGroups[LC_NUM_COLORGROUPS];
|
extern lcColorGroup gColorGroups[LC_NUM_COLORGROUPS];
|
||||||
extern int gNumUserColors;
|
|
||||||
extern int gEdgeColor;
|
extern int gEdgeColor;
|
||||||
extern int gDefaultColor;
|
extern int gDefaultColor;
|
||||||
|
|
||||||
|
|
|
@ -324,7 +324,7 @@ void PieceInfo::GetPartsList(int DefaultColorIndex, bool ScanSubModels, bool Add
|
||||||
if (ScanSubModels)
|
if (ScanSubModels)
|
||||||
mModel->GetPartsList(DefaultColorIndex, ScanSubModels, AddSubModels, PartsList);
|
mModel->GetPartsList(DefaultColorIndex, ScanSubModels, AddSubModels, PartsList);
|
||||||
|
|
||||||
if (AddSubModels && DefaultColorIndex < gNumUserColors)
|
if (AddSubModels)
|
||||||
PartsList[this][DefaultColorIndex]++;
|
PartsList[this][DefaultColorIndex]++;
|
||||||
}
|
}
|
||||||
else if (IsProject())
|
else if (IsProject())
|
||||||
|
@ -333,7 +333,7 @@ void PieceInfo::GetPartsList(int DefaultColorIndex, bool ScanSubModels, bool Add
|
||||||
if (Model)
|
if (Model)
|
||||||
Model->GetPartsList(DefaultColorIndex, ScanSubModels, AddSubModels, PartsList);
|
Model->GetPartsList(DefaultColorIndex, ScanSubModels, AddSubModels, PartsList);
|
||||||
}
|
}
|
||||||
else if (DefaultColorIndex < gNumUserColors)
|
else
|
||||||
PartsList[this][DefaultColorIndex]++;
|
PartsList[this][DefaultColorIndex]++;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -50,23 +50,23 @@ lcQPropertiesDialog::lcQPropertiesDialog(QWidget* Parent, lcPropertiesDialogOpti
|
||||||
const lcPartsList& PartsList = mOptions->PartsList;
|
const lcPartsList& PartsList = mOptions->PartsList;
|
||||||
QStringList horizontalLabels;
|
QStringList horizontalLabels;
|
||||||
|
|
||||||
QVector<bool> ColorsUsed(gNumUserColors);
|
std::vector<bool> ColorsUsed(gColorList.size());
|
||||||
|
|
||||||
for (const auto& PartIt : PartsList)
|
for (const auto& PartIt : PartsList)
|
||||||
for (const auto& ColorIt : PartIt.second)
|
for (const auto& ColorIt : PartIt.second)
|
||||||
ColorsUsed[ColorIt.first] = true;
|
ColorsUsed[ColorIt.first] = true;
|
||||||
|
|
||||||
QVector<int> ColorColumns(gNumUserColors);
|
std::vector<int> ColorColumns(gColorList.size());
|
||||||
int NumColors = 0;
|
int NumColors = 0;
|
||||||
|
|
||||||
horizontalLabels.append(tr("Part"));
|
horizontalLabels.append(tr("Part"));
|
||||||
|
|
||||||
for (int colorIdx = 0; colorIdx < gNumUserColors; colorIdx++)
|
for (size_t ColorIndex = 0; ColorIndex < gColorList.size(); ColorIndex++)
|
||||||
{
|
{
|
||||||
if (ColorsUsed[colorIdx])
|
if (ColorsUsed[ColorIndex])
|
||||||
{
|
{
|
||||||
ColorColumns[colorIdx] = NumColors++;
|
ColorColumns[ColorIndex] = NumColors++;
|
||||||
horizontalLabels.append(gColorList[colorIdx].Name);
|
horizontalLabels.append(gColorList[ColorIndex].Name);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue