SciDAVis
1.D4
|
#include <future_Matrix.h>
Public Member Functions | |
void | blockChangeSignals (bool block) |
Enable/disable the emission of dataChanged signals. | |
double | cell (int row, int col) const |
Return the value in the given cell. | |
void | clearColumn (int col) |
Fill column with zeroes. | |
QVector< qreal > | columnCells (int col, int first_row, int last_row) |
Return the values in the given cells as double vector. | |
int | columnCount () const |
Return the number of columns in the table. | |
int | columnWidth (int col) const |
int | displayedDigits () const |
void | emitDataChanged (int top, int left, int bottom, int right) |
Access to the dataChanged signal for commands. | |
QString | formula () const |
void | insertColumns (int before, int count) |
Insert columns before column number 'before'. | |
void | insertRows (int before, int count) |
Insert rows before row number 'before'. | |
QString | name () const |
char | numericFormat () const |
Private (Matrix *owner) | |
void | removeColumns (int first, int count) |
Remove Columns. | |
void | removeRows (int first, int count) |
Remove Columns. | |
QVector< qreal > | rowCells (int row, int first_column, int last_column) |
Return the values in the given cells as double vector. | |
int | rowCount () const |
Return the number of rows in the table. | |
int | rowHeight (int row) const |
void | setCell (int row, int col, double value) |
Set the value in the given cell. | |
void | setColumnCells (int col, int first_row, int last_row, const QVector< qreal > &values) |
Set the values in the given cells from a double vector. | |
void | setColumnWidth (int col, int width) |
void | setDisplayedDigits (int digits) |
void | setFormula (const QString &formula) |
void | setNumericFormat (char format) |
void | setRowCells (int row, int first_column, int last_column, const QVector< qreal > &values) |
Set the values in the given cells from a double vector. | |
void | setRowHeight (int row, int height) |
void | setXEnd (double x) |
void | setXStart (double x) |
void | setYEnd (double y) |
void | setYStart (double y) |
double | xEnd () const |
double | xStart () const |
double | yEnd () const |
double | yStart () const |
Private Attributes | |
bool | d_block_change_signals |
int | d_column_count |
The number of columns. | |
QList< int > | d_column_widths |
Columns widths. | |
QVector< QVector< qreal > > | d_data |
The matrix data. | |
int | d_displayed_digits |
Number of significant digits. | |
QString | d_formula |
Last formula used to calculate cell values. | |
char | d_numeric_format |
Format code for displaying numbers. | |
Matrix * | d_owner |
The owner aspect. | |
int | d_row_count |
The number of rows. | |
QList< int > | d_row_heights |
Row widths. | |
double | d_x_end |
X value corresponding to the last column. | |
double | d_x_start |
X value corresponding to column 1. | |
double | d_y_end |
Y value corresponding to the last row. | |
double | d_y_start |
Y value corresponding to row 1. |
This private class manages matrix based data (i.e., mathematically a MxN matrix with M rows, N columns). These data are typically used to for 3D plots.
The API of this private class is to be called by Matrix and matrix commands only. Matrix may only call the reading functions to ensure that undo/redo is possible for all data changing operations.
The values of the matrix are stored as double precision values. They are managed by QVector<double> objects. Although rows and columns are equally important in a matrix, the columns are chosen to be contiguous in memory to allow easier copying between column and matrix data.
future::Matrix::Private::Private | ( | Matrix * | owner | ) |
References d_block_change_signals, d_displayed_digits, d_numeric_format, d_x_end, d_x_start, d_y_end, and d_y_start.
|
inline |
Enable/disable the emission of dataChanged signals.
This can be used to suppress the emission of dataChanged signals temporally. It does not suppress any other signals however. Typical code: d_matrix_private->blockChangeSignals(true); for (...) for(...) setCell(...); d_matrix_private->blockChangeSignals(false); emit dataChanged(0, 0, rowCount()-1, columnCount()-1);
References d_block_change_signals.
Referenced by future::Matrix::copy(), future::Matrix::load(), MatrixTransposeCmd::redo(), MatrixMirrorHorizontallyCmd::redo(), and MatrixMirrorVerticallyCmd::redo().
double future::Matrix::Private::cell | ( | int | row, |
int | col | ||
) | const |
Return the value in the given cell.
Referenced by future::Matrix::cell(), and MatrixSetCellValueCmd::redo().
void future::Matrix::Private::clearColumn | ( | int | col | ) |
Fill column with zeroes.
Referenced by MatrixClearCmd::redo(), and MatrixClearColumnCmd::redo().
QVector< qreal > future::Matrix::Private::columnCells | ( | int | col, |
int | first_row, | ||
int | last_row | ||
) |
Return the values in the given cells as double vector.
Referenced by future::Matrix::columnCells(), MatrixRemoveColumnsCmd::redo(), MatrixRemoveRowsCmd::redo(), MatrixClearCmd::redo(), MatrixClearColumnCmd::redo(), MatrixSetColumnCellsCmd::redo(), MatrixTransposeCmd::redo(), and MatrixMirrorHorizontallyCmd::redo().
|
inline |
Return the number of columns in the table.
References d_column_count.
Referenced by future::Matrix::columnCount(), MatrixRemoveRowsCmd::redo(), MatrixClearCmd::redo(), MatrixTransposeCmd::redo(), MatrixMirrorHorizontallyCmd::redo(), MatrixMirrorVerticallyCmd::redo(), MatrixRemoveRowsCmd::undo(), and MatrixClearCmd::undo().
|
inline |
References d_column_widths.
Referenced by future::Matrix::columnWidth().
|
inline |
References d_displayed_digits.
Referenced by future::Matrix::displayedDigits(), MatrixSetDigitsCmd::redo(), and future::Matrix::text().
|
inline |
Access to the dataChanged signal for commands.
References d_owner, and future::Matrix::dataChanged().
Referenced by MatrixTransposeCmd::redo(), MatrixMirrorHorizontallyCmd::redo(), and MatrixMirrorVerticallyCmd::redo().
QString future::Matrix::Private::formula | ( | ) | const |
Referenced by future::Matrix::formula(), and MatrixSetFormulaCmd::redo().
void future::Matrix::Private::insertColumns | ( | int | before, |
int | count | ||
) |
Insert columns before column number 'before'.
If 'first' is equal to the current number of columns, the columns will be appended.
before | index of the column to insert before |
count | the number of columns to be inserted |
References future::Matrix::defaultColumnWidth().
Referenced by MatrixInsertColumnsCmd::redo(), MatrixTransposeCmd::redo(), and MatrixRemoveColumnsCmd::undo().
void future::Matrix::Private::insertRows | ( | int | before, |
int | count | ||
) |
Insert rows before row number 'before'.
If 'first' is equal to the current number of rows, the rows will be appended.
before | index of the row to insert before |
count | the number of rows to be inserted |
References future::Matrix::defaultRowHeight().
Referenced by MatrixInsertRowsCmd::redo(), MatrixTransposeCmd::redo(), and MatrixRemoveRowsCmd::undo().
|
inline |
References d_owner, and AbstractAspect::name().
Referenced by MatrixClearCmd::MatrixClearCmd(), MatrixClearColumnCmd::MatrixClearColumnCmd(), MatrixInsertColumnsCmd::MatrixInsertColumnsCmd(), MatrixInsertRowsCmd::MatrixInsertRowsCmd(), MatrixMirrorHorizontallyCmd::MatrixMirrorHorizontallyCmd(), MatrixMirrorVerticallyCmd::MatrixMirrorVerticallyCmd(), MatrixRemoveColumnsCmd::MatrixRemoveColumnsCmd(), MatrixRemoveRowsCmd::MatrixRemoveRowsCmd(), MatrixSetCellValueCmd::MatrixSetCellValueCmd(), MatrixSetColumnCellsCmd::MatrixSetColumnCellsCmd(), MatrixSetCoordinatesCmd::MatrixSetCoordinatesCmd(), MatrixSetDigitsCmd::MatrixSetDigitsCmd(), MatrixSetFormatCmd::MatrixSetFormatCmd(), MatrixSetFormulaCmd::MatrixSetFormulaCmd(), MatrixSetRowCellsCmd::MatrixSetRowCellsCmd(), and MatrixTransposeCmd::MatrixTransposeCmd().
|
inline |
References d_numeric_format.
Referenced by future::Matrix::copySelection(), future::Matrix::numericFormat(), MatrixSetFormatCmd::redo(), and future::Matrix::text().
void future::Matrix::Private::removeColumns | ( | int | first, |
int | count | ||
) |
Remove Columns.
first | index of the first column to be removed |
count | number of columns to remove |
Referenced by MatrixRemoveColumnsCmd::redo(), MatrixTransposeCmd::redo(), and MatrixInsertColumnsCmd::undo().
void future::Matrix::Private::removeRows | ( | int | first, |
int | count | ||
) |
Remove Columns.
first | index of the first row to be removed |
count | number of rows to remove |
Referenced by MatrixRemoveRowsCmd::redo(), MatrixTransposeCmd::redo(), and MatrixInsertRowsCmd::undo().
QVector< qreal > future::Matrix::Private::rowCells | ( | int | row, |
int | first_column, | ||
int | last_column | ||
) |
Return the values in the given cells as double vector.
Referenced by MatrixSetRowCellsCmd::redo(), MatrixTransposeCmd::redo(), MatrixMirrorVerticallyCmd::redo(), and future::Matrix::rowCells().
|
inline |
Return the number of rows in the table.
References d_row_count.
Referenced by MatrixRemoveColumnsCmd::redo(), MatrixClearCmd::redo(), MatrixClearColumnCmd::redo(), MatrixTransposeCmd::redo(), MatrixMirrorHorizontallyCmd::redo(), MatrixMirrorVerticallyCmd::redo(), future::Matrix::rowCount(), MatrixRemoveColumnsCmd::undo(), MatrixClearCmd::undo(), and MatrixClearColumnCmd::undo().
|
inline |
References d_row_heights.
Referenced by future::Matrix::rowHeight().
void future::Matrix::Private::setCell | ( | int | row, |
int | col, | ||
double | value | ||
) |
Set the value in the given cell.
Referenced by MatrixSetCellValueCmd::redo(), and MatrixSetCellValueCmd::undo().
void future::Matrix::Private::setColumnCells | ( | int | col, |
int | first_row, | ||
int | last_row, | ||
const QVector< qreal > & | values | ||
) |
Set the values in the given cells from a double vector.
Referenced by MatrixSetColumnCellsCmd::redo(), MatrixTransposeCmd::redo(), MatrixMirrorHorizontallyCmd::redo(), MatrixRemoveColumnsCmd::undo(), MatrixRemoveRowsCmd::undo(), MatrixClearCmd::undo(), MatrixClearColumnCmd::undo(), and MatrixSetColumnCellsCmd::undo().
|
inline |
References d_column_widths.
Referenced by future::Matrix::setColumnWidth().
|
inline |
References d_displayed_digits, d_owner, and future::Matrix::formatChanged().
Referenced by MatrixSetDigitsCmd::redo().
void future::Matrix::Private::setFormula | ( | const QString & | formula | ) |
References future::Matrix::formula().
Referenced by MatrixSetFormulaCmd::redo().
|
inline |
References d_numeric_format, d_owner, and future::Matrix::formatChanged().
Referenced by MatrixSetFormatCmd::redo().
void future::Matrix::Private::setRowCells | ( | int | row, |
int | first_column, | ||
int | last_column, | ||
const QVector< qreal > & | values | ||
) |
Set the values in the given cells from a double vector.
Referenced by MatrixSetRowCellsCmd::redo(), MatrixTransposeCmd::redo(), MatrixMirrorVerticallyCmd::redo(), and MatrixSetRowCellsCmd::undo().
|
inline |
References d_row_heights.
Referenced by future::Matrix::setRowHeight().
void future::Matrix::Private::setXEnd | ( | double | x | ) |
Referenced by MatrixSetCoordinatesCmd::redo(), and MatrixSetCoordinatesCmd::undo().
void future::Matrix::Private::setXStart | ( | double | x | ) |
Referenced by MatrixSetCoordinatesCmd::redo(), and MatrixSetCoordinatesCmd::undo().
void future::Matrix::Private::setYEnd | ( | double | y | ) |
Referenced by MatrixSetCoordinatesCmd::redo(), and MatrixSetCoordinatesCmd::undo().
void future::Matrix::Private::setYStart | ( | double | y | ) |
Referenced by MatrixSetCoordinatesCmd::redo(), and MatrixSetCoordinatesCmd::undo().
double future::Matrix::Private::xEnd | ( | ) | const |
Referenced by MatrixSetCoordinatesCmd::redo(), and future::Matrix::xEnd().
double future::Matrix::Private::xStart | ( | ) | const |
Referenced by MatrixSetCoordinatesCmd::redo(), and future::Matrix::xStart().
double future::Matrix::Private::yEnd | ( | ) | const |
Referenced by MatrixSetCoordinatesCmd::redo(), and future::Matrix::yEnd().
double future::Matrix::Private::yStart | ( | ) | const |
Referenced by MatrixSetCoordinatesCmd::redo(), and future::Matrix::yStart().
|
private |
Referenced by blockChangeSignals(), and Private().
|
private |
The number of columns.
Referenced by columnCount().
|
private |
Columns widths.
Referenced by columnWidth(), and setColumnWidth().
|
private |
The matrix data.
|
private |
Number of significant digits.
Referenced by displayedDigits(), Private(), and setDisplayedDigits().
|
private |
Last formula used to calculate cell values.
|
private |
Format code for displaying numbers.
Referenced by numericFormat(), Private(), and setNumericFormat().
|
private |
The owner aspect.
Referenced by emitDataChanged(), name(), setDisplayedDigits(), and setNumericFormat().
|
private |
The number of rows.
Referenced by rowCount().
|
private |
Row widths.
Referenced by rowHeight(), and setRowHeight().
|
private |
X value corresponding to the last column.
Referenced by Private().
|
private |
X value corresponding to column 1.
Referenced by Private().
|
private |
Y value corresponding to the last row.
Referenced by Private().
|
private |
Y value corresponding to row 1.
Referenced by Private().