Qt table model for displaying the curve values of a ModelFitPlotData instance.
More...
#include <QmitkFitPlotDataModel.h>
|
| using | FitVectorType = std::vector< mitk::modelFit::ModelFitInfo::ConstPointer > |
| | Vector type holding const pointers to ModelFitInfo instances. More...
|
| |
|
| | QmitkFitPlotDataModel (QObject *parent=nullptr) |
| | Constructs a QmitkFitPlotDataModel. More...
|
| |
| | ~QmitkFitPlotDataModel () override |
| | Destructor. More...
|
| |
| const mitk::ModelFitPlotData * | GetPlotData () const |
| | Returns a pointer to the currently stored plot data. More...
|
| |
| const std::string & | GetXName () const |
| | Returns the display name for the x-axis. More...
|
| |
| Qt::ItemFlags | flags (const QModelIndex &index) const override |
| | Returns item flags for the given model index (read-only). More...
|
| |
| QVariant | data (const QModelIndex &index, int role) const override |
| | Returns data for the given index and role. More...
|
| |
| QVariant | headerData (int section, Qt::Orientation orientation, int role) const override |
| | Returns header data for the specified section. More...
|
| |
| int | rowCount (const QModelIndex &parent=QModelIndex()) const override |
| | Returns the number of data points (rows) in the plot data. More...
|
| |
| int | columnCount (const QModelIndex &parent=QModelIndex()) const override |
| | Returns the number of columns. More...
|
| |
| bool | setData (const QModelIndex &index, const QVariant &value, int role=Qt::EditRole) override |
| | Sets data for a given index (currently always returns false; model is read-only). More...
|
| |
Qt table model for displaying the curve values of a ModelFitPlotData instance.
This model presents the numerical data behind model fit plot curves in a tabular form. Column 0 is the sample index, column 1 is the x-axis value, and subsequent columns correspond to individual plot curves (current position, positional, and static plots). Interpolated signal curves are automatically excluded from the column layout.
- See also
- QmitkFitPlotDataWidget
-
mitk::ModelFitPlotData
Definition at line 33 of file QmitkFitPlotDataModel.h.
◆ FitVectorType
◆ QmitkFitPlotDataModel()
| QmitkFitPlotDataModel::QmitkFitPlotDataModel |
( |
QObject * |
parent = nullptr | ) |
|
◆ ~QmitkFitPlotDataModel()
| QmitkFitPlotDataModel::~QmitkFitPlotDataModel |
( |
| ) |
|
|
inlineoverride |
◆ columnCount()
| int QmitkFitPlotDataModel::columnCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
override |
Returns the number of columns.
Equals 2 (index + x-axis) plus the number of non-interpolated curves across current position, positional, and static plot collections.
- Parameters
-
| [in] | parent | The parent model index. |
- Returns
- The number of columns. Returns 0 if parent is valid.
◆ data()
| QVariant QmitkFitPlotDataModel::data |
( |
const QModelIndex & |
index, |
|
|
int |
role |
|
) |
| const |
|
override |
Returns data for the given index and role.
Column 0 returns the row index, column 1 returns the x-axis value, and remaining columns return the y-value of the corresponding curve at the given row.
- Parameters
-
| [in] | index | The model index to query. |
| [in] | role | The Qt item data role. |
- Returns
- The requested data as QVariant.
◆ flags()
| Qt::ItemFlags QmitkFitPlotDataModel::flags |
( |
const QModelIndex & |
index | ) |
const |
|
override |
Returns item flags for the given model index (read-only).
- Parameters
-
| [in] | index | The model index to query. |
- Returns
- The item flags.
◆ GetCurveByColumn()
| std::pair<std::string, const mitk::PlotDataCurve*> QmitkFitPlotDataModel::GetCurveByColumn |
( |
int |
col | ) |
const |
|
protected |
Retrieves the curve name and pointer for the given column index.
Searches through current position plots, positional plots, and static plots (skipping interpolated signal curves) to find the curve matching the column.
- Parameters
-
| [in] | col | The column index (0-based, accounting for index and x-axis columns). |
- Returns
- A pair of the curve name and a pointer to the PlotDataCurve.
◆ GetPlotData()
Returns a pointer to the currently stored plot data.
- Returns
- Pointer to the internal ModelFitPlotData instance.
◆ GetPositionalCurvePoint()
| std::pair<bool, mitk::ModelFitPlotData::PositionalCollectionMap::value_type> QmitkFitPlotDataModel::GetPositionalCurvePoint |
( |
const mitk::PlotDataCurve * |
curve | ) |
const |
|
protected |
Determines whether the given curve belongs to a positional collection.
- Parameters
-
| [in] | curve | Pointer to the curve to look up. |
- Returns
- A pair where the first element indicates whether the curve was found in a positional collection, and the second element is the positional collection entry.
◆ GetXName()
| const std::string& QmitkFitPlotDataModel::GetXName |
( |
| ) |
const |
Returns the display name for the x-axis.
- Returns
- Const reference to the x-axis name string.
◆ headerData()
| QVariant QmitkFitPlotDataModel::headerData |
( |
int |
section, |
|
|
Qt::Orientation |
orientation, |
|
|
int |
role |
|
) |
| const |
|
override |
Returns header data for the specified section.
Column 0 header is "#", column 1 is the x-axis name, and remaining columns show the curve name optionally annotated with the positional collection name.
- Parameters
-
| [in] | section | The column index. |
| [in] | orientation | The header orientation. |
| [in] | role | The Qt item data role. |
- Returns
- The header data as QVariant.
◆ rowCount()
| int QmitkFitPlotDataModel::rowCount |
( |
const QModelIndex & |
parent = QModelIndex() | ) |
const |
|
override |
Returns the number of data points (rows) in the plot data.
All curves are assumed to have the same number of data points.
- Parameters
-
| [in] | parent | The parent model index. |
- Returns
- The number of rows.
◆ setData()
| bool QmitkFitPlotDataModel::setData |
( |
const QModelIndex & |
index, |
|
|
const QVariant & |
value, |
|
|
int |
role = Qt::EditRole |
|
) |
| |
|
override |
Sets data for a given index (currently always returns false; model is read-only).
- Parameters
-
| [in] | index | The model index. |
| [in] | value | The value to set. |
| [in] | role | The Qt item data role. |
- Returns
- Always false.
◆ SetPlotData
Sets the plot data to display.
Makes a deep copy of the provided data and triggers a full model reset.
- Parameters
-
| [in] | data | Pointer to the ModelFitPlotData to copy and display. |
◆ SetXName
| void QmitkFitPlotDataModel::SetXName |
( |
const std::string & |
xName | ) |
|
|
slot |
Sets the display name for the x-axis column header.
Triggers a full model reset.
- Parameters
-
| [in] | xName | The name to display in the x-axis column header. |
The documentation for this class was generated from the following file: