00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00023 #ifndef __vtkKWColorSwatchesWidget_h
00024 #define __vtkKWColorSwatchesWidget_h
00025
00026 #include "vtkKWCompositeWidget.h"
00027
00028 class vtkKWColorSwatchesWidgetInternals;
00029 class vtkKWFrameSet;
00030 class vtkKWColorPresetSelector;
00031
00032 class KWWidgets_EXPORT vtkKWColorSwatchesWidget : public vtkKWCompositeWidget
00033 {
00034
00035 public:
00036 static vtkKWColorSwatchesWidget* New();
00037 vtkTypeRevisionMacro(vtkKWColorSwatchesWidget,vtkKWCompositeWidget);
00038 void PrintSelf(ostream& os, vtkIndent indent);
00039
00042 virtual int AddCollection(const char *name);
00043
00045
00047 virtual int RemoveCollection(int collection_id);
00048 virtual void RemoveAllCollections();
00050
00053 virtual int GetCollectionId(const char *name);
00054
00056
00059 virtual int AddRGBSwatch(
00060 int collection_id, const char *name, double rgb[3]);
00061 virtual int AddRGBSwatch(
00062 int collection_id, const char *name, double r, double g, double b);
00064
00066
00067 enum
00068 {
00069 RepresentationFrames = 0,
00070 RepresentationList = 1
00071 };
00072
00073 virtual void SetSwatchesRepresentation(int);
00074 vtkGetMacro(SwatchesRepresentation, int);
00075 virtual void SetSwatchesRepresentationToFrames();
00076 virtual void SetSwatchesRepresentationToList();
00078
00080
00082 vtkGetMacro(SwatchSize, int);
00083 virtual void SetSwatchSize(int);
00085
00087
00089 virtual void SetMaximumNumberOfSwatchesPerRow(int);
00090 virtual int GetMaximumNumberOfSwatchesPerRow();
00092
00094
00096 virtual void SetSwatchesPadding(int);
00097 virtual int GetSwatchesPadding();
00099
00101 virtual vtkKWColorPresetSelector* GetSwatchesColorPresetSelector();
00102
00104 virtual void AddDefaultCollections();
00105
00113 virtual void SetSwatchSelectedCommand(vtkObject *object, const char *method);
00114
00116
00117 virtual void SwatchSelectedCallback(double r, double g, double b);
00118 virtual void CollectionSelectedCallback(const char*);
00119 virtual void PopulateCollectionsCallback();
00120 virtual void PopulateSwatchesCallback();
00121 virtual void SwatchesColorPresetApplyCallback(int id);
00123
00130 virtual void UpdateEnableState();
00131
00132
00133
00134 protected:
00135 vtkKWColorSwatchesWidget();
00136 ~vtkKWColorSwatchesWidget();
00137
00139 virtual void CreateWidget();
00140
00142
00143 char *SwatchSelectedCommand;
00144 virtual void InvokeSwatchSelectedCommand(double r, double g, double b);
00146
00148
00149 virtual void PopulateCollections();
00150 virtual void PopulateSwatches();
00151 virtual void PopulateSwatchesAsFrames();
00152 virtual void PopulateSwatchesAsList();
00153 virtual void SchedulePopulateCollections();
00154 virtual void SchedulePopulateSwatches();
00156
00158 virtual void Pack();
00159
00160 int SwatchSize;
00161 int SwatchesRepresentation;
00162 vtkKWColorSwatchesWidgetInternals *Internals;
00163
00164
00165
00166 private:
00167 vtkKWColorSwatchesWidget(const vtkKWColorSwatchesWidget&);
00168 void operator=(const vtkKWColorSwatchesWidget&);
00169 };
00170
00171 #endif
00172
00173