Hybrid/vtk3DWidget.h Source File

Main Page Class Hierarchy Alphabetical List Compound List File List Compound 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 =========================================================================*/
    00072 #ifndef __vtk3DWidget_h
    00073 #define __vtk3DWidget_h
    00074
    00075 #include "vtkInteractorObserver.h"
    00076
    00077 class vtkDataSet;
    00078 class vtkProp3D;
    00079
    00080 class VTK_HYBRID_EXPORT vtk3DWidget : public vtkInteractorObserver
    00081 {
    00082 public:
    00083   vtkTypeRevisionMacro(vtk3DWidget,vtkInteractorObserver);
    00084   void PrintSelf(ostream& os, vtkIndent indent);
    00085
    00087
    00094   virtual void PlaceWidget(float bounds[6]) = 0;
    00095   void PlaceWidget();
    00096   void PlaceWidget(float xmin, float xmax, float ymin, float ymax,
    00097                    float zmin, float zmax);
    00099
    00101
    00104   virtual void SetProp3D(vtkProp3D*);
    00105   vtkGetObjectMacro(Prop3D,vtkProp3D);
    00107
    00109
    00112   virtual void SetInput(vtkDataSet*);
    00113   vtkGetObjectMacro(Input,vtkDataSet);
    00115
    00117
    00123   vtkSetClampMacro(PlaceFactor,float,0.01,VTK_LARGE_FLOAT);
    00124   vtkGetMacro(PlaceFactor,float);
    00126
    00128
    00132   vtkSetClampMacro(HandleSize,float,0.001,0.5);
    00133   vtkGetMacro(HandleSize,float);
    00135
    00136 protected:
    00137   vtk3DWidget();
    00138   ~vtk3DWidget();
    00139
    00140   // Used to position and scale the widget initially
    00141   vtkProp3D *Prop3D;
    00142   vtkDataSet *Input;
    00143
    00144   //has the widget ever been placed
    00145   float PlaceFactor;
    00146   int Placed;
    00147   void AdjustBounds(float bounds[6], float newBounds[6], float center[3]);
    00148
    00149   //control the size of handles (if there are any)
    00150   float InitialBounds[6];
    00151   float InitialLength;
    00152   float HandleSize;
    00153   float SizeHandles(float factor);
    00154   virtual void SizeHandles() {}//subclass in turn invokes parent's SizeHandles()
    00155
    00156   //used to track the depth of the last pick; also interacts with handle sizing
    00157   int   ValidPick;
    00158   float LastPickPosition[3];
    00159
    00160 private:
    00161   vtk3DWidget(const vtk3DWidget&);  // Not implemented.
    00162   void operator=(const vtk3DWidget&);  // Not implemented.
    00163
    00164 };
    00165
    00166 #endif