CTK  0.1.0
The Common Toolkit is a community effort to provide support code for medical image analysis, surgical navigation, and related projects.
Public Types | Public Slots | Signals | Public Member Functions | Protected Member Functions | Properties | List of all members
ctkMatrixWidget Class Reference

#include <Libs/Widgets/ctkMatrixWidget.h>

Inheritance diagram for ctkMatrixWidget:
Inheritance graph
[legend]
Collaboration diagram for ctkMatrixWidget:
Collaboration graph
[legend]

Public Types

typedef QWidget Superclass
 Superclass typedef. More...
 

Public Slots

void identity ()
 Reset the matrix to identity. More...
 
void setDecimals (int decimals)
 

Signals

void decimalsChanged (int)
 
void matrixChanged ()
 

Public Member Functions

int columnCount () const
 
 ctkMatrixWidget (int rows, int columns, QWidget *parent=0)
 Constructor, builds a custom rowsXcolumns matrix. More...
 
 ctkMatrixWidget (QWidget *parent=0)
 Constructor, builds a 4x4 identity matrix. More...
 
int decimals () const
 
ctkDoubleSpinBox::DecimalsOptions decimalsOption () const
 
bool isEditable () const
 
double maximum () const
 
double minimum () const
 
virtual QSize minimumSizeHint () const
 Reimplemented from QAbstractScrollArea. More...
 
int rowCount () const
 
virtual void setColumnCount (int newColumnCount)
 
void setDecimalsOption (ctkDoubleSpinBox::DecimalsOptions option)
 
void setEditable (bool newEditable)
 
void setMaximum (double newMaximum)
 
void setMinimum (double newMinimum)
 
void setRange (double newMinimum, double newMaximum)
 
virtual void setRowCount (int newRowCount)
 
void setSingleStep (double step)
 
Q_INVOKABLE void setValue (int i, int j, double value)
 
void setValues (const QVector< double > &vector)
 
double singleStep () const
 
virtual QSize sizeHint () const
 
Q_INVOKABLE double value (int i, int j) const
 
QVector< double > values () const
 
virtual ~ctkMatrixWidget ()
 

Protected Member Functions

 ctkMatrixWidget (ctkMatrixWidgetPrivate &pvt, QWidget *parent=0)
 protected constructor to derive private implementations More...
 
virtual void resizeEvent (QResizeEvent *event)
 

Properties

int columnCount
 
int decimals
 
ctkDoubleSpinBox::DecimalsOptions decimalsOption
 
bool editable
 
double maximum
 
double minimum
 
int rowCount
 
double singleStep
 
QVector< double > values
 

Detailed Description

ctkMatrixWidget is the base class of matrix widgets.

Definition at line 38 of file ctkMatrixWidget.h.

Member Typedef Documentation

◆ Superclass

typedef QWidget ctkMatrixWidget::Superclass

Superclass typedef.

Definition at line 58 of file ctkMatrixWidget.h.

Constructor & Destructor Documentation

◆ ctkMatrixWidget() [1/3]

ctkMatrixWidget::ctkMatrixWidget ( QWidget *  parent = 0)
explicit

Constructor, builds a 4x4 identity matrix.

◆ ctkMatrixWidget() [2/3]

ctkMatrixWidget::ctkMatrixWidget ( int  rows,
int  columns,
QWidget *  parent = 0 
)
explicit

Constructor, builds a custom rowsXcolumns matrix.

◆ ~ctkMatrixWidget()

virtual ctkMatrixWidget::~ctkMatrixWidget ( )
virtual

◆ ctkMatrixWidget() [3/3]

ctkMatrixWidget::ctkMatrixWidget ( ctkMatrixWidgetPrivate &  pvt,
QWidget *  parent = 0 
)
protected

protected constructor to derive private implementations

Member Function Documentation

◆ columnCount()

int ctkMatrixWidget::columnCount ( ) const

Set the number of columns of the matrix

See also
rowCount, setRowCount

◆ decimals()

int ctkMatrixWidget::decimals ( ) const

This property holds the precision of the spinbox, in decimals.

Dictates how many decimals will be used for displaying and interpreting doubles by the spinbox used to adjust the value of a matrix element.

◆ decimalsChanged

void ctkMatrixWidget::decimalsChanged ( int  )
signal

This signal is fired when the number of decimals is changed. This can be useful when synchronizing decimals between widgets.

See also
decimals

◆ decimalsOption()

ctkDoubleSpinBox::DecimalsOptions ctkMatrixWidget::decimalsOption ( ) const

Return the decimalsOption property value

See also
decimalsOption

◆ identity

void ctkMatrixWidget::identity ( )
slot

Reset the matrix to identity.

◆ isEditable()

bool ctkMatrixWidget::isEditable ( ) const

This property determines whether the user can edit values by double clicking on the items. True by default

◆ matrixChanged

