1 #ifndef __VISU_SphereWidget_h
2 #define __VISU_SphereWidget_h
4 #include "VISU_ImplicitFunctionWidget.hxx"
6 class VISU_UnScaledActor;
9 class vtkPolyDataMapper;
12 class vtkSphereSource;
18 class vtkImplicitFunction;
20 class VISU_SphereWidget : public VISU_ImplicitFunctionWidget
24 // Instantiate the object.
25 static VISU_SphereWidget *New();
26 vtkTypeRevisionMacro(VISU_SphereWidget,VISU_ImplicitFunctionWidget);
27 void PrintSelf(ostream& os, vtkIndent indent);
29 virtual vtkImplicitFunction* ImplicitFunction();
32 // Methods that satisfy the superclass' API.
33 virtual void SetEnabled(int);
36 virtual void PlaceWidget(float bounds[6]);
39 // Set/Get the resolution of the sphere in the Theta direction.
40 void SetThetaResolution(int r);
41 int GetThetaResolution();
43 // Set/Get the resolution of the sphere in the Phi direction.
44 void SetPhiResolution(int r);
45 int GetPhiResolution();
48 // Set/Get the radius of sphere. Default is .5.
49 void SetRadius(float r);
54 // Set/Get the center of the sphere.
55 void SetCenter(float x, float y, float z);
56 void SetCenter(float x[3]);
59 void GetCenter(float xyz[3]);
62 // Set the ratio of the radius changing.
63 void SetRatio(float r) { myRatio = r; }
64 float GetRatio() { return myRatio; }
66 void ChangeRadius(bool up);
68 void GetPolyData(vtkPolyData *pd);
70 void GetSphere(vtkSphere *sphere);
73 vtkProperty* GetSphereProperty ();
74 vtkProperty* GetSelectedSphereProperty ();
82 static void ProcessEvents(vtkObject* object,
87 // ProcessEvents() dispatches to these methods.
88 void OnLeftButtonDown();
89 void OnLeftButtonUp();
90 void OnMiddleButtonDown();
91 void OnMiddleButtonUp();
94 void HighlightSphere(int highlight);
96 // Methods to manipulate the sphere widget
97 void Translate(double *p1, double *p2);
98 void Scale(double *p1, double *p2, int X, int Y);
100 //virtual void SizeHandles();
101 void CreateDefaultProperties();
103 //BTX - manage the state of the widget
115 vtkActor *mySphereActor;
116 vtkPolyDataMapper *mySphereMapper;
117 vtkSphereSource *mySphereSource;
120 vtkCellPicker *myPicker;
121 // Properties used to control the appearance of selected objects and
122 // the manipulator in general.
123 vtkProperty *mySphereProperty;
124 vtkProperty *mySelectedSphereProperty;
127 vtkImplicitSum* myImplicitSum;
130 VISU_SphereWidget(const VISU_SphereWidget&); //Not implemented
131 void operator=(const VISU_SphereWidget&); //Not implemented