Computer Assited Medical Intervention Tool Kit  version 5.0
camitk::HistoryItem Class Reference

HistoryItem class describes the entry of an action used in a pipeline, in the history. More...

#include <HistoryItem.h>

+ Collaboration diagram for camitk::HistoryItem:

Public Member Functions

void addProperty (QByteArray name, QVariant value)
 Add a property of the corresponding action to the history item. More...
 
QList< HistoryComponentgetInputHistoryComponents ()
 Get the input components of the history item action. More...
 
QString getName ()
 Get the name of the corresponding action in the pipeline. More...
 
QList< HistoryComponentgetOutputHistoryComponents ()
 Get the output components of the history item action. More...
 
 HistoryItem ()=default
 Empty constructor. More...
 
 HistoryItem (QString name)
 Default constructor. More...
 
void setInputHistoryComponents (QList< HistoryComponent > inputHistoryComponents)
 Set the input components of the history item action. More...
 
void setOutputHistoryComponents (QList< HistoryComponent > outputHistoryComponents)
 Set the output components of the history item action. More...
 
virtual ~HistoryItem ()=default
 Virtual destructor. More...
 

Private Attributes

QList< HistoryComponentinputHistoryComponents
 The input components for this action. More...
 
QString name
 The name of the action in the pipeline. More...
 
QList< HistoryComponentoutputHistoryComponents
 The outpu components for this action. More...
 
QMap< QByteArray, QVariant > properties
 The properties stored for this action. More...
 

Detailed Description

HistoryItem class describes the entry of an action used in a pipeline, in the history.

In CamiTK, every Action are stored in a history, which can be saved as a XML file.
Each history entry is an instance of HistoryItem and provides information about the processed action :

  • the name of the action processed.
  • the properties (name, values).
  • its input components, stored as HistoryComponent instances.
  • its output components, stored as HistoryComponent instances.

History items are mainly useful for getting back to a previous state by undoing an action or for scripting by storing in a file a pipeline of actions written in Python.
The history is stored in the Application class and uses the "construct on first use" idiom/design-pattern (with singletons).
It therefore avoids the infamous "static initialization order fiasco", see http://www.parashift.com/c++-faq/ctors.html

See also
HistoryComponent

Constructor & Destructor Documentation

◆ HistoryItem() [1/2]

camitk::HistoryItem::HistoryItem ( )
default

Empty constructor.

◆ HistoryItem() [2/2]

camitk::HistoryItem::HistoryItem ( QString  name)

Default constructor.

Parameters
namename of the action stored in the history

◆ ~HistoryItem()

virtual camitk::HistoryItem::~HistoryItem ( )
virtualdefault

Virtual destructor.

Member Function Documentation

◆ addProperty()

void camitk::HistoryItem::addProperty ( QByteArray  name,
QVariant  value 
)

Add a property of the corresponding action to the history item.

Parameters
nameName of the property to addProperty.
valueValue of the property to add (no type specified).

Referenced by camitk::Action::preProcessInPipeline().

+ Here is the caller graph for this function:

◆ getInputHistoryComponents()

QList< HistoryComponent > camitk::HistoryItem::getInputHistoryComponents ( )

Get the input components of the history item action.

Returns
The input components required to the corresponding action to work.

Referenced by camitk::Application::saveHistoryAsSXML().

+ Here is the caller graph for this function:

◆ getName()

QString camitk::HistoryItem::getName ( )

Get the name of the corresponding action in the pipeline.

Returns
the name of the action in the pipeline.

Referenced by camitk::Application::saveHistoryAsSXML().

+ Here is the caller graph for this function:

◆ getOutputHistoryComponents()

QList< HistoryComponent > camitk::HistoryItem::getOutputHistoryComponents ( )

Get the output components of the history item action.

Returns
The output components that the action has created / modified.

Referenced by camitk::Application::saveHistoryAsSXML().

+ Here is the caller graph for this function:

◆ setInputHistoryComponents()

void camitk::HistoryItem::setInputHistoryComponents ( QList< HistoryComponent inputHistoryComponents)

Set the input components of the history item action.

Parameters
inputHistoryComponentsThe list of input HistoryComponent.

◆ setOutputHistoryComponents()

void camitk::HistoryItem::setOutputHistoryComponents ( QList< HistoryComponent outputHistoryComponents)

Set the output components of the history item action.

Parameters
outputHistoryComponentsThe list of output HistoryComponent.

Member Data Documentation

◆ inputHistoryComponents

QList<HistoryComponent> camitk::HistoryItem::inputHistoryComponents
private

The input components for this action.

◆ name

QString camitk::HistoryItem::name
private

The name of the action in the pipeline.

◆ outputHistoryComponents

QList<HistoryComponent> camitk::HistoryItem::outputHistoryComponents
private

The outpu components for this action.

◆ properties

QMap<QByteArray, QVariant> camitk::HistoryItem::properties
private

The properties stored for this action.


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