Medical Imaging Interaction Toolkit  2026.06.00
Medical Imaging Interaction Toolkit

Helper class to step through a list. More...

#include <mitkStepper.h>

Inheritance diagram for mitk::Stepper:
Collaboration diagram for mitk::Stepper:

Public Member Functions

 mitkClassMacroItkParent (Stepper, itk::Object)
 
Pointer Clone () const
 
virtual unsigned int GetPos () const
 
virtual void SetPos (unsigned int pos)
 Set the current position, clamped to [0, GetSteps()-1]. More...
 
virtual unsigned int GetSteps () const
 
virtual void SetSteps (unsigned int _arg)
 
virtual bool GetAutoRepeat () const
 
virtual void SetAutoRepeat (bool _arg)
 
virtual void AutoRepeatOn ()
 
virtual void AutoRepeatOff ()
 
virtual void SetPingPong (bool _arg)
 
virtual bool GetPingPong () const
 
virtual void PingPongOn ()
 
virtual void PingPongOff ()
 
virtual void SetInverseDirection (bool _arg)
 
virtual bool GetInverseDirection () const
 
virtual void InverseDirectionOn ()
 
virtual void InverseDirectionOff ()
 
void SetRange (ScalarType min, ScalarType max)
 Set the scalar range (min/max) corresponding to the step positions. More...
 
void InvalidateRange ()
 Mark the current range as invalid while keeping the range itself. More...
 
ScalarType GetRangeMin () const
 Get the minimum value of the range. More...
 
ScalarType GetRangeMax () const
 Get the maximum value of the range. More...
 
bool HasValidRange () const
 Check whether the range has been set and is currently valid. More...
 
void RemoveRange ()
 Remove the range entirely. More...
 
bool HasRange () const
 Check whether a range has been set (may or may not be valid). More...
 
void SetUnitName (const char *unitName)
 Set the unit name string (e.g. "mm") for the stepping range. More...
 
const char * GetUnitName () const
 Get the unit name string. More...
 
void RemoveUnitName ()
 Remove the unit name. More...
 
bool HasUnitName () const
 Check whether a unit name has been set. More...
 
virtual void Next ()
 Advance to the next position in the list. More...
 
virtual void Previous ()
 Go to the previous position in the list. More...
 
virtual void MoveSlice (int sliceDelta)
 Move the position by a given delta (positive or negative). More...
 
virtual void First ()
 Go to the first position (index 0). More...
 
virtual void Last ()
 Go to the last position (index GetSteps() - 1). More...
 

Static Public Member Functions

static Pointer New ()
 

Protected Member Functions

 Stepper ()
 
 ~Stepper () override
 
void Increase ()
 Increment position by one, respecting AutoRepeat and PingPong. More...
 
void Decrease ()
 Decrement position by one, respecting AutoRepeat and PingPong. More...
 

Protected Attributes

unsigned int m_Pos
 
unsigned int m_Steps
 
bool m_AutoRepeat
 
bool m_PingPong
 
bool m_InverseDirection
 
ScalarType m_RangeMin
 
ScalarType m_RangeMax
 
bool m_RangeValid
 
bool m_HasRange
 
std::string m_UnitName
 
bool m_HasUnitName
 

Detailed Description

Helper class to step through a list.

A helper class to step through a list. Does not contain the list, just the position in the list (between 0 and GetSteps()). Provides methods like First (go to the first element), Next (go to the next one), etc.

Besides the actual number of steps, the stepper can also hold a stepping range, indicating the scalar values corresponding to the covered steps. For example, steppers are generally used to slice a dataset with a plane; Hereby, Steps indicates the total number of steps (positions) available for the plane, Pos indicates the current step, and Range indicates the physical minimum and maximum values for the plane, in this case a value in mm.

The range can also be supplied with a unit name (a string) which can be used by classes providing information about the stepping (e.g. graphical sliders).

Definition at line 47 of file mitkStepper.h.

Constructor & Destructor Documentation

◆ Stepper()

mitk::Stepper::Stepper ( )
protected

◆ ~Stepper()

mitk::Stepper::~Stepper ( )
overrideprotected

Member Function Documentation

◆ AutoRepeatOff()

virtual void mitk::Stepper::AutoRepeatOff ( )
virtual

◆ AutoRepeatOn()

virtual void mitk::Stepper::AutoRepeatOn ( )
virtual

◆ Clone()

Pointer mitk::Stepper::Clone ( ) const

◆ Decrease()

void mitk::Stepper::Decrease ( )
protected

Decrement position by one, respecting AutoRepeat and PingPong.

◆ First()

virtual void mitk::Stepper::First ( )
virtual

Go to the first position (index 0).

◆ GetAutoRepeat()

virtual bool mitk::Stepper::GetAutoRepeat ( ) const
virtual

◆ GetInverseDirection()

virtual bool mitk::Stepper::GetInverseDirection ( ) const
virtual

◆ GetPingPong()

virtual bool mitk::Stepper::GetPingPong ( ) const
virtual

◆ GetPos()

virtual unsigned int mitk::Stepper::GetPos ( ) const
virtual

◆ GetRangeMax()

ScalarType mitk::Stepper::GetRangeMax ( ) const

Get the maximum value of the range.

◆ GetRangeMin()

ScalarType mitk::Stepper::GetRangeMin ( ) const

Get the minimum value of the range.

◆ GetSteps()

