00001 /*========================================================================= 00002 00003 Program: ParaView 00004 Module: $RCSfile: vtkPVColorSelectionWidget.h,v $ 00005 00006 Copyright (c) Kitware, Inc. 00007 All rights reserved. 00008 See Copyright.txt or http://www.paraview.org/HTML/Copyright.html for details. 00009 00010 This software is distributed WITHOUT ANY WARRANTY; without even 00011 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00012 PURPOSE. See the above copyright notice for more information. 00013 00014 =========================================================================*/ 00025 #ifndef __vtkPVColorSelectionWidget_h 00026 #define __vtkPVColorSelectionWidget_h 00027 00028 #include "vtkKWMenuButton.h" 00029 00030 class vtkPVArrayInformation; 00031 class vtkPVDataInformation; 00032 class vtkPVDataSetAttributesInformation; 00033 class vtkPVSource; 00034 00035 class VTK_EXPORT vtkPVColorSelectionWidget : public vtkKWMenuButton 00036 { 00037 public: 00038 static vtkPVColorSelectionWidget* New(); 00039 vtkTypeRevisionMacro(vtkPVColorSelectionWidget, vtkKWMenuButton); 00040 void PrintSelf(ostream& os, vtkIndent indent); 00041 00043 00044 vtkPVSource* GetPVSource() { return this->PVSource; } 00045 void SetPVSource(vtkPVSource* src) { this->PVSource = src; } 00047 00049 00052 vtkGetStringMacro(ColorSelectionCommand); 00053 vtkSetStringMacro(ColorSelectionCommand); 00055 00056 void SetTarget(vtkKWWidget* t) { this->Target = t; } 00057 vtkGetObjectMacro(Target, vtkKWWidget); 00058 00062 void Update(int remove_all=1); 00063 00065 00066 void SetValue(const char* arrayname, int field); 00067 void SetValue(const char* label); 00069 00070 protected: 00071 vtkPVColorSelectionWidget(); 00072 ~vtkPVColorSelectionWidget(); 00073 00074 vtkPVSource* PVSource; 00075 vtkKWWidget* Target; 00076 char* ColorSelectionCommand; 00077 00078 void AddArray(vtkPVDataSetAttributesInformation* attrInfo, int field_type); 00079 00080 vtkPVArrayInformation* GetArrayInformation( 00081 vtkPVDataInformation* dataInfo, const char* arrayname, int field); 00082 00083 int FormLabel(vtkPVArrayInformation* arrayInfo, int field, char *label); 00084 00085 private: 00086 vtkPVColorSelectionWidget(const vtkPVColorSelectionWidget&); // Not implemented. 00087 void operator=(const vtkPVColorSelectionWidget&); // Not implemented. 00088 00089 }; 00090 00091 #endif