Skip to content

Commit

Permalink
SMESH: port to OCCT 7.6
Browse files Browse the repository at this point in the history
  • Loading branch information
wwmayer committed Oct 10, 2021
1 parent 51e4366 commit 6f3b00d
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 3 deletions.
Expand Up @@ -56,6 +56,7 @@
#include <NCollection_Map.hxx>
#include <Standard_ErrorHandler.hxx>
#include <Standard_ProgramError.hxx>
#include <Standard_Version.hxx>
#include <TColStd_MapOfInteger.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
Expand Down Expand Up @@ -700,7 +701,13 @@ 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() ));
#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 )
{
Expand Down
7 changes: 5 additions & 2 deletions src/3rdParty/salomesmesh/src/SMESH/SMESH_MeshAlgos.cpp
Expand Up @@ -38,10 +38,13 @@
#include <GC_MakeSegment.hxx>
#include <GeomAPI_ExtremaCurveCurve.hxx>
#include <Geom_Line.hxx>
#include <IntAna_IntConicQuad.hxx>
#include <IntAna_Quadric.hxx>
#include <gp_Cone.hxx>
#include <gp_Cylinder.hxx>
#include <gp_Lin.hxx>
#include <gp_Pln.hxx>
#include <gp_Sphere.hxx>
#include <IntAna_IntConicQuad.hxx>
#include <IntAna_Quadric.hxx>

#include <limits>
#include <numeric>
Expand Down
14 changes: 14 additions & 0 deletions src/3rdParty/salomesmesh/src/StdMeshers/StdMeshers_Adaptive1D.cpp
Expand Up @@ -46,6 +46,7 @@
#include <Poly_Array1OfTriangle.hxx>
#include <Poly_PolygonOnTriangulation.hxx>
#include <Poly_Triangulation.hxx>
#include <Standard_Version.hxx>
#include <TColgp_Array1OfPnt.hxx>
#include <TopExp.hxx>
#include <TopExp_Explorer.hxx>
Expand Down Expand Up @@ -318,13 +319,26 @@ namespace // internal utils
{
myFaceTol = SMESH_MesherHelper::MaxTolerance( face );
myTree = triaTree;
#if OCC_VERSION_HEX < 0x070600
myNodes = & tr->Nodes();
#else
TColgp_Array1OfPnt* trNodes = new TColgp_Array1OfPnt( 1, tr->NbNodes() );
for (Standard_Integer i = myNodes->Lower(); i <= myNodes->Upper(); i++)
{
trNodes->SetValue(i, tr->Node(i));
}
myNodes = trNodes;
myOwnNodes = true;
#endif
myPolyTrias = & tr->Triangles();
myTriasDeflection = tr->Deflection();
if ( !loc.IsIdentity() ) // transform nodes if necessary
{
TColgp_Array1OfPnt* trsfNodes = new TColgp_Array1OfPnt( myNodes->Lower(), myNodes->Upper() );
trsfNodes->Assign( *myNodes );
#if OCC_VERSION_HEX >= 0x070600
delete myNodes; // it's already a copy
#endif
myNodes = trsfNodes;
myOwnNodes = true;
const gp_Trsf& trsf = loc;
Expand Down
Expand Up @@ -50,7 +50,7 @@
#include <Geom_Surface.hxx>
#include <NCollection_DefineArray2.hxx>
#include <Precision.hxx>
#include <Quantity_Parameter.hxx>
#include <Standard_Real.hxx>
#include <TColStd_SequenceOfInteger.hxx>
#include <TColStd_SequenceOfReal.hxx>
#include <TColgp_SequenceOfXY.hxx>
Expand Down
Expand Up @@ -44,7 +44,10 @@
#include "SMESH_subMeshEventListener.hxx"
#include "StdMeshers_FaceSide.hxx"

#include <Standard_Version.hxx>
#if OCC_VERSION_HEX < 0x070600
#include <Adaptor3d_HSurface.hxx>
#endif
#include <BRepAdaptor_Curve2d.hxx>
#include <BRepAdaptor_Surface.hxx>
#include <BRepLProp_SLProps.hxx>
Expand Down Expand Up @@ -1340,8 +1343,13 @@ namespace VISCOUS_3D
//case GeomAbs_SurfaceOfExtrusion:
case GeomAbs_OffsetSurface:
{
#if OCC_VERSION_HEX < 0x070600
Handle(Adaptor3d_HSurface) base = surface.BasisSurface();
return getRovolutionAxis( base->Surface(), axis );
#else
Handle(Adaptor3d_Surface) base = surface.BasisSurface();
return getRovolutionAxis( *base, axis );
#endif
}
default: return false;
}
Expand Down

0 comments on commit 6f3b00d

Please sign in to comment.