VTK
|
00001 /*========================================================================= 00002 00003 Program: Visualization Toolkit 00004 Module: vtkCheckerboardRepresentation.h 00005 00006 Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 00007 All rights reserved. 00008 See Copyright.txt or http://www.kitware.com/Copyright.htm 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 =========================================================================*/ 00034 #ifndef __vtkCheckerboardRepresentation_h 00035 #define __vtkCheckerboardRepresentation_h 00036 00037 #include "vtkWidgetRepresentation.h" 00038 00039 class vtkImageCheckerboard; 00040 class vtkImageActor; 00041 class vtkSliderRepresentation3D; 00042 00043 00044 class VTK_WIDGETS_EXPORT vtkCheckerboardRepresentation : public vtkWidgetRepresentation 00045 { 00046 public: 00048 static vtkCheckerboardRepresentation *New(); 00049 00051 00052 vtkTypeMacro(vtkCheckerboardRepresentation,vtkWidgetRepresentation); 00053 void PrintSelf(ostream& os, vtkIndent indent); 00055 00057 00058 void SetCheckerboard(vtkImageCheckerboard *chkrbrd); 00059 vtkGetObjectMacro(Checkerboard,vtkImageCheckerboard); 00061 00063 00064 void SetImageActor(vtkImageActor *imageActor); 00065 vtkGetObjectMacro(ImageActor,vtkImageActor); 00067 00069 00072 vtkSetClampMacro(CornerOffset,double,0.0,0.4); 00073 vtkGetMacro(CornerOffset,double); 00075 00076 //BTX 00077 enum { 00078 TopSlider=0, 00079 RightSlider, 00080 BottomSlider, 00081 LeftSlider 00082 }; 00083 //ETX 00084 00087 void SliderValueChanged(int sliderNum); 00088 00090 00093 void SetTopRepresentation(vtkSliderRepresentation3D*); 00094 void SetRightRepresentation(vtkSliderRepresentation3D*); 00095 void SetBottomRepresentation(vtkSliderRepresentation3D*); 00096 void SetLeftRepresentation(vtkSliderRepresentation3D*); 00097 vtkGetObjectMacro(TopRepresentation,vtkSliderRepresentation3D); 00098 vtkGetObjectMacro(RightRepresentation,vtkSliderRepresentation3D); 00099 vtkGetObjectMacro(BottomRepresentation,vtkSliderRepresentation3D); 00100 vtkGetObjectMacro(LeftRepresentation,vtkSliderRepresentation3D); 00102 00104 00105 virtual void BuildRepresentation(); 00106 virtual void GetActors(vtkPropCollection*); 00107 virtual void ReleaseGraphicsResources(vtkWindow *w); 00108 virtual int RenderOverlay(vtkViewport *viewport); 00109 virtual int RenderOpaqueGeometry(vtkViewport *viewport); 00110 virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport); 00111 virtual int HasTranslucentPolygonalGeometry(); 00113 00114 protected: 00115 vtkCheckerboardRepresentation(); 00116 ~vtkCheckerboardRepresentation(); 00117 00118 // Instances that this class manipulates 00119 vtkImageCheckerboard *Checkerboard; 00120 vtkImageActor *ImageActor; 00121 00122 // The internal widgets for each side 00123 vtkSliderRepresentation3D *TopRepresentation; 00124 vtkSliderRepresentation3D *RightRepresentation; 00125 vtkSliderRepresentation3D *BottomRepresentation; 00126 vtkSliderRepresentation3D *LeftRepresentation; 00127 00128 // The corner offset 00129 double CornerOffset; 00130 00131 // Direction index of image actor's plane normal 00132 int OrthoAxis; 00133 00134 private: 00135 vtkCheckerboardRepresentation(const vtkCheckerboardRepresentation&); //Not implemented 00136 void operator=(const vtkCheckerboardRepresentation&); //Not implemented 00137 }; 00138 00139 #endif