Improvements to FEM constraint objects

This commit is contained in:
jrheinlaender
2013-03-08 19:59:08 +04:30
parent 517443fb59
commit f5c6e4eae3
29 changed files with 939 additions and 318 deletions

View File

@@ -46,7 +46,7 @@ PROPERTY_SOURCE(FemGui::ViewProviderFemConstraintForce, FemGui::ViewProviderFemC
ViewProviderFemConstraintForce::ViewProviderFemConstraintForce()
{
sPixmap = "view-femconstraintforce";
sPixmap = "view-femconstraintforce";
}
ViewProviderFemConstraintForce::~ViewProviderFemConstraintForce()
@@ -55,6 +55,8 @@ ViewProviderFemConstraintForce::~ViewProviderFemConstraintForce()
bool ViewProviderFemConstraintForce::setEdit(int ModNum)
{
Base::Console().Error("ViewProviderFemConstraintForce::setEdit(%u)\n", ModNum);
if (ModNum == ViewProvider::Default ) {
// When double-clicking on the item for this constraint the
// object unsets and sets its edit mode without closing
@@ -64,21 +66,28 @@ bool ViewProviderFemConstraintForce::setEdit(int ModNum)
if (constrDlg && constrDlg->getConstraintView() != this)
constrDlg = 0; // another constraint left open its task panel
if (dlg && !constrDlg) {
// Allow stacking of dialogs, for ShaftWizard application
// Note: If other features start to allow stacking, we need to check for oldDlg != NULL
oldDlg = dlg;
/*
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
msgBox.setInformativeText(QObject::tr("Do you want to close this dialog?"));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
int ret = msgBox.exec();
if (ret == QMessageBox::Yes)
Gui::Control().closeDialog();
else
// This case will occur in the ShaftWizard application
checkForWizard();
if ((wizardWidget == NULL) || (wizardSubLayout == NULL)) {
// No shaft wizard is running
QMessageBox msgBox;
msgBox.setText(QObject::tr("A dialog is already open in the task panel"));
msgBox.setInformativeText(QObject::tr("Do you want to close this dialog?"));
msgBox.setStandardButtons(QMessageBox::Yes | QMessageBox::No);
msgBox.setDefaultButton(QMessageBox::Yes);
int ret = msgBox.exec();
if (ret == QMessageBox::Yes)
Gui::Control().closeDialog();
else
return false;
} else if (constraintDialog != NULL) {
// Another FemConstraint* dialog is already open inside the Shaft Wizard
// Ignore the request to open another dialog
return false;
*/
} else {
constraintDialog = new TaskFemConstraintForce(this);
return true;
}
}
// clear the selection (convenience)
@@ -103,11 +112,6 @@ bool ViewProviderFemConstraintForce::setEdit(int ModNum)
void ViewProviderFemConstraintForce::updateData(const App::Property* prop)
{
// Gets called whenever a property of the attached object changes
if (this->getObject() != NULL)
Base::Console().Error("%s: VPF updateData: %s\n", this->getObject()->getNameInDocument(), prop->getName());
else
Base::Console().Error("Anonymous: VPF updateData: %s\n", prop->getName());
Fem::ConstraintForce* pcConstraint = static_cast<Fem::ConstraintForce*>(this->getObject());
/*