Logo Search packages:      
Sourcecode: scidavis version File versions  Download package

Matrix Class Reference

#include <Matrix.h>

Inheritance diagram for Matrix:

MatrixView scripted MyWidget

List of all members.

Detailed Description

Matrix worksheet class.

Definition at line 51 of file Matrix.h.

Public Types

enum  CaptionPolicy { Name = 0, Label = 1, Both = 2 }
 Possible window captions. More...
enum  Status { Hidden = -1, Normal = 0, Minimized = 1, Maximized = 2 }

Public Slots

static double ** allocateMatrixData (int rows, int columns)
 Allocate memory for a matrix buffer.
void applyCoordinates ()
void applyFormat ()
virtual QString birthDate ()
 Return the creation date.
QwtDoubleRect boundingRect ()
 Returns the bounding rect of the matrix coordinates.
double cell (int row, int col)
 Return the value of the cell as a double.
void clearSelection ()
 Clear cells.
bool columnsSelected ()
 Return whether any columns are fully selected.
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 determinant ()
 Calculate the determinant of the matrix.
void exportPDF (const QString &fileName)
void forgetSavedCells ()
QString formula ()
 Return the matrix formula.
static void freeMatrixData (double **data, int rows)
 Free memory used for a matrix buffer.
static MatrixfromImage (const QImage &image, ScriptingEnv *env)
void goToCell (int row, int col)
void handleChange ()
void handleHorizontalSectionResized (int logicalIndex, int oldSize, int newSize)
void handleVerticalSectionResized (int logicalIndex, int oldSize, int newSize)
void insertColumn ()
 Insert a column before the current cell.
void insertRow ()
 Insert a row before the current cell.
void invert ()
 Invert the matrix.
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 ()
 Print the Matrix.
void range (double *min, double *max)
 Min and max values of the matrix.
bool recalculate ()
 Calculate matrix values using the formula for all selected cells.
void rereadSectionSizes ()
bool rowsSelected ()
 Return whether any rows are fully selected.
QString saveAsTemplate (const QString &info)
 Format the matrix format in a string to save it in a template file.
void saveCellsToMemory ()
 Temporally save the cell values to memory.
QString saveText ()
 Return a string conaining the data of the matrix (<data> section).
QString saveToString (const QString &info)
 Return a string to save the matrix in a project file (<matrix> section).
void selectAll ()
void setCell (int row, int col, double value)
 Set the value of the cell.
void setColumnsWidth (int width)
 Set the width of all columns (obsolete, only for OPJ import).
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)
 Set the number format for the cells.
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.
void showControlCoordinatesTab ()
void showControlFormatTab ()
void showControlFormulaTab ()
QString text (int row, int col)
 Return the content of the cell as a string.
QChar textFormat ()
 Return the text format code ('e', 'f', ...).
void toggleControlTabBar ()
void transpose ()
 Transpose the matrix.
void updateCoordinatesTab ()
void updateFormatTab ()
void updateFormulaTab ()
double xEnd ()
 Return the X value corresponding to the last column.
double xStart ()
 Return the X value corresponding to column 1.
double yEnd ()
 Return the Y value corresponding to the last row.
double yStart ()
 Return the Y value corresponding to row 1.


void closedWindow (MyWidget *)
 Emitted when the window was closed.
void controlTabBarStatusChanged (bool visible)
void hiddenWindow (MyWidget *)
 Emitted when the window was hidden.
void modifiedWindow (QWidget *)
void resizedWindow (QWidget *)
void showContextMenu ()
 Show the context menu.
void showTitleBarMenu ()
 Emitted when the title bar recieves a QContextMenuEvent.
void statusChanged (MyWidget *)
 Emitted when the window status changed.

Public Member Functions

void askOnCloseEvent (bool ask)
 Toggle the "ask on close" flag.
QString aspect ()
 Return the window status as a string.
virtual CaptionPolicy captionPolicy ()
 Return the caption policy.
void closeEvent (QCloseEvent *)
 Close event handler.
int columnWidth (int col) const
void customEvent (QEvent *e)
 Custom event handler.
Folderfolder ()
 Returns the pointer to the parent folder of the window.
bool isControlTabBarVisible ()
 Matrix (ScriptingEnv *env, int r, int c, const QString &label, QWidget *parent=0, const char *name=0, Qt::WFlags f=0)
