File: vtkVVDisplayInterface.h

package info (click to toggle)
volview 3.4-3
  • links: PTS, VCS
  • area: main
  • in suites: wheezy
  • size: 25,204 kB
  • sloc: cpp: 132,585; ansic: 11,612; tcl: 236; sh: 64; makefile: 25; xml: 8
file content (209 lines) | stat: -rw-r--r-- 7,800 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
/*=========================================================================

  Copyright (c) Kitware, Inc.
  All rights reserved.
  See Copyright.txt or http://www.kitware.com/VolViewCopyright.htm for details.

     This software is distributed WITHOUT ANY WARRANTY; without even
     the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
     PURPOSE.  See the above copyright notice for more information.

=========================================================================*/
// .NAME vtkVVDisplayInterface - a user interface panel.
// .SECTION Description
// A concrete implementation of a user interface panel.
// See vtkKWUserInterfacePanel for a more detailed description.
// .SECTION See Also
// vtkKWUserInterfacePanel vtkKWUserInterfaceManager

#ifndef __vtkVVDisplayInterface_h
#define __vtkVVDisplayInterface_h

#include "vtkVVUserInterfacePanel.h"

//---------------------------------------------------------------------------

class vtkKWChangeColorButton;
class vtkKWCheckButton;
class vtkKWCheckButtonWithChangeColorButton;
class vtkKWEntryWithLabel;
class vtkKWERepresentativeVolumeImageCreator;
class vtkKWFrame;
class vtkKWFrameWithLabel;
class vtkKWImageMapToWindowLevelColors;
class vtkKWLabelWithLabelSet;
class vtkKWMenuButtonWithSpinButtons;
class vtkKWMenuButtonWithSpinButtonsWithLabel;
class vtkKWPiecewiseFunctionEditor;
class vtkKWPushButton;
class vtkKWPushButtonSet;
class vtkKWRadioButtonSetWithLabel;
class vtkKWScaleWithEntry;
class vtkKWVolumePropertyPresetSelector;
class vtkKWVolumePropertyWidget;
class vtkKWWindowLevelPresetSelector;
class vtkVVDisplayInterfaceInternals;
class vtkVolumeProperty;

class VTK_EXPORT vtkVVDisplayInterface : public vtkVVUserInterfacePanel
{
public:
  static vtkVVDisplayInterface* New();
  vtkTypeRevisionMacro(vtkVVDisplayInterface,vtkVVUserInterfacePanel);
  void PrintSelf(ostream& os, vtkIndent indent);

  // Description:
  // Create the interface objects.
  virtual void Create();

  // Description:
  // Refresh the interface given the current value of the Window and its
  // views/composites/widgets.
  virtual void Update();

  // Description:
  // Get the id of the 2D and 3D page in this user interface
  virtual int GetPage2DId();
  virtual int GetPage3DId();

  // Description:
  // Callbacks used when interaction has been performed.
  virtual void WindowLevelCallback(const char *);
  virtual void WindowLevelResetCallback();
  virtual void BlendModeCallback(int mode);

  // Description:
  // Callbacks used when interaction has been performed.
  virtual void WindowLevelPresetApplyCallback(int id);
  virtual int WindowLevelPresetAddCallback();
  virtual void WindowLevelPresetUpdateCallback(int id);
  virtual void WindowLevelPresetHasChangedCallback(int id);
  virtual int WindowLevelPresetRemoveCallback(int id);
  virtual int WindowLevelPresetLoadCallback();
  virtual void VolumePropertyPresetApplyCallback(int id);
  virtual int VolumePropertyPresetAddCallback();
  virtual void VolumePropertyPresetUpdateCallback(int id);
  virtual void VolumePropertyPresetHasChangedCallback(int id);
  virtual int VolumePropertyPresetLoadCallback();
  virtual void UpdateVolumePropertyPresetThumbnailsCallback();
  virtual void UpdateWindowLevelPresetThumbnailsCallback();
  virtual void WindowLevelPresetFilteringHasChangedCallback();
  virtual void VolumePropertyPresetFilteringHasChangedCallback();

  // Description:
  // Update the "enable" state of the object and its internal parts.
  // Depending on different Ivars (this->Enabled, the application's 
  // Limited Edition Mode, etc.), the "enable" state of the object is updated
  // and propagated to its internal parts/subwidgets. This will, for example,
  // enable/disable parts of the widget UI, enable/disable the visibility
  // of 3D widgets, etc.
  virtual void UpdateEnableState();

