Gui: Use getObject<T>() helpers in classes
This commit is generated using regex based find and replace: ``` s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*getObject\(\s*\)\)/getObject<$1>/ s/[\w:]+_cast\s*<([^>]+)\*>\s*\(\s*([^)]*)\s*->\s*getObject\(\s*\)\)/$2->getObject<$1>()/ ``` To regenerate if needed.
This commit is contained in:
@@ -170,7 +170,7 @@ void ViewProviderFemConstraint::onChanged(const App::Property* prop)
|
||||
|
||||
void ViewProviderFemConstraint::updateData(const App::Property* prop)
|
||||
{
|
||||
auto pcConstraint = static_cast<const Fem::Constraint*>(this->getObject());
|
||||
auto pcConstraint = this->getObject<const Fem::Constraint>();
|
||||
|
||||
if (prop == &pcConstraint->Points || prop == &pcConstraint->Normals
|
||||
|| prop == &pcConstraint->Scale) {
|
||||
@@ -202,7 +202,7 @@ void ViewProviderFemConstraint::handleChangedPropertyName(Base::XMLReader& reade
|
||||
|
||||
void ViewProviderFemConstraint::updateSymbol()
|
||||
{
|
||||
auto obj = static_cast<const Fem::Constraint*>(this->getObject());
|
||||
auto obj = this->getObject<const Fem::Constraint>();
|
||||
const std::vector<Base::Vector3d>& points = obj->Points.getValue();
|
||||
const std::vector<Base::Vector3d>& normals = obj->Normals.getValue();
|
||||
if (points.size() != normals.size()) {
|
||||
@@ -225,7 +225,7 @@ void ViewProviderFemConstraint::transformSymbol(const Base::Vector3d& point,
|
||||
const Base::Vector3d& normal,
|
||||
SbMatrix& mat) const
|
||||
{
|
||||
auto obj = static_cast<const Fem::Constraint*>(this->getObject());
|
||||
auto obj = this->getObject<const Fem::Constraint>();
|
||||
SbVec3f axisY(0, 1, 0);
|
||||
float s = obj->getScaleFactor();
|
||||
SbVec3f scale(s, s, s);
|
||||
@@ -240,7 +240,7 @@ void ViewProviderFemConstraint::transformSymbol(const Base::Vector3d& point,
|
||||
void ViewProviderFemConstraint::transformExtraSymbol() const
|
||||
{
|
||||
if (pExtraTrans) {
|
||||
auto obj = static_cast<const Fem::Constraint*>(this->getObject());
|
||||
auto obj = this->getObject<const Fem::Constraint>();
|
||||
float s = obj->getScaleFactor();
|
||||
SbMatrix mat;
|
||||
mat.setScale(s);
|
||||
|
||||
Reference in New Issue
Block a user