Salome HOME
PAL10332 - references are interpreted as original objects in filters, dialogs, etc.
[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 class SalomeApp_Module;
47
48
49 class VisuGUI_CutPlanesPane : public QFrame
50 {
51     Q_OBJECT
52
53 public:
54     VisuGUI_CutPlanesPane (QWidget* parent);
55     ~VisuGUI_CutPlanesPane();
56
57     void   setNbPlanes( const int nbp ) {nbPlan->setValue( nbp );}
58     int    getNbPlanes() {return nbPlan->value();}
59     void   setPlanePos( const VISU::CutPlanes::Orientation orient/*, const double pos1, const double pos2 */);
60     VISU::CutPlanes::Orientation  getOrientaion();
61     void   setRotation( const double r1, const double r2 );
62     double getRotation1() {return Rot1->value();}
63     double getRotation2() {return Rot2->value();}
64
65     void initFromPrsObject(VISU::CutPlanes_i* thePrs);
66     int storeToPrsObject(VISU::CutPlanes_i* thePrs);
67
68 private:
69     void createPlanes();
70     void deletePlanes();
71
72
73     QLabel* LabelRot1;
74     QLabel* LabelRot2;
75     QSpinBox* nbPlan;
76     QtxDblSpinBox* Rot1;
77     QtxDblSpinBox* Rot2;
78     QRadioButton* RBzx;
79     QRadioButton* RByz;
80     QRadioButton* RBxy;
81     QtxDblSpinBox* myPosSpn;
82     QTable* myPosTable;
83     VISU::CutPlanes_i* myCutPlanes;
84     QCheckBox* myPreviewCheck;
85     double          X1, X2;
86     double          Y1, Y2;
87     double          Z1, Z2;
88     bool hasInit;
89
90     SALOME_Actor* myPreviewActor;
91
92 private slots:
93     void editScalarBar();
94     void orientationChanged( int );
95     void DrawTable();
96     void setDefault( int all = -1);
97     void onValueChanged(int theRow, int theCol);
98     void onRotation(double theValue);
99     void onPreviewCheck(bool thePreview);
100 };
101
102
103 class VisuGUI_CutPlanesDlg : public QDialog
104 {
105     Q_OBJECT
106
107 public:
108     VisuGUI_CutPlanesDlg (SalomeApp_Module* theModule);
109     ~VisuGUI_CutPlanesDlg() {};
110
111     void initFromPrsObject (VISU::CutPlanes_i* thePrs);
112     int  storeToPrsObject  (VISU::CutPlanes_i* thePrs);
113
114 protected slots:
115     void accept();
116     void reject();
117     void onWindowActivated (SUIT_ViewWindow*);
118
119 private:
120     VisuGUI_CutPlanesPane* myCutPane;
121     VisuGUI_ScalarBarPane* myScalarPane;
122     VISU::CutPlanes_i*     myPrs;
123 };
124
125
126 class VisuGUI_NumEditItem: public QTableItem
127 {
128 public:
129     VisuGUI_NumEditItem(QTable* table, EditType et, const QString& text ):
130       QTableItem(table, et, text) {};
131     ~VisuGUI_NumEditItem() {};
132
133     QWidget* createEditor() const;
134 };
135
136 #endif // VISUGUI_CUTPLANESDLG_H