00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00039 #ifndef __vtkKWColorPresetSelector_h
00040 #define __vtkKWColorPresetSelector_h
00041
00042 #include "vtkKWPresetSelector.h"
00043
00044 class KWWidgets_EXPORT vtkKWColorPresetSelector : public vtkKWPresetSelector
00045 {
00046
00047 public:
00048 static vtkKWColorPresetSelector* New();
00049 vtkTypeRevisionMacro(vtkKWColorPresetSelector, vtkKWPresetSelector);
00050 void PrintSelf(ostream& os, vtkIndent indent);
00051
00053
00056 virtual void GetPresetColorAsRGB(int id, double &r, double &g, double &b);
00057 virtual void GetPresetColorAsRGB(int id, double rgb[3]);
00058 virtual int SetPresetColorAsRGB(int id, double r, double g, double b);
00059 virtual int SetPresetColorAsRGB(int id, double rgb[3]);
00060 virtual void GetPresetColorAsHSV(int id, double &h, double &s, double &v);
00061 virtual void GetPresetColorAsHSV(int id, double hsv[3]);
00062 virtual int SetPresetColorAsHSV(int id, double h, double s, double v);
00063 virtual int SetPresetColorAsHSV(int id, double hsv[3]);
00064 virtual int GetIdOfPresetWithColorAsRGB(double r, double g, double b);
00065 virtual int GetIdOfPresetWithColorAsRGB(double rgb[3]);
00067
00069
00071 virtual int SetPresetCommentAsHexadecimalRGB(int id);
00072 virtual int GetPresetCommentAsHexadecimalRGB(int id, int &r, int &g, int &b);
00073 virtual int HasPresetCommentAsHexadecimalRGB(int id);
00075
00077 virtual void AddDefaultColorPresets();
00078
00081 virtual int RemoveDuplicatedColors();
00082
00084
00095 virtual void SetDrawColorCellAsColorButton(int);
00096 vtkGetMacro(DrawColorCellAsColorButton,int);
00097 vtkBooleanMacro(DrawColorCellAsColorButton,int);
00099
00101
00112 vtkSetStringMacro(RegistryKey);
00113 vtkGetStringMacro(RegistryKey);
00115
00117
00120 virtual void SavePresetsToRegistry();
00121 virtual void RestorePresetsFromRegistry();
00123
00125
00126 static const char *ColorColumnName;
00127
00129
00130
00131
00132 protected:
00133 vtkKWColorPresetSelector();
00134 ~vtkKWColorPresetSelector();
00135
00137 virtual void CreateWidget();
00138
00142 virtual void CreateColumns();
00143
00151 virtual int UpdatePresetRow(int id);
00152
00154 virtual int GetColorColumnIndex();
00155
00156 int DrawColorCellAsColorButton;
00157 char *RegistryKey;
00158
00159 virtual int InvokePresetAddCommand();
00160 virtual void InvokePresetRemovedCommand();
00161 virtual void InvokePresetUpdateCommand(int id);
00162 virtual void InvokePresetHasChangedCommand(int id);
00163
00164 static int CompareRGBColors(double rgb1[3], double rgb2[3]);
00165 static int CompareRGBColors(double r1, double g1, double b1,
00166 double r2, double g2, double b2);
00167
00168
00169
00170 private:
00171
00172 vtkKWColorPresetSelector(const vtkKWColorPresetSelector&);
00173 void operator=(const vtkKWColorPresetSelector&);
00174 };
00175
00176 #endif
00177