Salome HOME
Porting to OCCT 7.8.0
[modules/smesh.git] / src / StdMeshers / StdMeshers_Projection_2D.cxx
index 494989655917c4b505ad4df7df72da684b394554..b73b3a0fe54d44ddd80eb78a98058443f5cef85b 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2021  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  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
@@ -45,6 +45,7 @@
 #include <SMESH_Comment.hxx>
 #include <SMESH_Gen.hxx>
 #include <SMESH_Mesh.hxx>
+#include <SMESH_SequentialMesh.hxx>
 #include <SMESH_MeshAlgos.hxx>
 #include <SMESH_MeshEditor.hxx>
 #include <SMESH_MesherHelper.hxx>
 #include <GeomAPI_ExtremaCurveCurve.hxx>
 #include <GeomAPI_ProjectPointOnSurf.hxx>
 #include <GeomAdaptor_Curve.hxx>
+#include <GeomAdaptor_Surface.hxx>
+
+#include <Basics_OCCTVersion.hxx>
+
+#if OCC_VERSION_LARGE < 0x07070000
 #include <GeomAdaptor_HCurve.hxx>
 #include <GeomAdaptor_HSurface.hxx>
-#include <GeomAdaptor_Surface.hxx>
+#endif
+
 #include <GeomLib_IsPlanarSurface.hxx>
 #include <Geom_Line.hxx>
 #include <IntCurveSurface_HInter.hxx>
@@ -318,7 +325,7 @@ namespace {
       break;
     }
     case TopAbs_EDGE: {
-      
+
       // Get submeshes of sub-vertices
       const map< int, SMESH_subMesh * >& subSM = sm->DependsOn();
       if ( subSM.size() != 2 )
@@ -705,7 +712,7 @@ namespace {
     while ( elemIt->more() ) // loop on all mesh faces on srcFace
     {
       const SMDS_MeshElement* elem = elemIt->next();
-      const int nbN = elem->NbCornerNodes(); 
+      const int nbN = elem->NbCornerNodes();
       tgtNodes.resize( nbN );
       helper->SetElementsOnShape( false );
       for ( int i = 0; i < nbN; ++i ) // loop on nodes of the source element
@@ -1090,7 +1097,7 @@ namespace {
    */
   //================================================================================
 
-  struct QuadMesh : public SMESH_Mesh
+  struct QuadMesh : public SMESH_SequentialMesh
   {
     ObjectPool< TriaCoordSys > _traiLCSPool;
     SMESH_ElementSearcher*     _elemSearcher;
@@ -1422,7 +1429,7 @@ namespace {
     //   const SMDS_MeshElement* elem = elemIt->next();
     //   TFaceConn& tgtNodes = newFacesVec[ iFaceSrc++ ];
 
-    //   const int nbN = elem->NbCornerNodes(); 
+    //   const int nbN = elem->NbCornerNodes();
     //   tgtNodes.resize( nbN );
     //   for ( int i = 0; i < nbN; ++i ) // loop on nodes of the source element
     //   {
@@ -1436,7 +1443,7 @@ namespace {
     //       {
     //         tgtNodeOrXY.first = srcN_tgtN->second; // tgt node exists
     //       }
-    //       else 
+    //       else
     //       {
     //         // find XY of src node within the quadrilateral srcFace
     //         if ( !block.ComputeParameters( SMESH_TNodeXYZ( srcNode ),
@@ -1883,8 +1890,13 @@ namespace {
     SMESHDS_Mesh* tgtMeshDS = tgtMesh->GetMeshDS();
 
     Handle(Geom_Surface)             tgtSurface = BRep_Tool::Surface( theTgtFace );
+#if OCC_VERSION_LARGE < 0x07070000
     Handle(GeomAdaptor_HSurface) tgtSurfAdaptor = new GeomAdaptor_HSurface( tgtSurface );
     Handle(GeomAdaptor_HCurve)    piercingCurve = new GeomAdaptor_HCurve( thePiercingLine );
+#else
+    Handle(GeomAdaptor_Surface) tgtSurfAdaptor = new GeomAdaptor_Surface( tgtSurface );
+    Handle(GeomAdaptor_Curve)    piercingCurve = new GeomAdaptor_Curve( thePiercingLine );
+#endif
     IntCurveSurface_HInter intersect;
 
     SMESH_MesherHelper* srcHelper = theSrcWires[0]->FaceHelper();
@@ -2507,9 +2519,8 @@ bool StdMeshers_Projection_2D::Compute(SMESH_Mesh& theMesh, const TopoDS_Shape&
       TAssocTool::Morph morph( srcWires );
       morph.Perform( helper, tgtWires, helper.GetSurface( tgtFace ),
                      _src2tgtNodes, /*moveAll=*/true );
-#ifdef _DEBUG_
-      cout << "StdMeshers_Projection_2D: Projection mesh IsDistorted2D() ==> do morph" << endl;
-#endif
+      if(SALOME::VerbosityActivated())
+        cout << "StdMeshers_Projection_2D: Projection mesh IsDistorted2D() ==> do morph" << endl;
 
       if ( !fixDistortedFaces( helper, tgtWires )) // smooth and check
         return error("Invalid mesh generated");