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

A class to simplify the access to different types of grid cell coords. Especially useful in the context of selected cells (which may come in different flavors). More...

#include <gridcellcoordscontainer.hpp>

Collaboration diagram for wxGridCellCoordsContainer:

Public Member Functions

 wxGridCellCoordsContainer ()=default
 Construct an empty wxGridCellCoordsContainer. More...
 
 wxGridCellCoordsContainer (const wxGridCellCoords &topleft, const wxGridCellCoords &bottomright)
 Construct a wxGridCellCoordsContainer from an upperleft and a lowerright coordinate pair. More...
 
 wxGridCellCoordsContainer (const wxGridCellCoordsArray &selected)
 Construct a wxGridCellCoordsContainer from a list of selected grid coordinates. More...
 
 wxGridCellCoordsContainer (const wxArrayInt &selectedRowsOrCols, int otherDim, bool rowsSelected=true)
 Construct a wxGridCellCoordsContainer from a set of indices for complete rows or columns. More...
 
const wxGridCellsExtentgetExtent () const
 Get the maximal needed enclosing box in terms of wxGridCellCoordinates. More...
 
size_t getRows () const
 Get the number of enclosed rows. More...
 
size_t getCols () const
 Get the number of enclosed columns. More...
 
bool contains (const wxGridCellCoords &cell) const
 Does this wxGridCellCoordsContainer contain the passed coordinates? More...
 
bool contains (int row, int col) const
 Does this wxGridCellCoordsContainer contain the passed coordinates? More...
 
bool isBlock () const
 Returns true, if the contained coordinates actually form a contigious block. More...
 
bool columnsSelected () const
 Returns true, if the contained coordinates originated from complete columns. More...
 
bool isSparse () const
 Returns true, if the contained coordinates form a sparse matrix. More...
 
const wxGridCellCoordsArray & getArray () const
 Get a reference to the internal wxGridCellCoordsArray (only available, if the contained coordinates form a sparse matrix). More...
 

Private Attributes

wxGridCellsExtent m_extent
 
wxGridCellCoordsArray m_array
 
wxArrayInt m_rowsOrCols
 
bool m_rowsSelected
 

Detailed Description

A class to simplify the access to different types of grid cell coords. Especially useful in the context of selected cells (which may come in different flavors).

Definition at line 40 of file gridcellcoordscontainer.hpp.

Constructor & Destructor Documentation

◆ wxGridCellCoordsContainer() [1/4]

wxGridCellCoordsContainer::wxGridCellCoordsContainer ( )
default

Construct an empty wxGridCellCoordsContainer.

◆ wxGridCellCoordsContainer() [2/4]

wxGridCellCoordsContainer::wxGridCellCoordsContainer ( const wxGridCellCoords &  topleft,
const wxGridCellCoords &  bottomright 
)
inline

Construct a wxGridCellCoordsContainer from an upperleft and a lowerright coordinate pair.

Parameters
topleftconst wxGridCellCoords&
bottomrightconst wxGridCellCoords&

Definition at line 65 of file gridcellcoordscontainer.hpp.

References wxGridCellsExtent::m_bottomright, m_extent, and wxGridCellsExtent::m_topleft.

◆ wxGridCellCoordsContainer() [3/4]

wxGridCellCoordsContainer::wxGridCellCoordsContainer ( const wxGridCellCoordsArray &  selected)
inline

Construct a wxGridCellCoordsContainer from a list of selected grid coordinates.

Parameters
selectedconst wxGridCellCoordsArray&

Definition at line 78 of file gridcellcoordscontainer.hpp.

References m_array, wxGridCellsExtent::m_bottomright, m_extent, wxGridCellsExtent::m_topleft, max, and min.

◆ wxGridCellCoordsContainer() [4/4]

wxGridCellCoordsContainer::wxGridCellCoordsContainer ( const wxArrayInt &  selectedRowsOrCols,
int  otherDim,
bool  rowsSelected = true 
)
inline

Construct a wxGridCellCoordsContainer from a set of indices for complete rows or columns.

Parameters
selectedRowsOrColsconst wxArrayInt&
otherDimint
truebool rowsSelected=

Definition at line 103 of file gridcellcoordscontainer.hpp.

