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

◆ Superclass

typedef QObject ctkValueProxy::Superclass

Definition at line 63 of file ctkValueProxy.h.

Constructor & Destructor Documentation

◆ ctkValueProxy()

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

◆ ~ctkValueProxy()

virtual ctkValueProxy::~ctkValueProxy ( )
virtual

Member Function Documentation

◆ proxyAboutToBeModified

void ctkValueProxy::proxyAboutToBeModified ( )
signal

◆ proxyModified

void ctkValueProxy::proxyModified ( )
signal

◆ proxyValue()

virtual double ctkValueProxy::proxyValue ( ) const
virtual

◆ proxyValueChanged

void ctkValueProxy::proxyValueChanged ( double  )
signal

◆ proxyValueFromValue()

virtual double ctkValueProxy::proxyValueFromValue ( double  value) const
pure virtual

Implemented in ctkLinearValueProxy.

◆ setProxyValue

void ctkValueProxy::setProxyValue ( double  newProxyValue)
slot

◆ setValue

void ctkValueProxy::setValue ( double  newValue)
slot

◆ updateProxyValue()

void ctkValueProxy::updateProxyValue ( )
protected

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

◆ updateValue()

void ctkValueProxy::updateValue ( )
protected

◆ value()

double ctkValueProxy::value ( ) const

◆ valueChanged

void ctkValueProxy::valueChanged ( double  )
signal

◆ valueFromProxyValue()

virtual double ctkValueProxy::valueFromProxyValue ( double  proxyValue) const
pure virtual

Implemented in ctkLinearValueProxy.

Member Data Documentation

◆ d_ptr

QScopedPointer<ctkValueProxyPrivate> ctkValueProxy::d_ptr
protected

Definition at line 85 of file ctkValueProxy.h.

Property Documentation

◆ proxyValue

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 1 of file ctkValueProxy.h.

◆ value

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 1 of file ctkValueProxy.h.


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