6#include <QtCore/QVector>
7#include <QtCore/QString>
161 double* errorFactorPtr =
NULL)
override;
165 double* errorFactorPtr =
NULL)
override;
170 double* errorFactorPtr =
NULL)
const override;
175 double* errorFactorPtr =
NULL)
const override;
199 QVector<Curve> m_curves;
200 QString m_xAxisLabel;
201 QString m_yAxisLabel;
205 bool m_isLegendVisible;
206 bool m_isGridVisible;
214 return m_curves.count();
220 return m_curves.at(index);
226 return m_curves[index];
250 return m_isLegendVisible;
256 return m_isGridVisible;
Data model for a 2D graph plot supporting multiple curves.
const QString & GetTitle() const
Get the graph title.
const QString & GetXAxisLabel() const
Get the X-axis label.
void SetYAxisLabel(const QString &label)
Set the Y-axis label.
void SetXAxisLabel(const QString &label)
Set the X-axis label.
void RemoveCurve(int index)
Remove a curve by index.
virtual CVector2d GetCenter() const override
Returns center of this 2D-object.
virtual istd::TUniqueInterfacePtr< istd::IChangeable > CloneMe(CompatibilityMode mode=CM_WITHOUT_REFS) const override
Make a copy of this object.
const Curve & GetCurve(int index) const
Get a curve by index.
virtual CRectangle GetBoundingBox() const override
Get bounding box of this shape.
istd::CRange GetYAxisRange() const
Get Y-axis range.
bool IsLegendVisible() const
Check if legend should be shown.
virtual bool Transform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) override
Transform this object using some transformation.
virtual void MoveCenterTo(const CVector2d &position) override
Move object to position position.
int GetCurvesCount() const
Get the number of curves in the graph.
void SetXAxisRange(const istd::CRange &range)
Set X-axis range.
virtual bool GetInvTransformed(const ITransformation2d &transformation, IObject2d &result, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) const override
Calulate inverse transformation of the object into second one.
virtual bool GetTransformed(const ITransformation2d &transformation, IObject2d &result, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) const override
Calulate transformation of the object into second one.
virtual QByteArray GetFactoryId() const override
Curve & GetCurveRef(int index)
Get reference to a curve by index.
istd::CRange GetXAxisRange() const
Get X-axis range.
bool IsGridVisible() const
Check if grid should be shown.
virtual bool Serialize(iser::IArchive &archive) override
Load or store state of this object as a archive stream.
virtual bool InvTransform(const ITransformation2d &transformation, ITransformation2d::ExactnessMode mode=ITransformation2d::EM_NONE, double *errorFactorPtr=NULL) override
Do inverse transformation of this object.
void SetGridVisible(bool visible=true)
Set whether grid should be shown.
void ClearCurves()
Clear all curves.
void AddCurve(const Curve &curve)
Add a new curve to the graph.
virtual int GetSupportedOperations() const override
Get set of flags for supported operations.
static QByteArray GetTypeName()
void SetYAxisRange(const istd::CRange &range)
Set Y-axis range.
void SetTitle(const QString &title)
Set the graph title.
virtual bool CopyFrom(const IChangeable &object, CompatibilityMode mode=CM_WITHOUT_REFS) override
void SetLegendVisible(bool visible=true)
Set whether legend should be shown.
const QString & GetYAxisLabel() const
Get the Y-axis label.
@ CF_GRAPH_DATA
Graph data (curves, points) changed.
@ CF_GRAPH_APPEARANCE
Graph appearance (colors, names, labels) changed.
@ CF_GRAPH_DISPLAY_OPTIONS
Display options (legend, grid visibility) changed.
Base class for 2D-objects implementing interface i2d::IObject2d.
Definition of rectangle area orthogonal to axis of coordination system.
Definition of position or mathematical vector on 2D plane.
Common interface for describing the 2D-objects.
Represents an input/output persistence archive for object serialization.
CompatibilityMode
Control how relationship betweeen objects are interpreted.
@ CM_WITHOUT_REFS
External references are simple ignored.
Unique ownership smart pointer for interface types.
Structure representing a single curve in the graph.
QString name
Name of the curve (for legend)
QVector< CVector2d > points
Points defining the curve.
QColor color
Color for drawing the curve.