Salome HOME
bos #20256: [CEA 18523] Porting SMESH to int 64 bits occ/20256_v2 V9_7_0a1 V9_7_0a2 V9_7_0b1
authoreap <eap@opencascade.com>
Wed, 17 Mar 2021 14:43:03 +0000 (17:43 +0300)
committervsr <vsr@opencascade.com>
Mon, 19 Apr 2021 14:27:12 +0000 (17:27 +0300)
src/GHS3DPRLPlugin/GHS3DPRLPlugin_GHS3DPRL.cxx

index 1f226d0ca088b819ad47a5bd1c978f07a841882e..71ff80573c7d3ec08d5b542c04de75a3b004aefa 100644 (file)
@@ -419,7 +419,7 @@ bool GHS3DPRLPlugin_GHS3DPRL::Evaluate(SMESH_Mesh& aMesh,
                                        const TopoDS_Shape& aShape,
                                        MapShapeNbElems& aResMap)
 {
-  int nbtri = 0, nbqua = 0;
+  smIdType nbtri = 0, nbqua = 0;
   double fullArea = 0.0;
   for (TopExp_Explorer exp(aShape, TopAbs_FACE); exp.More(); exp.Next()) {
     TopoDS_Face F = TopoDS::Face( exp.Current() );
@@ -431,9 +431,9 @@ bool GHS3DPRLPlugin_GHS3DPRL::Evaluate(SMESH_Mesh& aMesh,
                                             "Submesh can not be evaluated",this));
       return false;
     }
-    std::vector<int> aVec = (*anIt).second;
-    nbtri += Max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
-    nbqua += Max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
+    std::vector<smIdType> aVec = (*anIt).second;
+    nbtri += std::max(aVec[SMDSEntity_Triangle],aVec[SMDSEntity_Quad_Triangle]);
+    nbqua += std::max(aVec[SMDSEntity_Quadrangle],aVec[SMDSEntity_Quad_Quadrangle]);
     GProp_GProps G;
     BRepGProp::SurfaceProperties(F,G);
     double anArea = G.Mass();
@@ -441,7 +441,7 @@ bool GHS3DPRLPlugin_GHS3DPRL::Evaluate(SMESH_Mesh& aMesh,
   }
 
   // collect info from edges
-  int nb0d_e = 0, nb1d_e = 0;
+  smIdType nb0d_e = 0, nb1d_e = 0;
   bool IsQuadratic = false;
   bool IsFirst = true;
   TopTools_MapOfShape tmpMap;
@@ -452,9 +452,9 @@ bool GHS3DPRLPlugin_GHS3DPRL::Evaluate(SMESH_Mesh& aMesh,
     tmpMap.Add(E);
     SMESH_subMesh *aSubMesh = aMesh.GetSubMesh(exp.Current());
     MapShapeNbElemsItr anIt = aResMap.find(aSubMesh);
-    std::vector<int> aVec = (*anIt).second;
+    std::vector<smIdType> aVec = (*anIt).second;
     nb0d_e += aVec[SMDSEntity_Node];
-    nb1d_e += Max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
+    nb1d_e += std::max(aVec[SMDSEntity_Edge],aVec[SMDSEntity_Quad_Edge]);
     if(IsFirst) {
       IsQuadratic = (aVec[SMDSEntity_Quad_Edge] > aVec[SMDSEntity_Edge]);
       IsFirst = false;
@@ -469,11 +469,11 @@ bool GHS3DPRLPlugin_GHS3DPRL::Evaluate(SMESH_Mesh& aMesh,
   double aVolume = G.Mass();
   double tetrVol = 0.1179*ELen*ELen*ELen;
   double CoeffQuality = 0.9;
-  int nbVols = (int)aVolume/tetrVol/CoeffQuality;
-  int nb1d_f = (nbtri*3 + nbqua*4 - nb1d_e) / 2;
-  int nb1d_in = (int) ( nbVols*6 - nb1d_e - nb1d_f ) / 5;
-  std::vector<int> aVec(SMDSEntity_Last);
-  for(int i=0; i<SMDSEntity_Last; i++) aVec[i]=0;
+  smIdType nbVols = (smIdType)aVolume/tetrVol/CoeffQuality;
+  smIdType nb1d_f = (nbtri*3 + nbqua*4 - nb1d_e) / 2;
+  smIdType nb1d_in = (smIdType) ( nbVols*6 - nb1d_e - nb1d_f ) / 5;
+  std::vector<smIdType> aVec(SMDSEntity_Last);
+  for(smIdType i=0; i<SMDSEntity_Last; i++) aVec[i]=0;
   if( IsQuadratic ) {
     aVec[SMDSEntity_Node] = nb1d_in/6 + 1 + nb1d_in;
     aVec[SMDSEntity_Quad_Tetra] = nbVols - nbqua*2;