Computer Assited Medical Intervention Tool Kit  version 4.1
Public Types | List of all members
camitk::HistoryComponent Class Reference

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

#include <HistoryComponent.h>

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...
 

Private Attributes

Private properties
QString name
 The name of the Component. More...
 
Type type
 The component's Type. 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 :

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, name, OTHER, and type.

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.

References name.

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

◆ getType()

HistoryComponent::Type HistoryComponent::getType ( ) const

Get the Type of the Component associated to this item.

Returns
the Type of the associated Component.

References type.

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

Member Data Documentation

◆ name

QString camitk::HistoryComponent::name
private

The name of the Component.

Referenced by getName(), and HistoryComponent().

◆ type

Type camitk::HistoryComponent::type
private

The component's Type.

Type is a persistent information, stored in the XML.

Referenced by getType(), and HistoryComponent().


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