NumeRe v1.1.4
NumeRe: Framework für Numerische Rechnungen
GridNumeReTable Class Reference

This class is a specialisation for the standard wxGridTableBase supporting complex numbers as well as the internal data model. More...

#include <gridtable.hpp>

Inheritance diagram for GridNumeReTable:
Collaboration diagram for GridNumeReTable:

Public Member Functions

 GridNumeReTable ()
 Default constructor. More...
 
 GridNumeReTable (int numRows, int numCols)
 General constructor. Will create an empty internal table. More...
 
 GridNumeReTable (NumeRe::Table &&_extTable)
 Move constructor taking the contents of the passed table. More...
 
virtual ~GridNumeReTable ()
 
NumeRe::Table getTable ()
 
NumeRe::Table getTableCopy ()
 This member function returns a copy of the internal table. More...
 
NumeRe::TablegetTableRef ()
 This member function returns a reference to the internal table. More...
 
virtual int GetNumberRows ()
 This member function will return the number of lines including the headlines handled by this data provider class. More...
 
virtual int GetNumberCols ()
 This member function will return the number of columns handled by this data provider class. More...
 
virtual bool CanGetValueAs (int row, int col, const wxString &sTypeName)
 This virtual member function will tell the grid, which data types may be returned by the current cell. More...
 
virtual double GetValueAsDouble (int row, int col)
 This virtual member function returns the selected cell value as a double. More...
 
virtual bool GetValueAsBool (int row, int col)
 This virtual member function returns the selected cell value as a bool. More...
 
virtual void * GetValueAsCustom (int row, int col, const wxString &sTypeName)
 This member function will return the internal data as a void pointer referencing the internal mu::value_type attribute. More...
 
virtual wxString GetValue (int row, int col)
 This virtual member function returns the value of the selected cell as string. More...
 
virtual void SetValue (int row, int col, const wxString &value)
 This virtual member function sets the passed value in the internal buffer. It's decided automatically, whether it's stored as a headline and whether a new headline is required. More...
 
virtual void Clear ()
 This virtual function redirects the control directly to the internal buffer and cleares it contents. More...
 
virtual bool InsertRows (size_t pos=0, size_t numRows=1)
 This virtual function redirects the control directly to the internal buffer and inserts rows. More...
 
virtual bool AppendRows (size_t numRows=1)
 This virtual function redirects the control directly to the internal buffer and appends rows. More...
 
virtual bool DeleteRows (size_t pos=0, size_t numRows=1)
 This virtual function redirects the control directly to the internal buffer and deletes rows. More...
 
virtual bool InsertCols (size_t pos=0, size_t numRows=1)
 This virtual function redirects the control directly to the internal buffer and inserts columns. More...
 
virtual bool AppendCols (size_t numRows=1)
 This virtual function redirects the control directly to the internal buffer and appends columns. More...
 
virtual bool DeleteCols (size_t pos=0, size_t numRows=1)
 This virtual function redirects the control directly to the internal buffer and deletes columns. More...
 
virtual wxString GetRowLabelValue (int row)
 This virtual member function will return the label for the selected row as a string. More...
 
virtual wxString GetColLabelValue (int col)
 This virtual member function will return the label for the selected column as a string. More...
 
double min (const wxGridCellCoordsContainer &coords) const
 This member function calculates the minimal value in the range (r1,c1)->(r2,c2). More...
 
double max (const wxGridCellCoordsContainer &coords) const
 This member function calculates the maximal value in the range (r1,c1)->(r2,c2). More...
 
mu::value_type avg (const wxGridCellCoordsContainer &coords) const
 This member function calculates the average value of the range (r1,c1)->(r2,c2). More...
 
mu::value_type sum (const wxGridCellCoordsContainer &coords) const
 This member function calculates the sum of the range (r1,c1)->(r2,c2). More...
 
std::vector< int > getColumnTypes () const
 Returns the types of the handled table. More...
 
std::vector< std::string > getCategories (int col) const
 Returns the categories in the selected column, if this is a categorical column. More...
 

Private Member Functions

int getNumHeadlines () const
 This member function will return the number of headlines available in the internal buffer. More...
 

Private Attributes

NumeRe::Table _table
 
mu::value_type value
 

Detailed Description

This class is a specialisation for the standard wxGridTableBase supporting complex numbers as well as the internal data model.

