]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
refs #1847 colors assignment after merging of polylines
authorisn <isn@opencascade.com>
Fri, 11 Jan 2019 13:27:16 +0000 (16:27 +0300)
committerisn <isn@opencascade.com>
Fri, 11 Jan 2019 13:29:57 +0000 (16:29 +0300)
Signed-off-by: isn <isn@opencascade.com>
src/HYDROData/HYDROData_PolylineOperator.cxx

index 1b0c898544cb53d7a2110672244d657c4d983cc7..fff5820a2911a269a242fe163db466417f9faab3 100644 (file)
@@ -173,7 +173,7 @@ bool HYDROData_PolylineOperator::Merge( const Handle( HYDROData_Document )& theD
     NCollection_Sequence<TCollection_AsciiString>           aSectNames;
     NCollection_Sequence<HYDROData_PolylineXY::SectionType> aSectTypes;
     NCollection_Sequence<bool>                              aSectClosures;
-    aPolyline->GetSections( aSectNames, aSectTypes, aSectClosures );
+    aPolyline->GetSections( aSectNames, aSectTypes, aSectClosures );    
 
     for ( int i = 1, n = aSectNames.Size(); i <= n; ++i )
     {
@@ -182,7 +182,12 @@ bool HYDROData_PolylineOperator::Merge( const Handle( HYDROData_Document )& theD
       bool aSectClosure = aSectClosures.Value( i );
       aNewPolyline->AddSection(aSectName, aSectType, aSectClosure);
       HYDROData_PolylineXY::PointsList aPointsList = aPolyline->GetPoints(i-1, false);
-      aNewPolyline->SetPoints(ins++, aPointsList);
+      QColor sectColor; 
+      aPolyline->getSectionColor(i-1, sectColor);
+      aNewPolyline->SetPoints(ins, aPointsList);
+      if (sectColor.isValid())
+        aNewPolyline->setSectionColor(ins, sectColor);
+      ins++;
     }
   }
   QString aName = theName;