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 "mitkColorSequenceHalfTones.h"
00018 #include <vector>
00019 namespace mitk
00020 {
00021
00022 ColorSequenceHalfTones::ColorSequenceHalfTones()
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 ColorSequenceHalfTones::~ColorSequenceHalfTones()
00033 {
00034
00035 }
00036
00037 Color ColorSequenceHalfTones::GetNextColor()
00038 {
00039 m_Color = m_ColorList[m_ColorIndex];
00040
00041 if(m_ColorIndex < m_ColorList.size())
00042 {
00043 m_ColorIndex++;
00044 }
00045 else
00046 {
00047 m_ColorIndex = 0;
00048 }
00049 return m_Color;
00050 }
00051
00052 void ColorSequenceHalfTones::InitColorList()
00053 {
00054
00055 Color defaultColor, red, green, blue, yellow, magenta, cyan, orange;
00056 defaultColor.Set(1.0, 0.67, 0.0);
00057 red.Set(1.0, 0.6, 0.6);
00058 green.Set(0.6, 1.0, 0.6);
00059 blue.Set(0.6, 0.6, 1.0);
00060 yellow.Set(1.0, 1.0, 0.6);
00061 magenta.Set(1.0, 0.6, 1.0);
00062 cyan.Set(0.6, 1.0, 1.0);
00063 orange.Set(1.0, 0.8, 0.6);
00064
00065 m_ColorList.push_back(red);
00066 m_ColorList.push_back(yellow);
00067 m_ColorList.push_back(blue);
00068 m_ColorList.push_back(green);
00069 m_ColorList.push_back(magenta);
00070 m_ColorList.push_back(cyan);
00071 m_ColorList.push_back(orange);
00072 m_ColorList.push_back(defaultColor);
00073
00074
00075 }
00076
00077 void ColorSequenceHalfTones::GoToBegin()
00078 {
00079 m_ColorIndex = 0;
00080 }
00081
00082 }
00083