  // Description:
  // Get some internal objects
  vtkGetObjectMacro(WindowLevelPresetSelector, vtkKWWindowLevelPresetSelector);
  vtkGetObjectMacro(VolumePropertyPresetSelector, vtkKWVolumePropertyPresetSelector);
  vtkGetObjectMacro(WindowLevelFunctionEditor, vtkKWPiecewiseFunctionEditor);

protected:
  vtkVVDisplayInterface();
  ~vtkVVDisplayInterface();

  // Display: Window/Level Settings

  vtkKWFrameWithLabel                     *WindowLevelSettingsFrame;
  vtkKWFrame                              *WindowLevelEntriesFrame;
  vtkKWEntryWithLabel                     *WindowEntry;
  vtkKWEntryWithLabel                     *LevelEntry;
  vtkKWPushButton                         *WindowLevelResetButton;
  vtkKWPiecewiseFunctionEditor            *WindowLevelFunctionEditor;

  // Display: Volume Appearance Settings

  vtkKWVolumePropertyWidget               *VolumePropertyWidget;
  vtkKWMenuButtonWithSpinButtons          *BlendModeMenuButton;

  // Presets: Window/Level Presets

  vtkKWFrameWithLabel                     *WindowLevelPresetFrame;
  vtkKWWindowLevelPresetSelector          *WindowLevelPresetSelector;

  // Presets: Volume Appearance Presets

  vtkKWFrameWithLabel                     *VolumePropertyPresetFrame;
  vtkKWVolumePropertyPresetSelector       *VolumePropertyPresetSelector;

  // Description:
  // Rebuild the presets
  virtual void PopulateWindowLevelPresets();

  // Description:
  // Set the window/level in the UI programmatically.
  // Provided because we might want to update the window/level
  // faster than by calling Update().
  virtual void SetWindowLevelInInterface(double w, double l);
  virtual void SetInteractiveWindowLevelInInterface(double w, double l);

  // Description:
  // Set the window/level in all the render widgets that are using the
  // currently selected data item.
  virtual void SetWindowLevelInRenderWidgetsUsingSelectedDataItem(
    double w, double l);
  virtual void SetInteractiveWindowLevelInRenderWidgetsUsingSelectedDataItem(
    double w, double l);

  // Description:
  // Update a window/level preset thumbnail using the selected
  // widget, or all the thumbnails in a given group.
  virtual void UpdateWindowLevelPresetThumbnail(int id);
  virtual void UpdateWindowLevelPresetThumbnails();
  
  // Description:
  // Save/Load window level presets
  virtual void LoadWindowLevelPresets();
  virtual int LoadWindowLevelPreset(const char*);
  virtual void SaveWindowLevelPreset(int id);

  // Description:
  // Update a volume appearance preset thumbnail using the selected
  // widget, or all the thumbnails in a given group.
  virtual void UpdateVolumePropertyPresetThumbnail(int id);
  virtual void UpdateVolumePropertyPresetThumbnails();
  virtual void ScheduleUpdateVolumePropertyPresetThumbnail(int id);
  virtual void ScheduleUpdateVolumePropertyPresetThumbnails();

  // Description:
  // Save/Load a volume appearance preset
  virtual void LoadVolumePropertyPresets();
  virtual int LoadVolumePropertyPreset(const char *);
  virtual void SaveVolumePropertyPreset(int id);
  virtual void ScheduleUpdateWindowLevelPresetThumbnails(int delay);

  // Description:
  // Pack
  virtual void Pack();

  // Description:
  // Processes the events that are passed through CallbackCommand (or others).
  // Subclasses can oberride this method to process their own events, but
  // should call the superclass too.
  virtual void ProcessCallbackCommandEvents(
    vtkObject *caller, unsigned long event, void *calldata);

  // Description:
  // Helper class to create thumbnails
  vtkKWERepresentativeVolumeImageCreator *ThumbnailCreator;
  int WaitingOnThumbnailCreator;
  int ThumbnailCreatorID;
  
  // Description:
  // PIMPL Encapsulation for STL containers
  vtkVVDisplayInterfaceInternals *Internals;

private:
  vtkVVDisplayInterface(const vtkVVDisplayInterface&); // Not implemented
  void operator=(const vtkVVDisplayInterface&); // Not Implemented
};

#endif