virtual QString name ()
 Return the window name.
void notifyChanges ()
 Notifies the main application that the window has been modified.
int numCols ()
 Return the number of columns.
int numRows ()
 Return the number of rows.
virtual void restore (const QStringList &)
 Not implemented yet.
int rowHeight (int row) const
void scriptingChangeEvent (ScriptingChangeEvent *)
void scriptingChangeEvent (ScriptingChangeEvent *)
virtual void setBirthDate (const QString &s)
 Set the creation date.
void setCaptionPolicy (CaptionPolicy policy)
 Set the caption policy.
void setColumnWidth (int col, int width)
void setFolder (Folder *f)
 Initializes the pointer to the parent folder of the window.
virtual void setHidden ()
 Notifies that a window was hidden by a direct user action.
void setMaximized ()
void setMinimized ()
virtual void setName (const QString &s)
 Set the window name.
void setNormal ()
void setNumCols (int cols)
void setNumRows (int rows)
void setRowHeight (int row, int height)
void setStatus (Status s)
 Set the window status flag (hidden, normal, minimized or maximized).
virtual void setWindowLabel (const QString &s)
 Set the window label.
Status status ()
 Return the window status flag (hidden, normal, minimized or maximized).
void updateDecimalSeparators ()
virtual QWidget * view ()
virtual QString windowLabel ()
 Return the window label.
selection related functions
int firstSelectedColumn (bool full=false)
 Return the index of the first selected column.
int firstSelectedRow (bool full=false)
 Return the index of the first selected row.
void getCurrentCell (int *row, int *col)
 Determine the current cell (-1 if no cell is designated as the current).
bool isCellSelected (int row, int col)
 Return whether a cell is selected.
bool isColumnSelected (int col, bool full=false)
 Returns true if column 'col' is selected; otherwise false.
bool isRowSelected (int row, bool full=false)
 Returns true if row 'row' is selected; otherwise false.
int lastSelectedColumn (bool full=false)
 Return the index of the last selected column.
int lastSelectedRow (bool full=false)
 Return the index of the last selected row.
int selectedColumnCount (bool full=false)
 Return how many columns are selected.
int selectedRowCount (bool full=false)
 Return how many rows are (at least partly) selected.
void setCellSelected (int row, int col)
 Select a cell.
void setCellsSelected (int first_row, int first_col, int last_row, int last_col)
 Select a range of cells.

Public Attributes


Protected Slots

void addCell ()
void addFunction ()
void advanceCell ()
 Advance current cell after [Return] or [Enter] was pressed.
void applyFormula ()
void handleAspectDescriptionChange (const AbstractAspect *aspect)
void updateCaption ()
 Set caption according to current CaptionPolicy, name and label.
void updateFunctionDoc ()
void updateTypeInfo ()

Protected Member Functions

virtual void changeEvent (QEvent *event)
 Catches parent changes (in order to gain access to the title bar).
bool eventFilter (QObject *watched, QEvent *event)
 Filters other object's events (customizes title bar's context menu).
void init ()
void retranslateStrings ()

Protected Attributes

bool askOnClose
 Toggle on/off: Ask the user "delete, hide, or cancel?" on a close event.
QString birthdate
 The creation date.
CaptionPolicy caption_policy
 The caption policy.
QWidget * d_control_tabs
 Widget that contains the control tabs UI from ui.
QToolButton * d_hide_button
 Button to toogle the visibility of d_tool_box.
QHBoxLayout * d_main_layout
 Pointer to the current underlying model.
 The matrix view (first part of the UI).
 Pointer to the parent folder of the window.
QWidget * titleBar
 Title bar of this MDI window if it currently belongs to a QWorkspace, NULL else.
Ui::MatrixControlTabs ui
QString w_label
 The window label.
Status w_status
 The window status.

Private Member Functions

void init (int rows, int cols)
 Initialize the matrix.
 Matrix (future::Matrix *future_matrix, ScriptingEnv *env, int r, int c, const QString &label, QWidget *parent=0, const char *name=0, Qt::WFlags f=0)

Private Attributes

double ** dMatrix
 Stores the matrix data only before the user opens the matrix dialog in order to avoid data loses during number format changes.

The documentation for this class was generated from the following files:

Generated by  Doxygen 1.6.0   Back to index