Merge pull request #19636 from kadet1090/color-in-base
Base: Move App::Color to Base
This commit is contained in:
@@ -2223,7 +2223,7 @@ PropertyColor::~PropertyColor() = default;
|
||||
//**************************************************************************
|
||||
// Base class implementer
|
||||
|
||||
void PropertyColor::setValue(const Color& col)
|
||||
void PropertyColor::setValue(const Base::Color& col)
|
||||
{
|
||||
aboutToSetValue();
|
||||
_cCol = col;
|
||||
@@ -2244,7 +2244,7 @@ void PropertyColor::setValue(float r, float g, float b, float a)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
const Color& PropertyColor::getValue() const
|
||||
const Base::Color& PropertyColor::getValue() const
|
||||
{
|
||||
return _cCol;
|
||||
}
|
||||
@@ -2267,7 +2267,7 @@ PyObject* PropertyColor::getPyObject()
|
||||
|
||||
void PropertyColor::setPyObject(PyObject* value)
|
||||
{
|
||||
App::Color cCol;
|
||||
Base::Color cCol;
|
||||
if (PyTuple_Check(value) && (PyTuple_Size(value) == 3 || PyTuple_Size(value) == 4)) {
|
||||
PyObject* item;
|
||||
item = PyTuple_GetItem(value, 0);
|
||||
@@ -2407,7 +2407,7 @@ PyObject* PropertyColorList::getPyObject()
|
||||
return list;
|
||||
}
|
||||
|
||||
Color PropertyColorList::getPyValue(PyObject* item) const
|
||||
Base::Color PropertyColorList::getPyValue(PyObject* item) const
|
||||
{
|
||||
PropertyColor col;
|
||||
col.setPyObject(item);
|
||||
@@ -2451,7 +2451,7 @@ void PropertyColorList::RestoreDocFile(Base::Reader& reader)
|
||||
Base::InputStream str(reader);
|
||||
uint32_t uCt = 0;
|
||||
str >> uCt;
|
||||
std::vector<Color> values(uCt);
|
||||
std::vector<Base::Color> values(uCt);
|
||||
uint32_t value; // must be 32 bit long
|
||||
for (auto& it : values) {
|
||||
str >> value;
|
||||
@@ -2474,7 +2474,7 @@ void PropertyColorList::Paste(const Property& from)
|
||||
|
||||
unsigned int PropertyColorList::getMemSize() const
|
||||
{
|
||||
return static_cast<unsigned int>(_lValueList.size() * sizeof(Color));
|
||||
return static_cast<unsigned int>(_lValueList.size() * sizeof(Base::Color));
|
||||
}
|
||||
|
||||
//**************************************************************************
|
||||
@@ -2495,7 +2495,7 @@ void PropertyMaterial::setValue(const Material& mat)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterial::setValue(const Color& col)
|
||||
void PropertyMaterial::setValue(const Base::Color& col)
|
||||
{
|
||||
setDiffuseColor(col);
|
||||
}
|
||||
@@ -2515,7 +2515,7 @@ const Material& PropertyMaterial::getValue() const
|
||||
return _cMat;
|
||||
}
|
||||
|
||||
void PropertyMaterial::setAmbientColor(const Color& col)
|
||||
void PropertyMaterial::setAmbientColor(const Base::Color& col)
|
||||
{
|
||||
aboutToSetValue();
|
||||
_cMat.ambientColor = col;
|
||||
@@ -2536,7 +2536,7 @@ void PropertyMaterial::setAmbientColor(uint32_t rgba)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterial::setDiffuseColor(const Color& col)
|
||||
void PropertyMaterial::setDiffuseColor(const Base::Color& col)
|
||||
{
|
||||
aboutToSetValue();
|
||||
_cMat.diffuseColor = col;
|
||||
@@ -2557,7 +2557,7 @@ void PropertyMaterial::setDiffuseColor(uint32_t rgba)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterial::setSpecularColor(const Color& col)
|
||||
void PropertyMaterial::setSpecularColor(const Base::Color& col)
|
||||
{
|
||||
aboutToSetValue();
|
||||
_cMat.specularColor = col;
|
||||
@@ -2578,7 +2578,7 @@ void PropertyMaterial::setSpecularColor(uint32_t rgba)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterial::setEmissiveColor(const Color& col)
|
||||
void PropertyMaterial::setEmissiveColor(const Base::Color& col)
|
||||
{
|
||||
aboutToSetValue();
|
||||
_cMat.emissiveColor = col;
|
||||
@@ -2613,22 +2613,22 @@ void PropertyMaterial::setTransparency(float val)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
const Color& PropertyMaterial::getAmbientColor() const
|
||||
const Base::Color& PropertyMaterial::getAmbientColor() const
|
||||
{
|
||||
return _cMat.ambientColor;
|
||||
}
|
||||
|
||||
const Color& PropertyMaterial::getDiffuseColor() const
|
||||
const Base::Color& PropertyMaterial::getDiffuseColor() const
|
||||
{
|
||||
return _cMat.diffuseColor;
|
||||
}
|
||||
|
||||
const Color& PropertyMaterial::getSpecularColor() const
|
||||
const Base::Color& PropertyMaterial::getSpecularColor() const
|
||||
{
|
||||
return _cMat.specularColor;
|
||||
}
|
||||
|
||||
const Color& PropertyMaterial::getEmissiveColor() const
|
||||
const Base::Color& PropertyMaterial::getEmissiveColor() const
|
||||
{
|
||||
return _cMat.emissiveColor;
|
||||
}
|
||||
@@ -2816,7 +2816,7 @@ void PropertyMaterialList::setValue(int index, const Material& mat)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterialList::setAmbientColor(const Color& col)
|
||||
void PropertyMaterialList::setAmbientColor(const Base::Color& col)
|
||||
{
|
||||
aboutToSetValue();
|
||||
setMinimumSizeOne();
|
||||
@@ -2846,7 +2846,7 @@ void PropertyMaterialList::setAmbientColor(uint32_t rgba)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterialList::setAmbientColor(int index, const Color& col)
|
||||
void PropertyMaterialList::setAmbientColor(int index, const Base::Color& col)
|
||||
{
|
||||
verifyIndex(index);
|
||||
|
||||
@@ -2876,7 +2876,7 @@ void PropertyMaterialList::setAmbientColor(int index, uint32_t rgba)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterialList::setDiffuseColor(const Color& col)
|
||||
void PropertyMaterialList::setDiffuseColor(const Base::Color& col)
|
||||
{
|
||||
aboutToSetValue();
|
||||
setMinimumSizeOne();
|
||||
@@ -2906,7 +2906,7 @@ void PropertyMaterialList::setDiffuseColor(uint32_t rgba)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterialList::setDiffuseColor(int index, const Color& col)
|
||||
void PropertyMaterialList::setDiffuseColor(int index, const Base::Color& col)
|
||||
{
|
||||
verifyIndex(index);
|
||||
|
||||
@@ -2936,7 +2936,7 @@ void PropertyMaterialList::setDiffuseColor(int index, uint32_t rgba)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterialList::setDiffuseColors(const std::vector<App::Color>& colors)
|
||||
void PropertyMaterialList::setDiffuseColors(const std::vector<Base::Color>& colors)
|
||||
{
|
||||
aboutToSetValue();
|
||||
setSize(colors.size(), _lValueList[0]);
|
||||
@@ -2947,7 +2947,7 @@ void PropertyMaterialList::setDiffuseColors(const std::vector<App::Color>& color
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterialList::setSpecularColor(const Color& col)
|
||||
void PropertyMaterialList::setSpecularColor(const Base::Color& col)
|
||||
{
|
||||
aboutToSetValue();
|
||||
setMinimumSizeOne();
|
||||
@@ -2977,7 +2977,7 @@ void PropertyMaterialList::setSpecularColor(uint32_t rgba)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterialList::setSpecularColor(int index, const Color& col)
|
||||
void PropertyMaterialList::setSpecularColor(int index, const Base::Color& col)
|
||||
{
|
||||
verifyIndex(index);
|
||||
|
||||
@@ -3007,7 +3007,7 @@ void PropertyMaterialList::setSpecularColor(int index, uint32_t rgba)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterialList::setEmissiveColor(const Color& col)
|
||||
void PropertyMaterialList::setEmissiveColor(const Base::Color& col)
|
||||
{
|
||||
aboutToSetValue();
|
||||
setMinimumSizeOne();
|
||||
@@ -3037,7 +3037,7 @@ void PropertyMaterialList::setEmissiveColor(uint32_t rgba)
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
void PropertyMaterialList::setEmissiveColor(int index, const Color& col)
|
||||
void PropertyMaterialList::setEmissiveColor(int index, const Base::Color& col)
|
||||
{
|
||||
verifyIndex(index);
|
||||
|
||||
@@ -3118,29 +3118,29 @@ void PropertyMaterialList::setTransparencies(const std::vector<float>& transpare
|
||||
hasSetValue();
|
||||
}
|
||||
|
||||
const Color& PropertyMaterialList::getAmbientColor() const
|
||||
const Base::Color& PropertyMaterialList::getAmbientColor() const
|
||||
{
|
||||
return _lValueList[0].ambientColor;
|
||||
}
|
||||
|
||||
const Color& PropertyMaterialList::getAmbientColor(int index) const
|
||||
const Base::Color& PropertyMaterialList::getAmbientColor(int index) const
|
||||
{
|
||||
return _lValueList[index].ambientColor;
|
||||
}
|
||||
|
||||
const Color& PropertyMaterialList::getDiffuseColor() const
|
||||
const Base::Color& PropertyMaterialList::getDiffuseColor() const
|
||||
{
|
||||
return _lValueList[0].diffuseColor;
|
||||
}
|
||||
|
||||
const Color& PropertyMaterialList::getDiffuseColor(int index) const
|
||||
const Base::Color& PropertyMaterialList::getDiffuseColor(int index) const
|
||||
{
|
||||
return _lValueList[index].diffuseColor;
|
||||
}
|
||||
|
||||
std::vector<App::Color> PropertyMaterialList::getDiffuseColors() const
|
||||
std::vector<Base::Color> PropertyMaterialList::getDiffuseColors() const
|
||||
{
|
||||
std::vector<App::Color> list;
|
||||
std::vector<Base::Color> list;
|
||||
for (auto& material : _lValueList) {
|
||||
list.push_back(material.diffuseColor);
|
||||
}
|
||||
@@ -3148,22 +3148,22 @@ std::vector<App::Color> PropertyMaterialList::getDiffuseColors() const
|
||||
return list;
|
||||
}
|
||||
|
||||
const Color& PropertyMaterialList::getSpecularColor() const
|
||||
const Base::Color& PropertyMaterialList::getSpecularColor() const
|
||||
{
|
||||
return _lValueList[0].specularColor;
|
||||
}
|
||||
|
||||
const Color& PropertyMaterialList::getSpecularColor(int index) const
|
||||
const Base::Color& PropertyMaterialList::getSpecularColor(int index) const
|
||||
{
|
||||
return _lValueList[index].specularColor;
|
||||
}
|
||||
|
||||
const Color& PropertyMaterialList::getEmissiveColor() const
|
||||
const Base::Color& PropertyMaterialList::getEmissiveColor() const
|
||||
{
|
||||
return _lValueList[0].emissiveColor;
|
||||
}
|
||||
|
||||
const Color& PropertyMaterialList::getEmissiveColor(int index) const
|
||||
const Base::Color& PropertyMaterialList::getEmissiveColor(int index) const
|
||||
{
|
||||
return _lValueList[index].emissiveColor;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user