00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00024 #ifndef __vtkPVDisplayGUI_h
00025 #define __vtkPVDisplayGUI_h
00026
00027
00028 #include "vtkPVTracedWidget.h"
00029
00030 class vtkCollection;
00031 class vtkKWBoundsDisplay;
00032 class vtkKWChangeColorButton;
00033 class vtkKWCheckButton;
00034 class vtkKWCheckButton;
00035 class vtkKWEntry;
00036 class vtkKWFrame;
00037 class vtkKWFrameWithScrollbar;
00038 class vtkKWLabel;
00039 class vtkKWFrameWithLabel;
00040 class vtkKWMenuButton;
00041 class vtkKWPushButton;
00042 class vtkKWScaleWithEntry;
00043 class vtkKWThumbWheel;
00044 class vtkKWWidget;
00045 class vtkPVApplication;
00046 class vtkPVSource;
00047 class vtkPVRenderView;
00048 class vtkPVDataSetAttributesInformation;
00049 class vtkPVVolumeAppearanceEditor;
00050 class vtkPVColorSelectionWidget;
00051 class vtkPVDisplayGUIVRObserver;
00052
00053
00054 class vtkPVColorMap;
00055
00056 class VTK_EXPORT vtkPVDisplayGUI : public vtkPVTracedWidget
00057 {
00058 public:
00059 static vtkPVDisplayGUI* New();
00060 vtkTypeRevisionMacro(vtkPVDisplayGUI, vtkPVTracedWidget);
00061 void PrintSelf(ostream& os, vtkIndent indent);
00062
00064
00065 VTK_LEGACY(void SetVisibility(int v));
00066 VTK_LEGACY(void SetCubeAxesVisibility(int v));
00067 VTK_LEGACY(void SetPointLabelVisibility(int v));
00068 VTK_LEGACY(void SetScalarBarVisibility(int v));
00069 VTK_LEGACY(vtkPVColorMap* GetPVColorMap());
00071
00073 void Close();
00074
00076
00078 void SetPVSource(vtkPVSource *source);
00079 vtkGetObjectMacro(PVSource, vtkPVSource);
00081
00082
00083
00085
00087 void SetActorTranslate(double* p);
00088 void SetActorTranslate(double x, double y, double z);
00089 void SetActorTranslateNoTrace(double x, double y, double z);
00090 void GetActorTranslate(double* p);
00091 void ActorTranslateCallback();
00092 void ActorTranslateEndCallback();
00094
00096
00098 void SetActorScale(double* p);
00099 void SetActorScale(double x, double y, double z);
00100 void SetActorScaleNoTrace(double x, double y, double z);
00101 void GetActorScale(double* p);
00102 void ActorScaleCallback();
00103 void ActorScaleEndCallback();
00105
00107
00109 void SetActorOrientation(double* p);
00110 void SetActorOrientation(double x, double y, double z);
00111 void SetActorOrientationNoTrace(double x, double y, double z);
00112 void GetActorOrientation(double* p);
00113 void ActorOrientationCallback();
00114 void ActorOrientationEndCallback();
00116
00118
00120 void SetActorOrigin(double* p);
00121 void SetActorOrigin(double x, double y, double z);
00122 void SetActorOriginNoTrace(double x, double y, double z);
00123 void GetActorOrigin(double* p);
00124 void ActorOriginCallback();
00125 void ActorOriginEndCallback();
00127
00129
00130 void SetOpacity(float f);
00131 void OpacityChangedCallback();
00132 void OpacityChangedEndCallback();
00134
00136 void Create(vtkKWApplication* app);
00137
00139
00142 void Update();
00143 void UpdateCubeAxesVisibilityCheck();
00144 void UpdatePointLabelVisibilityCheck();
00145 void UpdateColorGUI();
00146 void UpdateVolumeGUI();
00148
00152 void Initialize();
00153
00156 void VisibilityCheckCallback();
00157
00159 vtkPVApplication *GetPVApplication();
00160
00162
00163 void SetRepresentation(const char*);
00164 void DrawWireframe();
00165 void DrawSurface();
00166 void DrawPoints();
00167 void DrawVolume();
00168 void DrawOutline();
00170
00172
00173 void DrawVolumePT();
00174 void DrawVolumeBunyk();
00175 void DrawVolumeZSweep();
00177
00179
00180 void SetInterpolation(const char*);
00181 void SetInterpolationToFlat();
00182 void SetInterpolationToGouraud();
00184
00186
00187 vtkGetObjectMacro(RepresentationMenu, vtkKWMenuButton);
00189
00191
00192 vtkGetObjectMacro(InterpolationMenu, vtkKWMenuButton);
00194
00196
00197 void EditColorMapCallback();
00198 void DataColorRangeCallback();
00200
00202
00203 void EditVolumeAppearanceCallback();
00204 void ShowVolumeAppearanceEditor();
00206
00207 void ScalarBarCheckCallback();
00208 vtkGetObjectMacro(ScalarBarCheck, vtkKWCheckButton);
00209
00210 void CubeAxesCheckCallback();
00211 vtkGetObjectMacro(CubeAxesCheck, vtkKWCheckButton);
00212 void PointLabelCheckCallback();
00213 vtkGetObjectMacro(PointLabelCheck, vtkKWCheckButton);
00214
00215 void CenterCamera();
00216
00218
00219 void ChangeActorColor(double r, double g, double b);
00220 vtkGetVector3Macro(ActorColor,double);
00222
00224
00225 void SetPointSize(int size);
00226 void SetLineWidth(int width);
00227 void SetPointLabelFontSize(int size);
00229
00231
00232 void ChangePointSize();
00233 void ChangePointSizeEndCallback();
00234 void ChangeLineWidth();
00235 void ChangeLineWidthEndCallback();
00236 void ChangePointLabelFontSize();
00238
00240
00241 vtkGetObjectMacro(ColorSelectionMenu, vtkPVColorSelectionWidget);
00243
00245
00246 void ColorByArray(const char* name, int field);
00247 void VolumeRenderByArray(const char* name ,int field);
00248 void ColorByProperty();
00250
00252 void DeleteCallback();
00253
00255 vtkPVRenderView* GetPVRenderView();
00256
00259 void UpdateVisibilityCheck();
00260
00262
00265 void SetMapScalarsFlag(int val);
00266 void MapScalarsCheckCallback();
00268
00270
00274 void SetInterpolateColorsFlag(int val);
00275 void InterpolateColorsCheckCallback();
00277
00278 vtkGetMacro(ColorSetByUser, int);
00279 vtkGetMacro(ArraySetByUser, int);
00280
00281 vtkGetMacro(ShouldReinitialize, int);
00282
00289 virtual void UpdateEnableState();
00290
00292
00293 vtkGetObjectMacro(ResetCameraButton, vtkKWPushButton);
00294 vtkGetObjectMacro(ActorControlFrame, vtkKWFrameWithLabel);
00295 vtkGetObjectMacro(MainFrame, vtkKWFrameWithScrollbar);
00297
00298 protected:
00299 vtkPVDisplayGUI();
00300 ~vtkPVDisplayGUI();
00301
00302
00303
00304
00305 void UpdateScalarBarVisibilityCheck();
00306 void UpdateColorMenu();
00307 void UpdateColorButton();
00308 void UpdateEditColorMapButton();
00309 void UpdateInterpolateColorsCheck();
00310 void UpdateMapScalarsCheck();
00311
00312
00313 vtkPVSource *PVSource;
00314
00315 void SetVolumeAppearanceEditor(vtkPVVolumeAppearanceEditor *appearanceEditor);
00316
00317
00318
00319 void ColorByPropertyInternal();
00320 void SetActorColor(double r, double g, double b);
00321
00322
00323 void VolumeRenderModeOn();
00324 void VolumeRenderModeOff();
00325
00326
00327
00328 int ColorSetByUser;
00329 int ArraySetByUser;
00330
00331
00332
00333 int ShouldReinitialize;
00334
00335 vtkKWFrameWithScrollbar *MainFrame;
00336
00337 vtkKWFrameWithLabel *ColorFrame;
00338 vtkKWFrameWithLabel *VolumeAppearanceFrame;
00339 vtkKWFrameWithLabel *DisplayStyleFrame;
00340 vtkKWFrameWithLabel *ViewFrame;
00341
00342 vtkKWLabel *ColorMenuLabel;
00343 vtkPVColorSelectionWidget* ColorSelectionMenu;
00344
00345 vtkKWChangeColorButton* ColorButton;
00346 vtkKWFrame* EditColorMapButtonFrame;
00347 vtkKWPushButton* EditColorMapButton;
00348 vtkKWPushButton* DataColorRangeButton;
00349
00350 vtkKWLabel *VolumeScalarsMenuLabel;
00351 vtkPVColorSelectionWidget* VolumeScalarSelectionWidget;
00352
00353 vtkKWLabel *VolumeRenderMethodMenuLabel;
00354 vtkKWMenuButton *VolumeRenderMethodMenu;
00355
00356 vtkKWPushButton *EditVolumeAppearanceButton;
00357
00358 vtkKWLabel *RepresentationMenuLabel;
00359 vtkKWMenuButton *RepresentationMenu;
00360 vtkKWLabel *InterpolationMenuLabel;
00361 vtkKWMenuButton *InterpolationMenu;
00362
00363 vtkKWLabel *PointSizeLabel;
00364 vtkKWThumbWheel *PointSizeThumbWheel;
00365 vtkKWLabel *LineWidthLabel;
00366 vtkKWThumbWheel *LineWidthThumbWheel;
00367 vtkKWLabel *PointLabelFontSizeLabel;
00368 vtkKWThumbWheel *PointLabelFontSizeThumbWheel;
00369
00370 vtkKWCheckButton *VisibilityCheck;
00371 vtkKWCheckButton *ScalarBarCheck;
00372
00373 vtkKWCheckButton *MapScalarsCheck;
00374 vtkKWCheckButton *InterpolateColorsCheck;
00375
00376
00377 vtkKWFrameWithLabel* ActorControlFrame;
00378 vtkKWLabel* TranslateLabel;
00379 vtkKWThumbWheel* TranslateThumbWheel[3];
00380 vtkKWLabel* ScaleLabel;
00381 vtkKWThumbWheel* ScaleThumbWheel[3];
00382 vtkKWLabel* OrientationLabel;
00383 vtkKWScaleWithEntry* OrientationScale[3];
00384 vtkKWLabel* OriginLabel;
00385 vtkKWThumbWheel* OriginThumbWheel[3];
00386 vtkKWLabel* OpacityLabel;
00387 vtkKWScaleWithEntry* OpacityScale;
00388
00389 vtkKWCheckButton *CubeAxesCheck;
00390
00391
00392 vtkKWCheckButton *PointLabelCheck;
00393 vtkKWPushButton *ResetCameraButton;
00394
00395 double ActorColor[3];
00396
00397 int VolumeRenderMode;
00398
00399
00400 int MapScalarsCheckVisible;
00401 int InterpolateColorsCheckVisible;
00402 int EditColorMapButtonVisible;
00403 int ColorButtonVisible;
00404 int ScalarBarCheckVisible;
00405
00406 vtkPVVolumeAppearanceEditor *VolumeAppearanceEditor;
00407
00408 void UpdateInternal();
00409 void UpdateActorControl();
00410 void UpdateActorControlResolutions();
00411
00412
00413 void DrawVolumePTInternal();
00414 void DrawVolumeBunykInternal();
00415 void DrawVolumeZSweepInternal();
00416
00417
00418 friend class vtkPVDisplayGUIVRObserver;
00419 vtkPVDisplayGUIVRObserver *VRObserver;
00420
00421
00422 private:
00423 vtkPVDisplayGUI(const vtkPVDisplayGUI&);
00424 void operator=(const vtkPVDisplayGUI&);
00425 };
00426
00427 #endif