Main Page | Directories | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

vtk3DWidget.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtk3DWidget.h,v $
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 =========================================================================*/
00069 #ifndef __vtk3DWidget_h
00070 #define __vtk3DWidget_h
00071 
00072 #include "vtkInteractorObserver.h"
00073 
00074 class vtkDataSet;
00075 class vtkProp3D;
00076 
00077 class VTK_HYBRID_EXPORT vtk3DWidget : public vtkInteractorObserver
00078 {
00079 public:
00080   vtkTypeRevisionMacro(vtk3DWidget,vtkInteractorObserver);
00081   void PrintSelf(ostream& os, vtkIndent indent);
00082 
00084 
00091   virtual void PlaceWidget(double bounds[6]) = 0;
00092   virtual void PlaceWidget();
00093   virtual void PlaceWidget(double xmin, double xmax, double ymin, double ymax, 
00094                            double zmin, double zmax);
00096 
00098 
00101   virtual void SetProp3D(vtkProp3D*);
00102   vtkGetObjectMacro(Prop3D,vtkProp3D);
00104   
00106 
00109   virtual void SetInput(vtkDataSet*);
00110   vtkGetObjectMacro(Input,vtkDataSet);
00112   
00114 
00120   vtkSetClampMacro(PlaceFactor,double,0.01,VTK_FLOAT_MAX);
00121   vtkGetMacro(PlaceFactor,double);
00123 
00125 
00129   vtkSetClampMacro(HandleSize,double,0.001,0.5);
00130   vtkGetMacro(HandleSize,double);
00132 
00133 protected:
00134   vtk3DWidget();
00135   ~vtk3DWidget();
00136 
00137   // Used to position and scale the widget initially
00138   vtkProp3D *Prop3D;
00139   vtkDataSet *Input;
00140   
00141   //has the widget ever been placed
00142   double PlaceFactor;
00143   int Placed; 
00144   void AdjustBounds(double bounds[6], double newBounds[6], double center[3]);
00145   
00146   //control the size of handles (if there are any)
00147   double InitialBounds[6];
00148   double InitialLength;
00149   double HandleSize;
00150   double SizeHandles(double factor);
00151   virtual void SizeHandles() {}//subclass in turn invokes parent's SizeHandles()
00152   
00153   //used to track the depth of the last pick; also interacts with handle sizing
00154   int   ValidPick;
00155   double LastPickPosition[3];
00156 
00157 private:
00158   vtk3DWidget(const vtk3DWidget&);  // Not implemented.
00159   void operator=(const vtk3DWidget&);  // Not implemented.
00160   
00161 };
00162 
00163 #endif