From a1867b176749f547ac17e88707e6fb6cd8da8655 Mon Sep 17 00:00:00 2001 From: ouv Date: Tue, 29 Dec 2015 11:18:25 +0300 Subject: [PATCH] DIAGRAM 0000564: External 560: Manual graphic parametrization should be permanent and graphics should be saved in .hdf --- src/Plot2d/Plot2d_ViewFrame.cxx | 15 +++++++++++++++ src/Plot2d/Plot2d_ViewFrame.h | 7 ++++++- src/Qtx/QtxWorkstack.cxx | 23 +++++++++++++++++++++++ src/Qtx/QtxWorkstack.h | 1 + 4 files changed, 45 insertions(+), 1 deletion(-) diff --git a/src/Plot2d/Plot2d_ViewFrame.cxx b/src/Plot2d/Plot2d_ViewFrame.cxx index b591d7274..329127cb0 100755 --- a/src/Plot2d/Plot2d_ViewFrame.cxx +++ b/src/Plot2d/Plot2d_ViewFrame.cxx @@ -229,6 +229,8 @@ Plot2d_ViewFrame::Plot2d_ViewFrame( QWidget* parent, const QString& title ) myYDistance2 = yMap2.s2() - yMap2.s1(); } myPlot->canvas()->installEventFilter( this ); + + connect( myPlot, SIGNAL( plotZoomed() ), this, SIGNAL( manualTransformationApplied() ) ); } /*! Destructor @@ -864,6 +866,8 @@ void Plot2d_ViewFrame::fitAll() myPlot->setAxisScale( QwtPlot::yRight, yMap2.s1(), yMap2.s2() ); } myPlot->replot(); + + emit fitAllApplied(); } /*! @@ -891,6 +895,8 @@ void Plot2d_ViewFrame::fitArea( const QRect& area ) myPlot->invTransform( QwtPlot::xBottom, rect.left() ), myPlot->invTransform( QwtPlot::xBottom, rect.right() ) ); myPlot->replot(); + + emit manualTransformationApplied(); } /*! @@ -909,6 +915,8 @@ void Plot2d_ViewFrame::fitData(const int mode, if ( mode == 0 || mode == 1 ) myPlot->setAxisScale( QwtPlot::xBottom, xMin, xMax ); myPlot->replot(); + + emit manualTransformationApplied(); } /*! @@ -1731,6 +1739,7 @@ void Plot2d_ViewFrame::plotMousePressed( const QMouseEvent& me ) myPlot->invTransform( QwtPlot::yRight, myPnt.y() ) - myYDistance2/2, myPlot->invTransform( QwtPlot::yRight, myPnt.y() ) + myYDistance2/2 ); myPlot->replot(); + emit manualTransformationApplied(); } } else { @@ -2216,6 +2225,8 @@ Plot2d_Plot2d::Plot2d_Plot2d( QWidget* parent ) canvas()->setMouseTracking( true ); myPlotZoomer->setEnabled( true ); + + connect( myPlotZoomer, SIGNAL( zoomed( const QwtDoubleRect& ) ), this, SIGNAL( plotZoomed() ) ); } /*! @@ -2793,6 +2804,8 @@ void Plot2d_ViewFrame::incrementalPan( const int incrX, const int incrY ) { myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() )-incrY ) ); } myPlot->replot(); + + emit manualTransformationApplied(); } /*! @@ -2812,6 +2825,8 @@ void Plot2d_ViewFrame::incrementalZoom( const int incrX, const int incrY ) { myPlot->invTransform( QwtPlot::yRight, y2Map.transform( y2Map.s2() ) + incrY ) ); } myPlot->replot(); + + emit manualTransformationApplied(); } #define INCREMENT_FOR_OP 10 diff --git a/src/Plot2d/Plot2d_ViewFrame.h b/src/Plot2d/Plot2d_ViewFrame.h index e30ea6139..dd7021107 100755 --- a/src/Plot2d/Plot2d_ViewFrame.h +++ b/src/Plot2d/Plot2d_ViewFrame.h @@ -204,7 +204,9 @@ signals: void yRangeUpdated( const double&, const double&, const double&, const double&); void bothRangesUpdated( const double&, const double&, const double&, const double&, const double&, const double& ); - + void manualTransformationApplied(); + void fitAllApplied(); + protected: Plot2d_Plot2d* myPlot; int myOperation; @@ -291,6 +293,9 @@ public slots: protected: bool existMarker( const QwtSymbol::Style typeMarker, const QColor& color, const Qt::PenStyle typeLine ); +signals: + void plotZoomed(); + protected: CurveDict myCurves; QwtPlotGrid* myGrid; diff --git a/src/Qtx/QtxWorkstack.cxx b/src/Qtx/QtxWorkstack.cxx index fffc0f996..4a9fefc0a 100644 --- a/src/Qtx/QtxWorkstack.cxx +++ b/src/Qtx/QtxWorkstack.cxx @@ -3235,6 +3235,29 @@ bool QtxWorkstack::move( QWidget* wid, QWidget* wid_to, const bool before ) return false; } +/*! + \brief Moves the widget to the end of its area + \param wid widget to be moved + \return TRUE if operation is completed successfully, FALSE otherwise +*/ +bool QtxWorkstack::moveToEnd( QWidget* wid ) +{ + if ( wid ) + { + QtxWorkstackArea* area = wgArea( wid ); + if ( area ) + { + // find index of the second widget + QWidgetList wgList = area->widgetList(); + int idx = wgList.count(); + area->removeWidget( wid, true ); + area->insertWidget( wid, idx ); + return true; + } + } + return false; +} + /*! \brief Group all windows in one area \return TRUE if operation is completed successfully, FALSE otherwise diff --git a/src/Qtx/QtxWorkstack.h b/src/Qtx/QtxWorkstack.h index 757e3c801..02b449841 100644 --- a/src/Qtx/QtxWorkstack.h +++ b/src/Qtx/QtxWorkstack.h @@ -88,6 +88,7 @@ public: void split( const int ); bool move( QWidget* wid, QWidget* wid_to, const bool before ); + bool moveToEnd( QWidget* wid ); void stack(); QWidget* addWindow( QWidget*, Qt::WindowFlags = 0 ); -- 2.39.2