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

Hybrid/vtk3DWidget.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Visualization Toolkit
00004   Module:    $RCSfile: vtk3DWidget.h,v $
00005   Language:  C++
00006 
00007   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
00008   All rights reserved.
00009   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
00010 
00011      This software is distributed WITHOUT ANY WARRANTY; without even 
00012      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
00013      PURPOSE.  See the above copyright notice for more information.
00014 
00015 =========================================================================*/
00073 #ifndef __vtk3DWidget_h
00074 #define __vtk3DWidget_h
00075 
00076 #include "vtkInteractorObserver.h"
00077 
00078 class vtkDataSet;
00079 class vtkProp3D;
00080 
00081 class VTK_HYBRID_EXPORT vtk3DWidget : public vtkInteractorObserver
00082 {
00083 public:
00084   vtkTypeRevisionMacro(vtk3DWidget,vtkInteractorObserver);
00085   void PrintSelf(ostream& os, vtkIndent indent);
00086 
00088 
00095   virtual void PlaceWidget(float bounds[6]) = 0;
00096   void PlaceWidget();
00097   void PlaceWidget(float xmin, float xmax, float ymin, float ymax, 
00098                    float zmin, float zmax);
00100 
00102 
00105   virtual void SetProp3D(vtkProp3D*);
00106   vtkGetObjectMacro(Prop3D,vtkProp3D);
00108   
00110 
00113   virtual void SetInput(vtkDataSet*);
00114   vtkGetObjectMacro(Input,vtkDataSet);
00116   
00118 
00124   vtkSetClampMacro(PlaceFactor,float,0.01,VTK_LARGE_FLOAT);
00125   vtkGetMacro(PlaceFactor,float);
00127 
00129 
00133   vtkSetClampMacro(HandleSize,float,0.001,0.5);
00134   vtkGetMacro(HandleSize,float);
00136 
00137 protected:
00138   vtk3DWidget();
00139   ~vtk3DWidget();
00140 
00141   // Used to position and scale the widget initially
00142   vtkProp3D *Prop3D;
00143   vtkDataSet *Input;
00144   
00145   //has the widget ever been placed
00146   float PlaceFactor;
00147   int Placed; 
00148   void AdjustBounds(float bounds[6], float newBounds[6], float center[3]);
00149   
00150   //control the size of handles (if there are any)
00151   float InitialBounds[6];
00152   float InitialLength;
00153   float HandleSize;
00154   float SizeHandles(float factor);
00155   virtual void SizeHandles() {}//subclass in turn invokes parent's SizeHandles()
00156   
00157   //used to track the depth of the last pick; also interacts with handle sizing
00158   int   ValidPick;
00159   float LastPickPosition[3];
00160 
00161 private:
00162   vtk3DWidget(const vtk3DWidget&);  // Not implemented.
00163   void operator=(const vtk3DWidget&);  // Not implemented.
00164   
00165 };
00166 
00167 #endif