Slicer  5.0
Slicer is a multi-platform, free and open source software package for visualization and medical image computing
List of all members | Classes | Public Types | Public Member Functions | Static Public Member Functions | Protected Types | Protected Member Functions | Static Protected Member Functions | Protected Attributes
vtkSegmentationHistory Class Reference

#include <Libs/vtkSegmentationCore/vtkSegmentationHistory.h>

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

Classes

struct  SegmentationState
 

Public Types

typedef vtkObject Superclass
 

Public Member Functions

virtual const char * GetClassName ()
 
virtual unsigned int GetMaximumNumberOfStates ()
 Get the limit of how many states may be stored. More...
 
int GetNumberOfStates ()
 Get the current number of states. More...
 
virtual vtkSegmentationGetSegmentation ()
 Get segmentation that the states will be stored of. More...
 
virtual int IsA (const char *type)
 
bool IsRestoreNextStateAvailable ()
 
bool IsRestorePreviousStateAvailable ()
 
void PrintSelf (ostream &os, vtkIndent indent) override
 
void RemoveAllStates ()
 Delete all states from memory. More...
 
bool RestoreNextState ()
 
bool RestorePreviousState ()
 
bool SaveState ()
 
void SetMaximumNumberOfStates (unsigned int maximumNumberOfStates)
 
void SetSegmentation (vtkSegmentation *segmentation)
 

Static Public Member Functions

static int IsTypeOf (const char *type)
 
static vtkSegmentationHistoryNew ()
 
static vtkSegmentationHistorySafeDownCast (vtkObject *o)
 

Protected Types

typedef std::map< std::string, vtkSmartPointer< vtkSegment > > SegmentsMap
 

Protected Member Functions

void RemoveAllNextStates ()
 Delete all states that are more recent than the last restored state. More...
 
void RemoveAllObsoleteStates ()
 Delete all old states so that we keep only up to MaximumNumberOfStates states. More...
 
bool RestoreState (unsigned int stateIndex)
 Restores a state defined by stateIndex. More...
 
 vtkSegmentationHistory ()
 
 ~vtkSegmentationHistory () override
 

Static Protected Member Functions

static void OnSegmentationModified (vtkObject *caller, unsigned long eid, void *clientData, void *callData)
 

Protected Attributes

unsigned int LastRestoredState
 
unsigned int MaximumNumberOfStates
 
bool RestoreStateInProgress
 
vtkSegmentationSegmentation
 
vtkCallbackCommand * SegmentationModifiedCallbackCommand
 
std::deque< SegmentationStateSegmentationStates
 

Detailed Description

Definition at line 41 of file vtkSegmentationHistory.h.

Member Typedef Documentation

◆ SegmentsMap

typedef std::map<std::string, vtkSmartPointer<vtkSegment> > vtkSegmentationHistory::SegmentsMap
protected

Definition at line 107 of file vtkSegmentationHistory.h.

◆ Superclass

Definition at line 45 of file vtkSegmentationHistory.h.

Constructor & Destructor Documentation

◆ vtkSegmentationHistory()

vtkSegmentationHistory::vtkSegmentationHistory ( )
protected

◆ ~vtkSegmentationHistory()

vtkSegmentationHistory::~vtkSegmentationHistory ( )
overrideprotected

Member Function Documentation

◆ GetClassName()

virtual const char* vtkSegmentationHistory::GetClassName ( )
virtual

◆ GetMaximumNumberOfStates()

virtual unsigned int vtkSegmentationHistory::GetMaximumNumberOfStates ( )
virtual

Get the limit of how many states may be stored.

◆ GetNumberOfStates()

int vtkSegmentationHistory::GetNumberOfStates ( )

Get the current number of states.

◆ GetSegmentation()

virtual vtkSegmentation* vtkSegmentationHistory::GetSegmentation ( )
virtual

Get segmentation that the states will be stored of.

◆ IsA()

virtual int vtkSegmentationHistory::IsA ( const char *  type)
virtual

