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 | Protected Attributes | Properties | List of all members
ctkValueProxy Class Referenceabstract

Base class for value proxies. Value proxy allows to decouple the displayed value from the values accessed within the program. For example, one may want to display Fahrenheit while still working with Celsius. More...

#include <Libs/Core/ctkValueProxy.h>

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

Public Types

typedef QObject Superclass
 

Public Slots

void setProxyValue (double newProxyValue)
 
void setValue (double newValue)
 

Signals

void proxyAboutToBeModified ()
 
void proxyModified ()
 
void proxyValueChanged (double)
 
void valueChanged (double)
 

Public Member Functions

 ctkValueProxy (QObject *parent=0)
 
virtual double proxyValue () const
 
virtual double proxyValueFromValue (double value) const =0
 
double value () const
 
virtual double valueFromProxyValue (double proxyValue) const =0
 
virtual ~ctkValueProxy ()
 

Protected Member Functions

void updateProxyValue ()
 
void updateValue ()
 

Protected Attributes

QScopedPointer< ctkValueProxyPrivate > d_ptr
 

Properties

double proxyValue
 
double value
 

Detailed Description

Base class for value proxies. Value proxy allows to decouple the displayed value from the values accessed within the program. For example, one may want to display Fahrenheit while still working with Celsius.

A ctkValueProxy can be used by connecting signal/slots to the value and proxyValue properties or by using directly the valueFromProxyValue and proxyValueFromValue functions.

Subclasses should reimplement the function proxyValueFromValue() and valueFromProxyValue().

See also
ctkLinearValueProxy

Definition at line 46 of file ctkValueProxy.h.

Member Typedef Documentation

typedef QObject ctkValueProxy::Superclass

Definition at line 63 of file ctkValueProxy.h.

Constructor & Destructor Documentation

ctkValueProxy::ctkValueProxy ( QObject *  parent = 0)
explicit
virtual ctkValueProxy::~ctkValueProxy ( )
virtual

Member Function Documentation

void ctkValueProxy::proxyAboutToBeModified ( )
signal
void ctkValueProxy::proxyModified ( )
signal
virtual double ctkValueProxy::proxyValue ( ) const
virtual
void ctkValueProxy::proxyValueChanged ( double  )
signal
virtual double ctkValueProxy::proxyValueFromValue ( double  value) const
pure virtual

Implemented in ctkLinearValueProxy.

void ctkValueProxy::setProxyValue ( double  newProxyValue)
slot
void ctkValueProxy::setValue ( double  newValue)
slot
void ctkValueProxy::updateProxyValue ( )
protected

Utilities function for subclasses. Can be called to update the value/proxyValue from the proxyValue/value.

void ctkValueProxy::updateValue ( )
protected
double ctkValueProxy::value ( ) const
void ctkValueProxy::valueChanged ( double  )
signal
virtual double ctkValueProxy::valueFromProxyValue ( double  proxyValue) const
pure virtual

Implemented in ctkLinearValueProxy.

Member Data Documentation

QScopedPointer<ctkValueProxyPrivate> ctkValueProxy::d_ptr
protected

Definition at line 85 of file ctkValueProxy.h.

Property Documentation

double ctkValueProxy::proxyValue
readwrite

The proxy value holds the value transformed. If the value proxy is considered as a function, then the proxy value is the result of this function applied to value. The proxy value is updated if the value is changed.

Definition at line 60 of file ctkValueProxy.h.

double ctkValueProxy::value
readwrite

The value holds the current value. If the value proxy is considered as a function, then this function applied to the value is the proxy value. The value is updated if the proxy value is changed.

Definition at line 54 of file ctkValueProxy.h.


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