Salome HOME
Merge branch 'master' into gni/adaptation
[modules/smesh.git] / src / SMDS / SMDS_Mesh.cxx
index a5af798e57899f7806fa9d0f594bbea1a6c9e927..f2aee846a6efbc854b55b3f766e3cdafa4c8d689 100644 (file)
@@ -68,7 +68,7 @@ int SMDS_Mesh::chunkSize = 1024;
  */
 //================================================================================
 
-int SMDS_Mesh::CheckMemory(const bool doNotRaise) throw (std::bad_alloc)
+int SMDS_Mesh::CheckMemory(const bool doNotRaise)
 {
   return -1;
 #if !defined WIN32 && !defined __APPLE__
@@ -831,6 +831,8 @@ SMDS_Mesh::AddPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> & nod
 {
   if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
 
+  if ( nodes.empty() )
+    throw std::invalid_argument("Polygon without nodes is forbidden");
   if ( SMDS_MeshCell* cell = myCellFactory->NewCell( ID ))
   {
     cell->init( SMDSEntity_Polygon, nodes );
@@ -874,6 +876,8 @@ SMDS_Mesh::AddQuadPolygonalFaceWithID (const std::vector<const SMDS_MeshNode*> &
                                        const int                                 ID)
 {
   if ( NbFaces() % CHECKMEMORY_INTERVAL == 0 ) CheckMemory();
+  if ( nodes.empty() )
+    throw std::invalid_argument("Polygon without nodes is forbidden");
   if ( SMDS_MeshCell* cell = myCellFactory->NewCell( ID ))
   {
     cell->init( SMDSEntity_Quad_Polygon, nodes );