Definition at line 33 of file gridtable.hpp.

Constructor & Destructor Documentation

◆ GridNumeReTable() [1/3]

GridNumeReTable::GridNumeReTable ( )

Default constructor.

Definition at line 27 of file gridtable.cpp.

References _table.

◆ GridNumeReTable() [2/3]

GridNumeReTable::GridNumeReTable ( int  numRows,
int  numCols 
)

General constructor. Will create an empty internal table.

Parameters
numRowsint
numColsint

Definition at line 41 of file gridtable.cpp.

References _table.

◆ GridNumeReTable() [3/3]

GridNumeReTable::GridNumeReTable ( NumeRe::Table &&  _extTable)

Move constructor taking the contents of the passed table.

Parameters
_extTableNumeRe::Table&&

Definition at line 54 of file gridtable.cpp.

References _table.

◆ ~GridNumeReTable()

virtual GridNumeReTable::~GridNumeReTable ( )
inlinevirtual

Definition at line 44 of file gridtable.hpp.

Member Function Documentation

◆ AppendCols()

bool GridNumeReTable::AppendCols ( size_t  numRows = 1)
virtual

This virtual function redirects the control directly to the internal buffer and appends columns.

Parameters
numRowssize_t
Returns
bool

Definition at line 424 of file gridtable.cpp.

References _table, and NumeRe::Table::appendCols().

Here is the call graph for this function:

◆ AppendRows()

bool GridNumeReTable::AppendRows ( size_t  numRows = 1)
virtual

This virtual function redirects the control directly to the internal buffer and appends rows.

Parameters
numRowssize_t
Returns
bool

Definition at line 347 of file gridtable.cpp.

References _table, and NumeRe::Table::appendLines().

Here is the call graph for this function:

◆ avg()

mu::value_type GridNumeReTable::avg ( const wxGridCellCoordsContainer coords) const

This member function calculates the average value of the range (r1,c1)->(r2,c2).

Parameters
coordsconst wxGridCellCoordsContainer&
Returns
mu::value_type

Definition at line 571 of file gridtable.cpp.

References _table, wxGridCellCoordsContainer::contains(), wxGridCellCoordsContainer::getExtent(), getNumHeadlines(), NumeRe::Table::getValue(), mu::isnan(), wxGridCellsExtent::m_bottomright, and wxGridCellsExtent::m_topleft.

Here is the call graph for this function:

◆ CanGetValueAs()

bool GridNumeReTable::CanGetValueAs ( int  row,
int  col,
const wxString &  sTypeName 
)
virtual

This virtual member function will tell the grid, which data types may be returned by the current cell.

Parameters
rowint
colint
sTypeNameconst wxString&
Returns
bool

Definition at line 140 of file gridtable.cpp.

References _table, NumeRe::Table::getColumn(), NumeRe::Table::getColumnType(), getNumHeadlines(), NumeRe::Table::getValue(), mu::imag(), mu::isnan(), TableColumn::isValid(), TableColumn::TYPE_DATETIME, TableColumn::TYPE_LOGICAL, TableColumn::TYPE_NONE, TableColumn::TYPE_STRING, and TableColumn::TYPE_VALUE.

Here is the call graph for this function:

◆ Clear()

void GridNumeReTable::Clear ( )
virtual

This virtual function redirects the control directly to the internal buffer and cleares it contents.

Returns
void

Definition at line 306 of file gridtable.cpp.

References _table, and NumeRe::Table::Clear().

Here is the call graph for this function:

◆ DeleteCols()

bool GridNumeReTable::DeleteCols ( size_t  pos = 0,
size_t  numRows = 1 
)
virtual

This virtual function redirects the control directly to the internal buffer and deletes columns.

Parameters
possize_t
numRowssize_t
Returns
bool

Definition at line 450 of file gridtable.cpp.

References _table, and NumeRe::Table::deleteCols().

Here is the call graph for this function:

◆ DeleteRows()

bool GridNumeReTable::DeleteRows ( size_t  pos = 0,
size_t  numRows = 1 
)
virtual

This virtual function redirects the control directly to the internal buffer and deletes rows.

Parameters
possize_t
numRowssize_t
Returns
bool

Definition at line 373 of file gridtable.cpp.

References _table, and NumeRe::Table::deleteLines().

Here is the call graph for this function:

◆ getCategories()

