X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FNETGENPlugin%2FNETGENPlugin_Mesher.cxx;h=30215872ec357aa8e398d2274ea4f70f8af54eef;hb=8c9a6bc255efb506c3daa676f937af5b7fada5c1;hp=44535f283b569bf4d69d41ad4e76728a1aa43b88;hpb=92cbce71d361328b23d943ad87d52db9f5282c72;p=plugins%2Fnetgenplugin.git diff --git a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx index 44535f2..3021587 100644 --- a/src/NETGENPlugin/NETGENPlugin_Mesher.cxx +++ b/src/NETGENPlugin/NETGENPlugin_Mesher.cxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2022 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2023 CEA, EDF, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -76,6 +76,7 @@ #include #include +#include // Netgen include files #ifndef OCCGEOMETRY #define OCCGEOMETRY @@ -503,6 +504,8 @@ namespace } // namespace + + //============================================================================= /*! * @@ -599,6 +602,8 @@ void NETGENPlugin_Mesher::SetDefaultParameters() _fineness = NETGENPlugin_Hypothesis::GetDefaultFineness(); mparams.uselocalh = NETGENPlugin_Hypothesis::GetDefaultSurfaceCurvature(); netgen::merge_solids = NETGENPlugin_Hypothesis::GetDefaultFuseEdges(); + // Unused argument but set 0 to initialise it + mparams.elementorder = 0; #ifdef NETGEN_V6 @@ -612,6 +617,7 @@ void NETGENPlugin_Mesher::SetDefaultParameters() #endif } + //============================================================================= /*! * Pass parameters to NETGEN @@ -873,12 +879,21 @@ void NETGENPlugin_Mesher::SetLocalSizeForChordalError( netgen::OCCGeometry& occg { Standard_Integer n1,n2,n3; triangulation->Triangles()(i).Get( n1,n2,n3 ); +#if OCC_VERSION_LARGE < 0x07060000 p [0] = triangulation->Nodes()(n1).Transformed(loc).XYZ(); p [1] = triangulation->Nodes()(n2).Transformed(loc).XYZ(); p [2] = triangulation->Nodes()(n3).Transformed(loc).XYZ(); uv[0] = triangulation->UVNodes()(n1).XY(); uv[1] = triangulation->UVNodes()(n2).XY(); uv[2] = triangulation->UVNodes()(n3).XY(); +#else + p[0] = triangulation->Node(n1).Transformed(loc).XYZ(); + p[1] = triangulation->Node(n2).Transformed(loc).XYZ(); + p[2] = triangulation->Node(n3).Transformed(loc).XYZ(); + uv[0] = triangulation->UVNode(n1).XY(); + uv[1] = triangulation->UVNode(n2).XY(); + uv[2] = triangulation->UVNode(n3).XY(); +#endif surfProp.SetParameters( uv[0].X(), uv[0].Y() ); if ( !surfProp.IsCurvatureDefined() ) break; @@ -1036,7 +1051,14 @@ double NETGENPlugin_Mesher::GetDefaultMinSize(const TopoDS_Shape& geom, BRep_Tool::Triangulation ( TopoDS::Face( fExp.Current() ), loc); if ( triangulation.IsNull() ) continue; const double fTol = BRep_Tool::Tolerance( TopoDS::Face( fExp.Current() )); - const TColgp_Array1OfPnt& points = triangulation->Nodes(); +#if OCC_VERSION_HEX < 0x070600 + const TColgp_Array1OfPnt& points = triangulation->Nodes(); +#else + auto points = [&triangulation](Standard_Integer index) { + return triangulation->Node(index); + }; +#endif + const Poly_Array1OfTriangle& trias = triangulation->Triangles(); for ( int iT = trias.Lower(); iT <= trias.Upper(); ++iT ) { @@ -4420,7 +4442,7 @@ int& NETGENPlugin_NetgenLibWrapper::instanceCounter() //================================================================================ NETGENPlugin_NetgenLibWrapper::NETGENPlugin_NetgenLibWrapper(): - _ngMesh(0) + _ngMesh(0),_tmpDir(SALOMEDS_Tool::GetTmpDir()) { if ( instanceCounter() == 0 ) { @@ -4496,6 +4518,9 @@ int NETGENPlugin_NetgenLibWrapper::GenerateMesh( netgen::OCCGeometry& occgeo, if ( !ngMesh ) ngMesh = new netgen::Mesh; + // To dump mparam + // netgen::mparam.Print(std::cerr); + #ifdef NETGEN_V6 ngMesh->SetGeometry( shared_ptr( &occgeo, &NOOP_Deleter ));