From: isn Date: Fri, 11 Jan 2019 13:27:16 +0000 (+0300) Subject: refs #1847 colors assignment after merging of polylines X-Git-Tag: SH_V2_2_0~99^2~39^2~3 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7aa695599bb8d4f78ce905c54641a7bb8c5f3f22;p=modules%2Fhydro.git refs #1847 colors assignment after merging of polylines Signed-off-by: isn --- diff --git a/src/HYDROData/HYDROData_PolylineOperator.cxx b/src/HYDROData/HYDROData_PolylineOperator.cxx index 1b0c8985..fff5820a 100644 --- a/src/HYDROData/HYDROData_PolylineOperator.cxx +++ b/src/HYDROData/HYDROData_PolylineOperator.cxx @@ -173,7 +173,7 @@ bool HYDROData_PolylineOperator::Merge( const Handle( HYDROData_Document )& theD NCollection_Sequence aSectNames; NCollection_Sequence aSectTypes; NCollection_Sequence 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;