SciDAVis  1.D4
Public Member Functions | Private Attributes
future::Matrix::Private Class Reference

#include <future_Matrix.h>

List of all members.

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.
Matrixd_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.

Detailed Description

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.


Constructor & Destructor Documentation

future::Matrix::Private::Private ( Matrix owner)

Member Function Documentation

void future::Matrix::Private::blockChangeSignals ( bool  block)
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 
)
int future::Matrix::Private::columnCount ( ) const
inline
int future::Matrix::Private::columnWidth ( int  col) const
inline

References d_column_widths.

Referenced by future::Matrix::columnWidth().

int future::Matrix::Private::displayedDigits ( ) const
inline
void future::Matrix::Private::emitDataChanged ( int  top,
int  left,
int  bottom,
int  right 
)
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
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.

Parameters:
beforeindex of the column to insert before
countthe 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.

Parameters:
beforeindex of the row to insert before
countthe number of rows to be inserted

References future::Matrix::defaultRowHeight().

Referenced by MatrixInsertRowsCmd::redo(), MatrixTransposeCmd::redo(), and MatrixRemoveRowsCmd::undo().

QString future::Matrix::Private::name ( ) const
inline
char future::Matrix::Private::numericFormat ( ) const
inline
void future::Matrix::Private::removeColumns ( int  first,
int  count 
)

Remove Columns.

Parameters:
firstindex of the first column to be removed
countnumber of columns to remove

Referenced by MatrixRemoveColumnsCmd::redo(), MatrixTransposeCmd::redo(), and MatrixInsertColumnsCmd::undo().

void future::Matrix::Private::removeRows ( int  first,
int  count 
)

Remove Columns.

Parameters:
firstindex of the first row to be removed
countnumber 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().

int future::Matrix::Private::rowCount ( ) const
inline
int future::Matrix::Private::rowHeight ( int  row) const
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 
)
void future::Matrix::Private::setColumnWidth ( int  col,
int  width 
)
inline
void future::Matrix::Private::setDisplayedDigits ( int  digits)
inline
void future::Matrix::Private::setFormula ( const QString &  formula)
void future::Matrix::Private::setNumericFormat ( char  format)
inline
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().

void future::Matrix::Private::setRowHeight ( int  row,
int  height 
)
inline

References d_row_heights.

Referenced by future::Matrix::setRowHeight().

void future::Matrix::Private::setXEnd ( double  x)
void future::Matrix::Private::setXStart ( double  x)
void future::Matrix::Private::setYEnd ( double  y)
void future::Matrix::Private::setYStart ( double  y)
double future::Matrix::Private::xEnd ( ) const
double future::Matrix::Private::xStart ( ) const
double future::Matrix::Private::yEnd ( ) const
double future::Matrix::Private::yStart ( ) const

Member Data Documentation

bool future::Matrix::Private::d_block_change_signals
private

Referenced by blockChangeSignals(), and Private().

int future::Matrix::Private::d_column_count
private

The number of columns.

Referenced by columnCount().

QList<int> future::Matrix::Private::d_column_widths
private

Columns widths.

Referenced by columnWidth(), and setColumnWidth().

QVector< QVector<qreal> > future::Matrix::Private::d_data
private

The matrix data.

int future::Matrix::Private::d_displayed_digits
private

Number of significant digits.

Referenced by displayedDigits(), Private(), and setDisplayedDigits().

QString future::Matrix::Private::d_formula
private

Last formula used to calculate cell values.

char future::Matrix::Private::d_numeric_format
private

Format code for displaying numbers.

Referenced by numericFormat(), Private(), and setNumericFormat().

Matrix* future::Matrix::Private::d_owner
private

The owner aspect.

Referenced by emitDataChanged(), name(), setDisplayedDigits(), and setNumericFormat().

int future::Matrix::Private::d_row_count
private

The number of rows.

Referenced by rowCount().

QList<int> future::Matrix::Private::d_row_heights
private

Row widths.

Referenced by rowHeight(), and setRowHeight().

double future::Matrix::Private::d_x_end
private

X value corresponding to the last column.

Referenced by Private().

double future::Matrix::Private::d_x_start
private

X value corresponding to column 1.

Referenced by Private().

double future::Matrix::Private::d_y_end
private

Y value corresponding to the last row.

Referenced by Private().

double future::Matrix::Private::d_y_start
private

Y value corresponding to row 1.

Referenced by Private().


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