32 #include <QHeaderView> 35 #include <QMessageBox> 43 #include <qwt_double_rect.h> 48 #define _Matrix_initial_rows_ 10 49 #define _Matrix_initial_columns_ 3 101 void exportRasterImage(
const QString& fileName,
int quality = 100,
int dpi = 0,
int compression = 0);
104 void exportVector(
const QString& fileName,
int res = 0,
bool color =
true);
105 void exportVector(QPrinter *printer,
int res = 0,
bool color =
true);
132 void moveCell(
const QModelIndex& index);
136 void rotate90(
bool clockwise =
true);
137 void fft(
bool inverse =
false);
159 bool calculate(
int startRow = 0,
int endRow = -1,
int startCol = 0,
int endCol = -1,
bool forceMuParser =
false);
161 bool muParserCalculate(
int startRow = 0,
int endRow = -1,
int startCol = 0,
int endCol = -1);
163 bool exportODF(
const QString& fname,
bool exportSelection);
164 bool exportExcel(
const QString& fname,
bool exportSelection);
167 bool exportASCII(
const QString& fname,
const QString& separator,
bool exportSelection);
168 void importASCII(
const QString &fname,
const QString &sep,
int ignoredLines,
bool stripSpaces,
170 const QLocale& l = QLocale(),
int endLineChar = 0,
int maxRows = -1);
178 void print(QPrinter *);
180 void print(
const QString& fileName);
191 QString
text(
int row,
int col);
193 void setText(
int row,
int col,
const QString & new_text );
195 double cell(
int row,
int col);
197 void setCell(
int row,
int col,
double value );
236 void restore(
const QStringList &l);
239 void save(
const QString &,
const QString &,
bool saveAsTemplate =
false);
285 void range(
double *
min,
double *max);
void setRainbowColorMap()
Definition: Matrix.cpp:1490
void fft(bool inverse=false)
Definition: Matrix.cpp:1562
double cell(int row, int col)
Return the value of the cell as a double.
Definition: Matrix.cpp:151
void goToRow(int row)
Scroll to row (row starts with 1)
Definition: Matrix.cpp:1265
HeaderViewType d_header_view_type
Keeps track of the header view type;.
Definition: Matrix.h:351
double d_color_max
Maximum value corresponding to the last color in the color map.
Definition: Matrix.h:346
QString formula_str
Last formula used to calculate cell values.
Definition: Matrix.h:333
int precision()
Return the number precision digits.
Definition: Matrix.h:211
void setNumRows(int rows)
Definition: Matrix.h:115
Definition: MatrixModel.h:43
MatrixModel * d_matrix_model
Definition: Matrix.h:327
ViewType viewType()
Definition: Matrix.h:92
void exportPDF(const QString &fileName)
Definition: Matrix.cpp:1004
void invert()
Invert the matrix.
Definition: Matrix.cpp:444
double y_start
Y value corresponding to row 1.
Definition: Matrix.h:338
int numSelectedRows()
Return the number of selected rows.
Definition: Matrix.cpp:853
void setDefaultColorMap()
Resets the color map to the one defined by the user in the Preferences dialog (3D plots tab) ...
Definition: Matrix.cpp:1472
ViewType d_view_type
Keeps track of the view type;.
Definition: Matrix.h:349
double x_start
X value corresponding to column 1.
Definition: Matrix.h:338
double y_end
Y value corresponding to the last row.
Definition: Matrix.h:338
void cutSelection()
Standard cut operation.
Definition: Matrix.cpp:781
QShortcut * d_select_all_shortcut
Definition: Matrix.h:358
void setFormula(const QString &s)
Set the matrix forumla.
Definition: Matrix.h:233
bool eventFilter(QObject *, QEvent *)
Definition: Matrix.cpp:1794
HeaderViewType
Definition: Matrix.h:81
void resample(int rows, int cols, const ResamplingMethod &method=Bilinear)
Definition: Matrix.cpp:494
ViewType
Definition: Matrix.h:82
void setCell(int row, int col, double value)
Set the value of the cell.
Definition: Matrix.cpp:156
An interpreter for evaluating scripting code. Abstract.
Definition: ScriptingEnv.h:50
LinearColorMap * colorMapPointer()
Definition: Matrix.h:143
void notifyModifiedData()
Definition: Matrix.h:310
void customEvent(QEvent *e)
Custom event handler.
Definition: Matrix.cpp:923
void exportVector(const QString &fileName, int res=0, bool color=true)
Definition: Matrix.cpp:1149
void flipVertically()
Definition: Matrix.cpp:464
Operation
Definition: Matrix.h:79
int columnCount(const QModelIndex &parent=QModelIndex()) const
Definition: MatrixModel.cpp:123
int numCols()
Return the number of columns.
Definition: Matrix.h:118
ResamplingMethod
Definition: Matrix.h:89
int d_column_width
Column width in pixels;.
Definition: Matrix.h:357
void insertColumn()
Insert a column before the current cell.
Definition: Matrix.cpp:903
QStackedWidget * d_stack
Definition: Matrix.h:326
void importImage(const QString &fn)
Definition: Matrix.cpp:1424
void smooth()
Definition: Matrix.cpp:527
void displayImage(const QImage &image)
Definition: Matrix.cpp:1339
void setHeaderViewType(HeaderViewType type)
Definition: Matrix.cpp:1539
double yStart()
Returns the Y value corresponding to row 1.
Definition: Matrix.h:270
double xEnd()
Returns the X value corresponding to the last column.
Definition: Matrix.h:268
double yEnd()
Returns the Y value corresponding to the last row.
Definition: Matrix.h:272
void save(const QString &, const QString &, bool saveAsTemplate=false)
Definition: Matrix.cpp:185
A customized QwtLinearColorMap.
Definition: LinearColorMap.h:39
double * initWorkspace(int size)
Tries to allocate memory for the workspace. Returns a NULL pointer if failure.
Definition: Matrix.cpp:1776
void initTableView()
Definition: Matrix.cpp:1384
QwtDoubleInterval colorRange()
Min and max values of the color map.
Definition: Matrix.cpp:1207
void print()
Print the Matrix.
Definition: Matrix.cpp:1009
bool isEmpty()
Returns true if no data values were set for this matrix.
Definition: Matrix.cpp:1174
#define min(a, b)
Definition: ShapiroWilkTest.cpp:36
bool calculate(int startRow=0, int endRow=-1, int startCol=0, int endCol=-1, bool forceMuParser=false)
Calculate matrix values using the formula_str.
Definition: Matrix.cpp:618
void clearSelection()
Clear cells.
Definition: Matrix.cpp:639
double x_end
X value corresponding to the last column.
Definition: Matrix.h:338
bool exportExcel(const QString &fname, bool exportSelection)
Definition: Matrix.cpp:1656
int numRows()
Return the number of rows.
Definition: Matrix.h:114
void deleteSelectedRows()
Delete the selected rows.
Definition: Matrix.cpp:787
void insertRow()
Insert a row before the current cell.
Definition: Matrix.cpp:883
void setText(int row, int col, const QString &new_text)
Set the content of the cell as a string.
Definition: Matrix.cpp:166
void exportToFile(const QString &fileName)
Definition: Matrix.cpp:962
bool ignoreUndo()
Definition: Matrix.cpp:1769
void setNumericFormat(const QChar &f, int prec)
Definition: Matrix.cpp:328
void copySelection()
Standard copy operation.
Definition: Matrix.cpp:665
replace content of current matrix with the imported file
Definition: Matrix.h:87
void setDimensions(int rows, int cols)
Set the Matrix size.
Definition: Matrix.cpp:364
double integrate()
Calculate the volume integral.
Definition: Matrix.cpp:386
static double ** allocateMatrixData(int rows, int columns, bool init=false)
Allocate memory for a matrix buffer.
Definition: Matrix.cpp:1217
void resetView()
Definition: Matrix.cpp:1524
QtiPlot's main window.
Definition: ApplicationWindow.h:133
void restore(const QStringList &l)
Load the matrix from a string list (i.e. lines from a project file)
Definition: Matrix.cpp:256
QTableView * d_table_view
Pointer to the table view.
Definition: Matrix.h:329
ColorMapType d_color_map_type
The color map type.
Definition: Matrix.h:355
QImage image()
Definition: Matrix.cpp:1419
int verticalHeaderWidth()
Definition: Matrix.h:302
QUndoStack * d_undo_stack
Undo/Redo commands stack.
Definition: Matrix.h:360
void setColumnsWidth(int width)
Set the width of all columns.
Definition: Matrix.cpp:347
void freeWorkspace()
Definition: Matrix.h:307
void moveCell(const QModelIndex &index)
Definition: Matrix.cpp:1287
int num_precision
Number of significant digits.
Definition: Matrix.h:337
int columnsWidth()
Return the width of all columns.
Definition: Matrix.h:183
double d_color_min
Minimum value corresponding to the first color in the color map.
Definition: Matrix.h:344
QString formula()
Return the matrix formula.
Definition: Matrix.h:231
void setTextFormat(const QChar &format, int precision)
Set the number format for the cells.
Definition: Matrix.cpp:341
Matrix worksheet class.
Definition: Matrix.h:57
void modifiedData(Matrix *)
QLabel * imageLabel
Used to display the image view.
Definition: Matrix.h:331
double * d_workspace
Pointer to a data buffer used for matrix operations.
Definition: Matrix.h:362
ImportMode
Definition: Matrix.h:84
void initImageView()
Definition: Matrix.cpp:1374
void exportRasterImage(const QString &fileName, int quality=100, int dpi=0, int compression=0)
Definition: Matrix.cpp:929
MatrixModel * matrixModel()
Definition: Matrix.h:108
void exportEMF(const QString &fileName)
Definition: Matrix.cpp:1164
QChar textFormat()
Return the text format code ('e', 'f', ...)
Definition: Matrix.h:204
void copy(Matrix *m)
Definition: Matrix.cpp:1295
QString text(int row, int col)
Return the content of the cell as a string.
Definition: Matrix.cpp:161
void goToColumn(int col)
Scroll to column (column starts with 1)
Definition: Matrix.cpp:1276
void setColorMapType(ColorMapType mapType)
Definition: Matrix.cpp:1514
void setColorMap(const LinearColorMap &map)
Definition: Matrix.cpp:1504
void exportSVG(const QString &fileName)
Definition: Matrix.cpp:990
Matrix(ScriptingEnv *env, int r, int c, const QString &label, ApplicationWindow *parent, const QString &name=QString(), Qt::WFlags f=0)
Constructor.
Definition: Matrix.cpp:73
QwtDoubleRect boundingRect()
Returns the bounding rect of the matrix coordinates.
Definition: Matrix.cpp:1551
void rotate90(bool clockwise=true)
Definition: Matrix.cpp:482
add file as new columns to the current matrix
Definition: Matrix.h:85
bool exportODF(const QString &fname, bool exportSelection)
Definition: Matrix.cpp:1578
QChar txt_format
Format code for displaying numbers.
Definition: Matrix.h:335
QUndoStack * undoStack()
Definition: Matrix.h:109
void range(double *min, double *max)
Min and max values of the matrix.
Definition: Matrix.cpp:1185
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)
Definition: Matrix.cpp:1749
HeaderViewType headerViewType()
Definition: Matrix.h:94
int numSelectedColumns()
Return the number of selected columns.
Definition: Matrix.cpp:868
bool canCalculate(bool useMuParser=true)
Definition: Matrix.cpp:546
ColorMapType colorMapType()
Definition: Matrix.h:139
void transpose()
Transpose the matrix.
Definition: Matrix.cpp:455
bool exportASCII(const QString &fname, const QString &separator, bool exportSelection)
Definition: Matrix.cpp:1666
Base class of all MDI client windows.
Definition: MdiSubWindow.h:51
Interface for maintaining a reference to the current ScriptingEnv.
Definition: Script.h:152
void initGlobals()
Definition: Matrix.cpp:85
int rowCount(const QModelIndex &parent=QModelIndex()) const
Definition: MatrixModel.cpp:118
QItemSelectionModel * selectionModel()
Definition: Matrix.h:111
bool exportOdsSpreadsheet(const QString &fname, bool exportSelection)
Definition: Matrix.cpp:1642
void setRowCount(int rows)
Definition: MatrixModel.cpp:128
void setViewType(ViewType, bool renderImage=true)
Definition: Matrix.cpp:1352
void initTable(int rows, int cols)
Initialize the matrix.
Definition: Matrix.cpp:114
LinearColorMap d_color_map
The color map used to display images.
Definition: Matrix.h:353
virtual QString sizeToString()
Size of the widget as a string.
Definition: Matrix.cpp:1788
void setCoordinates(double xs, double xe, double ys, double ye)
Set the X and Y coordinate intervals.
Definition: Matrix.cpp:171
bool muParserCalculate(int startRow=0, int endRow=-1, int startCol=0, int endCol=-1)
Calculate matrix values using the formula_str (optimization for muParser).
Definition: Matrix.cpp:600
void deleteSelectedColumns()
Delte the selected columns.
Definition: Matrix.cpp:820
void pasteSelection()
Standard paste operation.
Definition: Matrix.cpp:697
void flipHorizontally()
Definition: Matrix.cpp:473
void setColumnCount(int cols)
Definition: MatrixModel.cpp:143
double dx()
Returns the step of the X axis.
Definition: Matrix.h:275
void setNumericPrecision(int prec)
Set the number of significant digits.
Definition: Matrix.cpp:318
void initImage(const QImage &image)
Definition: Matrix.cpp:127
QString name()
Return the window name.
Definition: MdiSubWindow.h:84
static void freeMatrixData(double **data, int rows)
Free memory used for a matrix buffer.
Definition: Matrix.cpp:1257
LinearColorMap colorMap()
Definition: Matrix.h:142
void setNumCols(int cols)
Definition: Matrix.h:119
double dy()
Returns the step of the Y axis.
Definition: Matrix.h:277
void setGrayScale()
Definition: Matrix.cpp:1481
double determinant()
Calculate the determinant of the matrix.
Definition: Matrix.cpp:402
double xStart()
Returns the X value corresponding to column 1.
Definition: Matrix.h:266
ColorMapType
Definition: Matrix.h:83
add file as new rows to the current matrix
Definition: Matrix.h:86
~Matrix()
Definition: Matrix.cpp:1817