std::vector< std::string > GridNumeReTable::getCategories ( int  col) const

Returns the categories in the selected column, if this is a categorical column.

Parameters
colint
Returns
std::vector<std::string>

Definition at line 659 of file gridtable.cpp.

References _table, getCategories(), NumeRe::Table::getColumn(), NumeRe::Table::getColumnType(), and TableColumn::TYPE_CATEGORICAL.

Referenced by CombinedCellEditor::BeginEdit(), and getCategories().

Here is the call graph for this function:

◆ GetColLabelValue()

wxString GridNumeReTable::GetColLabelValue ( int  col)
virtual

This virtual member function will return the label for the selected column as a string.

Parameters
colint
Returns
wxString

Definition at line 493 of file gridtable.cpp.

References toString().

Here is the call graph for this function:

◆ getColumnTypes()

std::vector< int > GridNumeReTable::getColumnTypes ( ) const

Returns the types of the handled table.

Returns
std::vector<int>

Definition at line 640 of file gridtable.cpp.

References _table, NumeRe::Table::getCols(), and NumeRe::Table::getColumnType().

Referenced by CombinedCellEditor::BeginEdit(), TableViewer::layoutGrid(), and TableViewer::UpdateColumnAlignment().

Here is the call graph for this function:

◆ GetNumberCols()

int GridNumeReTable::GetNumberCols ( )
virtual

This member function will return the number of columns handled by this data provider class.

Returns
int

Definition at line 123 of file gridtable.cpp.

References _table, and NumeRe::Table::getCols().

Here is the call graph for this function:

◆ GetNumberRows()

int GridNumeReTable::GetNumberRows ( )
virtual

This member function will return the number of lines including the headlines handled by this data provider class.

Returns
int

Definition at line 109 of file gridtable.cpp.

References _table, NumeRe::Table::getLines(), getNumHeadlines(), and max.

Here is the call graph for this function:

◆ getNumHeadlines()

int GridNumeReTable::getNumHeadlines ( ) const
private

This member function will return the number of headlines available in the internal buffer.

Returns
int

Definition at line 68 of file gridtable.cpp.

References _table, and NumeRe::Table::getHeadCount().

Referenced by avg(), CanGetValueAs(), GetNumberRows(), GetRowLabelValue(), GetValue(), GetValueAsBool(), GetValueAsCustom(), GetValueAsDouble(), max(), min(), SetValue(), and sum().

Here is the call graph for this function:

◆ GetRowLabelValue()

wxString GridNumeReTable::GetRowLabelValue ( int  row)
virtual

This virtual member function will return the label for the selected row as a string.

Parameters
rowint
Returns
wxString

Definition at line 475 of file gridtable.cpp.

References getNumHeadlines(), and toString().

Here is the call graph for this function:

◆ getTable()

NumeRe::Table GridNumeReTable::getTable ( )
inline

Definition at line 46 of file gridtable.hpp.

References _table.

◆ getTableCopy()

NumeRe::Table GridNumeReTable::getTableCopy ( )

This member function returns a copy of the internal table.

Returns
NumeRe::Table

Definition at line 81 of file gridtable.cpp.

References _table.

◆ getTableRef()

NumeRe::Table & GridNumeReTable::getTableRef ( )

This member function returns a reference to the internal table.

Returns
NumeRe::Table

Definition at line 95 of file gridtable.cpp.

References _table.

◆ GetValue()

wxString GridNumeReTable::GetValue ( int  row,
int  col 
)
virtual

This virtual member function returns the value of the selected cell as string.

Parameters
rowint
colint
Returns
wxString

Definition at line 246 of file gridtable.cpp.

References _table, NumeRe::Table::getCleanHeadPart(), NumeRe::Table::getCols(), NumeRe::Table::getLines(), getNumHeadlines(), NumeRe::Table::getValueAsString(), and replaceControlCharacters().

Referenced by CombinedCellEditor::BeginEdit().

Here is the call graph for this function:

◆ GetValueAsBool()

bool GridNumeReTable::GetValueAsBool ( int  row,
int  col 
)
virtual

This virtual member function returns the selected cell value as a bool.

Parameters
rowint
colint
Returns
bool

Definition at line 206 of file gridtable.cpp.

References _table, NumeRe::Table::getCols(), NumeRe::Table::getLines(), getNumHeadlines(), and NumeRe::Table::getValue().

Here is the call graph for this function:

