Salome HOME
[bos #38046] [EDF] (2023-T3) allow compilation in windows.
[plugins/gmshplugin.git] / src / GMSHPlugin / GMSHPlugin_GMSH.cxx
index a0132dbde180f25686ac804142deffb92c43b0e5..a8141debd26c1463728eab9685c5b394486a773f 100644 (file)
@@ -1,5 +1,5 @@
 // Copyright (C) 2012-2015  ALNEOS
-// Copyright (C) 2016-2021  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
@@ -34,7 +34,7 @@ using namespace std;
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -53,7 +53,7 @@ GMSHPlugin_GMSH::GMSHPlugin_GMSH(int hypId, SMESH_Gen* gen)
 
 //=============================================================================
 /*!
- *  
+ *
  */
 //=============================================================================
 
@@ -64,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)
@@ -86,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() )
@@ -109,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();
 }
@@ -128,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;
 }