Salome HOME
Merge branch 'BR_v14_rc' of ssh://git.salome-platform.org/modules/hydro into BR_v14_rc
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_LandCoverOp.cxx
index 5240b42d86bdcbdbcd2879078db995073d854b55..00b32548846d5db87d1f9a82b87997da5af6e189 100644 (file)
@@ -189,17 +189,25 @@ bool HYDROGUI_LandCoverOp::processApply( int& theUpdateFlags,
     }
   }
 
+  if ( aZonePolylines.IsEmpty() )
+  {
+    theErrorMsg = tr( "POLYLINES_NOT_DEFINED" );
+    return false;
+  }
+
   QString aSelectedStricklerType = aPanel->getSelectedAdditionalParamName();
   
-  // TODO: Generate TopoDS_Shape based on the set of polylines, implement generateTopShape data model method
-  /*
-  if ( HYDROData_LandCover::generateTopShape( aZonePolylines ).IsNull() )
+  TCollection_AsciiString anError;
+  if ( HYDROData_LandCover::buildShape( aZonePolylines, anError ).IsNull() )
   {
-    theErrorMsg = tr( "ZONE_OBJECT_CANNOT_BE_CREATED" );
+    if ( !anError.IsEmpty() ) {
+      theErrorMsg = HYDROGUI_Tool::ToQString( anError );
+    } else {
+      theErrorMsg = tr( "LAND_COVER_OBJECT_CANNOT_BE_CREATED" );
+    }
     return false;
   }
-  */
-
+  
   Handle(HYDROData_LandCover) aZoneObj = myIsEdit ? myEditedObject :
     Handle(HYDROData_LandCover)::DownCast( doc()->CreateObject( KIND_LAND_COVER ) );