◆ GetValueAsCustom()

void * GridNumeReTable::GetValueAsCustom ( int  row,
int  col,
const wxString &  sTypeName 
)
virtual

This member function will return the internal data as a void pointer referencing the internal mu::value_type attribute.

Parameters
rowint
colint
sTypeNameconst wxString&
Returns
void*

Definition at line 230 of file gridtable.cpp.

References _table, getNumHeadlines(), NumeRe::Table::getValue(), and value.

Here is the call graph for this function:

◆ GetValueAsDouble()

double GridNumeReTable::GetValueAsDouble ( int  row,
int  col 
)
virtual

This virtual member function returns the selected cell value as a double.

Parameters
rowint
colint
Returns
double

Definition at line 184 of file gridtable.cpp.

References _table, NumeRe::Table::getCols(), NumeRe::Table::getLines(), getNumHeadlines(), and NumeRe::Table::getValue().

Here is the call graph for this function:

◆ InsertCols()

bool GridNumeReTable::InsertCols ( size_t  pos = 0,
size_t  numRows = 1 
)
virtual

This virtual function redirects the control directly to the internal buffer and inserts columns.

Parameters
possize_t
numRowssize_t
Returns
bool

Definition at line 399 of file gridtable.cpp.

References _table, and NumeRe::Table::insertCols().

Here is the call graph for this function:

◆ InsertRows()

bool GridNumeReTable::InsertRows ( size_t  pos = 0,
size_t  numRows = 1 
)
virtual

This virtual function redirects the control directly to the internal buffer and inserts rows.

Parameters
possize_t
numRowssize_t
Returns
bool

Definition at line 322 of file gridtable.cpp.

References _table, and NumeRe::Table::insertLines().

Here is the call graph for this function:

◆ max()

double GridNumeReTable::max ( const wxGridCellCoordsContainer coords) const

This member function calculates the maximal value in the range (r1,c1)->(r2,c2).

Parameters
coordsconst wxGridCellCoordsContainer&
Returns
double

Definition at line 539 of file gridtable.cpp.

References _table, wxGridCellCoordsContainer::contains(), wxGridCellCoordsContainer::getExtent(), getNumHeadlines(), NumeRe::Table::getValue(), mu::isnan(), wxGridCellsExtent::m_bottomright, and wxGridCellsExtent::m_topleft.

Here is the call graph for this function:

◆ min()

double GridNumeReTable::min ( const wxGridCellCoordsContainer coords) const

This member function calculates the minimal value in the range (r1,c1)->(r2,c2).

Parameters
coordsconst wxGridCellCoordsContainer&
Returns
double

Definition at line 507 of file gridtable.cpp.

References _table, wxGridCellCoordsContainer::contains(), wxGridCellCoordsContainer::getExtent(), getNumHeadlines(), NumeRe::Table::getValue(), mu::isnan(), wxGridCellsExtent::m_bottomright, and wxGridCellsExtent::m_topleft.

Here is the call graph for this function:

◆ SetValue()

void GridNumeReTable::SetValue ( int  row,
int  col,
const wxString &  value 
)
virtual

This virtual member function sets the passed value in the internal buffer. It's decided automatically, whether it's stored as a headline and whether a new headline is required.

Parameters
rowint
colint
valueconst wxString&
Returns
void

Definition at line 270 of file gridtable.cpp.

References _table, getNumHeadlines(), NumeRe::Table::setHeadPart(), NumeRe::Table::setValueAsString(), and value.

Here is the call graph for this function:

◆ sum()

mu::value_type GridNumeReTable::sum ( const wxGridCellCoordsContainer coords) const

This member function calculates the sum of the range (r1,c1)->(r2,c2).

Parameters
coordsconst wxGridCellCoordsContainer&
Returns
mu::value_type

Definition at line 610 of file gridtable.cpp.

References _table, wxGridCellCoordsContainer::contains(), wxGridCellCoordsContainer::getExtent(), getNumHeadlines(), NumeRe::Table::getValue(), mu::isnan(), wxGridCellsExtent::m_bottomright, and wxGridCellsExtent::m_topleft.

Here is the call graph for this function:

Member Data Documentation

◆ _table

◆ value

mu::value_type GridNumeReTable::value
private

Definition at line 38 of file gridtable.hpp.

Referenced by GetValueAsCustom(), and SetValue().


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