1 // SALOME VTKViewer : build VTK viewer into Salome desktop
3 // Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : VISU_WidgetCtrl.hxx
25 // Author : Peter KURNEV
29 #ifndef __VISU_WidgetCtrl_hxx
30 #define __VISU_WidgetCtrl_hxx
33 #include <vtkImplicitFunction.h>
35 class vtkImplicitFunction;
37 class vtkRenderWindowInteractor;
39 class vtkCallbackCommand;
41 class VISU_PlanesWidget;
42 class VISU_SphereWidget;
43 class VISU_ImplicitFunctionWidget;
45 class VISU_WidgetCtrl : public vtkImplicitFunction
48 static VISU_WidgetCtrl *New();
49 vtkTypeRevisionMacro(VISU_WidgetCtrl,vtkObject);
51 vtkImplicitFunction* ImplicitFunction();
55 EvaluateFunction(float theX[3]);
59 EvaluateGradient(float theX[3], float theG[3]);
65 void PlaceWidget(float theBounds[6]);
66 void SetEnabled(int theFlag);
68 void On() {SetEnabled(1);}
69 void Off(){SetEnabled(0);}
71 void SetInteractor(vtkRenderWindowInteractor* theRWI);
72 vtkRenderWindowInteractor* GetInteractor();
74 void SetPlaceFactor(float theFactor);
75 float GetPlaceFactor();
77 void SetActiveIndex(const int theFlag);
78 int GetActiveIndex()const;
79 bool HasActiveIndex()const;
80 bool IsPlanesActive()const;
81 bool IsSphereActive()const;
84 VISU_ImplicitFunctionWidget* GetActiveWidget();
85 VISU_ImplicitFunctionWidget* GetWidget(const int);
87 int GetNbWidgets()const;
88 int GetDisableAll()const;
91 VISU_PlanesWidget * GetPlanesWidget();
92 VISU_SphereWidget * GetSphereWidget();
94 static void ProcessEvents(vtkObject* theObject,
95 unsigned long theEvent,
109 VISU_ImplicitFunctionWidget *myWidgets[2];
110 VISU_ImplicitFunctionWidget *myDummyWidget;
111 VISU_PlanesWidget *myPlanesWidget;
112 VISU_SphereWidget *mySphereWidget;
113 vtkCallbackCommand *myEventCallbackCommand;
116 VISU_WidgetCtrl(const VISU_WidgetCtrl&); //Not implemented
117 void operator=(const VISU_WidgetCtrl&); //Not implemented