Gui: const correctness in ViewProviderPlane

This commit is contained in:
wmayer
2024-12-30 17:44:04 +01:00
parent 4892fcaaf1
commit bc641b66b9
2 changed files with 7 additions and 7 deletions

View File

@@ -152,7 +152,7 @@ void ViewProviderPlane::setLabelVisibility(bool val)
labelSwitch->whichChild = val ? SO_SWITCH_ALL : SO_SWITCH_NONE;
}
unsigned long ViewProviderPlane::getColor(std::string& role)
unsigned long ViewProviderPlane::getColor(const std::string& role) const
{
auto planesRoles = App::LocalCoordinateSystem::PlaneRoles;
if (role == planesRoles[0]) {
@@ -167,7 +167,7 @@ unsigned long ViewProviderPlane::getColor(std::string& role)
return 0;
}
std::string ViewProviderPlane::getLabelText(std::string& role)
std::string ViewProviderPlane::getLabelText(const std::string& role) const
{
std::string text;
auto planesRoles = App::LocalCoordinateSystem::PlaneRoles;
@@ -183,7 +183,7 @@ std::string ViewProviderPlane::getLabelText(std::string& role)
return text;
}
std::string ViewProviderPlane::getRole()
std::string ViewProviderPlane::getRole() const
{
// Note: Role property of App::Plane is not set yet when attaching.
const char* name = pcObject->getNameInDocument();
@@ -199,4 +199,4 @@ std::string ViewProviderPlane::getRole()
}
return "";
}
}

View File

@@ -43,9 +43,9 @@ public:
void attach (App::DocumentObject*) override;
unsigned long getColor(std::string& role);
std::string getRole();
std::string getLabelText(std::string& role);
unsigned long getColor(const std::string& role) const;
std::string getRole() const;
std::string getLabelText(const std::string& role) const;
void setLabelVisibility(bool val);
private: