Salome HOME
Replace oe by ?
[modules/smesh.git] / src / StdMeshers / StdMeshers_Hexa_3D.cxx
index 037a7d53abe0972fbf98fa6d6bda15e23a4c725c..de259316b69a0b1c93aced4004ea974825d40427 100644 (file)
@@ -189,7 +189,7 @@ namespace
     }
     gp_XYZ GetXYZ(int iCol, int iRow) const
     {
-      return SMESH_MeshEditor::TNodeXYZ( GetNode( iCol, iRow ));
+      return SMESH_TNodeXYZ( GetNode( iCol, iRow ));
     }
   };
 
@@ -388,7 +388,8 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
       const TopoDS_Edge& baseE = baseQuadSide->Edge( iE );
       eOri[ iE ] = baseE.Orientation();
 
-      // assure correctness of node positions on baseE
+      // assure correctness of node positions on baseE:
+      // helper.GetNodeU() will fix positions if they are wrong
       if ( SMESHDS_SubMesh* smDS = meshDS->MeshElements( baseE ))
       {
         bool ok;
@@ -422,6 +423,17 @@ bool StdMeshers_Hexa_3D::Compute(SMESH_Mesh &         aMesh,
           append( aCubeSide[i]._u2nodesMap, u2nodesMap.rbegin(), u2nodesMap.rend());
       }
     }
+    // check if the loaded grid corresponds to nb of quadrangles
+    const SMESHDS_SubMesh* faceSubMesh =
+      proxymesh ? proxymesh->GetSubMesh( F ) : meshDS->MeshElements( F );
+    const int nbQuads = faceSubMesh->NbElements();
+    const int nbHor = aCubeSide[i]._u2nodesMap.size() - 1;
+    const int nbVer = aCubeSide[i]._u2nodesMap.begin()->second.size() - 1;
+    if ( nbQuads != nbHor * nbVer )
+    {
+      SMESH_ComputeErrorPtr err = ComputePentahedralMesh(aMesh, aShape, proxymesh.get());
+      return error( err );
+    }
   }
 
   // Orient loaded grids of cube sides along axis of the unitary cube coord system