Computer Assisted Medical Intervention Tool Kit  version 5.2
camitk::HistoryComponent Class Reference

HistoryComponent class describes the component information (name, type) stored in the history. More...

#include <HistoryComponent.h>

+ Collaboration diagram for camitk::HistoryComponent:

Public Types

enum  Type { IMAGE_COMPONENT , MESH_COMPONENT , OTHER }
 The different Type (of representation) of the associated Component. More...
 

Public Member Functions

Constructors
 HistoryComponent (Component *component)
 Construct a new History component from the input component. More...
 
Accessors
QString getName () const
 Get the the name of the Component associated to this item. More...
 
Type getType () const
 Get the Type of the Component associated to this item. More...
 

Detailed Description

HistoryComponent class describes the component information (name, type) stored 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
HistoryItem

Member Enumeration Documentation

◆ Type

The different Type (of representation) of the associated Component.

Use getType() to get the information about a specific HistoryComponent.

Note
The type is highly linked to Component::Representation information :
  • ImageComponent instances have subcomponents of representation SLICE.
  • MeshComponent instances have a representation of type GEOMETRY.
  • Other components have no representation (NO_REPRESENTATION), and are thus of type OTHER.
As for Component::Representation the HistoryComponent type cannot be NULL : if a Component has no representation, then he is of type OTHER
Enumerator
IMAGE_COMPONENT 

this Component represents a volumic image and its subcomponents can be displayed as slices.

MESH_COMPONENT 

this Component represent a 3D mesh, it has a 3D representation which can be displayed in the 3D viewer.

OTHER 

this Component has no defined representation.

Constructor & Destructor Documentation

◆ HistoryComponent()

HistoryComponent::HistoryComponent ( Component component)

Construct a new History component from the input component.

Parameters
componentThe Component associated to the HistoryComponent.

References camitk::Component::getName(), IMAGE_COMPONENT, MESH_COMPONENT, and OTHER.

+ Here is the call graph for this function:

Member Function Documentation

◆ getName()

QString HistoryComponent::getName ( ) const

Get the the name of the Component associated to this item.

Returns
the name of the associated Component.

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

+ Here is the caller graph for this function:

◆ getType()

HistoryComponent::Type HistoryComponent::getType ( ) const

Get the Type of the Component associated to this item.

Returns
the Type of the associated Component.

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

+ Here is the caller graph for this function:

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