Salome HOME
[bos #38046] [EDF] (2023-T3) allow compilation in windows.
[plugins/gmshplugin.git] / src / GMSHPlugin / GMSHPlugin_GMSH.cxx
index 9c183d9fd819421ac5a088262e20e95872abb1c3..a8141debd26c1463728eab9685c5b394486a773f 100644 (file)
@@ -1,10 +1,10 @@
 // Copyright (C) 2012-2015  ALNEOS
-// Copyright (C) 2016-2019  EDF R&D
+// Copyright (C) 2016-2023  EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 // License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 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
@@ -16,6 +16,7 @@
 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
 // See http://www.alneos.com/ or email : contact@alneos.fr
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 #include "GMSHPlugin_GMSH.hxx"
 #include "GMSHPlugin_Hypothesis.hxx"
@@ -33,7 +34,7 @@ using namespace std;
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -52,7 +53,7 @@ GMSHPlugin_GMSH::GMSHPlugin_GMSH(int hypId, SMESH_Gen* gen)
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -63,19 +64,18 @@ GMSHPlugin_GMSH::~GMSHPlugin_GMSH()
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
-bool GMSHPlugin_GMSH::CheckHypothesis
-                         (SMESH_Mesh& aMesh,
-                          const TopoDS_Shape& aShape,
-                          SMESH_Hypothesis::Hypothesis_Status& aStatus)
+bool GMSHPlugin_GMSH::CheckHypothesis (SMESH_Mesh&                          aMesh,
+                                       const TopoDS_Shape&                  aShape,
+                                       SMESH_Hypothesis::Hypothesis_Status& aStatus)
 {
   MESSAGE("GMSHPlugin_GMSH::CheckHypothesis");
-  
+
   _hypothesis = NULL;
-  
+
   const list<const SMESHDS_Hypothesis*>& hyps = GetUsedHypothesis(aMesh, aShape);
   int nbHyp = hyps.size();
   if (!nbHyp)
@@ -85,7 +85,7 @@ bool GMSHPlugin_GMSH::CheckHypothesis
   }
   // use only the first hypothesis
   const SMESHDS_Hypothesis* theHyp = hyps.front();
-  
+
   string hypName = theHyp->GetName();
   if ( find( _compatibleHypothesis.begin(), _compatibleHypothesis.end(),
              hypName ) != _compatibleHypothesis.end() )
@@ -108,9 +108,9 @@ bool GMSHPlugin_GMSH::CheckHypothesis
 //=============================================================================
 
 bool GMSHPlugin_GMSH::Compute(SMESH_Mesh&         aMesh,
-                                       const TopoDS_Shape& aShape)
+                              const TopoDS_Shape& aShape)
 {
-  GMSHPlugin_Mesher mesher(&aMesh, aShape);
+  GMSHPlugin_Mesher mesher(&aMesh, aShape,/*2d=*/false, false);
   mesher.SetParameters(dynamic_cast<const GMSHPlugin_Hypothesis*>(_hypothesis));
   return mesher.Compute();
 }
@@ -127,15 +127,15 @@ void GMSHPlugin_GMSH::CancelCompute()
 //=============================================================================
 
 bool GMSHPlugin_GMSH::Evaluate(SMESH_Mesh&         aMesh,
-                                        const TopoDS_Shape& aShape,
-                                        MapShapeNbElems& aResMap)
+                               const TopoDS_Shape& aShape,
+                               MapShapeNbElems& aResMap)
 {
-  std::vector<int> aResVec(SMDSEntity_Last);
-  for(int i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
+  std::vector<smIdType> aResVec(SMDSEntity_Last);
+  for(smIdType i=SMDSEntity_Node; i<SMDSEntity_Last; i++) aResVec[i] = 0;
   SMESH_subMesh * sm = aMesh.GetSubMesh(aShape);
   aResMap.insert(std::make_pair(sm,aResVec));
   SMESH_ComputeErrorPtr& smError = sm->GetComputeError();
   smError.reset( new SMESH_ComputeError(COMPERR_ALGO_FAILED,"Evaluation is not implemented",this));
-  
+
   return true;
 }