◆ IsRestoreNextStateAvailable()

bool vtkSegmentationHistory::IsRestoreNextStateAvailable ( )

Check if it is possible to go restore the next state (redo).

Returns
True if the operation is allowed

◆ IsRestorePreviousStateAvailable()

bool vtkSegmentationHistory::IsRestorePreviousStateAvailable ( )

Check if it is possible to go back to a previous state (undo).

Returns
True if the operation is allowed

◆ IsTypeOf()

static int vtkSegmentationHistory::IsTypeOf ( const char *  type)
static

◆ New()

static vtkSegmentationHistory* vtkSegmentationHistory::New ( )
static

◆ OnSegmentationModified()

static void vtkSegmentationHistory::OnSegmentationModified ( vtkObject *  caller,
unsigned long  eid,
void *  clientData,
void *  callData 
)
staticprotected

Callback function called when the segmentation has been modified. It clears all states that are more recent than the last restored state.

◆ PrintSelf()

void vtkSegmentationHistory::PrintSelf ( ostream &  os,
vtkIndent  indent 
)
override

◆ RemoveAllNextStates()

void vtkSegmentationHistory::RemoveAllNextStates ( )
protected

Delete all states that are more recent than the last restored state.

◆ RemoveAllObsoleteStates()

void vtkSegmentationHistory::RemoveAllObsoleteStates ( )
protected

Delete all old states so that we keep only up to MaximumNumberOfStates states.

◆ RemoveAllStates()

void vtkSegmentationHistory::RemoveAllStates ( )

Delete all states from memory.

◆ RestoreNextState()

bool vtkSegmentationHistory::RestoreNextState ( )

Restores next state of the segmentation.

Returns
Success flag

◆ RestorePreviousState()

bool vtkSegmentationHistory::RestorePreviousState ( )

Restores previous state of the segmentation.

Returns
Success flag

◆ RestoreState()

bool vtkSegmentationHistory::RestoreState ( unsigned int  stateIndex)
protected

Restores a state defined by stateIndex.

◆ SafeDownCast()

static vtkSegmentationHistory* vtkSegmentationHistory::SafeDownCast ( vtkObject *  o)
static

◆ SaveState()

bool vtkSegmentationHistory::SaveState ( )

Saves all master representations of the segmentation in its current state. States more recent than the last restored state are removed.

Returns
Success flag

◆ SetMaximumNumberOfStates()

void vtkSegmentationHistory::SetMaximumNumberOfStates ( unsigned int  maximumNumberOfStates)

Limits how many states may be stored. If the number of stored states exceed the limit then the oldest state is removed.

◆ SetSegmentation()

void vtkSegmentationHistory::SetSegmentation ( vtkSegmentation segmentation)

Selects a segmentation that the states will be stored of. Current state of the segmentation is not stored.

Parameters
segmentationSegmentation to store. Deletes all stored states of the previously set segmentation.

Member Data Documentation

◆ LastRestoredState

unsigned int vtkSegmentationHistory::LastRestoredState
protected

Definition at line 123 of file vtkSegmentationHistory.h.

◆ MaximumNumberOfStates

unsigned int vtkSegmentationHistory::MaximumNumberOfStates
protected

Definition at line 118 of file vtkSegmentationHistory.h.

◆ RestoreStateInProgress

bool vtkSegmentationHistory::RestoreStateInProgress
protected

Definition at line 125 of file vtkSegmentationHistory.h.

◆ Segmentation

vtkSegmentation* vtkSegmentationHistory::Segmentation
protected

Definition at line 115 of file vtkSegmentationHistory.h.

◆ SegmentationModifiedCallbackCommand

vtkCallbackCommand* vtkSegmentationHistory::SegmentationModifiedCallbackCommand
protected

Definition at line 116 of file vtkSegmentationHistory.h.

◆ SegmentationStates

std::deque<SegmentationState> vtkSegmentationHistory::SegmentationStates
protected

Definition at line 117 of file vtkSegmentationHistory.h.


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