References wxGridCellsExtent::m_bottomright, m_extent, m_rowsOrCols, m_rowsSelected, wxGridCellsExtent::m_topleft, max, and min.

Member Function Documentation

◆ columnsSelected()

bool wxGridCellCoordsContainer::columnsSelected ( ) const
inline

Returns true, if the contained coordinates originated from complete columns.

Returns
bool

Definition at line 238 of file gridcellcoordscontainer.hpp.

References m_rowsOrCols, and m_rowsSelected.

Referenced by TableViewer::applyConditionalCellColourScheme().

◆ contains() [1/2]

bool wxGridCellCoordsContainer::contains ( const wxGridCellCoords &  cell) const
inline

Does this wxGridCellCoordsContainer contain the passed coordinates?

Parameters
cellconst wxGridCellCoords&
Returns
bool

Definition at line 166 of file gridcellcoordscontainer.hpp.

References isSparse(), m_array, wxGridCellsExtent::m_bottomright, m_extent, m_rowsOrCols, m_rowsSelected, and wxGridCellsExtent::m_topleft.

Referenced by TableViewer::applyConditionalCellColourScheme(), GridNumeReTable::avg(), TableViewer::calculateAvg(), TableViewer::calculateMax(), TableViewer::calculateMin(), TableViewer::calculateSum(), TableViewer::changeColType(), contains(), TableViewer::deleteSelection(), GridNumeReTable::max(), GridNumeReTable::min(), and GridNumeReTable::sum().

Here is the call graph for this function:

◆ contains() [2/2]

bool wxGridCellCoordsContainer::contains ( int  row,
int  col 
) const
inline

Does this wxGridCellCoordsContainer contain the passed coordinates?

Same as before but with different argument types for convenience.

Parameters
rowint
colint
Returns
bool

Definition at line 202 of file gridcellcoordscontainer.hpp.

References contains().

Here is the call graph for this function:

◆ getArray()

const wxGridCellCoordsArray & wxGridCellCoordsContainer::getArray ( ) const
inline

Get a reference to the internal wxGridCellCoordsArray (only available, if the contained coordinates form a sparse matrix).

Returns
const wxGridCellCoordsArray&

Definition at line 263 of file gridcellcoordscontainer.hpp.

References m_array.

◆ getCols()

size_t wxGridCellCoordsContainer::getCols ( ) const
inline

Get the number of enclosed columns.

Returns
size_t

Definition at line 153 of file gridcellcoordscontainer.hpp.

References wxGridCellsExtent::m_bottomright, m_extent, and wxGridCellsExtent::m_topleft.

Referenced by isBlock().

◆ getExtent()

◆ getRows()

size_t wxGridCellCoordsContainer::getRows ( ) const
inline

Get the number of enclosed rows.

Returns
size_t

Definition at line 142 of file gridcellcoordscontainer.hpp.

References wxGridCellsExtent::m_bottomright, m_extent, and wxGridCellsExtent::m_topleft.

Referenced by isBlock().

◆ isBlock()

bool wxGridCellCoordsContainer::isBlock ( ) const
inline

Returns true, if the contained coordinates actually form a contigious block.

Returns
bool

Definition at line 214 of file gridcellcoordscontainer.hpp.

References getCols(), getRows(), isSparse(), m_rowsOrCols, and m_rowsSelected.

Referenced by TableViewer::applyConditionalCellColourScheme().

Here is the call graph for this function:

◆ isSparse()

bool wxGridCellCoordsContainer::isSparse ( ) const
inline

Returns true, if the contained coordinates form a sparse matrix.

Returns
bool

Definition at line 250 of file gridcellcoordscontainer.hpp.

References m_array.

Referenced by contains(), and isBlock().

Member Data Documentation

◆ m_array

wxGridCellCoordsArray wxGridCellCoordsContainer::m_array
private

◆ m_extent

wxGridCellsExtent wxGridCellCoordsContainer::m_extent
private

◆ m_rowsOrCols

wxArrayInt wxGridCellCoordsContainer::m_rowsOrCols
private

◆ m_rowsSelected

bool wxGridCellCoordsContainer::m_rowsSelected
private

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