1 /*=========================================================================
3 Program: Visualization Toolkit
4 Module: $RCSfile: vtkPolyDataSourceWidget.h,v $
6 Date: $Date: 2003/04/16 19:27:45 $
7 Version: $Revision: 1.4.12.1 $
9 Copyright (c) 1993-2002 Ken Martin, Will Schroeder, Bill Lorensen
11 See Copyright.txt or http://www.kitware.com/Copyright.htm for details.
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.
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.
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().
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.
35 // vtk3DWidget vtkLineWidget vtkPlaneWidget vtkSphereWidget
37 #ifndef __vtkPolyDataSourceWidget_h
38 #define __vtkPolyDataSourceWidget_h
40 #include "vtk3DWidget.h"
42 class vtkPolyDataSource;
44 class VTK_HYBRID_EXPORT vtkPolyDataSourceWidget : public vtk3DWidget
47 vtkTypeRevisionMacro(vtkPolyDataSourceWidget, vtk3DWidget);
48 void PrintSelf(ostream& os, vtkIndent indent);
51 // Overrides vtk3DWidget PlaceWidget() so that it doesn't complain if
52 // there's no Input and no Prop3D.
53 virtual void PlaceWidget();
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;
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);}
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;
77 // If you've made changes to the underlying vtkPolyDataSource AFTER your
78 // initial call to PlaceWidget(), use this method to realise the changes
80 virtual void UpdatePlacement() = 0;
84 // Empty constructor that calls the parent constructor. Child classes
85 // should call this constructor as part of their initialisation.
86 vtkPolyDataSourceWidget();
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.