KWWidgets
vtkKWVolumeMaterialPropertyWidget.h
Go to the documentation of this file.
1 /*=========================================================================
2 
3  Module: $RCSfile: vtkKWVolumeMaterialPropertyWidget.h,v $
4 
5  Copyright (c) Kitware, Inc.
6  All rights reserved.
7  See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
8 
9  This software is distributed WITHOUT ANY WARRANTY; without even
10  the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
11  PURPOSE. See the above copyright notice for more information.
12 
13 =========================================================================*/
14 // .NAME vtkKWVolumeMaterialPropertyWidget - widget to control the material property of a volume (vtkVolumeProperty)
15 // .SECTION Description
16 
17 #ifndef __vtkKWVolumeMaterialPropertyWidget_h
18 #define __vtkKWVolumeMaterialPropertyWidget_h
19 
21 
24 class vtkVolumeProperty;
25 
27 {
28 public:
31  void PrintSelf(ostream& os, vtkIndent indent);
32 
33  // Description:
34  // Set/Get the volume property to edit with this widget
35  virtual void SetVolumeProperty(vtkVolumeProperty *prop);
36  vtkGetObjectMacro(VolumeProperty, vtkVolumeProperty);
37 
38  // Description:
39  // Set/Get the component controlled by the widget
40  virtual void SetSelectedComponent(int);
41  vtkGetMacro(SelectedComponent, int);
42  vtkGetObjectMacro(ComponentSelectionWidget,
44 
45  // Description:
46  // Set/Get the number of components controlled by the widget
47  virtual void SetNumberOfComponents(int);
48  vtkGetMacro(NumberOfComponents, int);
49 
50  // Description:
51  // Allow enable shading per component
52  virtual void SetAllowEnableShading(int);
53  vtkBooleanMacro(AllowEnableShading, int);
54  vtkGetMacro(AllowEnableShading, int);
55 
56  // Description:
57  // Refresh the interface given the value extracted from the current property.
58  virtual void Update();
59 
60  // Description:
61  // Update the "enable" state of the object and its internal parts.
62  // Depending on different Ivars (this->Enabled, the application's
63  // Limited Edition Mode, etc.), the "enable" state of the object is updated
64  // and propagated to its internal parts/subwidgets. This will, for example,
65  // enable/disable parts of the widget UI, enable/disable the visibility
66  // of 3D widgets, etc.
67  virtual void UpdateEnableState();
68 
69  // Description:
70  // Callbacks. Internal, do not use.
71  virtual void EnableShadingCallback(int state);
72  virtual void SelectedComponentCallback(int);
73 
74 protected:
77 
78  // Description:
79  // Create the widget.
80  virtual void CreateWidget();
81 
82  vtkVolumeProperty *VolumeProperty;
83 
84  int SelectedComponent;
85  int NumberOfComponents;
86  int AllowEnableShading;
87 
88  // UI
89 
90  vtkKWScalarComponentSelectionWidget *ComponentSelectionWidget;
91  vtkKWCheckButtonWithLabel *EnableShadingCheckButton;
92 
93  // Description:
94  // Pack
95  virtual void Pack();
96 
97  // Description:
98  // Update the property from the interface values or a preset
99  // Return 1 if the property was modified, 0 otherwise
100  virtual int UpdatePropertyFromInterface();
101  virtual int UpdatePropertyFromPreset(const Preset *preset);
102 
103  // Description:
104  // Send an event representing the state of the widget
105  virtual void SendStateEvent(int event);
106 
107  // Description:
108  // Return 1 if the controls should be enabled.
109  virtual int AreControlsEnabled();
110 
111 private:
113  void operator=(const vtkKWVolumeMaterialPropertyWidget&); //Not implemented
114 };
115 
116 #endif