virtual unsigned int mitk::Stepper::GetSteps ( ) const
virtual

◆ GetUnitName()

const char* mitk::Stepper::GetUnitName ( ) const

Get the unit name string.

◆ HasRange()

bool mitk::Stepper::HasRange ( ) const

Check whether a range has been set (may or may not be valid).

◆ HasUnitName()

bool mitk::Stepper::HasUnitName ( ) const

Check whether a unit name has been set.

◆ HasValidRange()

bool mitk::Stepper::HasValidRange ( ) const

Check whether the range has been set and is currently valid.

◆ Increase()

void mitk::Stepper::Increase ( )
protected

Increment position by one, respecting AutoRepeat and PingPong.

◆ InvalidateRange()

void mitk::Stepper::InvalidateRange ( )

Mark the current range as invalid while keeping the range itself.

◆ InverseDirectionOff()

virtual void mitk::Stepper::InverseDirectionOff ( )
virtual

◆ InverseDirectionOn()

virtual void mitk::Stepper::InverseDirectionOn ( )
virtual

◆ Last()

virtual void mitk::Stepper::Last ( )
virtual

Go to the last position (index GetSteps() - 1).

◆ mitkClassMacroItkParent()

mitk::Stepper::mitkClassMacroItkParent ( Stepper  ,
itk::Object   
)

◆ MoveSlice()

virtual void mitk::Stepper::MoveSlice ( int  sliceDelta)
virtual

Move the position by a given delta (positive or negative).

Respects AutoRepeat wrapping. If the resulting position would be negative, it is clamped to 0 (unless AutoRepeat is on).

Parameters
[in]sliceDeltaNumber of steps to move (can be negative).

◆ New()

static Pointer mitk::Stepper::New ( )
static

◆ Next()

virtual void mitk::Stepper::Next ( )
virtual

Advance to the next position in the list.

Respects AutoRepeat, PingPong, and InverseDirection settings.

◆ PingPongOff()

virtual void mitk::Stepper::PingPongOff ( )
virtual

◆ PingPongOn()

virtual void mitk::Stepper::PingPongOn ( )
virtual

◆ Previous()

virtual void mitk::Stepper::Previous ( )
virtual

Go to the previous position in the list.

Respects AutoRepeat, PingPong, and InverseDirection settings.

◆ RemoveRange()

void mitk::Stepper::RemoveRange ( )

Remove the range entirely.

◆ RemoveUnitName()

void mitk::Stepper::RemoveUnitName ( )

Remove the unit name.

◆ SetAutoRepeat()

virtual void mitk::Stepper::SetAutoRepeat ( bool  _arg)
virtual

◆ SetInverseDirection()

virtual void mitk::Stepper::SetInverseDirection ( bool  _arg)
virtual

If set to true, the Next() decreases the stepper and Previous() decreases it

◆ SetPingPong()

virtual void mitk::Stepper::SetPingPong ( bool  _arg)
virtual

Causes the stepper to shift direction when the boundary is reached

◆ SetPos()

virtual void mitk::Stepper::SetPos ( unsigned int  pos)
inlinevirtual

Set the current position, clamped to [0, GetSteps()-1].

Parameters
[in]posThe desired position.

Reimplemented in mitk::MultiStepper.

Definition at line 58 of file mitkStepper.h.

◆ SetRange()

void mitk::Stepper::SetRange ( ScalarType  min,
ScalarType  max 
)

Set the scalar range (min/max) corresponding to the step positions.

Parameters
[in]minThe minimum scalar value.
[in]maxThe maximum scalar value.

◆ SetSteps()

virtual void mitk::Stepper::SetSteps ( unsigned int  _arg)
virtual

Reimplemented in mitk::MultiStepper.

◆ SetUnitName()

void mitk::Stepper::SetUnitName ( const char *  unitName)

Set the unit name string (e.g. "mm") for the stepping range.

Parameters
[in]unitNameThe unit name string.

Member Data Documentation

◆ m_AutoRepeat

bool mitk::Stepper::m_AutoRepeat
protected

Definition at line 173 of file mitkStepper.h.

◆ m_HasRange

bool mitk::Stepper::m_HasRange
protected

Definition at line 181 of file mitkStepper.h.

◆ m_HasUnitName

bool mitk::Stepper::m_HasUnitName
protected

Definition at line 184 of file mitkStepper.h.

◆ m_InverseDirection

bool mitk::Stepper::m_InverseDirection
protected

Definition at line 176 of file mitkStepper.h.

◆ m_PingPong

bool mitk::Stepper::m_PingPong
protected

Definition at line 175 of file mitkStepper.h.

◆ m_Pos

unsigned int mitk::Stepper::m_Pos
protected

Definition at line 169 of file mitkStepper.h.

◆ m_RangeMax

ScalarType mitk::Stepper::m_RangeMax
protected

Definition at line 179 of file mitkStepper.h.

◆ m_RangeMin

ScalarType mitk::Stepper::m_RangeMin
protected

Definition at line 178 of file mitkStepper.h.

◆ m_RangeValid

bool mitk::Stepper::m_RangeValid
protected

Definition at line 180 of file mitkStepper.h.

◆ m_Steps

unsigned int mitk::Stepper::m_Steps
protected

Definition at line 171 of file mitkStepper.h.

◆ m_UnitName

std::string mitk::Stepper::m_UnitName
protected

Definition at line 183 of file mitkStepper.h.


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