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 Slots | Signals | Public Member Functions | Protected Slots | Protected Attributes | Properties | List of all members
ctkCoordinatesWidget Class Reference

#include <Libs/Widgets/ctkCoordinatesWidget.h>

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

Public Slots

void normalize ()
 
void setDecimals (int decimals)
 Set the number of decimals of each coordinate spin box. More...
 

Signals

void coordinatesChanged (double *pos)
 

Public Member Functions

double const * coordinates () const
 
QString coordinatesAsString () const
 
 ctkCoordinatesWidget (QWidget *parent=0)
 
int decimals () const
 
ctkDoubleSpinBox::DecimalsOptions decimalsOption () const
 
int dimension () const
 
bool isNormalized () const
 
double maximum () const
 
double minimum () const
 
double norm () const
 Return the norm of the coordinates. More...
 
void setCoordinates (double *pos)
 
void setCoordinates (double x, double y=0., double z=0., double w=0.)
 Convenient function that sets up to 4 elements of the coordinates. More...
 
void setCoordinatesAsString (QString pos)
 
void setDecimalsOption (ctkDoubleSpinBox::DecimalsOptions option)
 
void setDimension (int dim)
 
void setMaximum (double minimum)
 
void setMinimum (double minimum)
 
void setNormalized (bool normalize)
 
void setRange (double minimum, double maximum)
 
void setSingleStep (double step)
 
void setSizeHintPolicy (ctkDoubleSpinBox::SizeHintPolicy newSizeHintPolicy)
 
void setValueProxy (ctkValueProxy *proxy)
 
double singleStep () const
 
ctkDoubleSpinBox::SizeHintPolicy sizeHintPolicy () const
 
ctkDoubleSpinBoxspinBox (int id)
 Return the spinbox identitfied by id. More...
 
double squaredNorm () const
 Return the squared norm of the coordinates. More...
 
ctkValueProxyvalueProxy () const
 
virtual ~ctkCoordinatesWidget ()
 

Protected Slots

void updateCoordinate (double coordinate)
 
void updateCoordinates ()
 

Protected Attributes

QScopedPointer< ctkCoordinatesWidgetPrivate > d_ptr
 

Properties

QString coordinates
 
int decimals
 
ctkDoubleSpinBox::DecimalsOptions decimalsOption
 
int dimension
 
double maximum
 
double minimum
 
bool normalized
 
double singleStep
 
ctkDoubleSpinBox::SizeHintPolicy sizeHintPolicy
 

Detailed Description

ctkCoordinatesWidget is a simple container of dimension coordinates. For each coordinate a double spinbox is associated, everytime a value is modified, the signal valueChanged is fired. TODO: use pimpl

Definition at line 38 of file ctkCoordinatesWidget.h.

Constructor & Destructor Documentation

◆ ctkCoordinatesWidget()

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

◆ ~ctkCoordinatesWidget()

virtual ctkCoordinatesWidget::~ctkCoordinatesWidget ( )
virtual

Member Function Documentation

◆ coordinates()

double const* ctkCoordinatesWidget::coordinates ( ) const

◆ coordinatesAsString()

QString ctkCoordinatesWidget::coordinatesAsString ( ) const

◆ coordinatesChanged

void ctkCoordinatesWidget::coordinatesChanged ( double *  pos)
signal

valueChanged is fired anytime a coordinate is modified, the returned value is the point coordinates TODO: Don't fire the signal if the new values are not changed

◆ decimals()

int ctkCoordinatesWidget::decimals ( ) const

Get the number of decimals of each coordinate spin box The default number of decimals is 3.

◆ decimalsOption()

ctkDoubleSpinBox::DecimalsOptions ctkCoordinatesWidget::decimalsOption ( ) const

Return the decimalsOption property value

See also
decimalsOption

◆ dimension()

int ctkCoordinatesWidget::dimension ( ) const

◆ isNormalized()

bool ctkCoordinatesWidget::isNormalized ( ) const

◆ maximum()

double ctkCoordinatesWidget::maximum ( ) const

◆ minimum()

double ctkCoordinatesWidget::minimum ( ) const

◆ norm()

double ctkCoordinatesWidget::norm ( ) const

Return the norm of the coordinates.

◆ normalize

void ctkCoordinatesWidget::normalize ( )
slot

◆ setCoordinates() [1/2]

void ctkCoordinatesWidget::setCoordinates ( double *  pos)

Set/Get the coordinates The default values are 0.

◆ setCoordinates() [2/2]

void ctkCoordinatesWidget::setCoordinates ( double  x,
double  y = 0.,
double  z = 0.,
double  w = 0. 
)

Convenient function that sets up to 4 elements of the coordinates.

◆ setCoordinatesAsString()

void ctkCoordinatesWidget::setCoordinatesAsString ( QString  pos)

Set/Get the coordinates. Use commas to separate elements, spaces are allowed: e.g. "0,0.0, 0."

◆ setDecimals

void ctkCoordinatesWidget::setDecimals ( int  decimals)
slot

Set the number of decimals of each coordinate spin box.

