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

Provides a basic implementation for an application app. More...

#include <Plugins/org.commontk.dah.hostedapp/ctkDicomAbstractApp.h>

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

Signals

void cancelProgress ()
 ctkDicomAppHosting::CANCELED state received. More...
 
void exitHostedApp ()
 ctkDicomAppHosting::EXIT state received and legal. More...
 
void releaseResources ()
 ctkDicomAppHosting::IDLE state received and legal. More...
 
void resumeProgress ()
 ctkDicomAppHosting::INPROGRESS state received when the app is in the ctkDicomAppHosting::SUSPENDED state. More...
 
void startProgress ()
 ctkDicomAppHosting::INPROGRESS state received and legal. More...
 
void suspendProgress ()
 ctkDicomAppHosting::SUSPENDED state received. More...
 
- Signals inherited from ctkDicomAbstractExchangeCache
void dataAvailable ()
 
void internalDataAvailable ()
 

Public Member Functions

 ctkDicomAbstractApp (ctkPluginContext *context)
 
virtual ctkDicomHostInterfacegetHostInterface () const
 Gets a handle to the host, in order to call methods on it. More...
 
ctkDicomExchangeInterfacegetOtherSideExchangeService () const
 Gets the exchange service of the other side. More...
 
virtual ctkDicomAppHosting::State getState ()
 Sends the current state the app is in to the hosting system. More...
 
void setInternalState (ctkDicomAppHosting::State state)
 Sets the internal representation of the current state. More...
 
virtual bool setState (ctkDicomAppHosting::State newState)
 Method triggered by the host. Changes the state of the hosted application. More...
 
virtual ~ctkDicomAbstractApp ()
 
- Public Member Functions inherited from ctkDicomAbstractExchangeCache
void cleanIncomingData ()
 Clean internal data stucture that keeps the incoming data. More...
 
 ctkDicomAbstractExchangeCache ()
 Construct object. More...
 
virtual QList< ctkDicomAppHosting::ObjectLocatorgetData (const QList< QUuid > &objectUUIDs, const QList< QString > &acceptableTransferSyntaxUIDs, bool includeBulkData)
 Provide ctkDicomAppHosting::ObjectLocators to the other side. More...
 
const ctkDicomAppHosting::AvailableDatagetIncomingAvailableData () const
 Return the incoming available data. More...
 
bool lastIncomingData () const
 Return whether the incoming data was marked as lastData. More...
 
bool notifyDataAvailable (const ctkDicomAppHosting::AvailableData &data, bool lastData)
 Receive notification from other side. More...
 
ctkDicomObjectLocatorCacheobjectLocatorCache () const
 Return the cache for outgoing data. More...
 
bool publishData (const ctkDicomAppHosting::AvailableData &availableData, bool lastData)
 Publish data to other side. More...
 
void releaseData (const QList< QUuid > &objectUUIDs)
 
virtual ~ctkDicomAbstractExchangeCache ()
 Destructor. More...
 
- Public Member Functions inherited from ctkDicomExchangeInterface
virtual ~ctkDicomExchangeInterface ()
 
- Public Member Functions inherited from ctkDicomAppInterface
virtual bool bringToFront (const QRect &requestedScreenArea)=0
 

Detailed Description

Provides a basic implementation for an application app.

The methods of the ctkDicomAppInterface have to be implemented for the business logic.

Todo:
Provide helper/convenience methods to ease application development.

Definition at line 49 of file ctkDicomAbstractApp.h.

Constructor & Destructor Documentation

◆ ctkDicomAbstractApp()

ctkDicomAbstractApp::ctkDicomAbstractApp ( ctkPluginContext context)
Parameters
context

◆ ~ctkDicomAbstractApp()

virtual ctkDicomAbstractApp::~ctkDicomAbstractApp ( )
virtual

Member Function Documentation

◆ cancelProgress

void ctkDicomAbstractApp::cancelProgress ( )
signal

ctkDicomAppHosting::CANCELED state received.

The CANCELED state is particular because it leads to ctkDicomAppHosting::IDLE when the app has canceled the process. Therefore the notification the app entered this CANCELED state is sent straight away by the setState method.

The slot connected to this signal MUST NOT notify CANCELED, but MUST notify IDLE when the resources have been released.

◆ exitHostedApp

void ctkDicomAbstractApp::exitHostedApp ( )
signal

ctkDicomAppHosting::EXIT state received and legal.

An EXIT notification is sent by setState, no communication with the hosting system is needed anymore. A slot connected to this should stop the application process for good.

◆ getHostInterface()

virtual ctkDicomHostInterface* ctkDicomAbstractApp::getHostInterface ( ) const
virtual

Gets a handle to the host, in order to call methods on it.

Returns
ctkDicomHostInterface *

◆ getOtherSideExchangeService()

ctkDicomExchangeInterface* ctkDicomAbstractApp::getOtherSideExchangeService ( ) const
virtual

Gets the exchange service of the other side.

If we are a host, this must return the exchange service of the hosted app and vice versa.

Returns
ctkDicomExchangeService * of the other side

Implements ctkDicomAbstractExchangeCache.

◆ getState()

virtual ctkDicomAppHosting::State ctkDicomAbstractApp::getState ( )
virtual

Sends the current state the app is in to the hosting system.

Returns
ctkDicomAppHosting::State

Implements ctkDicomAppInterface.

◆ releaseResources

void ctkDicomAbstractApp::releaseResources ( )
signal

ctkDicomAppHosting::IDLE state received and legal.

It means the current state was COMPLETED, and it is now time to release the resources, the hosting system doesn't need them any more.

◆ resumeProgress

void ctkDicomAbstractApp::resumeProgress ( )
signal

ctkDicomAppHosting::INPROGRESS state received when the app is in the ctkDicomAppHosting::SUSPENDED state.

Corresponding slot responsible for calling getHostInterface()->notifyStateChanged(ctkDicomAppHosting::INPROGRESS); when resumed.

◆ setInternalState()

void ctkDicomAbstractApp::setInternalState ( ctkDicomAppHosting::State  state)

Sets the internal representation of the current state.

Parameters
state

◆ setState()

virtual bool ctkDicomAbstractApp::setState ( ctkDicomAppHosting::State  newState)
virtual

Method triggered by the host. Changes the state of the hosted application.

Goes through the transitions and emits signals when relevant to trigger actions. Checks for the legality of a transition.

See also
startProgress() resumeProgress() suspendProgress() cancelProgress() exitHostedApp() releaseResources()
Parameters
newState
Returns
bool true if state received and not illegal in the transition diagram from the reference, false if illegal or not recognized.

Implements ctkDicomAppInterface.

◆ startProgress

void ctkDicomAbstractApp::startProgress ( )
signal

ctkDicomAppHosting::INPROGRESS state received and legal.

the slot connected to this is responsible for notifying the hosting service that it is really in progress by a call to getHostInterface()->notifyStateChanged(ctkDicomAppHosting::INPROGRESS);

◆ suspendProgress

void ctkDicomAbstractApp::suspendProgress ( )
signal

ctkDicomAppHosting::SUSPENDED state received.

Corresponding slot responsible for calling getHostInterface()->notifyStateChanged(ctkDicomAppHosting::SUSPENDED); when resources have been released.


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