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:
@@ -56,8 +56,7 @@ TaskFemConstraintPressure::TaskFemConstraintPressure(
|
||||
this->groupLayout()->addWidget(proxy);
|
||||
|
||||
// Get the feature data
|
||||
Fem::ConstraintPressure* pcConstraint =
|
||||
static_cast<Fem::ConstraintPressure*>(ConstraintView->getObject());
|
||||
Fem::ConstraintPressure* pcConstraint = ConstraintView->getObject<Fem::ConstraintPressure>();
|
||||
|
||||
std::vector<App::DocumentObject*> Objects = pcConstraint->References.getValues();
|
||||
std::vector<std::string> SubElements = pcConstraint->References.getSubValues();
|
||||
@@ -120,8 +119,7 @@ void TaskFemConstraintPressure::updateUI()
|
||||
|
||||
void TaskFemConstraintPressure::onCheckReverse(const bool pressed)
|
||||
{
|
||||
Fem::ConstraintPressure* pcConstraint =
|
||||
static_cast<Fem::ConstraintPressure*>(ConstraintView->getObject());
|
||||
Fem::ConstraintPressure* pcConstraint = ConstraintView->getObject<Fem::ConstraintPressure>();
|
||||
pcConstraint->Reversed.setValue(pressed);
|
||||
}
|
||||
|
||||
@@ -133,8 +131,7 @@ void TaskFemConstraintPressure::addToSelection()
|
||||
QMessageBox::warning(this, tr("Selection error"), tr("Nothing selected!"));
|
||||
return;
|
||||
}
|
||||
Fem::ConstraintPressure* pcConstraint =
|
||||
static_cast<Fem::ConstraintPressure*>(ConstraintView->getObject());
|
||||
Fem::ConstraintPressure* pcConstraint = ConstraintView->getObject<Fem::ConstraintPressure>();
|
||||
std::vector<App::DocumentObject*> Objects = pcConstraint->References.getValues();
|
||||
std::vector<std::string> SubElements = pcConstraint->References.getSubValues();
|
||||
|
||||
@@ -188,8 +185,7 @@ void TaskFemConstraintPressure::removeFromSelection()
|
||||
QMessageBox::warning(this, tr("Selection error"), tr("Nothing selected!"));
|
||||
return;
|
||||
}
|
||||
Fem::ConstraintPressure* pcConstraint =
|
||||
static_cast<Fem::ConstraintPressure*>(ConstraintView->getObject());
|
||||
Fem::ConstraintPressure* pcConstraint = ConstraintView->getObject<Fem::ConstraintPressure>();
|
||||
std::vector<App::DocumentObject*> Objects = pcConstraint->References.getValues();
|
||||
std::vector<std::string> SubElements = pcConstraint->References.getSubValues();
|
||||
std::vector<size_t> itemsToDel;
|
||||
|
||||
Reference in New Issue
Block a user