]> SALOME platform Git repositories - modules/visu.git/blob - src/VISUGUI/VisuGUI_CutPlanesDlg.h
Salome HOME
Join modifications from BR_Dev_For_4_0 tag V4_1_1.
[modules/visu.git] / src / VISUGUI / VisuGUI_CutPlanesDlg.h
1 //  VISU VISUGUI : GUI of VISU component
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.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22 //
23 //
24 //  File   : VisuGUI_CutPlanesDlg.h
25 //  Author : Laurent CORNABE & Hubert ROLLAND
26 //  Module : VISU
27 //  $Header$
28
29 #ifndef VISUGUI_CUTPLANESDLG_H
30 #define VISUGUI_CUTPLANESDLG_H
31
32 #include "VisuGUI_Prs3dDlg.h"
33
34 #include <SALOME_Actor.h>
35
36 #include <qspinbox.h>
37 #include <qradiobutton.h>
38 #include <qtable.h>
39 #include <qtabwidget.h>
40
41 #include <QtxDblSpinBox.h>
42
43 #include "SALOMEconfig.h"
44 #include CORBA_CLIENT_HEADER(VISU_Gen)
45
46 namespace VISU 
47 {
48   class CutPlanes_i;
49 };
50
51 class SUIT_ViewWindow;
52 class SUIT_ViewManager;
53 class SalomeApp_Module;
54 class VisuGUI_InputPane;
55
56 class VisuGUI_CutPlanesPane : public QFrame
57 {
58     Q_OBJECT
59
60 public:
61     VisuGUI_CutPlanesPane (QWidget* parent);
62     ~VisuGUI_CutPlanesPane();
63
64     void   setNbPlanes( const int nbp ) {nbPlan->setValue( nbp );}
65     int    getNbPlanes() {return nbPlan->value();}
66     void   setPlanePos( const VISU::CutPlanes::Orientation orient/*, const double pos1, const double pos2 */);
67     VISU::CutPlanes::Orientation  getOrientaion();
68     void   setRotation( const double r1, const double r2 );
69     double getRotation1() {return Rot1->value();}
70     double getRotation2() {return Rot2->value();}
71
72     void initFromPrsObject(VISU::CutPlanes_i* thePrs);
73     int storeToPrsObject(VISU::CutPlanes_i* thePrs);
74
75 private:
76     void createPlanes();
77     void deletePlanes();
78
79     QLabel* LabelRot1;
80     QLabel* LabelRot2;
81     QSpinBox* nbPlan;
82     QtxDblSpinBox* Rot1;
83     QtxDblSpinBox* Rot2;
84     QRadioButton* RBzx;
85     QRadioButton* RByz;
86     QRadioButton* RBxy;
87     QtxDblSpinBox* myPosSpn;
88     QTable* myPosTable;
89     SALOME::GenericObjPtr<VISU::CutPlanes_i> myCutPlanes;
90     QCheckBox* myPreviewCheck;
91     double          X1, X2;
92     double          Y1, Y2;
93     double          Z1, Z2;
94     bool hasInit;
95
96     SALOME_Actor* myPreviewActor;
97
98 private slots:
99     void orientationChanged( int );
100     void DrawTable();
101     void setDefault( int all = -1);
102     void onValueChanged(int theRow, int theCol);
103     void onRotation(double theValue);
104     void onPreviewCheck(bool thePreview);
105 };
106
107
108 class VisuGUI_CutPlanesDlg : public VisuGUI_ScalarBarBaseDlg
109 {
110     Q_OBJECT
111
112 public:
113     VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule);
114     ~VisuGUI_CutPlanesDlg();
115
116     virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
117                                     bool theInit );
118
119     virtual int  storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
120
121 protected:
122     virtual QString        GetContextHelpFilePath();
123
124 protected slots:
125     void accept();
126     void reject();
127
128 private:
129     QTabWidget*            myTabBox;
130     VisuGUI_CutPlanesPane* myCutPane;
131     VisuGUI_InputPane*     myInputPane;
132     SALOME::GenericObjPtr<VISU::CutPlanes_i> myPrsCopy;
133 };
134
135
136 class VisuGUI_NumEditItem: public QTableItem
137 {
138 public:
139     VisuGUI_NumEditItem(QTable* table, EditType et, const QString& text ):
140       QTableItem(table, et, text) {};
141     ~VisuGUI_NumEditItem() {};
142
143     QWidget* createEditor() const;
144 };
145
146 #endif // VISUGUI_CUTPLANESDLG_H