OSDN Git Service

FIRST REPOSITORY
[eos/hostdependOTHERS.git] / I686LINUX / util / I686LINUX / include / vtk / vtkPolyDataSourceWidget.h
1 /*=========================================================================
2
3   Program:   Visualization Toolkit
4   Module:    $RCSfile: vtkPolyDataSourceWidget.h,v $
5   Language:  C++
6   Date:      $Date: 2003/04/16 19:27:45 $
7   Version:   $Revision: 1.4.12.1 $
8
9   Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen 
10   All rights reserved.
11   See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
12
13      This software is distributed WITHOUT ANY WARRANTY; without even 
14      the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15      PURPOSE.  See the above copyright notice for more information.
16
17 =========================================================================*/
18 // .NAME vtkPolyDataSourceWidget - abstract PolyDataSource-based 3D widget
19 // .SECTION Description
20 // This abstract class serves as parent to 3D widgets that have simple
21 // vtkPolyDataSource instances defining their geometry.
22 //
23 // In addition to what is offered by the vtk3DWidget parent, this class
24 // makes it possible to manipulate the underlying polydatasource and to
25 // PlaceWidget() according to that, instead of having to make use of
26 // SetInput() or SetProp3D().
27 //
28 // Implementors of child classes HAVE to implement their PlaceWidget(bounds)
29 // to check for the existence of Input and Prop3D FIRST.  If these don't
30 // exist, place according to the underlying PolyDataSource.  Child classes
31 // also have to imprement UpdatePlacement(), which updates the widget according
32 // to the geometry of the underlying PolyDataSource.
33
34 // .SECTION See Also
35 // vtk3DWidget vtkLineWidget vtkPlaneWidget vtkSphereWidget
36
37 #ifndef __vtkPolyDataSourceWidget_h
38 #define __vtkPolyDataSourceWidget_h
39
40 #include "vtk3DWidget.h"
41
42 class vtkPolyDataSource;
43
44 class VTK_HYBRID_EXPORT vtkPolyDataSourceWidget : public vtk3DWidget
45 {
46  public:
47   vtkTypeRevisionMacro(vtkPolyDataSourceWidget, vtk3DWidget);
48   void PrintSelf(ostream& os, vtkIndent indent);
49
50   // Description:
51   // Overrides vtk3DWidget PlaceWidget() so that it doesn't complain if
52   // there's no Input and no Prop3D.
53   virtual void PlaceWidget();
54
55   // Description:
56   // We have to redeclare this abstract, PlaceWidget() requires it.  You HAVE
57   // to override this in your concrete child classes.  If there's no Prop3D
58   // and no Input, your PlaceWidget must make use of the underlying 
59   // PolyDataSource to do its work.
60   virtual void PlaceWidget(float bounds[6]) = 0;
61
62   // Description:
63   // Convenience method brought over from vtkPlaneWidget.
64   void PlaceWidget(float xmin, float xmax, float ymin, float ymax, 
65                    float zmin, float zmax)
66     {this->Superclass::PlaceWidget(xmin,xmax,ymin,ymax,zmin,zmax);}
67
68   // Description:
69   // Returns underlying vtkPolyDataSource that determines geometry.  This
70   // can be modified after which PlaceWidget() or UpdatePlacement() can be
71   // called.  UpdatePlacement() will always update the planewidget according
72   // to the geometry of the underlying PolyDataSource.  PlaceWidget() will
73   // only make use of this geometry if there is no Input and no Prop3D set.
74   virtual vtkPolyDataSource* GetPolyDataSource() = 0;
75
76   // Description:
77   // If you've made changes to the underlying vtkPolyDataSource AFTER your
78   // initial call to PlaceWidget(), use this method to realise the changes
79   // in the widget.
80   virtual void UpdatePlacement() = 0;
81
82 protected:
83   // Description:
84   // Empty constructor that calls the parent constructor.  Child classes
85   // should call this constructor as part of their initialisation.
86   vtkPolyDataSourceWidget();
87
88 private:
89   // this copy constructor and assignment operator are deliberately not
90   // implemented so that any "accidental" invocation of a copy (pass by value)
91   // or assignment will trigger linker errors; the class is not meant to
92   // be used in these ways.  I couldn't resist adding this explanation. :)
93   vtkPolyDataSourceWidget(const vtkPolyDataSourceWidget&);  // Not implemented.
94   void operator=(const vtkPolyDataSourceWidget&);  // Not implemented.
95 };
96
97 #endif