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