00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef __vtkKWColorSwatchesWidget_h
00022 #define __vtkKWColorSwatchesWidget_h
00023
00024 #include "vtkKWCompositeWidget.h"
00025
00026 class vtkKWColorSwatchesWidgetInternals;
00027 class vtkKWFrameSet;
00028 class vtkKWColorPresetSelector;
00029
00030 class KWWidgets_EXPORT vtkKWColorSwatchesWidget : public vtkKWCompositeWidget
00031 {
00032 public:
00033 static vtkKWColorSwatchesWidget* New();
00034 vtkTypeRevisionMacro(vtkKWColorSwatchesWidget,vtkKWCompositeWidget);
00035 void PrintSelf(ostream& os, vtkIndent indent);
00036
00037
00038
00039
00040 virtual int AddCollection(const char *name);
00041
00042
00043
00044
00045 virtual int RemoveCollection(int collection_id);
00046 virtual void RemoveAllCollections();
00047
00048
00049
00050
00051 virtual int GetCollectionId(const char *name);
00052
00053
00054
00055
00056
00057 virtual int AddRGBSwatch(
00058 int collection_id, const char *name, double rgb[3]);
00059 virtual int AddRGBSwatch(
00060 int collection_id, const char *name, double r, double g, double b);
00061
00062
00063
00064
00065 enum
00066 {
00067 RepresentationFrames = 0,
00068 RepresentationList = 1
00069 };
00070
00071 virtual void SetSwatchesRepresentation(int);
00072 vtkGetMacro(SwatchesRepresentation, int);
00073 virtual void SetSwatchesRepresentationToFrames();
00074 virtual void SetSwatchesRepresentationToList();
00075
00076
00077
00078
00079 vtkGetMacro(SwatchSize, int);
00080 virtual void SetSwatchSize(int);
00081
00082
00083
00084
00085 virtual void SetMaximumNumberOfSwatchesPerRow(int);
00086 virtual int GetMaximumNumberOfSwatchesPerRow();
00087
00088
00089
00090
00091 virtual void SetSwatchesPadding(int);
00092 virtual int GetSwatchesPadding();
00093
00094
00095
00096 virtual vtkKWColorPresetSelector* GetSwatchesColorPresetSelector();
00097
00098
00099
00100 virtual void AddDefaultCollections();
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111 virtual void SetSwatchSelectedCommand(vtkObject *object, const char *method);
00112
00113
00114
00115 virtual void SwatchSelectedCallback(double r, double g, double b);
00116 virtual void CollectionSelectedCallback(const char*);
00117 virtual void PopulateCollectionsCallback();
00118 virtual void PopulateSwatchesCallback();
00119 virtual void SwatchesColorPresetApplyCallback(int id);
00120
00121
00122
00123
00124
00125
00126
00127
00128 virtual void UpdateEnableState();
00129
00130 protected:
00131 vtkKWColorSwatchesWidget();
00132 ~vtkKWColorSwatchesWidget();
00133
00134
00135
00136 virtual void CreateWidget();
00137
00138
00139
00140 char *SwatchSelectedCommand;
00141 virtual void InvokeSwatchSelectedCommand(double r, double g, double b);
00142
00143
00144
00145 virtual void PopulateCollections();
00146 virtual void PopulateSwatches();
00147 virtual void PopulateSwatchesAsFrames();
00148 virtual void PopulateSwatchesAsList();
00149 virtual void SchedulePopulateCollections();
00150 virtual void SchedulePopulateSwatches();
00151
00152
00153
00154 virtual void Pack();
00155
00156 int SwatchSize;
00157 int SwatchesRepresentation;
00158 vtkKWColorSwatchesWidgetInternals *Internals;
00159
00160 private:
00161 vtkKWColorSwatchesWidget(const vtkKWColorSwatchesWidget&);
00162 void operator=(const vtkKWColorSwatchesWidget&);
00163 };
00164
00165 #endif
00166