Changeset View
Changeset View
Standalone View
Standalone View
src/KChart/Cartesian/KChartCartesianCoordinatePlane.h
Show First 20 Lines • Show All 41 Lines • ▼ Show 20 Line(s) | 25 | namespace KChart { | |||
---|---|---|---|---|---|
42 | 42 | | |||
43 | friend class CartesianAxis; | 43 | friend class CartesianAxis; | ||
44 | friend class CartesianGrid; | 44 | friend class CartesianGrid; | ||
45 | 45 | | |||
46 | public: | 46 | public: | ||
47 | explicit CartesianCoordinatePlane ( Chart* parent = nullptr ); | 47 | explicit CartesianCoordinatePlane ( Chart* parent = nullptr ); | ||
48 | ~CartesianCoordinatePlane(); | 48 | ~CartesianCoordinatePlane(); | ||
49 | 49 | | |||
50 | void addDiagram ( AbstractDiagram* diagram ) Q_DECL_OVERRIDE; | 50 | void addDiagram ( AbstractDiagram* diagram ) override; | ||
51 | 51 | | |||
52 | /** | 52 | /** | ||
53 | * If @p onOff is true, enforce that X and Y distances are scaled by the same factor. | 53 | * If @p onOff is true, enforce that X and Y distances are scaled by the same factor. | ||
54 | * This makes the plane's height a function of its width, and hasHeightForWidth() | 54 | * This makes the plane's height a function of its width, and hasHeightForWidth() | ||
55 | * will return true. | 55 | * will return true. | ||
56 | */ | 56 | */ | ||
57 | void setIsometricScaling ( bool onOff ); | 57 | void setIsometricScaling ( bool onOff ); | ||
58 | 58 | | |||
59 | bool doesIsometricScaling() const; | 59 | bool doesIsometricScaling() const; | ||
60 | 60 | | |||
61 | const QPointF translate ( const QPointF& diagramPoint ) const Q_DECL_OVERRIDE; | 61 | const QPointF translate ( const QPointF& diagramPoint ) const override; | ||
62 | 62 | | |||
63 | /** | 63 | /** | ||
64 | * \sa setZoomFactorX, setZoomCenter | 64 | * \sa setZoomFactorX, setZoomCenter | ||
65 | */ | 65 | */ | ||
66 | qreal zoomFactorX() const Q_DECL_OVERRIDE; | 66 | qreal zoomFactorX() const override; | ||
67 | /** | 67 | /** | ||
68 | * \sa setZoomFactorY, setZoomCenter | 68 | * \sa setZoomFactorY, setZoomCenter | ||
69 | */ | 69 | */ | ||
70 | qreal zoomFactorY() const Q_DECL_OVERRIDE; | 70 | qreal zoomFactorY() const override; | ||
71 | 71 | | |||
72 | /** | 72 | /** | ||
73 | * \sa setZoomFactorX,setZoomFactorY | 73 | * \sa setZoomFactorX,setZoomFactorY | ||
74 | */ | 74 | */ | ||
75 | void setZoomFactors( qreal factorX, qreal factorY ) Q_DECL_OVERRIDE; | 75 | void setZoomFactors( qreal factorX, qreal factorY ) override; | ||
76 | /** | 76 | /** | ||
77 | * \sa zoomFactorX, setZoomCenter | 77 | * \sa zoomFactorX, setZoomCenter | ||
78 | */ | 78 | */ | ||
79 | void setZoomFactorX( qreal factor ) Q_DECL_OVERRIDE; | 79 | void setZoomFactorX( qreal factor ) override; | ||
80 | /** | 80 | /** | ||
81 | * \sa zoomFactorY, setZoomCenter | 81 | * \sa zoomFactorY, setZoomCenter | ||
82 | */ | 82 | */ | ||
83 | void setZoomFactorY( qreal factor ) Q_DECL_OVERRIDE; | 83 | void setZoomFactorY( qreal factor ) override; | ||
84 | 84 | | |||
85 | /** | 85 | /** | ||
86 | * \sa setZoomCenter, setZoomFactorX, setZoomFactorY | 86 | * \sa setZoomCenter, setZoomFactorX, setZoomFactorY | ||
87 | */ | 87 | */ | ||
88 | QPointF zoomCenter() const Q_DECL_OVERRIDE; | 88 | QPointF zoomCenter() const override; | ||
89 | 89 | | |||
90 | /** | 90 | /** | ||
91 | * \sa zoomCenter, setZoomFactorX, setZoomFactorY | 91 | * \sa zoomCenter, setZoomFactorX, setZoomFactorY | ||
92 | */ | 92 | */ | ||
93 | void setZoomCenter( const QPointF& center ) Q_DECL_OVERRIDE; | 93 | void setZoomCenter( const QPointF& center ) override; | ||
94 | 94 | | |||
95 | /** | 95 | /** | ||
96 | * Allows to specify a fixed data-space / coordinate-space relation. If set | 96 | * Allows to specify a fixed data-space / coordinate-space relation. If set | ||
97 | * to true then fixed bar widths are used, so you see more bars as the window | 97 | * to true then fixed bar widths are used, so you see more bars as the window | ||
98 | * is made wider. | 98 | * is made wider. | ||
99 | * | 99 | * | ||
100 | * This allows to completely restrict the size of bars in a graph such that, | 100 | * This allows to completely restrict the size of bars in a graph such that, | ||
101 | * upon resizing a window, the graphs coordinate plane will grow (add more | 101 | * upon resizing a window, the graphs coordinate plane will grow (add more | ||
▲ Show 20 Lines • Show All 265 Lines • ▼ Show 20 Line(s) | 362 | #endif | |||
367 | /** Specifies the calculation modes for all axes */ | 367 | /** Specifies the calculation modes for all axes */ | ||
368 | void setAxesCalcModes( AxesCalcMode mode ); | 368 | void setAxesCalcModes( AxesCalcMode mode ); | ||
369 | /** Specifies the calculation mode for all Ordinate axes */ | 369 | /** Specifies the calculation mode for all Ordinate axes */ | ||
370 | void setAxesCalcModeY( AxesCalcMode mode ); | 370 | void setAxesCalcModeY( AxesCalcMode mode ); | ||
371 | /** Specifies the calculation mode for all Abscissa axes */ | 371 | /** Specifies the calculation mode for all Abscissa axes */ | ||
372 | void setAxesCalcModeX( AxesCalcMode mode ); | 372 | void setAxesCalcModeX( AxesCalcMode mode ); | ||
373 | 373 | | |||
374 | /** reimpl */ | 374 | /** reimpl */ | ||
375 | void paint( QPainter* ) Q_DECL_OVERRIDE; | 375 | void paint( QPainter* ) override; | ||
376 | 376 | | |||
377 | /** reimpl */ | 377 | /** reimpl */ | ||
378 | AbstractCoordinatePlane* sharedAxisMasterPlane( QPainter* p = nullptr ) Q_DECL_OVERRIDE; | 378 | AbstractCoordinatePlane* sharedAxisMasterPlane( QPainter* p = nullptr ) override; | ||
379 | 379 | | |||
380 | /** | 380 | /** | ||
381 | * Returns the currently visible data range. Might be greater than the | 381 | * Returns the currently visible data range. Might be greater than the | ||
382 | * range of the grid. | 382 | * range of the grid. | ||
383 | */ | 383 | */ | ||
384 | QRectF visibleDataRange() const; | 384 | QRectF visibleDataRange() const; | ||
385 | 385 | | |||
386 | /** | 386 | /** | ||
▲ Show 20 Lines • Show All 42 Lines • ▼ Show 20 Line(s) | |||||
429 | /** | 429 | /** | ||
430 | * \return Whether the vertical range is reversed or not | 430 | * \return Whether the vertical range is reversed or not | ||
431 | */ | 431 | */ | ||
432 | bool isVerticalRangeReversed() const; | 432 | bool isVerticalRangeReversed() const; | ||
433 | 433 | | |||
434 | /** | 434 | /** | ||
435 | * reimplemented from AbstractCoordinatePlane | 435 | * reimplemented from AbstractCoordinatePlane | ||
436 | */ | 436 | */ | ||
437 | void setGeometry( const QRect& r ) Q_DECL_OVERRIDE; | 437 | void setGeometry( const QRect& r ) override; | ||
438 | 438 | | |||
439 | // reimplemented | 439 | // reimplemented | ||
440 | Qt::Orientations expandingDirections() const Q_DECL_OVERRIDE; | 440 | Qt::Orientations expandingDirections() const override; | ||
441 | 441 | | |||
442 | 442 | | |||
443 | public Q_SLOTS: | 443 | public Q_SLOTS: | ||
444 | /** | 444 | /** | ||
445 | * \brief Adjust both, horizontal and vertical range settings to the | 445 | * \brief Adjust both, horizontal and vertical range settings to the | ||
446 | * ranges covered by the model's data values. | 446 | * ranges covered by the model's data values. | ||
447 | * | 447 | * | ||
448 | * \sa setHorizontalRange, setVerticalRange | 448 | * \sa setHorizontalRange, setVerticalRange | ||
Show All 14 Lines | |||||
463 | */ | 463 | */ | ||
464 | void adjustVerticalRangeToData(); | 464 | void adjustVerticalRangeToData(); | ||
465 | 465 | | |||
466 | protected: | 466 | protected: | ||
467 | QRectF getRawDataBoundingRectFromDiagrams() const; | 467 | QRectF getRawDataBoundingRectFromDiagrams() const; | ||
468 | QRectF adjustedToMaxEmptyInnerPercentage( | 468 | QRectF adjustedToMaxEmptyInnerPercentage( | ||
469 | const QRectF& r, unsigned int percentX, unsigned int percentY ) const; | 469 | const QRectF& r, unsigned int percentX, unsigned int percentY ) const; | ||
470 | virtual QRectF calculateRawDataBoundingRect() const; | 470 | virtual QRectF calculateRawDataBoundingRect() const; | ||
471 | DataDimensionsList getDataDimensionsList() const Q_DECL_OVERRIDE; | 471 | DataDimensionsList getDataDimensionsList() const override; | ||
472 | // the whole drawing area, includes diagrams and axes, but maybe smaller | 472 | // the whole drawing area, includes diagrams and axes, but maybe smaller | ||
473 | // than (width, height): | 473 | // than (width, height): | ||
474 | virtual QRectF drawingArea() const; | 474 | virtual QRectF drawingArea() const; | ||
475 | public: | 475 | public: | ||
476 | const QPointF translateBack( const QPointF& screenPoint ) const; | 476 | const QPointF translateBack( const QPointF& screenPoint ) const; | ||
477 | protected: | 477 | protected: | ||
478 | void paintEvent ( QPaintEvent* ); | 478 | void paintEvent ( QPaintEvent* ); | ||
479 | void layoutDiagrams() Q_DECL_OVERRIDE; | 479 | void layoutDiagrams() override; | ||
480 | // the following three return true if the new value is different from the old | 480 | // the following three return true if the new value is different from the old | ||
481 | bool doneSetZoomFactorX( qreal factor ); | 481 | bool doneSetZoomFactorX( qreal factor ); | ||
482 | bool doneSetZoomFactorY( qreal factor ); | 482 | bool doneSetZoomFactorY( qreal factor ); | ||
483 | bool doneSetZoomCenter( const QPointF& center ); | 483 | bool doneSetZoomCenter( const QPointF& center ); | ||
484 | 484 | | |||
485 | void handleFixedDataCoordinateSpaceRelation( const QRectF& geometry ); | 485 | void handleFixedDataCoordinateSpaceRelation( const QRectF& geometry ); | ||
486 | 486 | | |||
487 | // reimplemented from QLayoutItem, via AbstractLayoutItem, AbstractArea, AbstractCoordinatePlane | 487 | // reimplemented from QLayoutItem, via AbstractLayoutItem, AbstractArea, AbstractCoordinatePlane | ||
488 | bool hasHeightForWidth() const Q_DECL_OVERRIDE; | 488 | bool hasHeightForWidth() const override; | ||
489 | int heightForWidth( int w ) const Q_DECL_OVERRIDE; | 489 | int heightForWidth( int w ) const override; | ||
490 | QSize sizeHint() const Q_DECL_OVERRIDE; | 490 | QSize sizeHint() const override; | ||
491 | 491 | | |||
492 | protected Q_SLOTS: | 492 | protected Q_SLOTS: | ||
493 | void slotLayoutChanged( AbstractDiagram* ); | 493 | void slotLayoutChanged( AbstractDiagram* ); | ||
494 | 494 | | |||
495 | private: | 495 | private: | ||
496 | void setHasOwnGridAttributes( | 496 | void setHasOwnGridAttributes( | ||
497 | Qt::Orientation orientation, bool on ); | 497 | Qt::Orientation orientation, bool on ); | ||
498 | }; | 498 | }; | ||
499 | 499 | | |||
500 | } | 500 | } | ||
501 | 501 | | |||
502 | #endif | 502 | #endif |