]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
Merge branch 'BR_v14_rc' of ssh://git.salome-platform.org/modules/hydro into BR_v14_rc
authorasl <asl@opencascade.com>
Mon, 29 Jun 2015 13:29:17 +0000 (16:29 +0300)
committerasl <asl@opencascade.com>
Mon, 29 Jun 2015 13:29:17 +0000 (16:29 +0300)
src/HYDROData/HYDROData_PolylineOperator.cxx
src/HYDROGUI/HYDROGUI_SplitPolylinesDlg.cxx

index f95789d6f5bcd981f9ff98df66abc1c390558189..ed7a4a93fe558a958bbe7a5d2476eb3540fd11ce 100644 (file)
@@ -511,6 +511,7 @@ bool HYDROData_PolylineOperator::CreatePolylines( const Handle( HYDROData_Docume
     return false;
 
   int n = theShapes.size();
+  int anIndex = 1;
   for( int i=0; i<n; i++ )
   {
     Handle( HYDROData_PolylineXY ) aPolyline = 
@@ -519,7 +520,18 @@ bool HYDROData_PolylineOperator::CreatePolylines( const Handle( HYDROData_Docume
       return false;
 
     aPolyline->SetShape( theShapes[i] );
-    //TODO: set name
+
+    if( isUseIndices )
+    {
+      QString aNewName = theNamePrefix + "_" + QString::number( anIndex );
+      if( theDoc->FindObjectByName( aNewName ).IsNull() )  // the object with such a name is not found
+        aPolyline->SetName( aNewName );
+      anIndex++;
+    }
+    else
+    {
+      aPolyline->SetName( theNamePrefix );
+    }
   }
   return true;
 }
index aa70371aac72b4a49798d1c8e364e2146979724c..58699e13bb53f902b7d5d6d24a066c6f022e22c7 100644 (file)
@@ -149,6 +149,7 @@ void HYDROGUI_SplitPolylinesDlg::setPolylinesFromSelection()
 {
   myMainPolyline1->reset();
   myMainPolyline2->reset();
+  myToolPolyline->reset();
   myPolylines->reset();
 
   Handle( HYDROData_Entity ) anObject = HYDROGUI_Tool::GetSelectedObject( module() );