+ Fix typo, fix undo/redo problem when creating an FEM analysis object

This commit is contained in:
wmayer
2013-11-08 09:57:37 +01:00
parent 580b58fea1
commit 86760cf414
6 changed files with 16 additions and 17 deletions

View File

@@ -60,7 +60,7 @@ FemMeshShapeNetgenObject::FemMeshShapeNetgenObject()
ADD_PROPERTY_TYPE(SecondOrder,(false), "MeshParams",Prop_None,"Create quadric elements");
ADD_PROPERTY_TYPE(Fininess,(2), "MeshParams",Prop_None,"Fininess level of the mesh");
Fininess.setEnums(FininessEnums);
ADD_PROPERTY_TYPE(GrothRate,(0.3), "MeshParams",Prop_None," allows to define how much the linear dimensions of two adjacent cells can differ");
ADD_PROPERTY_TYPE(GrowthRate,(0.3), "MeshParams",Prop_None," allows to define how much the linear dimensions of two adjacent cells can differ");
ADD_PROPERTY_TYPE(NbSegsPerEdge,(1), "MeshParams",Prop_None,"allows to define the minimum number of mesh segments in which edges will be split");
ADD_PROPERTY_TYPE(NbSegsPerRadius,(2), "MeshParams",Prop_None,"allows to define the minimum number of mesh segments in which radiuses will be split");
ADD_PROPERTY_TYPE(Optimize,(true), "MeshParams",Prop_None,"Shape for the analysis");
@@ -108,7 +108,7 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
int iFininess = Fininess.getValue();
tet->SetFineness((NETGENPlugin_Hypothesis::Fineness)iFininess);
if(iFininess == 5){
tet->SetGrowthRate(GrothRate.getValue());
tet->SetGrowthRate(GrowthRate.getValue());
tet->SetNbSegPerEdge(NbSegsPerEdge.getValue());
tet->SetNbSegPerRadius(NbSegsPerRadius.getValue());
}

View File

@@ -44,7 +44,7 @@ public:
App::PropertyFloat MaxSize;
App::PropertyBool SecondOrder;
App::PropertyEnumeration Fininess;
App::PropertyFloat GrothRate;
App::PropertyFloat GrowthRate;
App::PropertyInteger NbSegsPerEdge;
App::PropertyInteger NbSegsPerRadius;
App::PropertyBool Optimize;

View File

@@ -161,6 +161,7 @@ void CmdFemCreateAnalysis::activated(int iMsg)
doCommand(Doc,"App.activeDocument().%s.Member = App.activeDocument().%s",AnalysisName.c_str(),MeshName.c_str());
addModule(Gui,"FemGui");
doCommand(Gui,"FemGui.setActiveAnalysis(App.activeDocument().%s)",AnalysisName.c_str());
commitCommand();
updateActive();
@@ -225,6 +226,7 @@ void CmdFemAddPart::activated(int iMsg)
doCommand(Doc,"App.activeDocument().%s.Member = App.activeDocument().%s",AnalysisName.c_str(),MeshName.c_str());
addModule(Gui,"FemGui");
doCommand(Gui,"FemGui.setActiveAnalysis(App.activeDocument().%s)",AnalysisName.c_str());
commitCommand();
updateActive();

View File

