Salome HOME
lot 10 - warnings for DTM - untested
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_PolylineOp.cxx
index a59af02da79c5366e2075e689443812b797250a9..9c3ffd7e27e52ea4b7fee172becc8913b0439f4f 100755 (executable)
@@ -31,6 +31,7 @@
 
 #include <CurveCreator_Curve.hxx>
 #include <CurveCreator_Displayer.hxx>
+#include <CurveCreator_Utils.hxx>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -182,8 +183,12 @@ void HYDROGUI_PolylineOp::startOperation()
           aCurveCoords.push_back( aSectPoint.Y() );
         }
 
+        Quantity_Color aColor = CurveCreator_Utils::getRandColor();      
+        QColor aQColor = CurveCreator_Utils::colorConv(aColor);
+        myEditedObject->GetSectionColor(i-1, aQColor);
+
         myCurve->addSectionInternal( aSectName.toStdString(),
-          aCurveType, aSectClosure, aCurveCoords );
+          aCurveType, aSectClosure, aCurveCoords, CurveCreator_Utils::colorConv(aQColor) );
       }
     }
     else
@@ -239,7 +244,7 @@ void HYDROGUI_PolylineOp::startOperation()
         for (int aSI = 0; aSI < aSCount; ++aSI)
         {
           myCurve->addSectionInternal((aNamePrefix + (aSI + 1)).ToCString(),
-            CurveCreator::Spline, isCloseds[aSI], aPs[aSI]);
+            CurveCreator::Spline, isCloseds[aSI], aPs[aSI], CurveCreator_Utils::getRandColor());
         }
       }
     }
@@ -353,6 +358,9 @@ bool HYDROGUI_PolylineOp::processApply( int& theUpdateFlags,
 
     aPolylineObj->AddSection( aSectName, aSectType, aSectClosure );
 
+    Quantity_Color aColor = myCurve->getColorSection(i);
+    aPolylineObj->SetSectionColor(i, CurveCreator_Utils::colorConv(aColor));
+
     // Add the points from section
     CurveCreator::Coordinates aCurveCoords = myCurve->getCoords( i );
 
@@ -374,10 +382,10 @@ bool HYDROGUI_PolylineOp::processApply( int& theUpdateFlags,
     }
   }
 
 if ( !myIsEdit )
 {
   aPolylineObj->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
 }
//if ( !myIsEdit )
//{
//  aPolylineObj->SetWireColor( HYDROData_PolylineXY::DefaultWireColor() );
//}
 
   // Update the wire of polyline
   aPolylineObj->Update();