Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / VISUGUI / VisuGUI_Plot3DDlg.h
1 //  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 //  Copyright (C) 2003-2007  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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 //  VISU VISUGUI : GUI of VISU component
24 //  File   : VisuGUI_Plot3DDlg.h
25 //  Author : Laurent CORNABE & Hubert ROLLAND
26 //  Module : VISU
27 //  $Header$
28 //
29 #ifndef VISUGUI_PLOT3D_H
30 #define VISUGUI_PLOT3D_H
31
32 #include "VisuGUI_Prs3dDlg.h"
33
34
35 class QButtonGroup;
36 class QTabWidget;
37 class QGroupBox;
38
39 class SalomeApp_Module;
40 class SalomeApp_IntSpinBox;
41
42 class VisuGUI_InputPane;
43 class SalomeApp_DoubleSpinBox;
44
45 namespace VISU 
46 {
47   class Plot3D_i;
48 };
49
50 class VISU_Plot3DPL;
51 class SVTK_ViewWindow;
52 class SALOME_Actor;
53
54 class VisuGUI_Plot3DPane : public QWidget//QVBox
55 {
56   Q_OBJECT
57
58  public:
59   VisuGUI_Plot3DPane(QWidget* parent);
60   ~VisuGUI_Plot3DPane();
61
62   void initFromPrsObject (VISU::Plot3D_i* thePrs);
63   int  storeToPrsObject  (VISU::Plot3D_i* thePrs);
64
65   bool check();
66
67   VISU::Plot3D_i* GetPrs() { return myPrs; }
68
69   void setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos);
70
71  private:
72   bool                 myInitFromPrs;
73   SALOME_Actor*        myPreviewActor;
74   SVTK_ViewWindow*     myViewWindow;
75   VISU::Plot3D_i*      myPrs;
76   VISU_Plot3DPL*       myPipeCopy;
77
78   void storePrsParams();
79   void restorePrsParams();
80
81   QButtonGroup  * GBOrientation;
82   QGroupBox     * GBoxOrient;
83   QLabel        * LabelRot1;
84   QLabel        * LabelRot2;
85   SalomeApp_DoubleSpinBox * Rot1;
86   SalomeApp_DoubleSpinBox * Rot2;
87   SalomeApp_DoubleSpinBox * PositionSpn;
88   QCheckBox     * RelativeChkB;
89   SalomeApp_DoubleSpinBox * ScaleSpn;
90   QButtonGroup  * GBPrsType;
91   SalomeApp_IntSpinBox * NbContoursSpn;
92   QCheckBox     * PreviewChkB;
93
94  private slots:
95
96   void orientationChanged( int );
97   void onRelativePos( bool );
98   void onPrsType( int );
99   void onPositionSpn();
100   void updatePreview();
101 };
102
103
104 class VisuGUI_Plot3DDlg : public VisuGUI_ScalarBarBaseDlg
105 {
106   Q_OBJECT
107
108  public:
109   VisuGUI_Plot3DDlg (SalomeApp_Module* theModule);
110   ~VisuGUI_Plot3DDlg();
111
112   virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
113                                   bool theInit );
114
115   virtual int  storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
116
117   void setPlane(int theOrientation, double theXRotation, double theYRotation, double thePlanePos);
118
119  protected:
120   virtual QString GetContextHelpFilePath();
121  
122  protected slots:
123   void accept();
124   void reject();
125
126  private:
127   QTabWidget*            myTabBox;
128   VisuGUI_Plot3DPane*    myIsoPane;
129   VisuGUI_InputPane*     myInputPane;
130
131   SALOME::GenericObjPtr<VISU::Plot3D_i> myPrsCopy;
132 };
133
134 #endif // VISUGUI_PLOT3D_H