void ctkMatrixWidget::matrixChanged ( )
signal

◆ maximum()

double ctkMatrixWidget::maximum ( ) const

This property holds the maximum value of matrix elements.

Any matrix elements whose values are greater than the new maximum value will be reset to equal the new maximum value.

◆ minimum()

double ctkMatrixWidget::minimum ( ) const

This property holds the minimum value of matrix elements.

Any matrix elements whose values are less than the new minimum value will be reset to equal the new minimum value.

◆ minimumSizeHint()

virtual QSize ctkMatrixWidget::minimumSizeHint ( ) const
virtual

Reimplemented from QAbstractScrollArea.

◆ resizeEvent()

virtual void ctkMatrixWidget::resizeEvent ( QResizeEvent *  event)
protectedvirtual

◆ rowCount()

int ctkMatrixWidget::rowCount ( ) const

Set the number of rows of the matrix

See also
columnCount, setColumnCount

◆ setColumnCount()

virtual void ctkMatrixWidget::setColumnCount ( int  newColumnCount)
virtual

Reimplemented in ctkVTKAbstractMatrixWidget.

◆ setDecimals

void ctkMatrixWidget::setDecimals ( int  decimals)
slot

Set how many decimals will be used for displaying and interpreting doubles by the spinbox used to adjust the value of a matrix element.

◆ setDecimalsOption()

void ctkMatrixWidget::setDecimalsOption ( ctkDoubleSpinBox::DecimalsOptions  option)

Set the decimalsOption property value.

See also
decimalsOption

◆ setEditable()

void ctkMatrixWidget::setEditable ( bool  newEditable)

◆ setMaximum()

void ctkMatrixWidget::setMaximum ( double  newMaximum)

◆ setMinimum()

void ctkMatrixWidget::setMinimum ( double  newMinimum)

◆ setRange()

void ctkMatrixWidget::setRange ( double  newMinimum,
double  newMaximum 
)

Description Utility function that sets the min/max at once.

◆ setRowCount()

virtual void ctkMatrixWidget::setRowCount ( int  newRowCount)
virtual

Reimplemented in ctkVTKAbstractMatrixWidget.

◆ setSingleStep()

void ctkMatrixWidget::setSingleStep ( double  step)

◆ setValue()

Q_INVOKABLE void ctkMatrixWidget::setValue ( int  i,
int  j,
double  value 
)

◆ setValues()

void ctkMatrixWidget::setValues ( const QVector< double > &  vector)

◆ singleStep()

double ctkMatrixWidget::singleStep ( ) const

This property holds the step value of the spinbox.

When the user uses the arrows to change the value of the spinbox used to adjust the value of a matrix element, the value will be incremented/decremented by the amount of the singleStep.

◆ sizeHint()

virtual QSize ctkMatrixWidget::sizeHint ( ) const
virtual

◆ value()

Q_INVOKABLE double ctkMatrixWidget::value ( int  i,
int  j 
) const

Set / Get values of the matrix

  • i is the row index,
  • j is the column index
    Warning
    There is no check that the indexes are inside their valid range
    The value of a matrix element will not be changed on an attempt to set it to a value that is less than the minimum or greater than the maximum.

◆ values()

QVector<double> ctkMatrixWidget::values ( ) const

Utility function to set/get all the values of the matrix at once. Only one signal matrixChanged() is fired at the end.

Property Documentation

◆ columnCount

int ctkMatrixWidget::columnCount
readwrite

Definition at line 1 of file ctkMatrixWidget.h.

◆ decimals

int ctkMatrixWidget::decimals
readwrite

This property controls how many decimals are used to display and edit the matrix values.

See also
decimals(), setDecimals(), decimalsChanged(), decimalsOption

Definition at line 1 of file ctkMatrixWidget.h.

◆ decimalsOption

ctkDoubleSpinBox::DecimalsOptions ctkMatrixWidget::decimalsOption
readwrite

This property provides more controls over the decimals.

See also
ctkDoubleSpinBox::DecimalsOptions, decimals

Definition at line 1 of file ctkMatrixWidget.h.

◆ editable

bool ctkMatrixWidget::editable
readwrite

Definition at line 1 of file ctkMatrixWidget.h.

◆ maximum

double ctkMatrixWidget::maximum
readwrite

Definition at line 1 of file ctkMatrixWidget.h.

◆ minimum

double ctkMatrixWidget::minimum
readwrite

Definition at line 1 of file ctkMatrixWidget.h.

◆ rowCount

int ctkMatrixWidget::rowCount
readwrite

Definition at line 1 of file ctkMatrixWidget.h.

◆ singleStep

double ctkMatrixWidget::singleStep
readwrite

Definition at line 1 of file ctkMatrixWidget.h.

◆ values

QVector<double> ctkMatrixWidget::values
readwrite

Definition at line 1 of file ctkMatrixWidget.h.


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