Matrix worksheet class. More...
#include <Matrix.h>
Public Types | |
enum | ColorMapType { Default, GrayScale, Rainbow, Custom } |
enum | HeaderViewType { ColumnRow, XY } |
enum | ImportMode { NewColumns, NewRows, Overwrite } |
enum | Operation { Transpose, Invert, FlipHorizontally, FlipVertically, RotateClockwise, RotateCounterClockwise, FFT, Clear, Calculate, MuParserCalculate, SetImage, ImportAscii } |
enum | ViewType { TableView, ImageView } |
Public Slots | |
static double ** | allocateMatrixData (int rows, int columns) |
Allocate memory for a matrix buffer. | |
QwtDoubleRect | boundingRect () |
Returns the bounding rect of the matrix coordinates. | |
bool | canCalculate (bool useMuParser=true) |
double | cell (int row, int col) |
Return the value of the cell as a double. | |
void | clearSelection () |
Clear cells. | |
int | columnsWidth () |
Return the width of all columns. | |
void | copy (Matrix *m) |
void | copySelection () |
Standard copy operation. | |
void | cutSelection () |
Standard cut operation. | |
void | deleteSelectedColumns () |
Delte the selected columns. | |
void | deleteSelectedRows () |
Delete the selected rows. | |
double | dx () |
Returns the step of the X axis. | |
double | dy () |
Returns the step of the Y axis. | |
void | exportPDF (const QString &fileName) |
QString | formula () |
Return the matrix formula. | |
static void | freeMatrixData (double **data, int rows) |
Free memory used for a matrix buffer. | |
void | freeWorkspace () |
void | goToColumn (int col) |
Scroll to column (column starts with 1). | |
void | goToRow (int row) |
Scroll to row (row starts with 1). | |
double * | initWorkspace (int size) |
Tries to allocate memory for the workspace. Returns a NULL pointer if failure. | |
void | insertColumn () |
Insert a column before the current cell. | |
void | insertRow () |
Insert a row before the current cell. | |
bool | isEmpty () |
Returns true if no data values were set for this matrix. | |
void | notifyModifiedData () |
int | numSelectedColumns () |
Return the number of selected columns. | |
int | numSelectedRows () |
Return the number of selected rows. | |
void | pasteSelection () |
Standard paste operation. | |
int | precision () |
Return the number precision digits. | |
void | print (const QString &fileName) |
Print the Matrix to fileName. | |
void | print (QPrinter *) |
void | print () |
Print the Matrix. | |
void | range (double *min, double *max) |
Min and max values of the matrix. | |
void | restore (const QStringList &l) |
Load the matrix from a string list (i.e. lines from a project file). | |
void | save (const QString &, const QString &, bool saveAsTemplate=false) |
void | setCell (int row, int col, double value) |
Set the value of the cell. | |
void | setColumnsWidth (int width) |
Set the width of all columns. | |
void | setCoordinates (double xs, double xe, double ys, double ye) |
Set the X and Y coordinate intervals. | |
void | setDimensions (int rows, int cols) |
Set the Matrix size. | |
void | setFormula (const QString &s) |
Set the matrix forumla. | |
void | setNumericFormat (const QChar &f, int prec) |
void | setNumericPrecision (int prec) |
Set the number of significant digits. | |
void | setText (int row, int col, const QString &new_text) |
Set the content of the cell as a string. | |
void | setTextFormat (const QChar &format, int precision) |
Set the number format for the cells. | |
QString | text (int row, int col) |
Return the content of the cell as a string. | |
QChar | textFormat () |
Return the text format code ('e', 'f', ...). | |
int | verticalHeaderWidth () |
double | xEnd () |
Returns the X value corresponding to the last column. | |
double | xStart () |
Returns the X value corresponding to column 1. | |
double | yEnd () |
Returns the Y value corresponding to the last row. | |
double | yStart () |
Returns the Y value corresponding to row 1. | |
Signals | |
void | modifiedData (Matrix *) |
Public Member Functions | |
bool | calculate (int startRow=0, int endRow=-1, int startCol=0, int endCol=-1, bool forceMuParser=false) |
Calculate matrix values using the formula_str. | |
QwtLinearColorMap | colorMap () |
QwtLinearColorMap * | colorMapPointer () |
ColorMapType | colorMapType () |
void | customEvent (QEvent *e) |
Custom event handler. | |
double | determinant () |
Calculate the determinant of the matrix. | |
void | displayImage (const QImage &image) |
bool | exportASCII (const QString &fname, const QString &separator, bool exportSelection) |
bool | exportODF (const QString &fname, bool exportSelection) |
void | exportRasterImage (const QString &fileName, int quality=100, int dpi=0) |
void | exportSVG (const QString &fileName) |
void | exportToFile (const QString &fileName) |
void | exportVector (const QString &fileName, int res=0, bool color=true) |
void | fft (bool inverse=false) |
void | flipHorizontally () |
void | flipVertically () |
HeaderViewType | headerViewType () |
QImage | image () |
void | importASCII (const QString &fname, const QString &sep, int ignoredLines, bool stripSpaces, bool simplifySpaces, const QString &commentString, ImportMode importAs=Overwrite, const QLocale &l=QLocale(), int endLineChar=0, int maxRows=-1) |
void | importImage (const QString &fn) |
void | importImage (const QImage &image) |
double | integrate () |
Calculate the volume integral. | |
void | invert () |
Invert the matrix. | |
Matrix (ScriptingEnv *env, const QImage &image, const QString &label, ApplicationWindow *parent, const QString &name=QString(), Qt::WFlags f=0) | |
Matrix (ScriptingEnv *env, int r, int c, const QString &label, ApplicationWindow *parent, const QString &name=QString(), Qt::WFlags f=0) | |
Constructor. | |
MatrixModel * | matrixModel () |
void | moveCell (const QModelIndex &index) |
bool | muParserCalculate (int startRow=0, int endRow=-1, int startCol=0, int endCol=-1) |
Calculate matrix values using the formula_str (optimization for muParser). | |
int | numCols () |
Return the number of columns. | |
int | numRows () |
Return the number of rows. | |
void | resetView () |
void | rotate90 (bool clockwise=true) |
QItemSelectionModel * | selectionModel () |
void | setColorMap (const QwtLinearColorMap &map) |
void | setColorMap (const QStringList &lst) |
Used when restoring from project files. | |
void | setColorMapType (ColorMapType mapType) |
void | setDefaultColorMap () |
Resets the color map to the one defined by the user in the Preferences dialog (3D plots tab). | |
void | setGrayScale () |
void | setHeaderViewType (HeaderViewType type) |
void | setNumCols (int cols) |
void | setNumRows (int rows) |
void | setRainbowColorMap () |
void | setViewType (ViewType, bool renderImage=true) |
virtual QString | sizeToString () |
void | transpose () |
Transpose the matrix. | |
QUndoStack * | undoStack () |
ViewType | viewType () |
~Matrix () | |
Private Member Functions | |
bool | eventFilter (QObject *, QEvent *) |
bool | ignoreUndo () |
void | initGlobals () |
void | initImage (const QImage &image) |
void | initImageView () |
void | initTable (int rows, int cols) |
Initialize the matrix. | |
void | initTableView () |
Private Attributes | |
QwtLinearColorMap | d_color_map |
The color map used to display images. | |
ColorMapType | d_color_map_type |
The color map type. | |
int | d_column_width |
Column width in pixels;. | |
HeaderViewType | d_header_view_type |
Keeps track of the header view type;. | |
MatrixModel * | d_matrix_model |
QShortcut * | d_select_all_shortcut |
QStackedWidget * | d_stack |
QTableView * | d_table_view |
Pointer to the table view. | |
QUndoStack * | d_undo_stack |
Undo/Redo commands stack. | |
ViewType | d_view_type |
Keeps track of the view type;. | |
double * | d_workspace |
Pointer to a data buffer used for matrix operations. | |
QString | formula_str |
Last formula used to calculate cell values. | |
QLabel * | imageLabel |
Used to display the image view. | |
int | num_precision |
Number of significant digits. | |
QChar | txt_format |
Format code for displaying numbers. | |
double | x_end |
X value corresponding to the last column. | |
double | x_start |
X value corresponding to column 1. | |
double | y_end |
Y value corresponding to the last row. | |
double | y_start |
Y value corresponding to row 1. |
Matrix worksheet class.
enum Matrix::ColorMapType |
enum Matrix::ImportMode |
enum Matrix::Operation |
enum Matrix::ViewType |
Matrix::Matrix | ( | ScriptingEnv * | env, | |
int | r, | |||
int | c, | |||
const QString & | label, | |||
ApplicationWindow * | parent, | |||
const QString & | name = QString() , |
|||
Qt::WFlags | f = 0 | |||
) |
Constructor.
env | scripting interpreter | |
r | initial number of rows | |
c | initial number of columns | |
label | window label | |
parent | parent object | |
name | ||
name | window name | |
f | window flags |
References initTable().
Matrix::Matrix | ( | ScriptingEnv * | env, | |
const QImage & | image, | |||
const QString & | label, | |||
ApplicationWindow * | parent, | |||
const QString & | name = QString() , |
|||
Qt::WFlags | f = 0 | |||
) |
References initImage().
Matrix::~Matrix | ( | ) |
References d_matrix_model, and d_undo_stack.
double ** Matrix::allocateMatrixData | ( | int | rows, | |
int | columns | |||
) | [static, slot] |
Allocate memory for a matrix buffer.
Referenced by Graph3D::addMatrixData(), Graph3D::addRibbon(), MatrixModel::fft(), fft2d(), fft2d_inv(), FFTDialog::fftMatrix(), Graph3D::updateDataXY(), Graph3D::updateMatrixData(), Graph3D::updateScales(), and Graph3D::updateScalesFromMatrix().
QwtDoubleRect Matrix::boundingRect | ( | ) | [slot] |
bool Matrix::calculate | ( | int | startRow = 0 , |
|
int | endRow = -1 , |
|||
int | startCol = 0 , |
|||
int | endCol = -1 , |
|||
bool | forceMuParser = false | |||
) |
Calculate matrix values using the formula_str.
References MatrixModel::calculate(), Calculate, d_matrix_model, d_undo_stack, MatrixModel::dataCopy(), ignoreUndo(), modifiedData(), MdiSubWindow::modifiedWindow(), muParserCalculate(), and scripted::scriptEnv.
Referenced by MatrixValuesDialog::apply().
bool Matrix::canCalculate | ( | bool | useMuParser = true |
) | [slot] |
References muParserScript::codeLines(), Script::compile(), muParserScript::compile(), muParserScript::defineVariable(), Script::eval(), muParserScript::eval(), muParserScript::evalSingleLine(), formula_str, ScriptingEnv::newScript(), print(), scripted::scriptEnv, and Script::setDouble().
Referenced by MatrixValuesDialog::apply(), MatrixData::MatrixData(), Spectrogram::setMatrix(), and Spectrogram::setUseMatrixFormula().
double Matrix::cell | ( | int | row, | |
int | col | |||
) | [slot] |
Return the value of the cell as a double.
References MatrixModel::cell(), and d_matrix_model.
Referenced by Graph3D::addMatrixData(), muParserScript::cell(), determinant(), FFTDialog::fftMatrix(), ApplicationWindow::matrixToTable(), pasteSelection(), range(), Graph3D::updateMatrixData(), Graph3D::updateScalesFromMatrix(), and MatrixData::value().
void Matrix::clearSelection | ( | ) | [slot] |
Clear cells.
References MatrixModel::clear(), Clear, d_matrix_model, d_table_view, d_undo_stack, d_view_type, MatrixModel::dataCopy(), ignoreUndo(), ImageView, modifiedData(), and MdiSubWindow::modifiedWindow().
Referenced by cutSelection().
QwtLinearColorMap Matrix::colorMap | ( | ) | [inline] |
QwtLinearColorMap* Matrix::colorMapPointer | ( | ) | [inline] |
References d_color_map.
ColorMapType Matrix::colorMapType | ( | ) | [inline] |
int Matrix::columnsWidth | ( | ) | [inline, slot] |
Return the width of all columns.
References d_column_width.
Referenced by MatrixDialog::apply(), copy(), and MatrixDialog::setMatrix().
void Matrix::copy | ( | Matrix * | m | ) | [slot] |
References colorMap(), colorMapType(), columnsWidth(), d_color_map, d_color_map_type, d_header_view_type, d_matrix_model, d_select_all_shortcut, d_stack, d_table_view, d_view_type, MatrixModel::dataVector(), formula(), formula_str, headerViewType(), imageLabel, ImageView, initImageView(), matrixModel(), num_precision, numCols(), numRows(), precision(), resetView(), setColumnsWidth(), textFormat(), txt_format, viewType(), x_end, x_start, xEnd(), xStart(), y_end, y_start, yEnd(), and yStart().
void Matrix::copySelection | ( | ) | [slot] |
Standard copy operation.
References MdiSubWindow::applicationWindow(), d_matrix_model, d_table_view, d_view_type, ApplicationWindow::endOfLine(), ImageView, MatrixModel::text(), and text().
Referenced by cutSelection().
void Matrix::customEvent | ( | QEvent * | e | ) |
Custom event handler.
Currently handles SCRIPTING_CHANGE_EVENT only.
References scripted::scriptingChangeEvent().
void Matrix::cutSelection | ( | ) | [slot] |
Standard cut operation.
References clearSelection(), and copySelection().
void Matrix::deleteSelectedColumns | ( | ) | [slot] |
Delte the selected columns.
References d_matrix_model, d_table_view, d_undo_stack, MatrixModel::dataCopy(), ignoreUndo(), modifiedData(), MdiSubWindow::modifiedWindow(), numCols(), numRows(), and MatrixModel::removeColumns().
void Matrix::deleteSelectedRows | ( | ) | [slot] |
Delete the selected rows.
References d_matrix_model, d_table_view, d_undo_stack, MatrixModel::dataCopy(), ignoreUndo(), modifiedData(), MdiSubWindow::modifiedWindow(), numCols(), numRows(), and MatrixModel::removeRows().
double Matrix::determinant | ( | ) |
Calculate the determinant of the matrix.
References MdiSubWindow::applicationWindow(), cell(), d_matrix_model, MatrixModel::dataVector(), numCols(), and numRows().
Referenced by ApplicationWindow::matrixDeterminant().
void Matrix::displayImage | ( | const QImage & | image | ) |
References imageLabel.
Referenced by importImage(), initImage(), MatrixSetImageCommand::redo(), resetView(), setColorMap(), setDefaultColorMap(), setGrayScale(), setRainbowColorMap(), and setViewType().
double Matrix::dx | ( | ) | [inline, slot] |
Returns the step of the X axis.
References numCols(), x_end, and x_start.
Referenced by boundingRect(), MatrixModel::calculate(), MatrixModel::headerData(), integrate(), MatrixData::MatrixData(), MatrixModel::muParserCalculate(), Graph3D::updateScalesFromMatrix(), and MatrixModel::x().
double Matrix::dy | ( | ) | [inline, slot] |
Returns the step of the Y axis.
References numRows(), y_end, and y_start.
Referenced by boundingRect(), MatrixModel::calculate(), MatrixModel::headerData(), integrate(), MatrixData::MatrixData(), MatrixModel::muParserCalculate(), Graph3D::updateScalesFromMatrix(), and MatrixModel::y().
bool Matrix::eventFilter | ( | QObject * | object, | |
QEvent * | e | |||
) | [private] |
References imageLabel.
bool Matrix::exportASCII | ( | const QString & | fname, | |
const QString & | separator, | |||
bool | exportSelection | |||
) |
bool Matrix::exportODF | ( | const QString & | fname, | |
bool | exportSelection | |||
) |
References d_matrix_model, d_table_view, d_view_type, numCols(), numRows(), TableView, and MatrixModel::text().
Referenced by exportASCII().
void Matrix::exportPDF | ( | const QString & | fileName | ) | [slot] |
References print().
void Matrix::exportRasterImage | ( | const QString & | fileName, | |
int | quality = 100 , |
|||
int | dpi = 0 | |||
) |
References d_matrix_model, image(), and MatrixModel::renderImage().
Referenced by ApplicationWindow::exportMatrix().
void Matrix::exportSVG | ( | const QString & | fileName | ) |
References d_matrix_model, numCols(), numRows(), and MatrixModel::renderImage().
Referenced by ApplicationWindow::exportMatrix(), and exportToFile().
void Matrix::exportToFile | ( | const QString & | fileName | ) |
References d_matrix_model, exportSVG(), exportVector(), and MatrixModel::renderImage().
void Matrix::exportVector | ( | const QString & | fileName, | |
int | res = 0 , |
|||
bool | color = true | |||
) |
References d_matrix_model, numCols(), numRows(), and MatrixModel::renderImage().
Referenced by ApplicationWindow::exportMatrix(), and exportToFile().
void Matrix::fft | ( | bool | inverse = false |
) |
References d_matrix_model, d_undo_stack, MatrixModel::dataCopy(), MatrixModel::fft(), ignoreUndo(), modifiedData(), MdiSubWindow::modifiedWindow(), numCols(), and numRows().
Referenced by ApplicationWindow::matrixDirectFFT(), and ApplicationWindow::matrixInverseFFT().
void Matrix::flipHorizontally | ( | ) |
References d_matrix_model, d_undo_stack, d_workspace, FlipHorizontally, initWorkspace(), numCols(), and numRows().
Referenced by ApplicationWindow::flipMatrixHorizontally().
void Matrix::flipVertically | ( | ) |
References d_matrix_model, d_undo_stack, d_workspace, FlipVertically, initWorkspace(), numCols(), and numRows().
Referenced by ApplicationWindow::flipMatrixVertically().
QString Matrix::formula | ( | ) | [inline, slot] |
Return the matrix formula.
References formula_str.
Referenced by MatrixValuesDialog::apply(), MatrixModel::calculate(), copy(), MatrixData::MatrixData(), MatrixModel::muParserCalculate(), PlotDialog::setActiveCurve(), and MatrixValuesDialog::setMatrix().
void Matrix::freeMatrixData | ( | double ** | data, | |
int | rows | |||
) | [static, slot] |
Free memory used for a matrix buffer.
Referenced by Graph3D::addMatrixData(), Graph3D::addRibbon(), MatrixModel::fft(), fft2d(), fft2d_inv(), FFTDialog::fftMatrix(), Graph3D::updateDataXY(), Graph3D::updateMatrixData(), Graph3D::updateScales(), and Graph3D::updateScalesFromMatrix().
void Matrix::freeWorkspace | ( | ) | [inline, slot] |
References d_workspace.
Referenced by MatrixModel::flipHorizontally(), MatrixModel::flipVertically(), MatrixModel::rotate90(), and MatrixModel::transpose().
void Matrix::goToColumn | ( | int | col | ) | [slot] |
Scroll to column (column starts with 1).
References d_matrix_model, d_table_view, d_undo_stack, d_view_type, ImageView, numCols(), and TableView.
void Matrix::goToRow | ( | int | row | ) | [slot] |
Scroll to row (row starts with 1).
References d_matrix_model, d_table_view, d_undo_stack, d_view_type, ImageView, numRows(), and TableView.
HeaderViewType Matrix::headerViewType | ( | ) | [inline] |
bool Matrix::ignoreUndo | ( | ) | [private] |
References MdiSubWindow::applicationWindow().
Referenced by calculate(), clearSelection(), deleteSelectedColumns(), deleteSelectedRows(), fft(), importASCII(), importImage(), muParserCalculate(), pasteSelection(), and setDimensions().
QImage Matrix::image | ( | ) |
References d_matrix_model, and MatrixModel::renderImage().
Referenced by exportRasterImage(), and importImage().
void Matrix::importASCII | ( | const QString & | fname, | |
const QString & | sep, | |||
int | ignoredLines, | |||
bool | stripSpaces, | |||
bool | simplifySpaces, | |||
const QString & | commentString, | |||
ImportMode | importAs = Overwrite , |
|||
const QLocale & | l = QLocale() , |
|||
int | endLineChar = 0 , |
|||
int | maxRows = -1 | |||
) |
References d_matrix_model, d_undo_stack, MatrixModel::dataCopy(), ignoreUndo(), MatrixModel::importASCII(), modifiedData(), MdiSubWindow::modifiedWindow(), numCols(), and numRows().
Referenced by ApplicationWindow::importASCII().
void Matrix::importImage | ( | const QImage & | image | ) |
void Matrix::importImage | ( | const QString & | fn | ) |
References d_matrix_model, d_undo_stack, d_view_type, MatrixModel::dataCopy(), displayImage(), ignoreUndo(), image(), ImageView, modifiedData(), MdiSubWindow::modifiedWindow(), numCols(), numRows(), MatrixModel::setImage(), setViewType(), MdiSubWindow::setWindowLabel(), x_end, x_start, y_end, and y_start.
Referenced by ApplicationWindow::dropEvent(), and ApplicationWindow::importImage().
void Matrix::initGlobals | ( | ) | [private] |
References MdiSubWindow::applicationWindow(), ApplicationWindow::d_3D_color_map, d_color_map, d_color_map_type, d_column_width, d_header_view_type, d_stack, d_table_view, d_undo_stack, d_workspace, formula_str, imageLabel, num_precision, txt_format, x_end, x_start, y_end, and y_start.
Referenced by initImage(), and initTable().
void Matrix::initImage | ( | const QImage & | image | ) | [private] |
References d_matrix_model, d_view_type, displayImage(), imageLabel, initGlobals(), initImageView(), x_end, x_start, y_end, and y_start.
Referenced by Matrix().
void Matrix::initImageView | ( | ) | [private] |
References d_stack, and imageLabel.
Referenced by copy(), initImage(), restore(), and setViewType().
void Matrix::initTable | ( | int | rows, | |
int | cols | |||
) | [private] |
Initialize the matrix.
References _Matrix_initial_columns_, _Matrix_initial_rows_, d_matrix_model, d_table_view, d_view_type, initGlobals(), and initTableView().
Referenced by Matrix().
void Matrix::initTableView | ( | ) | [private] |
References d_column_width, d_matrix_model, d_select_all_shortcut, d_stack, d_table_view, and numCols().
Referenced by initTable(), and setViewType().
double * Matrix::initWorkspace | ( | int | size | ) | [slot] |
Tries to allocate memory for the workspace. Returns a NULL pointer if failure.
References MdiSubWindow::applicationWindow(), and d_workspace.
Referenced by MatrixModel::flipHorizontally(), flipHorizontally(), MatrixModel::flipVertically(), flipVertically(), MatrixModel::rotate90(), rotate90(), MatrixModel::transpose(), and transpose().
void Matrix::insertColumn | ( | ) | [slot] |
Insert a column before the current cell.
References MatrixModel::canResize(), d_matrix_model, d_table_view, d_undo_stack, modifiedData(), MdiSubWindow::modifiedWindow(), numCols(), and numRows().
void Matrix::insertRow | ( | ) | [slot] |
Insert a row before the current cell.
References MatrixModel::canResize(), d_matrix_model, d_table_view, d_undo_stack, modifiedData(), MdiSubWindow::modifiedWindow(), numCols(), and numRows().
double Matrix::integrate | ( | ) |
Calculate the volume integral.
References MatrixModel::cell(), d_matrix_model, dx(), dy(), numCols(), and numRows().
void Matrix::invert | ( | ) |
Invert the matrix.
References MdiSubWindow::applicationWindow(), d_matrix_model, d_undo_stack, MatrixModel::initWorkspace(), Invert, numCols(), and numRows().
Referenced by ApplicationWindow::invertMatrix().
bool Matrix::isEmpty | ( | ) | [slot] |
Returns true if no data values were set for this matrix.
References range().
Referenced by Graph3D::addMatrixData(), and Graph3D::updateMatrixData().
MatrixModel* Matrix::matrixModel | ( | ) | [inline] |
References d_matrix_model.
Referenced by copy(), ImportOPJ::importTables(), QwtHistogram::loadDataFromMatrix(), and ApplicationWindow::matrixToTable().
void Matrix::modifiedData | ( | Matrix * | ) | [signal] |
void Matrix::moveCell | ( | const QModelIndex & | index | ) |
References d_matrix_model, and d_table_view.
Referenced by MatrixModel::setData().
bool Matrix::muParserCalculate | ( | int | startRow = 0 , |
|
int | endRow = -1 , |
|||
int | startCol = 0 , |
|||
int | endCol = -1 | |||
) |
Calculate matrix values using the formula_str (optimization for muParser).
References d_matrix_model, d_undo_stack, MatrixModel::dataCopy(), ignoreUndo(), modifiedData(), MdiSubWindow::modifiedWindow(), MatrixModel::muParserCalculate(), and MuParserCalculate.
Referenced by calculate().
void Matrix::notifyModifiedData | ( | ) | [inline, slot] |
References modifiedData().
Referenced by MatrixModel::setData().
int Matrix::numCols | ( | ) | [inline] |
Return the number of columns.
References MatrixModel::columnCount(), and d_matrix_model.
Referenced by CreateBinMatrixDialog::accept(), Graph3D::addMatrixData(), boundingRect(), muParserScript::cell(), copy(), deleteSelectedColumns(), deleteSelectedRows(), determinant(), dx(), exportASCII(), exportODF(), exportSVG(), exportVector(), fft(), FFTDialog::fftMatrix(), flipHorizontally(), flipVertically(), goToColumn(), importASCII(), importImage(), ImportOPJ::importTables(), initTableView(), insertColumn(), insertRow(), integrate(), invert(), QwtHistogram::loadDataFromMatrix(), MatrixData::MatrixData(), MatrixSizeDialog::MatrixSizeDialog(), ApplicationWindow::matrixToTable(), ImageProfilesTool::modifiedMatrix(), numSelectedColumns(), pasteSelection(), ApplicationWindow::plotImageProfiles(), print(), range(), rotate90(), save(), setColumnsWidth(), setDimensions(), MatrixValuesDialog::setMatrix(), MultiLayer::sizeToString(), transpose(), and Graph3D::updateMatrixData().
int Matrix::numRows | ( | ) | [inline] |
Return the number of rows.
References d_matrix_model, and MatrixModel::rowCount().
Referenced by CreateBinMatrixDialog::accept(), Graph3D::addMatrixData(), boundingRect(), muParserScript::cell(), copy(), deleteSelectedColumns(), deleteSelectedRows(), determinant(), dy(), exportASCII(), exportODF(), exportSVG(), exportVector(), fft(), FFTDialog::fftMatrix(), flipHorizontally(), flipVertically(), goToRow(), importASCII(), importImage(), ImportOPJ::importTables(), insertColumn(), insertRow(), integrate(), invert(), QwtHistogram::loadDataFromMatrix(), MatrixData::MatrixData(), MatrixSizeDialog::MatrixSizeDialog(), ApplicationWindow::matrixToTable(), ImageProfilesTool::modifiedMatrix(), numSelectedRows(), pasteSelection(), ApplicationWindow::plotImageProfiles(), print(), range(), rotate90(), save(), setDimensions(), MatrixValuesDialog::setMatrix(), MultiLayer::sizeToString(), transpose(), and Graph3D::updateMatrixData().
int Matrix::numSelectedColumns | ( | ) | [slot] |
Return the number of selected columns.
References d_table_view, and numCols().
Referenced by ApplicationWindow::showWindowContextMenu().
int Matrix::numSelectedRows | ( | ) | [slot] |
Return the number of selected rows.
References d_table_view, and numRows().
Referenced by ApplicationWindow::showWindowContextMenu().
void Matrix::pasteSelection | ( | ) | [slot] |
Standard paste operation.
References MdiSubWindow::applicationWindow(), cell(), ApplicationWindow::clipboardLocale(), d_matrix_model, d_table_view, d_undo_stack, d_view_type, MatrixModel::dataCopy(), ApplicationWindow::guessEndOfLine(), ignoreUndo(), ImageView, modifiedData(), MdiSubWindow::modifiedWindow(), numCols(), numRows(), MatrixModel::pasteData(), and text().
int Matrix::precision | ( | ) | [inline, slot] |
Return the number precision digits.
See arguments of setNumericFormat().
References num_precision.
Referenced by MatrixDialog::apply(), copy(), MatrixModel::data(), ApplicationWindow::decreasePrecision(), MatrixModel::headerData(), ApplicationWindow::increasePrecision(), MatrixModel::MatrixModel(), MatrixDialog::setMatrix(), and MatrixModel::text().
void Matrix::print | ( | ) | [slot] |
Print the Matrix.
Referenced by canCalculate(), exportPDF(), and print().
void Matrix::print | ( | const QString & | fileName | ) | [slot] |
Print the Matrix to fileName.
References MdiSubWindow::applicationWindow(), and print().
void Matrix::print | ( | QPrinter * | printer | ) | [slot] |
References d_matrix_model, d_table_view, d_view_type, MatrixModel::headerData(), ImageView, numCols(), numRows(), MatrixModel::renderImage(), and text().
void Matrix::range | ( | double * | min, | |
double * | max | |||
) | [slot] |
Min and max values of the matrix.
References cell(), numCols(), and numRows().
Referenced by FFTDialog::fftMatrix(), isEmpty(), QwtHistogram::loadDataFromMatrix(), MatrixData::MatrixData(), ImageProfilesTool::modifiedMatrix(), MultiLayer::plotProfiles(), MatrixModel::renderImage(), and ColorMapDialog::setMatrix().
void Matrix::resetView | ( | ) |
References d_column_width, d_matrix_model, d_table_view, d_view_type, displayImage(), ImageView, MatrixModel::renderImage(), and TableView.
Referenced by copy(), Fit::covarianceMatrix(), MatrixModel::fft(), MatrixModel::importASCII(), ApplicationWindow::openMatrix(), MatrixPasteCommand::redo(), MatrixSymmetryOperation::redo(), MatrixUndoCommand::redo(), MatrixSetSizeCommand::redo(), MatrixEditCellCommand::redo(), restore(), MatrixModel::setData(), setDimensions(), setHeaderViewType(), setNumericFormat(), MatrixPasteCommand::undo(), MatrixSymmetryOperation::undo(), MatrixUndoCommand::undo(), MatrixSetSizeCommand::undo(), and MatrixEditCellCommand::undo().
void Matrix::restore | ( | const QStringList & | l | ) | [slot] |
Load the matrix from a string list (i.e. lines from a project file).
References d_color_map_type, d_header_view_type, d_select_all_shortcut, d_stack, d_table_view, d_view_type, formula_str, imageLabel, ImageView, initImageView(), Rainbow, resetView(), setColorMap(), setColumnsWidth(), setRainbowColorMap(), setTextFormat(), x_end, x_start, y_end, and y_start.
void Matrix::rotate90 | ( | bool | clockwise = true |
) |
References d_matrix_model, d_undo_stack, d_workspace, initWorkspace(), numCols(), numRows(), RotateClockwise, and RotateCounterClockwise.
Referenced by ApplicationWindow::rotateMatrix90(), and ApplicationWindow::rotateMatrixMinus90().
void Matrix::save | ( | const QString & | fn, | |
const QString & | info, | |||
bool | saveAsTemplate = false | |||
) | [slot] |
Format the matrix format in a string to save it in a template file Return a string to save the matrix in a project file (<matrix> section)
References MdiSubWindow::birthDate(), MdiSubWindow::captionPolicy(), Custom, d_color_map, d_color_map_type, d_column_width, d_header_view_type, d_matrix_model, d_view_type, MatrixModel::dataVector(), formula_str, num_precision, numCols(), numRows(), ColorMapEditor::saveToXmlString(), txt_format, MdiSubWindow::windowLabel(), x_end, x_start, y_end, and y_start.
Referenced by ApplicationWindow::saveWindow().
QItemSelectionModel* Matrix::selectionModel | ( | ) | [inline] |
References d_table_view.
Referenced by MatrixValuesDialog::setMatrix().
void Matrix::setCell | ( | int | row, | |
int | col, | |||
double | value | |||
) | [slot] |
Set the value of the cell.
References d_matrix_model, and MatrixModel::setCell().
Referenced by CreateBinMatrixDialog::accept(), ApplicationWindow::convertTableToMatrixRegularXYZ(), Fit::covarianceMatrix(), FFTDialog::fftMatrix(), ApplicationWindow::openMatrix(), and ApplicationWindow::tableToMatrix().
void Matrix::setColorMap | ( | const QStringList & | lst | ) |
Used when restoring from project files.
References d_color_map, and d_color_map_type.
void Matrix::setColorMap | ( | const QwtLinearColorMap & | map | ) |
References d_color_map, d_color_map_type, d_matrix_model, d_view_type, displayImage(), ImageView, MdiSubWindow::modifiedWindow(), and MatrixModel::renderImage().
Referenced by ColorMapDialog::apply(), ImportOPJ::importTables(), ApplicationWindow::openMatrix(), MatrixSetColorMapCommand::redo(), restore(), and MatrixSetColorMapCommand::undo().
void Matrix::setColorMapType | ( | ColorMapType | mapType | ) |
References d_color_map_type, GrayScale, Rainbow, setGrayScale(), and setRainbowColorMap().
Referenced by ApplicationWindow::openMatrix().
void Matrix::setColumnsWidth | ( | int | width | ) | [slot] |
Set the width of all columns.
References d_column_width, d_table_view, d_view_type, MdiSubWindow::modifiedWindow(), numCols(), and TableView.
Referenced by MatrixDialog::apply(), copy(), ImportOPJ::importTables(), ApplicationWindow::openMatrix(), MatrixSetColWidthCommand::redo(), restore(), and MatrixSetColWidthCommand::undo().
void Matrix::setCoordinates | ( | double | xs, | |
double | xe, | |||
double | ys, | |||
double | ye | |||
) | [slot] |
Set the X and Y coordinate intervals.
References modifiedData(), MdiSubWindow::modifiedWindow(), x_end, x_start, y_end, and y_start.
Referenced by CreateBinMatrixDialog::accept(), MatrixSizeDialog::apply(), ApplicationWindow::convertTableToMatrixRegularXYZ(), ImportOPJ::importTables(), ApplicationWindow::openMatrix(), MatrixSetCoordinatesCommand::redo(), and MatrixSetCoordinatesCommand::undo().
void Matrix::setDefaultColorMap | ( | ) |
Resets the color map to the one defined by the user in the Preferences dialog (3D plots tab).
References MdiSubWindow::applicationWindow(), ApplicationWindow::d_3D_color_map, d_color_map, d_color_map_type, d_matrix_model, d_view_type, displayImage(), ImageView, MdiSubWindow::modifiedWindow(), and MatrixModel::renderImage().
Referenced by MatrixSetColorMapCommand::redo(), ApplicationWindow::setMatrixDefaultScale(), and MatrixSetColorMapCommand::undo().
void Matrix::setDimensions | ( | int | rows, | |
int | cols | |||
) | [slot] |
Set the Matrix size.
References MatrixModel::canResize(), d_matrix_model, d_undo_stack, MatrixModel::dataCopy(), ignoreUndo(), modifiedData(), MdiSubWindow::modifiedWindow(), numCols(), numRows(), resetView(), and MatrixModel::setDimensions().
Referenced by MatrixSizeDialog::apply().
void Matrix::setFormula | ( | const QString & | s | ) | [inline, slot] |
Set the matrix forumla.
References formula_str.
Referenced by MatrixValuesDialog::apply(), ImportOPJ::importTables(), ApplicationWindow::openMatrix(), MatrixSetFormulaCommand::redo(), and MatrixSetFormulaCommand::undo().
void Matrix::setGrayScale | ( | ) |
References d_color_map, d_color_map_type, d_matrix_model, d_view_type, displayImage(), ImageView, MdiSubWindow::modifiedWindow(), and MatrixModel::renderImage().
Referenced by ImportOPJ::importTables(), MatrixSetColorMapCommand::redo(), setColorMapType(), ApplicationWindow::setMatrixGrayScale(), and MatrixSetColorMapCommand::undo().
void Matrix::setHeaderViewType | ( | HeaderViewType | type | ) |
References d_header_view_type, d_view_type, MdiSubWindow::modifiedWindow(), resetView(), and TableView.
Referenced by ImportOPJ::importTables(), ApplicationWindow::openMatrix(), MatrixSetHeaderViewCommand::redo(), MatrixSetHeaderViewCommand::undo(), ApplicationWindow::viewMatrixColumnRow(), and ApplicationWindow::viewMatrixXY().
void Matrix::setNumCols | ( | int | cols | ) | [inline] |
References d_matrix_model, and MatrixModel::setColumnCount().
void Matrix::setNumericFormat | ( | const QChar & | f, | |
int | prec | |||
) | [slot] |
References MdiSubWindow::modifiedWindow(), num_precision, resetView(), and txt_format.
Referenced by MatrixDialog::apply(), ImportOPJ::importTables(), MatrixSetPrecisionCommand::redo(), and MatrixSetPrecisionCommand::undo().
void Matrix::setNumericPrecision | ( | int | prec | ) | [slot] |
Set the number of significant digits.
References num_precision.
Referenced by Fit::covarianceMatrix(), ApplicationWindow::decreasePrecision(), ApplicationWindow::increasePrecision(), and ApplicationWindow::initMatrix().
void Matrix::setNumRows | ( | int | rows | ) | [inline] |
References d_matrix_model, and MatrixModel::setRowCount().
void Matrix::setRainbowColorMap | ( | ) |
References d_color_map, d_color_map_type, d_matrix_model, d_view_type, displayImage(), ImageView, MdiSubWindow::modifiedWindow(), and MatrixModel::renderImage().
Referenced by MatrixSetColorMapCommand::redo(), restore(), setColorMapType(), ApplicationWindow::setMatrixRainbowScale(), and MatrixSetColorMapCommand::undo().
void Matrix::setText | ( | int | row, | |
int | col, | |||
const QString & | new_text | |||
) | [slot] |
Set the content of the cell as a string.
References d_matrix_model, and MatrixModel::setText().
Referenced by ApplicationWindow::openMatrix().
void Matrix::setTextFormat | ( | const QChar & | format, | |
int | precision | |||
) | [slot] |
Set the number format for the cells.
This method should only be called before any user interaction was done. Use setTextFormat() if you want to change it from a dialog.
References num_precision, and txt_format.
Referenced by ApplicationWindow::openMatrix(), and restore().
void Matrix::setViewType | ( | ViewType | type, | |
bool | renderImage = true | |||
) |
References d_matrix_model, d_select_all_shortcut, d_stack, d_table_view, d_view_type, displayImage(), imageLabel, ImageView, initImageView(), initTableView(), MdiSubWindow::modifiedWindow(), MatrixModel::renderImage(), and TableView.
Referenced by FFTDialog::fftMatrix(), importImage(), ImportOPJ::importTables(), ApplicationWindow::openMatrix(), MatrixSetImageCommand::redo(), MatrixSetViewCommand::redo(), MatrixSetImageCommand::undo(), MatrixSetViewCommand::undo(), ApplicationWindow::viewMatrixImage(), and ApplicationWindow::viewMatrixTable().
QString Matrix::sizeToString | ( | ) | [virtual] |
References MatrixModel::columnCount(), d_matrix_model, and MatrixModel::rowCount().
QString Matrix::text | ( | int | row, | |
int | col | |||
) | [slot] |
Return the content of the cell as a string.
References d_matrix_model, and MatrixModel::text().
Referenced by muParserScript::cell(), copySelection(), pasteSelection(), and print().
QChar Matrix::textFormat | ( | ) | [inline, slot] |
Return the text format code ('e', 'f', ...).
References txt_format.
Referenced by MatrixDialog::apply(), copy(), MatrixModel::data(), ApplicationWindow::decreasePrecision(), MatrixModel::headerData(), ApplicationWindow::increasePrecision(), MatrixModel::MatrixModel(), MatrixDialog::setMatrix(), and MatrixModel::text().
void Matrix::transpose | ( | ) |
Transpose the matrix.
References d_matrix_model, d_undo_stack, d_workspace, initWorkspace(), numCols(), numRows(), and Transpose.
Referenced by ApplicationWindow::transposeMatrix().
QUndoStack* Matrix::undoStack | ( | ) | [inline] |
References d_undo_stack.
Referenced by MatrixValuesDialog::apply(), MatrixSizeDialog::apply(), MatrixDialog::apply(), ColorMapDialog::apply(), ApplicationWindow::decreasePrecision(), ApplicationWindow::increasePrecision(), ApplicationWindow::initMatrix(), MatrixModel::setData(), ApplicationWindow::setMatrixDefaultScale(), ApplicationWindow::setMatrixGrayScale(), ApplicationWindow::setMatrixRainbowScale(), ApplicationWindow::viewMatrixColumnRow(), ApplicationWindow::viewMatrixImage(), ApplicationWindow::viewMatrixTable(), and ApplicationWindow::viewMatrixXY().
int Matrix::verticalHeaderWidth | ( | ) | [inline, slot] |
References d_table_view.
Referenced by ApplicationWindow::importASCII(), and ImportOPJ::importTables().
ViewType Matrix::viewType | ( | ) | [inline] |
double Matrix::xEnd | ( | ) | [inline, slot] |
Returns the X value corresponding to the last column.
References x_end.
Referenced by Graph3D::addMatrixData(), MatrixSizeDialog::apply(), copy(), MatrixModel::headerData(), ImageProfilesTool::ImageProfilesTool(), MatrixSizeDialog::MatrixSizeDialog(), ImageProfilesTool::modifiedMatrix(), ApplicationWindow::plotImage(), MultiLayer::plotProfiles(), Graph3D::updateMatrixData(), Graph3D::updateScalesFromMatrix(), and MatrixModel::x().
double Matrix::xStart | ( | ) | [inline, slot] |
Returns the X value corresponding to column 1.
References x_start.
Referenced by Graph3D::addMatrixData(), MatrixSizeDialog::apply(), MatrixModel::calculate(), copy(), MatrixModel::headerData(), ImageProfilesTool::ImageProfilesTool(), MatrixData::MatrixData(), MatrixSizeDialog::MatrixSizeDialog(), ImageProfilesTool::modifiedMatrix(), MatrixModel::muParserCalculate(), ApplicationWindow::plotImage(), MultiLayer::plotProfiles(), Graph3D::updateMatrixData(), Graph3D::updateScalesFromMatrix(), and MatrixModel::x().
double Matrix::yEnd | ( | ) | [inline, slot] |
Returns the Y value corresponding to the last row.
References y_end.
Referenced by Graph3D::addMatrixData(), MatrixSizeDialog::apply(), copy(), MatrixModel::headerData(), ImageProfilesTool::ImageProfilesTool(), MatrixSizeDialog::MatrixSizeDialog(), ImageProfilesTool::modifiedMatrix(), ApplicationWindow::plotImage(), MultiLayer::plotProfiles(), Graph3D::updateMatrixData(), Graph3D::updateScalesFromMatrix(), and MatrixModel::y().
double Matrix::yStart | ( | ) | [inline, slot] |
Returns the Y value corresponding to row 1.
References y_start.
Referenced by Graph3D::addMatrixData(), MatrixSizeDialog::apply(), MatrixModel::calculate(), copy(), MatrixModel::headerData(), ImageProfilesTool::ImageProfilesTool(), MatrixData::MatrixData(), MatrixSizeDialog::MatrixSizeDialog(), ImageProfilesTool::modifiedMatrix(), MatrixModel::muParserCalculate(), ApplicationWindow::plotImage(), MultiLayer::plotProfiles(), Graph3D::updateMatrixData(), Graph3D::updateScalesFromMatrix(), and MatrixModel::y().
QwtLinearColorMap Matrix::d_color_map [private] |
The color map used to display images.
Referenced by colorMap(), colorMapPointer(), copy(), initGlobals(), save(), setColorMap(), setDefaultColorMap(), setGrayScale(), and setRainbowColorMap().
ColorMapType Matrix::d_color_map_type [private] |
The color map type.
Referenced by colorMapType(), copy(), initGlobals(), restore(), save(), setColorMap(), setColorMapType(), setDefaultColorMap(), setGrayScale(), and setRainbowColorMap().
int Matrix::d_column_width [private] |
Column width in pixels;.
Referenced by columnsWidth(), initGlobals(), initTableView(), resetView(), save(), and setColumnsWidth().
HeaderViewType Matrix::d_header_view_type [private] |
Keeps track of the header view type;.
Referenced by copy(), headerViewType(), initGlobals(), restore(), save(), and setHeaderViewType().
MatrixModel* Matrix::d_matrix_model [private] |
Referenced by calculate(), cell(), clearSelection(), copy(), copySelection(), deleteSelectedColumns(), deleteSelectedRows(), determinant(), exportASCII(), exportODF(), exportRasterImage(), exportSVG(), exportToFile(), exportVector(), fft(), flipHorizontally(), flipVertically(), goToColumn(), goToRow(), image(), importASCII(), importImage(), initImage(), initTable(), initTableView(), insertColumn(), insertRow(), integrate(), invert(), matrixModel(), moveCell(), muParserCalculate(), numCols(), numRows(), pasteSelection(), print(), resetView(), rotate90(), save(), setCell(), setColorMap(), setDefaultColorMap(), setDimensions(), setGrayScale(), setNumCols(), setNumRows(), setRainbowColorMap(), setText(), setViewType(), sizeToString(), text(), transpose(), and ~Matrix().
QShortcut* Matrix::d_select_all_shortcut [private] |
Referenced by copy(), initTableView(), restore(), and setViewType().
QStackedWidget* Matrix::d_stack [private] |
Referenced by copy(), initGlobals(), initImageView(), initTableView(), restore(), and setViewType().
QTableView* Matrix::d_table_view [private] |
Pointer to the table view.
Referenced by clearSelection(), copy(), copySelection(), deleteSelectedColumns(), deleteSelectedRows(), exportASCII(), exportODF(), goToColumn(), goToRow(), initGlobals(), initTable(), initTableView(), insertColumn(), insertRow(), moveCell(), numSelectedColumns(), numSelectedRows(), pasteSelection(), print(), resetView(), restore(), selectionModel(), setColumnsWidth(), setViewType(), and verticalHeaderWidth().
QUndoStack* Matrix::d_undo_stack [private] |
Undo/Redo commands stack.
Referenced by calculate(), clearSelection(), deleteSelectedColumns(), deleteSelectedRows(), fft(), flipHorizontally(), flipVertically(), goToColumn(), goToRow(), importASCII(), importImage(), initGlobals(), insertColumn(), insertRow(), invert(), muParserCalculate(), pasteSelection(), rotate90(), setDimensions(), transpose(), undoStack(), and ~Matrix().
ViewType Matrix::d_view_type [private] |
Keeps track of the view type;.
Referenced by clearSelection(), copy(), copySelection(), exportASCII(), exportODF(), goToColumn(), goToRow(), importImage(), initImage(), initTable(), pasteSelection(), print(), resetView(), restore(), save(), setColorMap(), setColumnsWidth(), setDefaultColorMap(), setGrayScale(), setHeaderViewType(), setRainbowColorMap(), setViewType(), and viewType().
double* Matrix::d_workspace [private] |
Pointer to a data buffer used for matrix operations.
Referenced by flipHorizontally(), flipVertically(), freeWorkspace(), initGlobals(), initWorkspace(), rotate90(), and transpose().
QString Matrix::formula_str [private] |
Last formula used to calculate cell values.
Referenced by canCalculate(), copy(), formula(), initGlobals(), restore(), save(), and setFormula().
QLabel* Matrix::imageLabel [private] |
Used to display the image view.
Referenced by copy(), displayImage(), eventFilter(), initGlobals(), initImage(), initImageView(), restore(), and setViewType().
int Matrix::num_precision [private] |
Number of significant digits.
Referenced by copy(), initGlobals(), precision(), save(), setNumericFormat(), setNumericPrecision(), and setTextFormat().
QChar Matrix::txt_format [private] |
Format code for displaying numbers.
Referenced by copy(), initGlobals(), save(), setNumericFormat(), setTextFormat(), and textFormat().
double Matrix::x_end [private] |
X value corresponding to the last column.
Referenced by boundingRect(), copy(), dx(), importImage(), initGlobals(), initImage(), restore(), save(), setCoordinates(), and xEnd().
double Matrix::x_start [private] |
X value corresponding to column 1.
Referenced by boundingRect(), copy(), dx(), importImage(), initGlobals(), initImage(), restore(), save(), setCoordinates(), and xStart().
double Matrix::y_end [private] |
Y value corresponding to the last row.
Referenced by boundingRect(), copy(), dy(), importImage(), initGlobals(), initImage(), restore(), save(), setCoordinates(), and yEnd().
double Matrix::y_start [private] |
Y value corresponding to row 1.
Referenced by boundingRect(), copy(), dy(), importImage(), initGlobals(), initImage(), restore(), save(), setCoordinates(), and yStart().