Porting to OCCT 7.7.0

This commit is contained in:
asozinov 2023-04-13 14:40:38 +01:00
parent 8f71164d60
commit 426282e4b0

View File

@ -76,6 +76,7 @@
#include <TopoDS.hxx> #include <TopoDS.hxx>
#include <TopoDS_Compound.hxx> #include <TopoDS_Compound.hxx>
#include <Basics_OCCTVersion.hxx>
// Netgen include files // Netgen include files
#ifndef OCCGEOMETRY #ifndef OCCGEOMETRY
#define OCCGEOMETRY #define OCCGEOMETRY
@ -876,12 +877,21 @@ void NETGENPlugin_Mesher::SetLocalSizeForChordalError( netgen::OCCGeometry& occg
{ {
Standard_Integer n1,n2,n3; Standard_Integer n1,n2,n3;
triangulation->Triangles()(i).Get( n1,n2,n3 ); triangulation->Triangles()(i).Get( n1,n2,n3 );
#if OCC_VERSION_LARGE < 0x07060000
p [0] = triangulation->Nodes()(n1).Transformed(loc).XYZ(); p [0] = triangulation->Nodes()(n1).Transformed(loc).XYZ();
p [1] = triangulation->Nodes()(n2).Transformed(loc).XYZ(); p [1] = triangulation->Nodes()(n2).Transformed(loc).XYZ();
p [2] = triangulation->Nodes()(n3).Transformed(loc).XYZ(); p [2] = triangulation->Nodes()(n3).Transformed(loc).XYZ();
uv[0] = triangulation->UVNodes()(n1).XY(); uv[0] = triangulation->UVNodes()(n1).XY();
uv[1] = triangulation->UVNodes()(n2).XY(); uv[1] = triangulation->UVNodes()(n2).XY();
uv[2] = triangulation->UVNodes()(n3).XY(); uv[2] = triangulation->UVNodes()(n3).XY();
#elif
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() ); surfProp.SetParameters( uv[0].X(), uv[0].Y() );
if ( !surfProp.IsCurvatureDefined() ) if ( !surfProp.IsCurvatureDefined() )
break; break;
@ -1039,7 +1049,14 @@ double NETGENPlugin_Mesher::GetDefaultMinSize(const TopoDS_Shape& geom,
BRep_Tool::Triangulation ( TopoDS::Face( fExp.Current() ), loc); BRep_Tool::Triangulation ( TopoDS::Face( fExp.Current() ), loc);
if ( triangulation.IsNull() ) continue; if ( triangulation.IsNull() ) continue;
const double fTol = BRep_Tool::Tolerance( TopoDS::Face( fExp.Current() )); 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(); const Poly_Array1OfTriangle& trias = triangulation->Triangles();
for ( int iT = trias.Lower(); iT <= trias.Upper(); ++iT ) for ( int iT = trias.Lower(); iT <= trias.Upper(); ++iT )
{ {