Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #include "mitkColorSequenceRainbow.h"
00018 #include <vector>
00019 namespace mitk
00020 {
00021
00022 ColorSequenceRainbow::ColorSequenceRainbow()
00023 {
00024 m_ColorIndex = 0;
00025 m_Color.SetRed(1.0);
00026 m_Color.SetGreen(0.67);
00027 m_Color.SetBlue(0.0);
00028 InitColorList();
00029 }
00030
00031
00032 ColorSequenceRainbow::~ColorSequenceRainbow()
00033 {
00034
00035 }
00036
00037 Color ColorSequenceRainbow::GetNextColor()
00038 {
00039 m_Color = m_ColorList[m_ColorIndex];
00040 if(m_ColorIndex < m_ColorList.size())
00041 {
00042 m_ColorIndex++;
00043 }
00044 else
00045 {
00046 m_ColorIndex = 0;
00047 }
00048 return m_Color;
00049 }
00050
00051 void ColorSequenceRainbow::InitColorList()
00052 {
00053
00054 mitk::Color defaultColor, red, green, blue, yellow, magenta, cyan, orange;
00055 defaultColor.Set(1.0, 0.67, 0.0);
00056 red.Set(1.0, 0.0, 0.0);
00057 green.Set(0.0, 1.0, 0.0);
00058 blue.Set(0.0, 0.0, 1.0);
00059 yellow.Set(1.0, 1.0, 0.0);
00060 magenta.Set(1.0, 0.0, 1.0);
00061 cyan.Set(0.0, 1.0, 1.0);
00062 orange.Set(1.0, 0.6, 0.0);
00063
00064 m_ColorList.push_back(red);
00065 m_ColorList.push_back(yellow);
00066 m_ColorList.push_back(blue);
00067 m_ColorList.push_back(green);
00068 m_ColorList.push_back(magenta);
00069 m_ColorList.push_back(cyan);
00070 m_ColorList.push_back(orange);
00071 m_ColorList.push_back(defaultColor);
00072
00073
00074 }
00075
00076 void ColorSequenceRainbow::GoToBegin()
00077 {
00078 m_ColorIndex = 0;
00079 }
00080
00081 }
00082