VTK
dox/Interaction/Widgets/vtkCheckerboardRepresentation.h
Go to the documentation of this file.
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 "vtkInteractionWidgetsModule.h" // For export macro
00038 #include "vtkWidgetRepresentation.h"
00039 
00040 class vtkImageCheckerboard;
00041 class vtkImageActor;
00042 class vtkSliderRepresentation3D;
00043 
00044 
00045 class VTKINTERACTIONWIDGETS_EXPORT vtkCheckerboardRepresentation : public vtkWidgetRepresentation
00046 {
00047 public:
00049   static vtkCheckerboardRepresentation *New();
00050 
00052 
00053   vtkTypeMacro(vtkCheckerboardRepresentation,vtkWidgetRepresentation);
00054   void PrintSelf(ostream& os, vtkIndent indent);
00056 
00058 
00059   void SetCheckerboard(vtkImageCheckerboard *chkrbrd);
00060   vtkGetObjectMacro(Checkerboard,vtkImageCheckerboard);
00062 
00064 
00065   void SetImageActor(vtkImageActor *imageActor);
00066   vtkGetObjectMacro(ImageActor,vtkImageActor);
00068 
00070 
00073   vtkSetClampMacro(CornerOffset,double,0.0,0.4);
00074   vtkGetMacro(CornerOffset,double);
00076 
00077 //BTX
00078   enum {
00079     TopSlider=0,
00080     RightSlider,
00081     BottomSlider,
00082     LeftSlider
00083   };
00084 //ETX
00085 
00088   void SliderValueChanged(int sliderNum);
00089 
00091 
00094   void SetTopRepresentation(vtkSliderRepresentation3D*);
00095   void SetRightRepresentation(vtkSliderRepresentation3D*);
00096   void SetBottomRepresentation(vtkSliderRepresentation3D*);
00097   void SetLeftRepresentation(vtkSliderRepresentation3D*);
00098   vtkGetObjectMacro(TopRepresentation,vtkSliderRepresentation3D);
00099   vtkGetObjectMacro(RightRepresentation,vtkSliderRepresentation3D);
00100   vtkGetObjectMacro(BottomRepresentation,vtkSliderRepresentation3D);
00101   vtkGetObjectMacro(LeftRepresentation,vtkSliderRepresentation3D);
00103 
00105 
00106   virtual void BuildRepresentation();
00107   virtual void GetActors(vtkPropCollection*);
00108   virtual void ReleaseGraphicsResources(vtkWindow *w);
00109   virtual int RenderOverlay(vtkViewport *viewport);
00110   virtual int RenderOpaqueGeometry(vtkViewport *viewport);
00111   virtual int RenderTranslucentPolygonalGeometry(vtkViewport *viewport);
00112   virtual int HasTranslucentPolygonalGeometry();
00114 
00115 protected:
00116   vtkCheckerboardRepresentation();
00117   ~vtkCheckerboardRepresentation();
00118 
00119   // Instances that this class manipulates
00120   vtkImageCheckerboard *Checkerboard;
00121   vtkImageActor        *ImageActor;
00122 
00123   // The internal widgets for each side
00124   vtkSliderRepresentation3D *TopRepresentation;
00125   vtkSliderRepresentation3D *RightRepresentation;
00126   vtkSliderRepresentation3D *BottomRepresentation;
00127   vtkSliderRepresentation3D *LeftRepresentation;
00128 
00129   // The corner offset
00130   double CornerOffset;
00131 
00132   // Direction index of image actor's plane normal
00133   int OrthoAxis;
00134 
00135 private:
00136   vtkCheckerboardRepresentation(const vtkCheckerboardRepresentation&);  //Not implemented
00137   void operator=(const vtkCheckerboardRepresentation&);  //Not implemented
00138 };
00139 
00140 #endif