KWWidgets
|
00001 /*========================================================================= 00002 00003 Module: $RCSfile: vtkKWScalarComponentSelectionWidget.h,v $ 00004 00005 Copyright (c) Kitware, Inc. 00006 All rights reserved. 00007 See Copyright.txt or http://www.kitware.com/Copyright.htm for details. 00008 00009 This software is distributed WITHOUT ANY WARRANTY; without even 00010 the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 00011 PURPOSE. See the above copyright notice for more information. 00012 00013 =========================================================================*/ 00014 // .NAME vtkKWScalarComponentSelectionWidget - a scalar component selection widget 00015 // .SECTION Description 00016 // This class contains the UI for scalar component selection. 00017 00018 #ifndef __vtkKWScalarComponentSelectionWidget_h 00019 #define __vtkKWScalarComponentSelectionWidget_h 00020 00021 #include "vtkKWCompositeWidget.h" 00022 00023 class vtkKWMenuButtonWithLabel; 00024 00025 class KWWidgets_EXPORT vtkKWScalarComponentSelectionWidget : public vtkKWCompositeWidget 00026 { 00027 public: 00028 static vtkKWScalarComponentSelectionWidget* New(); 00029 void PrintSelf(ostream& os, vtkIndent indent); 00030 vtkTypeRevisionMacro(vtkKWScalarComponentSelectionWidget,vtkKWCompositeWidget); 00031 00032 // Description: 00033 // Are the components independent of each other? 00034 virtual void SetIndependentComponents(int); 00035 vtkGetMacro(IndependentComponents, int); 00036 vtkBooleanMacro(IndependentComponents, int); 00037 00038 // Description: 00039 // Set/Get the number of components controlled by the widget 00040 virtual void SetNumberOfComponents(int); 00041 vtkGetMacro(NumberOfComponents, int); 00042 00043 // Description: 00044 // Set/Get the current component controlled by the widget (if controllable) 00045 virtual void SetSelectedComponent(int); 00046 vtkGetMacro(SelectedComponent, int); 00047 00048 // Description: 00049 // Allow component selection (a quick way to hide the UI) 00050 virtual void SetAllowComponentSelection(int); 00051 vtkBooleanMacro(AllowComponentSelection, int); 00052 vtkGetMacro(AllowComponentSelection, int); 00053 00054 // Description: 00055 // Update the whole UI depending on the value of the Ivars 00056 virtual void Update(); 00057 00058 // Description: 00059 // Specifies a command to associate with the widget. This command is 00060 // typically invoked when the selected component is changed. 00061 // The 'object' argument is the object that will have the method called on 00062 // it. The 'method' argument is the name of the method to be called and any 00063 // arguments in string form. If the object is NULL, the method is still 00064 // evaluated as a simple command. 00065 // The following parameters are also passed to the command: 00066 // - the selected component: int 00067 virtual void SetSelectedComponentChangedCommand( 00068 vtkObject *object, const char *method); 00069 00070 // Description: 00071 // Access to objects 00072 vtkGetObjectMacro(SelectedComponentOptionMenu, vtkKWMenuButtonWithLabel); 00073 00074 // Description: 00075 // Update the "enable" state of the object and its internal parts. 00076 // Depending on different Ivars (this->Enabled, the application's 00077 // Limited Edition Mode, etc.), the "enable" state of the object is updated 00078 // and propagated to its internal parts/subwidgets. This will, for example, 00079 // enable/disable parts of the widget UI, enable/disable the visibility 00080 // of 3D widgets, etc. 00081 virtual void UpdateEnableState(); 00082 00083 // Description: 00084 // Callbacks. Internal, do not use. 00085 virtual void SelectedComponentCallback(int); 00086 00087 protected: 00088 vtkKWScalarComponentSelectionWidget(); 00089 ~vtkKWScalarComponentSelectionWidget(); 00090 00091 // Description: 00092 // Create the widget. 00093 virtual void CreateWidget(); 00094 00095 int IndependentComponents; 00096 int NumberOfComponents; 00097 int SelectedComponent; 00098 int AllowComponentSelection; 00099 00100 char *SelectedComponentChangedCommand; 00101 virtual void InvokeSelectedComponentChangedCommand(int comp); 00102 00103 // GUI 00104 00105 vtkKWMenuButtonWithLabel *SelectedComponentOptionMenu; 00106 00107 // Pack 00108 virtual void Pack(); 00109 00110 private: 00111 vtkKWScalarComponentSelectionWidget(const vtkKWScalarComponentSelectionWidget&); // Not implemented 00112 void operator=(const vtkKWScalarComponentSelectionWidget&); // Not implemented 00113 }; 00114 00115 #endif