◆ setDecimalsOption()

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

Set the decimalsOption property value.

See also
decimalsOption

◆ setDimension()

void ctkCoordinatesWidget::setDimension ( int  dim)

Set/Get the dimension of the point The default dimension is 3

◆ setMaximum()

void ctkCoordinatesWidget::setMaximum ( double  minimum)

Set/Get the maximum value of each coordinate spin box The default maximum is 100000.

◆ setMinimum()

void ctkCoordinatesWidget::setMinimum ( double  minimum)

Set/Get the minimum value of each coordinate spin box The default minimum is -100000.

◆ setNormalized()

void ctkCoordinatesWidget::setNormalized ( bool  normalize)

Change the normalized property. If normalize is true, it normalizes the current coordinates, the range of possible values is reset to [-1, 1].

See also
isNormalized

◆ setRange()

void ctkCoordinatesWidget::setRange ( double  minimum,
double  maximum 
)

Set the minimum and maximum of each coordinate spinbox at once.

See also
minimum, maximum

◆ setSingleStep()

void ctkCoordinatesWidget::setSingleStep ( double  step)

Set/Get the single step of each coordinate spin box The default single step is 1.

◆ setSizeHintPolicy()

void ctkCoordinatesWidget::setSizeHintPolicy ( ctkDoubleSpinBox::SizeHintPolicy  newSizeHintPolicy)

Set the sizeHintPolicy property value.

See also
sizeHintPolicy

◆ setValueProxy()

void ctkCoordinatesWidget::setValueProxy ( ctkValueProxy proxy)

Set/Get the value proxy of the spinboxes used to display the coordinates.

See also
setValueProxy(), valueProxy()

◆ singleStep()

double ctkCoordinatesWidget::singleStep ( ) const

◆ sizeHintPolicy()

ctkDoubleSpinBox::SizeHintPolicy ctkCoordinatesWidget::sizeHintPolicy ( ) const

Return the sizeHintPolicy property value.

See also
sizeHintPolicy

◆ spinBox()

ctkDoubleSpinBox* ctkCoordinatesWidget::spinBox ( int  id)

Return the spinbox identitfied by id.

◆ squaredNorm()

double ctkCoordinatesWidget::squaredNorm ( ) const

Return the squared norm of the coordinates.

◆ updateCoordinate

void ctkCoordinatesWidget::updateCoordinate ( double  coordinate)
protectedslot

◆ updateCoordinates

void ctkCoordinatesWidget::updateCoordinates ( )
protectedslot

◆ valueProxy()

ctkValueProxy* ctkCoordinatesWidget::valueProxy ( ) const

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkCoordinatesWidgetPrivate> ctkCoordinatesWidget::d_ptr
protected

Definition at line 169 of file ctkCoordinatesWidget.h.

Property Documentation

◆ coordinates

QString ctkCoordinatesWidget::coordinates
readwrite

Definition at line 1 of file ctkCoordinatesWidget.h.

◆ decimals

int ctkCoordinatesWidget::decimals
readwrite

This property controls how many decimals should be displayed by the spinboxes. This number might not be used depending on decimalsOption. In general, the coordinatesWidget tries to use the same number of decimals for all the spinboxes except if numbers require more decimals.

Definition at line 1 of file ctkCoordinatesWidget.h.

◆ decimalsOption

ctkDoubleSpinBox::DecimalsOptions ctkCoordinatesWidget::decimalsOption
readwrite

This property provides more controls over the decimals.

See also
ctkDoubleSpinBox::DecimalsOptions, decimals

Definition at line 1 of file ctkCoordinatesWidget.h.

◆ dimension

int ctkCoordinatesWidget::dimension
readwrite

Definition at line 1 of file ctkCoordinatesWidget.h.

◆ maximum

double ctkCoordinatesWidget::maximum
readwrite

This property the maximum value of the spinboxes. No limit (max double) by default.

See also
maximum(), setMaximum(), minimum, sizeHintPolicy

Definition at line 1 of file ctkCoordinatesWidget.h.

◆ minimum

double ctkCoordinatesWidget::minimum
readwrite

This property controls the minimum value of the spinboxes. No limit (-max double) by default.

See also
minimum(), setMinimum(), maximum, sizeHintPolicy

Definition at line 1 of file ctkCoordinatesWidget.h.

◆ normalized

bool ctkCoordinatesWidget::normalized
readwrite

This property controls whether the coordinates must be normalized. If true, the norm of the coordinates is enforced to be 1. False by default.

Definition at line 1 of file ctkCoordinatesWidget.h.

◆ singleStep

double ctkCoordinatesWidget::singleStep
readwrite

Definition at line 1 of file ctkCoordinatesWidget.h.

◆ sizeHintPolicy

ctkDoubleSpinBox::SizeHintPolicy ctkCoordinatesWidget::sizeHintPolicy
readwrite

This property controls the size hint of the spinboxes. ctkDoubleSpinBox::SizeHintByValue by default

See also
ctkDoubleSpinBox::SizeHintPolicy

Definition at line 1 of file ctkCoordinatesWidget.h.


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