scidavis
2.3.0
About: SciDAVis is a free application for Scientific Data Analysis and Visualization (a fork off of QtiPlot).
![]() ![]() |
#include <future_Table.h>
Public Member Functions | |
Private (Table &owner) | |
void | replaceColumns (int first, QList< Column * > new_cols) |
Replace columns completely. More... | |
void | insertColumns (int before, QList< Column * > cols) |
Insert columns before column number 'before'. More... | |
void | removeColumns (int first, int count) |
Remove Columns. More... | |
void | appendColumns (QList< Column * > cols) |
Append columns to the table. More... | |
void | moveColumn (int from, int to) |
Move a column to another position. More... | |
int | columnCount () const |
Return the number of columns in the table. More... | |
int | rowCount () const |
Return the number of rows in the table. More... | |
void | setRowCount (int count) |
Set the number of rows of the table. More... | |
QString | columnHeader (int col) |
Return the full column header string. More... | |
int | numColsWithPD (SciDAVis::PlotDesignation pd) |
Return the number of columns with a given plot designation. More... | |
Column * | column (int index) const |
Return column number 'index'. More... | |
int | columnIndex (const Column *col) const |
Return the index of the given column in the table. More... | |
QString | name () const |
QVariant | headerData (int section, Qt::Orientation orientation, int role) const |
void | updateVerticalHeader (int start_row) |
Update the vertical header labels. More... | |
void | updateHorizontalHeader (int start_col, int end_col) |
Update the horizontal header labels. More... | |
void | setColumnWidth (int col, int width) |
int | columnWidth (int col) const |
Private Member Functions | |
void | composeColumnHeader (int col, const QString &label) |
Internal function to put together the column header. More... | |
Private Attributes | |
Table & | d_owner |
The owner aspect. More... | |
int | d_column_count |
The number of columns. More... | |
int | d_row_count |
The maximum number of rows of all columns. More... | |
QList< int > | d_vertical_header_data |
Vertical header data. More... | |
QStringList | d_horizontal_header_data |
Horizontal header data. More... | |
QList< Column * > | d_columns |
List of pointers to the column data vectors. More... | |
QList< int > | d_column_widths |
Columns widths. More... | |
This private class manages column based data (i.e., 1D vector based data such as x-values and y-values for a plot) for a Table. Its API is to be called by Table and table commands only. Table may only call the reading functions to ensure that undo/redo is possible for all data changing operations.
Each column is represented by a Column object and can be directly accessed by the pointer returned by column(). Most of the column manipulation is done directly to the columns. The signals of the columns are connected to various handlers in Table which acts according to all changes made to the columns.
The Column objects are managed as child aspects by Table.
Every column has two filters as children: An input filter that can convert a string (e.g., entered by the user in a cell) to the column's data type and an output filter that delivers the correct string representation to display in a table.
The number of columns in the Table will always be equal to d_columns.size(). The number of rows is generally indepenent of the number of rows in the wrapped columns. It is however always adjusted to be large enough to display the longest column. When columns are inserted, resized etc., the table is resized automatically.
Definition at line 485 of file future_Table.h.
|
inline |
Definition at line 488 of file future_Table.h.
void future::Table::Private::appendColumns | ( | QList< Column * > | cols | ) |
Append columns to the table.
Definition at line 2532 of file future_Table.cpp.
References future::Table::insertColumns().
Column * future::Table::Private::column | ( | int | index | ) | const |
Return column number 'index'.
Definition at line 2453 of file future_Table.cpp.
References d_columns, and AbstractAspect::index().
Referenced by future::Table::column(), future::Table::insertRows(), future::Table::moveColumn(), future::Table::pasteIntoSelection(), future::Table::removeColumns(), future::Table::removeRows(), future::Table::setRowCount(), and TableMoveColumnCmd::TableMoveColumnCmd().
|
inline |
Return the number of columns in the table.
Definition at line 520 of file future_Table.h.
References d_column_count.
Referenced by future::Table::columnCount(), future::Table::insertRows(), future::Table::removeRows(), and future::Table::setRowCount().
QString future::Table::Private::columnHeader | ( | int | col | ) |
Return the full column header string.
Definition at line 2573 of file future_Table.cpp.
References future::Table::headerData().
|
inline |
Return the index of the given column in the table.
Definition at line 535 of file future_Table.h.
References d_columns.
Referenced by future::Table::columnIndex().
|
inline |
Definition at line 561 of file future_Table.h.
References d_column_widths.
Referenced by future::Table::columnWidth().
|
private |
Internal function to put together the column header.
Don't use this outside updateHorizontalHeader()
Definition at line 2666 of file future_Table.cpp.
QVariant future::Table::Private::headerData | ( | int | section, |
Qt::Orientation | orientation, | ||
int | role | ||
) | const |
Definition at line 2674 of file future_Table.cpp.
References TableModel::CommentRole.
Referenced by future::Table::headerData().
void future::Table::Private::insertColumns | ( | int | before, |
QList< Column * > | cols | ||
) |
Insert columns before column number 'before'.
If 'first' is equal to the number of columns, the columns will be appended.
before | index of the column to insert before |
cols | a list of column data objects |
Definition at line 2482 of file future_Table.cpp.
References future::Table::defaultColumnWidth(), and future::Table::setRowCount().
Referenced by TableInsertColumnsCmd::redo(), and TableRemoveColumnsCmd::undo().
void future::Table::Private::moveColumn | ( | int | from, |
int | to | ||
) |
Move a column to another position.
Definition at line 2537 of file future_Table.cpp.
Referenced by TableMoveColumnCmd::redo(), and TableMoveColumnCmd::undo().
|
inline |
Definition at line 541 of file future_Table.h.
References d_owner, and AbstractAspect::name().
Referenced by TableInsertColumnsCmd::TableInsertColumnsCmd(), TableMoveColumnCmd::TableMoveColumnCmd(), TableRemoveColumnsCmd::TableRemoveColumnsCmd(), and TableSetNumberOfRowsCmd::TableSetNumberOfRowsCmd().
int future::Table::Private::numColsWithPD | ( | SciDAVis::PlotDesignation | pd | ) |
Return the number of columns with a given plot designation.
Definition at line 2578 of file future_Table.cpp.
void future::Table::Private::removeColumns | ( | int | first, |
int | count | ||
) |
Remove Columns.
This does not delete the removed columns because this must be handled by the undo/redo system.
first | index of the first column to be removed |
count | number of columns to remove |
Definition at line 2511 of file future_Table.cpp.
Referenced by TableRemoveColumnsCmd::redo(), and TableInsertColumnsCmd::undo().
void future::Table::Private::replaceColumns | ( | int | first, |
QList< Column * > | new_cols | ||
) |
Replace columns completely.
first | the first column to be replaced |
new_cols | list of the columns that replace the old ones This does not delete the replaced columns. |
Definition at line 2458 of file future_Table.cpp.
References future::Table::setRowCount().
|
inline |
Return the number of rows in the table.
Definition at line 522 of file future_Table.h.
References d_row_count.
Referenced by TableInsertColumnsCmd::redo(), TableSetNumberOfRowsCmd::redo(), future::Table::removeRows(), future::Table::rowCount(), and future::Table::setRowCount().
|
inline |
Definition at line 560 of file future_Table.h.
References d_column_widths.
Referenced by future::Table::setColumnWidth().
void future::Table::Private::setRowCount | ( | int | count | ) |
Set the number of rows of the table.
Definition at line 2551 of file future_Table.cpp.
Referenced by TableSetNumberOfRowsCmd::redo(), TableInsertColumnsCmd::undo(), and TableSetNumberOfRowsCmd::undo().
void future::Table::Private::updateHorizontalHeader | ( | int | start_col, |
int | end_col | ||
) |
Update the horizontal header labels.
This must be called whenever columns are added or removed and when comments, labels, and column types change.
start_col | first column that needs to be updated |
end_col | last column that needs to be updated |
Definition at line 2599 of file future_Table.cpp.
References SciDAVis::X, SciDAVis::xErr, SciDAVis::Y, SciDAVis::yErr, and SciDAVis::Z.
Referenced by future::Table::handleDescriptionChange(), future::Table::handleModeChange(), and future::Table::handlePlotDesignationChange().
void future::Table::Private::updateVerticalHeader | ( | int | start_row | ) |
Update the vertical header labels.
This must be called whenever rows are added or removed.
start_row | first row that needs to be updated |
Definition at line 2589 of file future_Table.cpp.
|
private |
|
private |
Columns widths.
Definition at line 582 of file future_Table.h.
Referenced by columnWidth(), and setColumnWidth().
|
private |
List of pointers to the column data vectors.
Definition at line 575 of file future_Table.h.
Referenced by column(), and columnIndex().
|
private |
Horizontal header data.
Definition at line 573 of file future_Table.h.
|
private |
|
private |
The maximum number of rows of all columns.
Definition at line 569 of file future_Table.h.
Referenced by rowCount().
|
private |
Vertical header data.
Definition at line 571 of file future_Table.h.