@@ -65,7 +65,7 @@ TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidg
ui->doubleSpinBox_MaxSize->setValue(pcObject->MaxSize.getValue());
ui->comboBox_Fineness->setCurrentIndex(pcObject->Fininess.getValue());
ui->checkBox_SecondOrder->setChecked(pcObject->SecondOrder.getValue());
ui->doubleSpinBox_GrothRate->setValue(pcObject->GrothRate.getValue());
ui->doubleSpinBox_GrowthRate->setValue(pcObject->GrowthRate.getValue());
ui->spinBox_SegsPerEdge->setValue(pcObject->NbSegsPerEdge.getValue());
ui->spinBox_SegsPerRadius->setValue(pcObject->NbSegsPerRadius.getValue());
ui->checkBox_Optimize->setChecked(pcObject->Optimize.getValue());
@@ -73,7 +73,7 @@ TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidg
QObject::connect(ui->doubleSpinBox_MaxSize,SIGNAL(valueChanged(double)),this,SLOT(maxSizeValueChanged(double)));
QObject::connect(ui->comboBox_Fineness,SIGNAL(activated (int)),this,SLOT(SwitchMethod(int)));
QObject::connect(ui->checkBox_SecondOrder,SIGNAL(stateChanged (int)),this,SLOT(setQuadric(int)));
QObject::connect(ui->doubleSpinBox_GrothRate,SIGNAL(valueChanged(double)),this,SLOT(setGrothRate(double)));
QObject::connect(ui->doubleSpinBox_GrowthRate,SIGNAL(valueChanged(double)),this,SLOT(setGrowthRate(double)));
QObject::connect(ui->spinBox_SegsPerEdge,SIGNAL(valueChanged (int)),this,SLOT(setSegsPerEdge(int)));
QObject::connect(ui->spinBox_SegsPerRadius,SIGNAL(valueChanged (int)),this,SLOT(setSegsPerRadius(int)));
QObject::connect(ui->checkBox_Optimize,SIGNAL(stateChanged (int)),this,SLOT(setOptimize(int)));
@@ -94,24 +94,23 @@ TaskTetParameter::~TaskTetParameter()
void TaskTetParameter::SwitchMethod(int Value)
{
if(Value == 5){
ui->doubleSpinBox_GrothRate->setEnabled(true);
ui->doubleSpinBox_GrowthRate->setEnabled(true);
ui->spinBox_SegsPerEdge->setEnabled(true);
ui->spinBox_SegsPerRadius->setEnabled(true);
}else{
ui->doubleSpinBox_GrothRate->setEnabled(false);
ui->doubleSpinBox_GrowthRate->setEnabled(false);
ui->spinBox_SegsPerEdge->setEnabled(false);
ui->spinBox_SegsPerRadius->setEnabled(false);
}
pcObject->Fininess.setValue(Value);
touched = true;
pcObject->Fininess.setValue(Value);
touched = true;
}
void TaskTetParameter::maxSizeValueChanged(double Value)
{
pcObject->MaxSize.setValue(Value);
touched = true;
}
void TaskTetParameter::setQuadric(int s)
@@ -120,9 +119,9 @@ void TaskTetParameter::setQuadric(int s)
touched = true;
}
void TaskTetParameter::setGrothRate(double v)
void TaskTetParameter::setGrowthRate(double v)
{
pcObject->GrothRate.setValue(v);
pcObject->GrowthRate.setValue(v);
touched = true;
}
@@ -138,14 +137,12 @@ void TaskTetParameter::setSegsPerRadius(int v)
{
pcObject->NbSegsPerRadius.setValue(v);
touched = true;
}
void TaskTetParameter::setOptimize(int v)
{
pcObject->Optimize.setValue(v!=0);
touched = true;
}

View File

@@ -67,7 +67,7 @@ private Q_SLOTS:
void SwitchMethod(int Value);
void maxSizeValueChanged(double Value);
void setQuadric(int s);
void setGrothRate(double v);
void setGrowthRate(double v);
void setSegsPerEdge(int v);
void setSegsPerRadius(int v);
void setOptimize(int v);

View File

@@ -94,12 +94,12 @@
<item row="1" column="0">
<widget class="QLabel" name="label_3">
<property name="text">
<string>Groth Rate:</string>
<string>Growth Rate:</string>
</property>
</widget>
</item>
<item row="1" column="1">
<widget class="QDoubleSpinBox" name="doubleSpinBox_GrothRate">
<widget class="QDoubleSpinBox" name="doubleSpinBox_GrowthRate">
<property name="enabled">
<bool>false</bool>
</property>