Changeset 11158 in ntrip for trunk/BNC/qwt/qwt_plot_rescaler.h
- Timestamp:
- Nov 3, 2026, 10:53:35 AM (3 weeks ago)
- File:
-
- 1 edited
-
trunk/BNC/qwt/qwt_plot_rescaler.h (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/BNC/qwt/qwt_plot_rescaler.h
r9383 r11158 1 /* -*- mode: C++ ; c-file-style: "stroustrup" -*-*****************************1 /****************************************************************************** 2 2 * Qwt Widget Library 3 3 * Copyright (C) 1997 Josef Wilgen … … 9 9 10 10 #ifndef QWT_PLOT_RESCALER_H 11 #define QWT_PLOT_RESCALER_H 111 #define QWT_PLOT_RESCALER_H 12 12 13 13 #include "qwt_global.h" 14 #include "qwt_interval.h"15 14 #include "qwt_plot.h" 15 16 16 #include <qobject.h> 17 17 18 18 class QwtPlot; 19 class QwtInterval; 19 20 class QResizeEvent; 20 21 … … 24 25 QwtPlotRescaler auto adjusts the axes of a QwtPlot according 25 26 to fixed aspect ratios. 26 */ 27 */ 27 28 28 class QWT_EXPORT QwtPlotRescaler: public QObject 29 class QWT_EXPORT QwtPlotRescaler : public QObject 29 30 { 30 public: 31 Q_OBJECT 32 33 public: 31 34 /*! 32 The rescale policy defines how to rescale the reference axis and 33 their depending axes. 35 The rescale policy defines how to rescale the reference axis and 36 their depending axes. 34 37 35 \sa ExpandingDirection, setIntervalHint() 36 */ 38 \sa ExpandingDirection, setIntervalHint() 39 */ 37 40 enum RescalePolicy 38 41 { 39 42 /*! 40 The interval of the reference axis remains unchanged, when the 41 geometry of the canvas changes. All other axes 42 will be adjusted according to their aspect ratio. 43 The interval of the reference axis remains unchanged, when the 44 geometry of the canvas changes. All other axes 45 will be adjusted according to their aspect ratio. 43 46 */ 44 47 Fixed, 45 48 46 49 /*! 47 The interval of the reference axis will be shrunk/expanded, 48 when the geometry of the canvas changes. All other axes 49 will be adjusted according to their aspect ratio. 50 The interval of the reference axis will be shrunk/expanded, 51 when the geometry of the canvas changes. All other axes 52 will be adjusted according to their aspect ratio. 50 53 51 The interval, that is represented by one pixel is fixed. 54 The interval, that is represented by one pixel is fixed. 52 55 53 56 */ … … 55 58 56 59 /*! 57 The intervals of the axes are calculated, so that all axes include 58 their interval hint. 60 The intervals of the axes are calculated, so that all axes include 61 their interval hint. 59 62 */ 60 63 Fitting … … 77 80 }; 78 81 79 explicit QwtPlotRescaler( QWidget *canvas,80 intreferenceAxis = QwtPlot::xBottom,82 explicit QwtPlotRescaler( QWidget* canvas, 83 QwtAxisId referenceAxis = QwtAxis::XBottom, 81 84 RescalePolicy = Expanding ); 82 85 … … 90 93 91 94 void setExpandingDirection( ExpandingDirection ); 92 void setExpandingDirection( int axis, ExpandingDirection );93 ExpandingDirection expandingDirection( int axis) const;95 void setExpandingDirection( QwtAxisId, ExpandingDirection ); 96 ExpandingDirection expandingDirection( QwtAxisId ) const; 94 97 95 void setReferenceAxis( int axis);96 intreferenceAxis() const;98 void setReferenceAxis( QwtAxisId ); 99 QwtAxisId referenceAxis() const; 97 100 98 101 void setAspectRatio( double ratio ); 99 void setAspectRatio( int axis, double ratio );100 double aspectRatio( int axis) const;102 void setAspectRatio( QwtAxisId, double ratio ); 103 double aspectRatio( QwtAxisId ) const; 101 104 102 void setIntervalHint( int axis, const QwtInterval& );103 QwtInterval intervalHint( int axis) const;105 void setIntervalHint( QwtAxisId, const QwtInterval& ); 106 QwtInterval intervalHint( QwtAxisId ) const; 104 107 105 QWidget *canvas();106 const QWidget *canvas() const;108 QWidget* canvas(); 109 const QWidget* canvas() const; 107 110 108 QwtPlot *plot();109 const QwtPlot *plot() const;111 QwtPlot* plot(); 112 const QwtPlot* plot() const; 110 113 111 virtual bool eventFilter( QObject *, QEvent* );114 virtual bool eventFilter( QObject*, QEvent* ) QWT_OVERRIDE; 112 115 113 116 void rescale() const; 114 117 115 protected: 116 virtual void canvasResizeEvent( QResizeEvent * );118 protected: 119 virtual void canvasResizeEvent( QResizeEvent* ); 117 120 118 virtual void rescale( const QSize &oldSize, const QSize&newSize ) const;121 virtual void rescale( const QSize& oldSize, const QSize& newSize ) const; 119 122 virtual QwtInterval expandScale( 120 int axis, const QSize&oldSize, const QSize&newSize ) const;123 QwtAxisId, const QSize& oldSize, const QSize& newSize ) const; 121 124 122 125 virtual QwtInterval syncScale( 123 int axis, const QwtInterval& reference, 124 const QSize &size ) const; 126 QwtAxisId, const QwtInterval& reference, const QSize& size ) const; 125 127 126 128 virtual void updateScales( 127 QwtInterval intervals[Qwt Plot::axisCnt] ) const;129 QwtInterval intervals[QwtAxis::AxisPositions] ) const; 128 130 129 Qt::Orientation orientation( int axis) const;130 QwtInterval interval( int axis) const;131 QwtInterval expandInterval( const QwtInterval &,131 Qt::Orientation orientation( QwtAxisId ) const; 132 QwtInterval interval( QwtAxisId ) const; 133 QwtInterval expandInterval( const QwtInterval&, 132 134 double width, ExpandingDirection ) const; 133 135 134 private: 135 double pixelDist( int axis, const QSize& ) const;136 private: 137 double pixelDist( QwtAxisId, const QSize& ) const; 136 138 137 139 class AxisData; 138 140 class PrivateData; 139 PrivateData *d_data;141 PrivateData* m_data; 140 142 }; 141 143
Note:
See TracChangeset
for help on using the changeset viewer.
