From bd1739213eac9b954d69192c3c2067413efccc85 Mon Sep 17 00:00:00 2001 From: imn Date: Mon, 13 Apr 2015 11:10:01 +0300 Subject: [PATCH] INT PAL 0052656: Plot2D Viewer: add possibility to change curve type of analytical curves --- src/Plot2d/Plot2d_AnalyticalCurve.h | 3 ++- src/Plot2d/Plot2d_ViewFrame.cxx | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/Plot2d/Plot2d_AnalyticalCurve.h b/src/Plot2d/Plot2d_AnalyticalCurve.h index bb74280cb..8d7d0e56a 100755 --- a/src/Plot2d/Plot2d_AnalyticalCurve.h +++ b/src/Plot2d/Plot2d_AnalyticalCurve.h @@ -30,6 +30,7 @@ class QwtPlot; class QwtPlotItem; +class QwtPlotCurve; class PLOT2D_EXPORT Plot2d_AnalyticalCurve @@ -131,7 +132,7 @@ protected: QString myName; int myAction; int myState; - QwtPlotItem* myCurve; + QwtPlotCurve* myCurve; bool myActive; bool myIsSelected; diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index 032627fec..db3e2acc5 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -1988,6 +1988,13 @@ void Plot2d_ViewFrame::setCurveType( int curveType, bool update ) if ( crv ) setCurveType( crv, myCurveType ); } + for(int i=0 ; i < myAnalyticalCurves.count(); i++) { + QwtPlotCurve* aPCurve = dynamic_cast( myAnalyticalCurves[i]->plotItem() ); + Plot2d_AnalyticalCurve* aCurve = dynamic_cast( myAnalyticalCurves[i] ); + if ( aPCurve && aCurve ) { + setCurveType( aPCurve, myCurveType ); + } + } if ( update ) myPlot->replot(); emit vpCurveChanged(); -- 2.39.2