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:
@@ -305,14 +305,14 @@ void ViewProviderPartExt::onChanged(const App::Property* prop)
|
||||
pcPointStyle->pointSize = PointSize.getValue();
|
||||
}
|
||||
else if (prop == &LineColor) {
|
||||
const App::Color& c = LineColor.getValue();
|
||||
const Base::Color& c = LineColor.getValue();
|
||||
pcLineMaterial->diffuseColor.setValue(c.r,c.g,c.b);
|
||||
if (c != LineMaterial.getValue().diffuseColor)
|
||||
LineMaterial.setDiffuseColor(c);
|
||||
LineColorArray.setValue(LineColor.getValue());
|
||||
}
|
||||
else if (prop == &PointColor) {
|
||||
const App::Color& c = PointColor.getValue();
|
||||
const Base::Color& c = PointColor.getValue();
|
||||
pcPointMaterial->diffuseColor.setValue(c.r,c.g,c.b);
|
||||
if (c != PointMaterial.getValue().diffuseColor)
|
||||
PointMaterial.setDiffuseColor(c);
|
||||
@@ -348,7 +348,7 @@ void ViewProviderPartExt::onChanged(const App::Property* prop)
|
||||
}
|
||||
else if (prop == &_diffuseColor) {
|
||||
// Used to load the old DiffuseColor values asynchronously
|
||||
std::vector<App::Color> colors = _diffuseColor.getValues();
|
||||
std::vector<Base::Color> colors = _diffuseColor.getValues();
|
||||
std::vector<float> transparencies;
|
||||
transparencies.resize(static_cast<int>(colors.size()));
|
||||
for (int i = 0; i < static_cast<int>(colors.size()); i++) {
|
||||
@@ -671,8 +671,8 @@ void ViewProviderPartExt::setHighlightedFaces(const App::PropertyMaterialList& a
|
||||
setHighlightedFaces(appearance.getValues());
|
||||
}
|
||||
|
||||
std::map<std::string,App::Color> ViewProviderPartExt::getElementColors(const char *element) const {
|
||||
std::map<std::string,App::Color> ret;
|
||||
std::map<std::string,Base::Color> ViewProviderPartExt::getElementColors(const char *element) const {
|
||||
std::map<std::string,Base::Color> ret;
|
||||
|
||||
if(!element || !element[0]) {
|
||||
auto color = ShapeAppearance.getDiffuseColor();
|
||||
@@ -766,7 +766,7 @@ void ViewProviderPartExt::unsetHighlightedFaces()
|
||||
Transparency.touch();
|
||||
}
|
||||
|
||||
void ViewProviderPartExt::setHighlightedEdges(const std::vector<App::Color>& colors)
|
||||
void ViewProviderPartExt::setHighlightedEdges(const std::vector<Base::Color>& colors)
|
||||
{
|
||||
if (getObject() && getObject()->testStatus(App::ObjectStatus::TouchOnColorChange))
|
||||
getObject()->touch(true);
|
||||
@@ -803,7 +803,7 @@ void ViewProviderPartExt::unsetHighlightedEdges()
|
||||
LineMaterial.touch();
|
||||
}
|
||||
|
||||
void ViewProviderPartExt::setHighlightedPoints(const std::vector<App::Color>& colors)
|
||||
void ViewProviderPartExt::setHighlightedPoints(const std::vector<Base::Color>& colors)
|
||||
{
|
||||
if (getObject() && getObject()->testStatus(App::ObjectStatus::TouchOnColorChange))
|
||||
getObject()->touch(true);
|
||||
|
||||
Reference in New Issue
Block a user