1 // Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 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.salome-platform.org/ or email : webmaster.salome@opencascade.com
22 // SALOME VTKViewer : build VTK viewer into Salome desktop
23 // File : VISU_WidgetCtrl.hxx
24 // Author : Peter KURNEV
28 #ifndef __VISU_WidgetCtrl_hxx
29 #define __VISU_WidgetCtrl_hxx
31 #include "VISUPipeline.hxx"
32 #include <vtkImplicitFunction.h>
34 #include "VTKViewer.h"
36 class vtkImplicitFunction;
38 class vtkRenderWindowInteractor;
40 class vtkCallbackCommand;
42 class VISU_PlanesWidget;
43 class VISU_SphereWidget;
44 class VISU_ImplicitFunctionWidget;
46 class VISU_PIPELINE_EXPORT VISU_WidgetCtrl : public vtkImplicitFunction
49 static VISU_WidgetCtrl *New();
50 vtkTypeRevisionMacro(VISU_WidgetCtrl,vtkObject);
52 vtkImplicitFunction* ImplicitFunction();
56 EvaluateFunction(vtkFloatingPointType theX[3]);
60 EvaluateGradient(vtkFloatingPointType theX[3],
61 vtkFloatingPointType theG[3]);
67 void PlaceWidget(vtkFloatingPointType theBounds[6]);
68 void SetEnabled(int theFlag);
70 void On() {SetEnabled(1);}
71 void Off(){SetEnabled(0);}
73 void SetInteractor(vtkRenderWindowInteractor* theRWI);
74 vtkRenderWindowInteractor* GetInteractor();
77 SetPlaceFactor(vtkFloatingPointType theFactor);
82 void SetActiveIndex(const int theFlag);
83 int GetActiveIndex()const;
84 bool HasActiveIndex()const;
85 bool IsPlanesActive()const;
86 bool IsSphereActive()const;
89 VISU_ImplicitFunctionWidget* GetActiveWidget();
90 VISU_ImplicitFunctionWidget* GetWidget(const int);
92 int GetNbWidgets()const;
93 int GetDisableAll()const;
96 VISU_PlanesWidget * GetPlanesWidget();
97 VISU_SphereWidget * GetSphereWidget();
99 static void ProcessEvents(vtkObject* theObject,
100 unsigned long theEvent,
113 vtkFloatingPointType myPriority;
114 VISU_ImplicitFunctionWidget *myWidgets[2];
115 VISU_ImplicitFunctionWidget *myDummyWidget;
116 VISU_PlanesWidget *myPlanesWidget;
117 VISU_SphereWidget *mySphereWidget;
118 vtkCallbackCommand *myEventCallbackCommand;
121 VISU_WidgetCtrl(const VISU_WidgetCtrl&); //Not implemented
122 void operator=(const VISU_WidgetCtrl&); //Not implemented