Base: Move App::Color to Base

Every basic data type is stored in Base module, color is standing out as
one that does not. Moving it to Base opens possibilities to integrate it
better with the rest of FreeCAD.
This commit is contained in:
Kacper Donat
2025-02-15 22:58:19 +01:00
parent 145af5cddc
commit a72a63232a
215 changed files with 1057 additions and 1054 deletions

View File

@@ -115,7 +115,7 @@ void ViewProviderFilling::highlightReferences(ShapeType type, const References&
switch (type) {
case ViewProviderFilling::Vertex:
if (on) {
std::vector<App::Color> colors;
std::vector<Base::Color> colors;
TopTools_IndexedMapOfShape vMap;
TopExp::MapShapes(base->Shape.getValue(), TopAbs_VERTEX, vMap);
colors.resize(vMap.Extent(), svp->PointColor.getValue());
@@ -126,7 +126,7 @@ void ViewProviderFilling::highlightReferences(ShapeType type, const References&
std::size_t idx =
static_cast<std::size_t>(std::stoi(jt.substr(6)) - 1);
if (idx < colors.size()) {
colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta
colors[idx] = Base::Color(1.0, 0.0, 1.0); // magenta
}
}
@@ -138,7 +138,7 @@ void ViewProviderFilling::highlightReferences(ShapeType type, const References&
break;
case ViewProviderFilling::Edge:
if (on) {
std::vector<App::Color> colors;
std::vector<Base::Color> colors;
TopTools_IndexedMapOfShape eMap;
TopExp::MapShapes(base->Shape.getValue(), TopAbs_EDGE, eMap);
colors.resize(eMap.Extent(), svp->LineColor.getValue());
@@ -149,7 +149,7 @@ void ViewProviderFilling::highlightReferences(ShapeType type, const References&
// check again that the index is in range because it's possible that
// the sub-names are invalid
if (idx < colors.size()) {
colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta
colors[idx] = Base::Color(1.0, 0.0, 1.0); // magenta
}
}
@@ -173,7 +173,7 @@ void ViewProviderFilling::highlightReferences(ShapeType type, const References&
// the sub-names are invalid
if (idx < materials.size()) {
materials[idx].diffuseColor =
App::Color(1.0, 0.0, 1.0); // magenta
Base::Color(1.0, 0.0, 1.0); // magenta
}
}

View File

@@ -119,7 +119,7 @@ void ViewProviderGeomFillSurface::highlightReferences(bool on)
Gui::Application::Instance->getViewProvider(base));
if (svp) {
if (on) {
std::vector<App::Color> colors;
std::vector<Base::Color> colors;
TopTools_IndexedMapOfShape eMap;
TopExp::MapShapes(base->Shape.getValue(), TopAbs_EDGE, eMap);
colors.resize(eMap.Extent(), svp->LineColor.getValue());
@@ -127,7 +127,7 @@ void ViewProviderGeomFillSurface::highlightReferences(bool on)
for (const auto& jt : it.second) {
std::size_t idx = static_cast<std::size_t>(std::stoi(jt.substr(4)) - 1);
assert(idx < colors.size());
colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta
colors[idx] = Base::Color(1.0, 0.0, 1.0); // magenta
}
svp->setHighlightedEdges(colors);

View File

@@ -115,7 +115,7 @@ void ViewProviderSections::highlightReferences(ShapeType type, const References&
switch (type) {
case ViewProviderSections::Vertex:
if (on) {
std::vector<App::Color> colors;
std::vector<Base::Color> colors;
TopTools_IndexedMapOfShape vMap;
TopExp::MapShapes(base->Shape.getValue(), TopAbs_VERTEX, vMap);
colors.resize(vMap.Extent(), svp->PointColor.getValue());
@@ -126,7 +126,7 @@ void ViewProviderSections::highlightReferences(ShapeType type, const References&
std::size_t idx =
static_cast<std::size_t>(std::stoi(jt.substr(6)) - 1);
if (idx < colors.size()) {
colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta
colors[idx] = Base::Color(1.0, 0.0, 1.0); // magenta
}
}
@@ -138,7 +138,7 @@ void ViewProviderSections::highlightReferences(ShapeType type, const References&
break;
case ViewProviderSections::Edge:
if (on) {
std::vector<App::Color> colors;
std::vector<Base::Color> colors;
TopTools_IndexedMapOfShape eMap;
TopExp::MapShapes(base->Shape.getValue(), TopAbs_EDGE, eMap);
colors.resize(eMap.Extent(), svp->LineColor.getValue());
@@ -149,7 +149,7 @@ void ViewProviderSections::highlightReferences(ShapeType type, const References&
// check again that the index is in range because it's possible that
// the sub-names are invalid
if (idx < colors.size()) {
colors[idx] = App::Color(1.0, 0.0, 1.0); // magenta
colors[idx] = Base::Color(1.0, 0.0, 1.0); // magenta
}
}
@@ -173,7 +173,7 @@ void ViewProviderSections::highlightReferences(ShapeType type, const References&
// the sub-names are invalid
if (idx < materials.size()) {
// magenta
materials[idx].diffuseColor = App::Color(1.0, 0.0, 1.0);
materials[idx].diffuseColor = Base::Color(1.0, 0.0, 1.0);
}
}