Salome HOME
7e661ef267db9ca61ebc576a4c78f6921485289a
[modules/visu.git] / src / VISUGUI / VisuGUI_CutLinesDlg.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 //  File   : VisuGUI_CutLinesDlg.h
24 //  Author : VSV
25 //  Module : VISU
26 //
27 #ifndef VISUGUI_CUTLINESDLG_H
28 #define VISUGUI_CUTLINESDLG_H
29
30 #include "VisuGUI_CutPlanesDlg.h"
31
32 #include <QCheckBox>
33
34 class QLineEdit;
35 class QTabWidget;
36
37 class SUIT_ViewManager;
38 class SalomeApp_Module;
39 class VisuGUI_InputPane;
40 class SalomeApp_DoubleSpinBox;
41
42 namespace VISU
43 {
44   class CutLines_i;
45 }
46
47 class VisuGUI_CutLinesDlg: public VisuGUI_ScalarBarBaseDlg
48 {
49     Q_OBJECT
50
51 public:
52     VisuGUI_CutLinesDlg (SalomeApp_Module* theModule);
53     ~VisuGUI_CutLinesDlg();
54
55     virtual void initFromPrsObject( VISU::ColoredPrs3d_i* thePrs,
56                                     bool theInit );
57
58     virtual int  storeToPrsObject(VISU::ColoredPrs3d_i* thePrs);
59
60     bool isGenerateTable() { return myCreateTable->isChecked(); }
61     bool isGenerateCurves() { return myCreateTable->isChecked() && myCurvesCheck->isChecked(); }
62
63 protected:
64   virtual QString GetContextHelpFilePath();
65  
66 protected slots:
67   void accept();
68   void reject();
69
70 private slots:
71   void onPlaneSelect (int theId);
72   void onCutSelect (int theId, bool theUpdate = true);
73   void setBaseDefault (bool theUpdate = true);
74   void setDefault (int all = -1);
75   void DrawTable();
76   void onValueChanged (int theRow, int theCol);
77   void onPreviewCheck (bool thePreview);
78   void onAllCurvesInvertedCheck(bool theInvert);
79   void onRotation (double theValue);
80   void onPlanePos (const QString& theValue);
81
82 private:
83   void createPlanes();
84   void deletePlanes();
85   void updateGlyphs(bool update);
86
87   QButtonGroup* mySelPlane;
88   SalomeApp_DoubleSpinBox* myRotXSpn;
89   SalomeApp_DoubleSpinBox* myRotYSpn;
90   QLabel* myRotXLbl;
91   QLabel* myRotYLbl;
92   SalomeApp_DoubleSpinBox* myPosSpn;
93   QLineEdit* myBasePlanePos;
94   QCheckBox* myCBSetDef;
95   QCheckBox* myCreateTable;
96   QCheckBox* myCurvesCheck;
97
98   QButtonGroup* mySelPlane2;
99   SalomeApp_DoubleSpinBox* myNbSpn;
100   SalomeApp_DoubleSpinBox* myRotXSpn2;
101   SalomeApp_DoubleSpinBox* myRotYSpn2;
102   QLabel* myRotXLbl2;
103   QLabel* myRotYLbl2;
104   SalomeApp_DoubleSpinBox* myPosSpn2;
105   QTableWidget* myPosTable;
106   bool hasInit;
107
108   QDoubleValidator *mydvalidator;
109   SALOME::GenericObjPtr<VISU::CutLines_i> myCutLines;
110
111   QTabWidget*            myTabBox;
112   VisuGUI_InputPane*     myInputPane;
113
114   VISU::CutPlanes::Orientation getOrientaion (bool IsBasePlane = true);
115   void setOrientation (const VISU::CutPlanes::Orientation orient);
116   void setOrientation2 (const VISU::CutPlanes::Orientation orient);
117
118   SALOME_Actor* myPreviewActor;
119   SALOME_Actor* myPreviewActorGlyphs;
120   QCheckBox* myPreviewCheck;
121   QCheckBox* myAllCurvesInvertedCheck;
122   QCheckBox* myUseAbsoluteLengthCheck;
123
124   SALOME::GenericObjPtr<VISU::CutLines_i> myPrsCopy;
125 };
126
127 #endif // VISUGUI_CUTLINESDLG_H