Add ViewProvider and Dialogs for Analysis object and the Netgen mesher object
This commit is contained in:
@@ -54,6 +54,8 @@ SET(FemBase_SRCS
|
||||
FemMeshObject.h
|
||||
FemMeshShapeObject.cpp
|
||||
FemMeshShapeObject.h
|
||||
FemMeshShapeNetgenObject.cpp
|
||||
FemMeshShapeNetgenObject.h
|
||||
FemAnalysis.cpp
|
||||
FemAnalysis.h
|
||||
FemMesh.cpp
|
||||
@@ -102,6 +104,7 @@ SET(Fem_SRCS
|
||||
${Python_SRCS}
|
||||
)
|
||||
|
||||
FILE( GLOB Driver_Resources Driver/*.py )
|
||||
|
||||
|
||||
add_library(Fem SHARED ${Fem_SRCS})
|
||||
@@ -111,10 +114,12 @@ target_link_libraries(Fem ${Fem_LIBS})
|
||||
fc_target_copy_resource(Fem
|
||||
${CMAKE_SOURCE_DIR}/src/Mod/Fem
|
||||
${CMAKE_BINARY_DIR}/Mod/Fem
|
||||
Init.py
|
||||
${Driver_Resources}
|
||||
Init.py
|
||||
convert2TetGen.py
|
||||
FemLib.py)
|
||||
|
||||
|
||||
if(MSVC)
|
||||
set_target_properties(Fem PROPERTIES SUFFIX ".pyd")
|
||||
set_target_properties(Fem PROPERTIES DEBUG_OUTPUT_NAME "Fem_d")
|
||||
|
||||
122
src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp
Normal file
122
src/Mod/Fem/App/FemMeshShapeNetgenObject.cpp
Normal file
@@ -0,0 +1,122 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
|
||||
#ifndef _PreComp_
|
||||
#endif
|
||||
|
||||
#include "FemMeshShapeNetgenObject.h"
|
||||
#include "FemMesh.h"
|
||||
#include <App/DocumentObjectPy.h>
|
||||
#include <Base/Placement.h>
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
|
||||
#include <SMESH_Gen.hxx>
|
||||
#include <SMESH_Mesh.hxx>
|
||||
#include <SMDS_PolyhedralVolumeOfNodes.hxx>
|
||||
#include <SMDS_VolumeTool.hxx>
|
||||
|
||||
#include <NETGENPlugin_SimpleHypothesis_3D.hxx>
|
||||
#include <NETGENPlugin_Mesher.hxx>
|
||||
|
||||
#include <BRepBuilderAPI_Copy.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
|
||||
using namespace Fem;
|
||||
using namespace App;
|
||||
|
||||
PROPERTY_SOURCE(Fem::FemMeshShapeNetgenObject, Fem::FemMeshShapeObject)
|
||||
|
||||
|
||||
FemMeshShapeNetgenObject::FemMeshShapeNetgenObject()
|
||||
{
|
||||
//ADD_PROPERTY_TYPE(Shape,(0), "Shape",Prop_None,"Shape for the analysis");
|
||||
}
|
||||
|
||||
FemMeshShapeNetgenObject::~FemMeshShapeNetgenObject()
|
||||
{
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *FemMeshShapeNetgenObject::execute(void)
|
||||
{
|
||||
Fem::FemMesh newMesh;
|
||||
|
||||
Part::Feature *feat = Shape.getValue<Part::Feature*>();
|
||||
TopoDS_Shape shape = feat->Shape.getValue();
|
||||
|
||||
NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true);
|
||||
|
||||
//NETGENPlugin_SimpleHypothesis_2D * tet2 = new NETGENPlugin_SimpleHypothesis_2D(hyp++,1,myGen);
|
||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetNumberOfSegments(5);
|
||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetLocalLength(0.1);
|
||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->LengthFromEdges();
|
||||
//myNetGenMesher.SetParameters(tet2);
|
||||
|
||||
//NETGENPlugin_SimpleHypothesis_3D* tet= new NETGENPlugin_SimpleHypothesis_3D(hyp++,1,myGen);
|
||||
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->LengthFromFaces();
|
||||
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->SetMaxElementVolume(0.1);
|
||||
//myNetGenMesher.SetParameters( tet);
|
||||
|
||||
myNetGenMesher.Compute();
|
||||
|
||||
|
||||
|
||||
SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(newMesh.getSMesh())->GetMeshDS();
|
||||
const SMDS_MeshInfo& info = data->GetMeshInfo();
|
||||
int numNode = info.NbNodes();
|
||||
int numTria = info.NbTriangles();
|
||||
int numQuad = info.NbQuadrangles();
|
||||
int numPoly = info.NbPolygons();
|
||||
int numVolu = info.NbVolumes();
|
||||
int numTetr = info.NbTetras();
|
||||
int numHexa = info.NbHexas();
|
||||
int numPyrd = info.NbPyramids();
|
||||
int numPris = info.NbPrisms();
|
||||
int numHedr = info.NbPolyhedrons();
|
||||
|
||||
// set the value to the object
|
||||
FemMesh.setValue(newMesh);
|
||||
|
||||
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
|
||||
//short FemMeshShapeNetgenObject::mustExecute(void) const
|
||||
//{
|
||||
// return 0;
|
||||
//}
|
||||
|
||||
//PyObject *FemMeshShapeNetgenObject::getPyObject()
|
||||
//{
|
||||
// if (PythonObject.is(Py::_None())){
|
||||
// // ref counter is set to 1
|
||||
// PythonObject = Py::Object(new DocumentObjectPy(this),true);
|
||||
// }
|
||||
// return Py::new_reference_to(PythonObject);
|
||||
//}
|
||||
|
||||
void FemMeshShapeNetgenObject::onChanged(const Property* prop)
|
||||
{
|
||||
App::GeoFeature::onChanged(prop);
|
||||
}
|
||||
62
src/Mod/Fem/App/FemMeshShapeNetgenObject.h
Normal file
62
src/Mod/Fem/App/FemMeshShapeNetgenObject.h
Normal file
@@ -0,0 +1,62 @@
|
||||
/***************************************************************************
|
||||
* Copyright (c) 2013 Jürgen Riegel (FreeCAD@juergen-riegel.net) *
|
||||
* *
|
||||
* This file is part of the FreeCAD CAx development system. *
|
||||
* *
|
||||
* This library is free software; you can redistribute it and/or *
|
||||
* modify it under the terms of the GNU Library General Public *
|
||||
* License as published by the Free Software Foundation; either *
|
||||
* version 2 of the License, or (at your option) any later version. *
|
||||
* *
|
||||
* This library is distributed in the hope that it will be useful, *
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
|
||||
* GNU Library General Public License for more details. *
|
||||
* *
|
||||
* You should have received a copy of the GNU Library General Public *
|
||||
* License along with this library; see the file COPYING.LIB. If not, *
|
||||
* write to the Free Software Foundation, Inc., 59 Temple Place, *
|
||||
* Suite 330, Boston, MA 02111-1307, USA *
|
||||
* *
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
#ifndef Fem_FemMeshShapeNetgenObject_H
|
||||
#define Fem_FemMeshShapeNetgenObject_H
|
||||
|
||||
|
||||
#include "FemMesh.h"
|
||||
#include "FemMeshShapeObject.h"
|
||||
|
||||
namespace Fem
|
||||
{
|
||||
|
||||
class AppFemExport FemMeshShapeNetgenObject : public FemMeshShapeObject
|
||||
{
|
||||
PROPERTY_HEADER(Fem::FemMeshShapeNetgenObject);
|
||||
|
||||
public:
|
||||
/// Constructor
|
||||
FemMeshShapeNetgenObject(void);
|
||||
virtual ~FemMeshShapeNetgenObject();
|
||||
|
||||
/// returns the type name of the ViewProvider
|
||||
virtual const char* getViewProviderName(void) const {
|
||||
return "FemGui::ViewProviderFemMeshShapeNetgen";
|
||||
}
|
||||
virtual App::DocumentObjectExecReturn *execute(void);
|
||||
|
||||
//virtual short mustExecute(void) const;
|
||||
//virtual PyObject *getPyObject(void);
|
||||
|
||||
//App::PropertyLink Shape;
|
||||
|
||||
protected:
|
||||
/// get called by the container when a property has changed
|
||||
virtual void onChanged (const App::Property* prop);
|
||||
};
|
||||
|
||||
} //namespace Fem
|
||||
|
||||
|
||||
#endif // Fem_FemMeshShapeNetgenObject_H
|
||||
@@ -32,50 +32,6 @@
|
||||
#include <Base/Placement.h>
|
||||
#include <Mod/Part/App/PartFeature.h>
|
||||
|
||||
#include <SMESH_Gen.hxx>
|
||||
#include <SMESH_Mesh.hxx>
|
||||
#include <SMDS_PolyhedralVolumeOfNodes.hxx>
|
||||
#include <SMDS_VolumeTool.hxx>
|
||||
#include <StdMeshers_Arithmetic1D.hxx>
|
||||
#include <StdMeshers_AutomaticLength.hxx>
|
||||
#include <StdMeshers_MaxLength.hxx>
|
||||
#include <StdMeshers_LocalLength.hxx>
|
||||
#include <StdMeshers_MaxElementArea.hxx>
|
||||
#include <StdMeshers_NotConformAllowed.hxx>
|
||||
#include <StdMeshers_QuadranglePreference.hxx>
|
||||
#include <StdMeshers_Quadrangle_2D.hxx>
|
||||
#include <StdMeshers_Regular_1D.hxx>
|
||||
#include <StdMeshers_UseExisting_1D2D.hxx>
|
||||
#include <StdMeshers_CompositeSegment_1D.hxx>
|
||||
#include <StdMeshers_Deflection1D.hxx>
|
||||
#include <StdMeshers_Hexa_3D.hxx>
|
||||
#include <StdMeshers_LayerDistribution.hxx>
|
||||
#include <StdMeshers_LengthFromEdges.hxx>
|
||||
#include <StdMeshers_MaxElementVolume.hxx>
|
||||
#include <StdMeshers_MEFISTO_2D.hxx>
|
||||
#include <StdMeshers_NumberOfLayers.hxx>
|
||||
#include <StdMeshers_NumberOfSegments.hxx>
|
||||
#include <StdMeshers_Prism_3D.hxx>
|
||||
#include <StdMeshers_Projection_1D.hxx>
|
||||
#include <StdMeshers_Projection_2D.hxx>
|
||||
#include <StdMeshers_Projection_3D.hxx>
|
||||
#include <StdMeshers_QuadraticMesh.hxx>
|
||||
#include <StdMeshers_RadialPrism_3D.hxx>
|
||||
#include <StdMeshers_SegmentAroundVertex_0D.hxx>
|
||||
#include <StdMeshers_TrianglePreference.hxx>
|
||||
#include <StdMeshers_ProjectionSource1D.hxx>
|
||||
#include <StdMeshers_ProjectionSource2D.hxx>
|
||||
#include <StdMeshers_ProjectionSource3D.hxx>
|
||||
#include <StdMeshers_SegmentLengthAroundVertex.hxx>
|
||||
#include <StdMeshers_StartEndLength.hxx>
|
||||
//#include <StdMeshers_Propagation.hxx>
|
||||
#include <StdMeshers_CompositeHexa_3D.hxx>
|
||||
#include <NETGENPlugin_SimpleHypothesis_3D.hxx>
|
||||
#include <NETGENPlugin_Mesher.hxx>
|
||||
|
||||
#include <BRepBuilderAPI_Copy.hxx>
|
||||
#include <BRepTools.hxx>
|
||||
|
||||
using namespace Fem;
|
||||
using namespace App;
|
||||
|
||||
@@ -91,140 +47,140 @@ FemMeshShapeObject::~FemMeshShapeObject()
|
||||
{
|
||||
}
|
||||
|
||||
App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
|
||||
{
|
||||
Fem::FemMesh newMesh;
|
||||
|
||||
Part::Feature *feat = Shape.getValue<Part::Feature*>();
|
||||
|
||||
#if 0
|
||||
TopoDS_Shape oshape = feat->Shape.getValue();
|
||||
BRepBuilderAPI_Copy copy(oshape);
|
||||
const TopoDS_Shape& shape = copy.Shape();
|
||||
BRepTools::Clean(shape); // remove triangulation
|
||||
#else
|
||||
TopoDS_Shape shape = feat->Shape.getValue();
|
||||
#endif
|
||||
|
||||
newMesh.getSMesh()->ShapeToMesh(shape);
|
||||
SMESH_Gen *myGen = newMesh.getGenerator();
|
||||
|
||||
int hyp=0;
|
||||
#if 0
|
||||
SMESH_HypothesisPtr len(new StdMeshers_MaxLength(hyp++, 1, myGen));
|
||||
static_cast<StdMeshers_MaxLength*>(len.get())->SetLength(1.0);
|
||||
newMesh.addHypothesis(shape, len);
|
||||
|
||||
SMESH_HypothesisPtr loc(new StdMeshers_LocalLength(hyp++, 1, myGen));
|
||||
static_cast<StdMeshers_LocalLength*>(loc.get())->SetLength(1.0);
|
||||
newMesh.addHypothesis(shape, loc);
|
||||
|
||||
SMESH_HypothesisPtr area(new StdMeshers_MaxElementArea(hyp++, 1, myGen));
|
||||
static_cast<StdMeshers_MaxElementArea*>(area.get())->SetMaxArea(1.0);
|
||||
newMesh.addHypothesis(shape, area);
|
||||
|
||||
SMESH_HypothesisPtr segm(new StdMeshers_NumberOfSegments(hyp++, 1, myGen));
|
||||
static_cast<StdMeshers_NumberOfSegments*>(segm.get())->SetNumberOfSegments(1);
|
||||
newMesh.addHypothesis(shape, segm);
|
||||
|
||||
SMESH_HypothesisPtr defl(new StdMeshers_Deflection1D(hyp++, 1, myGen));
|
||||
static_cast<StdMeshers_Deflection1D*>(defl.get())->SetDeflection(0.01);
|
||||
newMesh.addHypothesis(shape, defl);
|
||||
|
||||
SMESH_HypothesisPtr reg(new StdMeshers_Regular_1D(hyp++, 1, myGen));
|
||||
newMesh.addHypothesis(shape, reg);
|
||||
|
||||
//SMESH_HypothesisPtr sel(new StdMeshers_StartEndLength(hyp++, 1, myGen));
|
||||
//static_cast<StdMeshers_StartEndLength*>(sel.get())->SetLength(1.0, true);
|
||||
//newMesh.addHypothesis(shape, sel;
|
||||
|
||||
SMESH_HypothesisPtr qdp(new StdMeshers_QuadranglePreference(hyp++,1,myGen));
|
||||
newMesh.addHypothesis(shape, qdp);
|
||||
|
||||
//SMESH_HypothesisPtr q2d(new StdMeshers_Quadrangle_2D(hyp++,1,myGen));
|
||||
//newMesh.addHypothesis(shape, q2d);
|
||||
|
||||
SMESH_HypothesisPtr h3d(new StdMeshers_Hexa_3D(hyp++,1,myGen));
|
||||
newMesh.addHypothesis(shape, h3d);
|
||||
|
||||
// create mesh
|
||||
newMesh.compute();
|
||||
#endif
|
||||
#if 0 // Surface quad mesh
|
||||
SMESH_HypothesisPtr len(new StdMeshers_MaxLength(hyp++, 1, myGen));
|
||||
static_cast<StdMeshers_MaxLength*>(len.get())->SetLength(1.0);
|
||||
newMesh.addHypothesis(shape, len);
|
||||
|
||||
SMESH_HypothesisPtr loc(new StdMeshers_LocalLength(hyp++, 1, myGen));
|
||||
static_cast<StdMeshers_LocalLength*>(loc.get())->SetLength(1.0);
|
||||
newMesh.addHypothesis(shape, loc);
|
||||
|
||||
SMESH_HypothesisPtr area(new StdMeshers_MaxElementArea(hyp++, 1, myGen));
|
||||
static_cast<StdMeshers_MaxElementArea*>(area.get())->SetMaxArea(1.0);
|
||||
newMesh.addHypothesis(shape, area);
|
||||
|
||||
SMESH_HypothesisPtr segm(new StdMeshers_NumberOfSegments(hyp++, 1, myGen));
|
||||
static_cast<StdMeshers_NumberOfSegments*>(segm.get())->SetNumberOfSegments(1);
|
||||
newMesh.addHypothesis(shape, segm);
|
||||
|
||||
SMESH_HypothesisPtr defl(new StdMeshers_Deflection1D(hyp++, 1, myGen));
|
||||
static_cast<StdMeshers_Deflection1D*>(defl.get())->SetDeflection(0.01);
|
||||
newMesh.addHypothesis(shape, defl);
|
||||
|
||||
SMESH_HypothesisPtr reg(new StdMeshers_Regular_1D(hyp++, 1, myGen));
|
||||
newMesh.addHypothesis(shape, reg);
|
||||
|
||||
//SMESH_HypothesisPtr sel(new StdMeshers_StartEndLength(hyp++, 1, myGen));
|
||||
//static_cast<StdMeshers_StartEndLength*>(sel.get())->SetLength(1.0, true);
|
||||
//newMesh.addHypothesis(shape, sel;
|
||||
|
||||
SMESH_HypothesisPtr qdp(new StdMeshers_QuadranglePreference(hyp++,1,myGen));
|
||||
newMesh.addHypothesis(shape, qdp);
|
||||
|
||||
SMESH_HypothesisPtr q2d(new StdMeshers_Quadrangle_2D(hyp++,1,myGen));
|
||||
newMesh.addHypothesis(shape, q2d);
|
||||
|
||||
// create mesh
|
||||
newMesh.compute();
|
||||
#endif
|
||||
#if 1 // NETGEN test
|
||||
NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true);
|
||||
|
||||
//NETGENPlugin_SimpleHypothesis_2D * tet2 = new NETGENPlugin_SimpleHypothesis_2D(hyp++,1,myGen);
|
||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetNumberOfSegments(5);
|
||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetLocalLength(0.1);
|
||||
//static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->LengthFromEdges();
|
||||
//myNetGenMesher.SetParameters(tet2);
|
||||
|
||||
//NETGENPlugin_SimpleHypothesis_3D* tet= new NETGENPlugin_SimpleHypothesis_3D(hyp++,1,myGen);
|
||||
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->LengthFromFaces();
|
||||
//static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->SetMaxElementVolume(0.1);
|
||||
//myNetGenMesher.SetParameters( tet);
|
||||
|
||||
myNetGenMesher.Compute();
|
||||
#endif
|
||||
|
||||
|
||||
|
||||
SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(newMesh.getSMesh())->GetMeshDS();
|
||||
const SMDS_MeshInfo& info = data->GetMeshInfo();
|
||||
int numNode = info.NbNodes();
|
||||
int numTria = info.NbTriangles();
|
||||
int numQuad = info.NbQuadrangles();
|
||||
int numPoly = info.NbPolygons();
|
||||
int numVolu = info.NbVolumes();
|
||||
int numTetr = info.NbTetras();
|
||||
int numHexa = info.NbHexas();
|
||||
int numPyrd = info.NbPyramids();
|
||||
int numPris = info.NbPrisms();
|
||||
int numHedr = info.NbPolyhedrons();
|
||||
|
||||
// set the value to the object
|
||||
FemMesh.setValue(newMesh);
|
||||
|
||||
|
||||
return App::DocumentObject::StdReturn;
|
||||
}
|
||||
//App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
|
||||
//{
|
||||
// Fem::FemMesh newMesh;
|
||||
//
|
||||
// Part::Feature *feat = Shape.getValue<Part::Feature*>();
|
||||
//
|
||||
//#if 0
|
||||
// TopoDS_Shape oshape = feat->Shape.getValue();
|
||||
// BRepBuilderAPI_Copy copy(oshape);
|
||||
// const TopoDS_Shape& shape = copy.Shape();
|
||||
// BRepTools::Clean(shape); // remove triangulation
|
||||
//#else
|
||||
// TopoDS_Shape shape = feat->Shape.getValue();
|
||||
//#endif
|
||||
//
|
||||
// newMesh.getSMesh()->ShapeToMesh(shape);
|
||||
// SMESH_Gen *myGen = newMesh.getGenerator();
|
||||
//
|
||||
// int hyp=0;
|
||||
//#if 0
|
||||
// SMESH_HypothesisPtr len(new StdMeshers_MaxLength(hyp++, 1, myGen));
|
||||
// static_cast<StdMeshers_MaxLength*>(len.get())->SetLength(1.0);
|
||||
// newMesh.addHypothesis(shape, len);
|
||||
//
|
||||
// SMESH_HypothesisPtr loc(new StdMeshers_LocalLength(hyp++, 1, myGen));
|
||||
// static_cast<StdMeshers_LocalLength*>(loc.get())->SetLength(1.0);
|
||||
// newMesh.addHypothesis(shape, loc);
|
||||
//
|
||||
// SMESH_HypothesisPtr area(new StdMeshers_MaxElementArea(hyp++, 1, myGen));
|
||||
// static_cast<StdMeshers_MaxElementArea*>(area.get())->SetMaxArea(1.0);
|
||||
// newMesh.addHypothesis(shape, area);
|
||||
//
|
||||
// SMESH_HypothesisPtr segm(new StdMeshers_NumberOfSegments(hyp++, 1, myGen));
|
||||
// static_cast<StdMeshers_NumberOfSegments*>(segm.get())->SetNumberOfSegments(1);
|
||||
// newMesh.addHypothesis(shape, segm);
|
||||
//
|
||||
// SMESH_HypothesisPtr defl(new StdMeshers_Deflection1D(hyp++, 1, myGen));
|
||||
// static_cast<StdMeshers_Deflection1D*>(defl.get())->SetDeflection(0.01);
|
||||
// newMesh.addHypothesis(shape, defl);
|
||||
//
|
||||
// SMESH_HypothesisPtr reg(new StdMeshers_Regular_1D(hyp++, 1, myGen));
|
||||
// newMesh.addHypothesis(shape, reg);
|
||||
//
|
||||
// //SMESH_HypothesisPtr sel(new StdMeshers_StartEndLength(hyp++, 1, myGen));
|
||||
// //static_cast<StdMeshers_StartEndLength*>(sel.get())->SetLength(1.0, true);
|
||||
// //newMesh.addHypothesis(shape, sel;
|
||||
//
|
||||
// SMESH_HypothesisPtr qdp(new StdMeshers_QuadranglePreference(hyp++,1,myGen));
|
||||
// newMesh.addHypothesis(shape, qdp);
|
||||
//
|
||||
// //SMESH_HypothesisPtr q2d(new StdMeshers_Quadrangle_2D(hyp++,1,myGen));
|
||||
// //newMesh.addHypothesis(shape, q2d);
|
||||
//
|
||||
// SMESH_HypothesisPtr h3d(new StdMeshers_Hexa_3D(hyp++,1,myGen));
|
||||
// newMesh.addHypothesis(shape, h3d);
|
||||
//
|
||||
// // create mesh
|
||||
// newMesh.compute();
|
||||
//#endif
|
||||
//#if 0 // Surface quad mesh
|
||||
// SMESH_HypothesisPtr len(new StdMeshers_MaxLength(hyp++, 1, myGen));
|
||||
// static_cast<StdMeshers_MaxLength*>(len.get())->SetLength(1.0);
|
||||
// newMesh.addHypothesis(shape, len);
|
||||
//
|
||||
// SMESH_HypothesisPtr loc(new StdMeshers_LocalLength(hyp++, 1, myGen));
|
||||
// static_cast<StdMeshers_LocalLength*>(loc.get())->SetLength(1.0);
|
||||
// newMesh.addHypothesis(shape, loc);
|
||||
//
|
||||
// SMESH_HypothesisPtr area(new StdMeshers_MaxElementArea(hyp++, 1, myGen));
|
||||
// static_cast<StdMeshers_MaxElementArea*>(area.get())->SetMaxArea(1.0);
|
||||
// newMesh.addHypothesis(shape, area);
|
||||
//
|
||||
// SMESH_HypothesisPtr segm(new StdMeshers_NumberOfSegments(hyp++, 1, myGen));
|
||||
// static_cast<StdMeshers_NumberOfSegments*>(segm.get())->SetNumberOfSegments(1);
|
||||
// newMesh.addHypothesis(shape, segm);
|
||||
//
|
||||
// SMESH_HypothesisPtr defl(new StdMeshers_Deflection1D(hyp++, 1, myGen));
|
||||
// static_cast<StdMeshers_Deflection1D*>(defl.get())->SetDeflection(0.01);
|
||||
// newMesh.addHypothesis(shape, defl);
|
||||
//
|
||||
// SMESH_HypothesisPtr reg(new StdMeshers_Regular_1D(hyp++, 1, myGen));
|
||||
// newMesh.addHypothesis(shape, reg);
|
||||
//
|
||||
// //SMESH_HypothesisPtr sel(new StdMeshers_StartEndLength(hyp++, 1, myGen));
|
||||
// //static_cast<StdMeshers_StartEndLength*>(sel.get())->SetLength(1.0, true);
|
||||
// //newMesh.addHypothesis(shape, sel;
|
||||
//
|
||||
// SMESH_HypothesisPtr qdp(new StdMeshers_QuadranglePreference(hyp++,1,myGen));
|
||||
// newMesh.addHypothesis(shape, qdp);
|
||||
//
|
||||
// SMESH_HypothesisPtr q2d(new StdMeshers_Quadrangle_2D(hyp++,1,myGen));
|
||||
// newMesh.addHypothesis(shape, q2d);
|
||||
//
|
||||
// // create mesh
|
||||
// newMesh.compute();
|
||||
//#endif
|
||||
//#if 1 // NETGEN test
|
||||
// NETGENPlugin_Mesher myNetGenMesher(newMesh.getSMesh(),shape,true);
|
||||
//
|
||||
// //NETGENPlugin_SimpleHypothesis_2D * tet2 = new NETGENPlugin_SimpleHypothesis_2D(hyp++,1,myGen);
|
||||
// //static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetNumberOfSegments(5);
|
||||
// //static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->SetLocalLength(0.1);
|
||||
// //static_cast<NETGENPlugin_SimpleHypothesis_2D*>(tet2.get())->LengthFromEdges();
|
||||
// //myNetGenMesher.SetParameters(tet2);
|
||||
//
|
||||
// //NETGENPlugin_SimpleHypothesis_3D* tet= new NETGENPlugin_SimpleHypothesis_3D(hyp++,1,myGen);
|
||||
// //static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->LengthFromFaces();
|
||||
// //static_cast<NETGENPlugin_SimpleHypothesis_3D*>(tet.get())->SetMaxElementVolume(0.1);
|
||||
// //myNetGenMesher.SetParameters( tet);
|
||||
//
|
||||
// myNetGenMesher.Compute();
|
||||
//#endif
|
||||
//
|
||||
//
|
||||
//
|
||||
// SMESHDS_Mesh* data = const_cast<SMESH_Mesh*>(newMesh.getSMesh())->GetMeshDS();
|
||||
// const SMDS_MeshInfo& info = data->GetMeshInfo();
|
||||
// int numNode = info.NbNodes();
|
||||
// int numTria = info.NbTriangles();
|
||||
// int numQuad = info.NbQuadrangles();
|
||||
// int numPoly = info.NbPolygons();
|
||||
// int numVolu = info.NbVolumes();
|
||||
// int numTetr = info.NbTetras();
|
||||
// int numHexa = info.NbHexas();
|
||||
// int numPyrd = info.NbPyramids();
|
||||
// int numPris = info.NbPrisms();
|
||||
// int numHedr = info.NbPolyhedrons();
|
||||
//
|
||||
// // set the value to the object
|
||||
// FemMesh.setValue(newMesh);
|
||||
//
|
||||
//
|
||||
// return App::DocumentObject::StdReturn;
|
||||
//}
|
||||
|
||||
//short FemMeshShapeObject::mustExecute(void) const
|
||||
//{
|
||||
@@ -240,7 +196,7 @@ App::DocumentObjectExecReturn *FemMeshShapeObject::execute(void)
|
||||
// return Py::new_reference_to(PythonObject);
|
||||
//}
|
||||
|
||||
void FemMeshShapeObject::onChanged(const Property* prop)
|
||||
{
|
||||
App::GeoFeature::onChanged(prop);
|
||||
}
|
||||
//void FemMeshShapeObject::onChanged(const Property* prop)
|
||||
//{
|
||||
// App::GeoFeature::onChanged(prop);
|
||||
//}
|
||||
|
||||
@@ -25,9 +25,7 @@
|
||||
#define Fem_FemMeshShapeObject_H
|
||||
|
||||
|
||||
#include "FemMesh.h"
|
||||
#include "FemMeshObject.h"
|
||||
#include "FemMeshProperty.h"
|
||||
|
||||
namespace Fem
|
||||
{
|
||||
@@ -45,7 +43,7 @@ public:
|
||||
//virtual const char* getViewProviderName(void) const {
|
||||
// return "FemGui::ViewProviderFemMeshShape";
|
||||
//}
|
||||
virtual App::DocumentObjectExecReturn *execute(void);
|
||||
//virtual App::DocumentObjectExecReturn *execute(void);
|
||||
|
||||
//virtual short mustExecute(void) const;
|
||||
//virtual PyObject *getPyObject(void);
|
||||
@@ -54,7 +52,7 @@ public:
|
||||
|
||||
protected:
|
||||
/// get called by the container when a property has changed
|
||||
virtual void onChanged (const App::Property* prop);
|
||||
//virtual void onChanged (const App::Property* prop);
|
||||
};
|
||||
|
||||
} //namespace Fem
|
||||
|
||||
Reference in New Issue
Block a user