Main Page | Class Hierarchy | Alphabetical List | Class List | Directories | 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 =========================================================================*/
00058 #ifndef __vtk3DWidget_h
00059 #define __vtk3DWidget_h
00060 
00061 #include "vtkInteractorObserver.h"
00062 
00063 class vtkDataSet;
00064 class vtkProp3D;
00065 
00066 class VTK_WIDGETS_EXPORT vtk3DWidget : public vtkInteractorObserver
00067 {
00068 public:
00069   vtkTypeRevisionMacro(vtk3DWidget,vtkInteractorObserver);
00070   void PrintSelf(ostream& os, vtkIndent indent);
00071 
00073 
00080   virtual void PlaceWidget(double bounds[6]) = 0;
00081   virtual void PlaceWidget();
00082   virtual void PlaceWidget(double xmin, double xmax, double ymin, double ymax, 
00083                            double zmin, double zmax);
00085 
00087 
00090   virtual void SetProp3D(vtkProp3D*);
00091   vtkGetObjectMacro(Prop3D,vtkProp3D);
00093   
00095 
00098   virtual void SetInput(vtkDataSet*);
00099   vtkGetObjectMacro(Input,vtkDataSet);
00101   
00103 
00109   vtkSetClampMacro(PlaceFactor,double,0.01,VTK_FLOAT_MAX);
00110   vtkGetMacro(PlaceFactor,double);
00112 
00114 
00118   vtkSetClampMacro(HandleSize,double,0.001,0.5);
00119   vtkGetMacro(HandleSize,double);
00121 
00122 protected:
00123   vtk3DWidget();
00124   ~vtk3DWidget();
00125 
00126   // Used to position and scale the widget initially
00127   vtkProp3D *Prop3D;
00128   vtkDataSet *Input;
00129   
00130   //has the widget ever been placed
00131   double PlaceFactor;
00132   int Placed; 
00133   void AdjustBounds(double bounds[6], double newBounds[6], double center[3]);
00134   
00135   //control the size of handles (if there are any)
00136   double InitialBounds[6];
00137   double InitialLength;
00138   double HandleSize;
00139   double SizeHandles(double factor);
00140   virtual void SizeHandles() {}//subclass in turn invokes parent's SizeHandles()
00141   
00142   //used to track the depth of the last pick; also interacts with handle sizing
00143   int   ValidPick;
00144   double LastPickPosition[3];
00145 
00146 private:
00147   vtk3DWidget(const vtk3DWidget&);  // Not implemented.
00148   void operator=(const vtk3DWidget&);  // Not implemented.
00149   
00150 };
00151 
00152 #endif

Generated on Mon Jan 21 23:07:38 2008 for VTK by  doxygen 1.4.3-20050530