]> SALOME platform Git repositories - modules/visu.git/blob - src/VISUGUI/VisuGUI_CutPlanesDlg.h
Salome HOME
0fb35b6f88271ce704cff7fb2ca5a1b0a66a48d8
[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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
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_ScalarBarDlg.h"
33 #include "VISU_CutPlanes_i.hh"
34
35 #include <SALOME_Actor.h>
36
37 #include <qradiobutton.h>
38 #include <qtable.h>
39
40 #include "SALOMEconfig.h"
41 #include CORBA_CLIENT_HEADER(VISU_Gen)
42
43 class QtxDblSpinBox;
44 class SUIT_ViewWindow;
45 class SUIT_ViewManager;
46
47
48 class VisuGUI_CutPlanesPane : public QFrame
49 {
50     Q_OBJECT
51
52 public:
53     VisuGUI_CutPlanesPane(QWidget* theParent/*, SUIT_ViewManager * theStudy*/);
54     ~VisuGUI_CutPlanesPane();
55
56     void   setNbPlanes( const int nbp ) {nbPlan->setValue( nbp );}
57     int    getNbPlanes() {return nbPlan->value();}
58     void   setPlanePos( const VISU::CutPlanes::Orientation orient/*, const double pos1, const double pos2 */);
59     VISU::CutPlanes::Orientation  getOrientaion();
60     void   setRotation( const double r1, const double r2 );
61     double getRotation1() {return Rot1->value();}
62     double getRotation2() {return Rot2->value();}
63
64     void initFromPrsObject(VISU::CutPlanes_i* thePrs);
65     int storeToPrsObject(VISU::CutPlanes_i* thePrs);
66
67 private:
68     void createPlanes();
69     void deletePlanes();
70
71
72     QLabel* LabelRot1;
73     QLabel* LabelRot2;
74     QSpinBox* nbPlan;
75     QtxDblSpinBox* Rot1;
76     QtxDblSpinBox* Rot2;
77     QRadioButton* RBzx;
78     QRadioButton* RByz;
79     QRadioButton* RBxy;
80     QtxDblSpinBox* myPosSpn;
81     QTable* myPosTable;
82     VISU::CutPlanes_i* myCutPlanes;
83     QCheckBox* myPreviewCheck;
84     double          X1, X2;
85     double          Y1, Y2;
86     double          Z1, Z2;
87     bool hasInit;
88     //SUIT_ViewManager  *myMgr;
89
90     //vector<SALOME_Actor*> myPreviewActors;
91     SALOME_Actor* myPreviewActor;
92
93 private slots:
94     void editScalarBar();
95     void orientationChanged( int );
96     void DrawTable();
97     void setDefault( int all = -1);
98     void onValueChanged(int theRow, int theCol);
99     void onRotation(double theValue);
100     void onPreviewCheck(bool thePreview);
101 };
102
103
104
105 class VisuGUI_CutPlanesDlg : public QDialog
106 {
107     Q_OBJECT
108
109 public:
110     //VisuGUI_CutPlanesDlg(QWidget* parent, bool theIsCreation = true, bool theIsModal = false);
111     VisuGUI_CutPlanesDlg(QWidget* parent, bool theIsCreation = true, bool theIsModal = true);
112     ~VisuGUI_CutPlanesDlg() {};
113
114     void initFromPrsObject(VISU::CutPlanes_i* thePrs)
115       {myPrs=thePrs; myScalarPane->initFromPrsObject(thePrs); myCutPane->initFromPrsObject(thePrs);}
116
117     int storeToPrsObject(VISU::CutPlanes_i* thePrs)
118       {return myScalarPane->storeToPrsObject(thePrs) && myCutPane->storeToPrsObject(thePrs);}
119
120 protected slots:
121   void accept();
122   void reject();
123   void onWindowActivated( SUIT_ViewWindow* );
124
125 private:
126     VisuGUI_CutPlanesPane* myCutPane;
127     VisuGUI_ScalarBarPane* myScalarPane;
128     VISU::CutPlanes_i* myPrs;
129
130     bool myIsCreation;
131
132     //SUIT_ViewManager  *myMgr;
133     //SUIT_ViewWindow   *myStudyWnd;
134 };
135
136
137 class VisuGUI_NumEditItem: public QTableItem
138 {
139   //    Q_OBJECT
140
141 public:
142     VisuGUI_NumEditItem(QTable* table, EditType et, const QString& text ):
143       QTableItem(table, et, text) {};
144     ~VisuGUI_NumEditItem() {};
145
146     QWidget* createEditor() const;
147 };
148
149
150 #endif // VISUGUI_CUTPLANESDLG_H