]> SALOME platform Git repositories - modules/visu.git/blob - src/PIPELINE/VISU_WidgetCtrl.hxx
Salome HOME
Join modifications from branch OCC_debug_for_3_2_0b1
[modules/visu.git] / src / PIPELINE / VISU_WidgetCtrl.hxx
1 //  SALOME VTKViewer : build VTK viewer into Salome desktop
2 //
3 //  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS 
5 // 
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. 
10 // 
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. 
15 // 
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 
19 // 
20 //  See http://www.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org 
21 //
22 //
23 //
24 //  File   : VISU_WidgetCtrl.hxx
25 //  Author : Peter KURNEV
26 //  Module : SALOME
27 //  $Header$
28
29 #ifndef __VISU_WidgetCtrl_hxx
30 #define __VISU_WidgetCtrl_hxx
31
32 #include <vtkImplicitFunction.h>
33
34 #include "VTKViewer.h"
35
36 class vtkImplicitFunction;
37 class vtkObject;
38 class vtkRenderWindowInteractor;
39 class vtkCommand;
40 class vtkCallbackCommand;
41
42 class VISU_PlanesWidget;
43 class VISU_SphereWidget;
44 class VISU_ImplicitFunctionWidget;
45
46 class VISU_WidgetCtrl : public vtkImplicitFunction
47 {
48 public:
49   static VISU_WidgetCtrl *New();
50   vtkTypeRevisionMacro(VISU_WidgetCtrl,vtkObject);
51
52   vtkImplicitFunction* ImplicitFunction();
53
54   virtual
55   vtkFloatingPointType  
56   EvaluateFunction(vtkFloatingPointType theX[3]);
57
58   virtual
59   void  
60   EvaluateGradient(vtkFloatingPointType theX[3], 
61                    vtkFloatingPointType theG[3]);
62
63   virtual
64   unsigned long
65   GetMTime();
66
67   void PlaceWidget(vtkFloatingPointType theBounds[6]);
68   void SetEnabled(int theFlag);
69   int  GetEnabled();
70   void On() {SetEnabled(1);}
71   void Off(){SetEnabled(0);}
72   
73   void SetInteractor(vtkRenderWindowInteractor* theRWI);
74   vtkRenderWindowInteractor* GetInteractor();
75   //
76   void  
77   SetPlaceFactor(vtkFloatingPointType theFactor);
78
79   vtkFloatingPointType
80   GetPlaceFactor();
81   //
82   void SetActiveIndex(const int theFlag);
83   int  GetActiveIndex()const;
84   bool HasActiveIndex()const;
85   bool IsPlanesActive()const;
86   bool IsSphereActive()const;
87
88   
89   VISU_ImplicitFunctionWidget* GetActiveWidget();
90   VISU_ImplicitFunctionWidget* GetWidget(const int);
91
92   int GetNbWidgets()const;
93   int GetDisableAll()const;
94   
95   //
96   VISU_PlanesWidget * GetPlanesWidget();
97   VISU_SphereWidget * GetSphereWidget();
98   //
99   static void ProcessEvents(vtkObject* theObject, 
100                             unsigned long theEvent,
101                             void* theClientData, 
102                             void* theCalldata);
103   //
104 protected:
105   VISU_WidgetCtrl();
106   ~VISU_WidgetCtrl();
107
108 protected:
109   int myNbWidgets;
110   int myActiveIndex;
111   int myCounter;
112   int myDisableAll;
113   vtkFloatingPointType myPriority;
114   VISU_ImplicitFunctionWidget *myWidgets[2];
115   VISU_ImplicitFunctionWidget *myDummyWidget;
116   VISU_PlanesWidget *myPlanesWidget;
117   VISU_SphereWidget *mySphereWidget;
118   vtkCallbackCommand *myEventCallbackCommand;
119
120 private:
121   VISU_WidgetCtrl(const VISU_WidgetCtrl&);  //Not implemented
122   void operator=(const VISU_WidgetCtrl&);   //Not implemented
123 };
124
125 #endif