6#include <QtGui/QPainter>
85 virtual void DrawFigure(QPainter& drawContext)
const override;
94 void DrawAxes(QPainter& drawContext,
const QRectF& plotRect,
const i2d::CGraphData2d* graphPtr)
const;
99 void DrawGrid(QPainter& drawContext,
const QRectF& plotRect,
const i2d::CGraphData2d* graphPtr)
const;
104 void DrawCurves(QPainter& drawContext,
const QRectF& plotRect,
const i2d::CGraphData2d* graphPtr)
const;
109 void DrawLegend(QPainter& drawContext,
const QRectF& plotRect,
const i2d::CGraphData2d* graphPtr)
const;
114 void DrawTitle(QPainter& drawContext,
const QRectF& plotRect,
const i2d::CGraphData2d* graphPtr)
const;
119 QPointF DataToScreen(
const i2d::CVector2d& dataPoint,
const QRectF& plotRect,
125 QVector<double> CalculateTickPositions(
const istd::CRange& range,
int maxTicks = 10)
const;
130 QString FormatTickLabel(
double value)
const;
133 int m_axisLabelFontSize;
134 int m_tickLabelFontSize;
135 int m_curveLineWidth;
149 if (m_plotMargin != margin){
150 m_plotMargin = margin;
158 return m_axisLabelFontSize;
164 if (m_axisLabelFontSize != size){
165 m_axisLabelFontSize = size;
173 return m_tickLabelFontSize;
179 if (m_tickLabelFontSize != size){
180 m_tickLabelFontSize = size;
188 return m_curveLineWidth;
194 if (m_curveLineWidth != width){
195 m_curveLineWidth = width;
Data model for a 2D graph plot supporting multiple curves.
Simple rectangle with integer bounds.
Definition of position or mathematical vector on 2D plane.
Common interface for model objects, that supports Model/Observer design pattern.
Index implementation for addressing elements in 2D-space.
Set of change flags (its IDs).
Shape for displaying 2D graph plots with multiple curves.
CRectControlledShapeBase BaseClass
void SetCurveLineWidth(int width)
Set line width for curves (in pixels).
virtual void DrawFigure(QPainter &drawContext) const override
int GetCurveLineWidth() const
Get line width for curves (in pixels).
int GetPlotMargin() const
Get the margin around the plot area (in pixels).
int GetAxisLabelFontSize() const
Get the font size for axis labels.
virtual bool OnModelAttached(imod::IModel *modelPtr, istd::IChangeable::ChangeSet &changeMask) override
Callback invoked when an observable model is about to be attached to this observer.
int GetTickLabelFontSize() const
Get the font size for tick labels.
virtual i2d::CRect CalcBoundingBox() const override
Calculate bounding box.
virtual void EnsureValidNodes() const override
virtual bool IsCurveTouched(istd::CIndex2d position) const override
virtual TouchState IsTouched(istd::CIndex2d position) const override
Check, if any shape is touched.
void SetTickLabelFontSize(int size)
Set the font size for tick labels.
void SetAxisLabelFontSize(int size)
Set the font size for axis labels.
void SetPlotMargin(int margin)
Set the margin around the plot area (in pixels).
virtual void Invalidate()
TouchState
Enumeration for possible shape touch states.
In this library is defined 2D view concept and standard visualisation objects.