diff --git a/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp b/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp index a0e356e27..241092805 100644 --- a/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp +++ b/src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp @@ -42,7 +42,7 @@ #include #include #include -#endif +#endif #include #include @@ -52,14 +52,14 @@ using namespace App; PROPERTY_SOURCE(Fem::FemMeshShapeNetgenObject, Fem::FemMeshShapeObject) -const char* FininessEnums[]= {"VeryCoarse","Coarse","Moderate","Fine","VeryFine","UserDefined",NULL}; +const char* FinenessEnums[]= {"VeryCoarse","Coarse","Moderate","Fine","VeryFine","UserDefined",NULL}; FemMeshShapeNetgenObject::FemMeshShapeNetgenObject() { ADD_PROPERTY_TYPE(MaxSize,(1000), "MeshParams",Prop_None,"Maximum element size"); ADD_PROPERTY_TYPE(SecondOrder,(true), "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(Fineness,(2), "MeshParams",Prop_None,"Fineness level of the mesh"); + Fineness.setEnums(FinenessEnums); 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"); @@ -71,10 +71,10 @@ FemMeshShapeNetgenObject::~FemMeshShapeNetgenObject() { } -App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void) +App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void) { #ifdef FCWithNetgen - + Fem::FemMesh newMesh; Part::Feature *feat = Shape.getValue(); @@ -82,7 +82,7 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void) TopoDS_Shape shape = feat->Shape.getValue(); - + newMesh.getSMesh()->ShapeToMesh(shape); SMESH_Gen *myGen = newMesh.getGenerator(); @@ -91,26 +91,26 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void) NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true); //NETGENPlugin_SimpleHypothesis_2D * tet2 = new NETGENPlugin_SimpleHypothesis_2D(hyp++,1,myGen); - //static_cast(tet2.get())->SetNumberOfSegments(5); - //static_cast(tet2.get())->SetLocalLength(0.1); - //static_cast(tet2.get())->LengthFromEdges(); + //static_cast(tet2.get())->SetNumberOfSegments(5); + //static_cast(tet2.get())->SetLocalLength(0.1); + //static_cast(tet2.get())->LengthFromEdges(); //myNetGenMesher.SetParameters(tet2); //NETGENPlugin_SimpleHypothesis_3D* tet= new NETGENPlugin_SimpleHypothesis_3D(hyp++,1,myGen); - //static_cast(tet.get())->LengthFromFaces(); - //static_cast(tet.get())->SetMaxElementVolume(0.1); + //static_cast(tet.get())->LengthFromFaces(); + //static_cast(tet.get())->SetMaxElementVolume(0.1); //myNetGenMesher.SetParameters( tet); NETGENPlugin_Hypothesis* tet= new NETGENPlugin_Hypothesis(hyp++,1,myGen); - tet->SetMaxSize(MaxSize.getValue()); - tet->SetSecondOrder(SecondOrder.getValue()); - tet->SetOptimize(Optimize.getValue()); - int iFininess = Fininess.getValue(); - tet->SetFineness((NETGENPlugin_Hypothesis::Fineness)iFininess); - if(iFininess == 5){ - tet->SetGrowthRate(GrowthRate.getValue()); - tet->SetNbSegPerEdge(NbSegsPerEdge.getValue()); - tet->SetNbSegPerRadius(NbSegsPerRadius.getValue()); + tet->SetMaxSize(MaxSize.getValue()); + tet->SetSecondOrder(SecondOrder.getValue()); + tet->SetOptimize(Optimize.getValue()); + int iFineness = Fineness.getValue(); + tet->SetFineness((NETGENPlugin_Hypothesis::Fineness)iFineness); + if(iFineness == 5){ + tet->SetGrowthRate(GrowthRate.getValue()); + tet->SetNbSegPerEdge(NbSegsPerEdge.getValue()); + tet->SetNbSegPerRadius(NbSegsPerRadius.getValue()); } myNetGenMesher.SetParameters( tet); @@ -135,8 +135,8 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void) // set the value to the object FemMesh.setValue(newMesh); -#endif - +#endif + return App::DocumentObject::StdReturn; } @@ -151,7 +151,7 @@ App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void) // // ref counter is set to 1 // PythonObject = Py::Object(new DocumentObjectPy(this),true); // } -// return Py::new_reference_to(PythonObject); +// return Py::new_reference_to(PythonObject); //} //void FemMeshShapeNetgenObject::onChanged(const Property* prop) diff --git a/src/Mod/Fem/App/FemMeshShapeNetgenObject.h b/src/Mod/Fem/App/FemMeshShapeNetgenObject.h index d1c351d6e..fca5fc25f 100644 --- a/src/Mod/Fem/App/FemMeshShapeNetgenObject.h +++ b/src/Mod/Fem/App/FemMeshShapeNetgenObject.h @@ -43,10 +43,10 @@ public: App::PropertyFloat MaxSize; App::PropertyBool SecondOrder; - App::PropertyEnumeration Fininess; + App::PropertyEnumeration Fineness; App::PropertyFloat GrowthRate; App::PropertyInteger NbSegsPerEdge; - App::PropertyInteger NbSegsPerRadius; + App::PropertyInteger NbSegsPerRadius; App::PropertyBool Optimize; /// returns the type name of the ViewProvider diff --git a/src/Mod/Fem/Gui/TaskTetParameter.cpp b/src/Mod/Fem/Gui/TaskTetParameter.cpp index ada6957b1..4433dbffa 100644 --- a/src/Mod/Fem/Gui/TaskTetParameter.cpp +++ b/src/Mod/Fem/Gui/TaskTetParameter.cpp @@ -50,7 +50,7 @@ using namespace Gui; TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidget *parent) : TaskBox(Gui::BitmapFactory().pixmap("Fem_FemMesh_createnodebypoly"), tr("Tet Parameter"), - true, + true, parent), pcObject(pcObject) { @@ -63,7 +63,7 @@ TaskTetParameter::TaskTetParameter(Fem::FemMeshShapeNetgenObject *pcObject,QWidg this->groupLayout()->addWidget(proxy); ui->doubleSpinBox_MaxSize->setValue(pcObject->MaxSize.getValue()); - ui->comboBox_Fineness->setCurrentIndex(pcObject->Fininess.getValue()); + ui->comboBox_Fineness->setCurrentIndex(pcObject->Fineness.getValue()); ui->checkBox_SecondOrder->setChecked(pcObject->SecondOrder.getValue()); ui->doubleSpinBox_GrowthRate->setValue(pcObject->GrowthRate.getValue()); ui->spinBox_SegsPerEdge->setValue(pcObject->NbSegsPerEdge.getValue()); @@ -103,7 +103,7 @@ void TaskTetParameter::SwitchMethod(int Value) ui->spinBox_SegsPerRadius->setEnabled(false); } - pcObject->Fininess.setValue(Value); + pcObject->Fineness.setValue(Value); touched = true; }