00001 /*========================================================================= 00002 00003 Program: Medical Imaging & Interaction Toolkit 00004 Language: C++ 00005 Date: $Date$ 00006 Version: $Revision$ 00007 00008 Copyright (c) German Cancer Research Center, Division of Medical and 00009 Biological Informatics. All rights reserved. 00010 See MITKCopyright.txt or https://www.mitk.org/copyright.html for details. 00011 00012 This software is distributed WITHOUT ANY WARRANTY; without even 00013 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00014 PURPOSE. See the above copyright notices for more information. 00015 00016 =========================================================================*/ 00017 00018 00019 #ifndef MULTISTEPPER_H_HEADER_INCLUDED 00020 #define MULTISTEPPER_H_HEADER_INCLUDED 00021 00022 #include <set> 00023 #include "MitkExtExports.h" 00024 #include "mitkCommon.h" 00025 #include "mitkVector.h" 00026 #include "mitkStepper.h" 00027 #include <itkObject.h> 00028 #include <itkObjectFactory.h> 00029 00030 namespace mitk { 00031 00032 //##Documentation 00033 //## @brief Helper class to step through a list 00034 //## 00035 //## A helper class to step through a list. Does not contain the list, just the 00036 //## position in the list (between 0 and GetSteps()). Provides methods like 00037 //## First (go to the first element), Next (go to the next one), etc. 00038 //## @ingroup NavigationControl 00039 class MitkExt_EXPORT MultiStepper : public Stepper 00040 { 00041 public: 00042 mitkClassMacro(MultiStepper, Stepper); 00043 itkNewMacro(Self); 00044 void AddStepper(Stepper::Pointer stepper,unsigned int repeat = 1); 00045 void RemoveStepper(Stepper::Pointer stepper,unsigned int repeat = 1); 00046 /*void Next(); 00047 void Previous(); 00048 void First(); 00049 void Last(); */ 00050 // unsigned int GetPos(); 00051 void SetPos(unsigned int pos); 00052 void SetSteps(const unsigned int steps); 00053 00054 protected: 00055 MultiStepper(); 00056 virtual ~MultiStepper(); 00057 typedef std::set<Stepper::Pointer> StepperSet; 00058 typedef std::map<Stepper::Pointer,unsigned int> ScaleFactorMap; 00059 StepperSet m_SubSteppers; 00060 ScaleFactorMap m_ScaleFactors; 00061 Stepper::Pointer m_LargestRangeStepper; 00062 void UpdateStepCount(); 00063 }; 00064 00065 } // namespace mitk 00066 00067 00068 00069 #endif /* MULTISTEPPER_H_HEADER_INCLUDED */