]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
#585: patch for names for result
authorasl <asl@opencascade.com>
Mon, 29 Jun 2015 12:12:56 +0000 (15:12 +0300)
committerasl <asl@opencascade.com>
Mon, 29 Jun 2015 12:12:56 +0000 (15:12 +0300)
src/HYDROData/HYDROData_PolylineOperator.cxx

index 757805c153a54f82611f58dbcb8cdc296f1fbeac..96ad9b4d459004154af5ab8ccf03f1fa08c476aa 100644 (file)
@@ -208,6 +208,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 = 
@@ -216,7 +217,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;
 }