Salome HOME
Copyrights update 2015.
[modules/geom.git] / src / AdvancedGUI / AdvancedGUI_PipeTShapeDlg.h
1 // Copyright (C) 2007-2015  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef ADVANCEDGUI_PIPETSHAPEDLG_H
21 #define ADVANCEDGUI_PIPETSHAPEDLG_H
22
23 #include <GEOMBase_Skeleton.h>
24
25 class DlgRef_1Spin;
26 class DlgRef_2Spin;
27 class DlgRef_3Spin;
28 class DlgRef_4Spin;
29 class DlgRef_3Sel;
30 class DlgRef_6Sel;
31 class QCheckBox;
32 class QLineEdit;
33 class QLabel;
34 class QGridLayout;
35 class QGroupBox;
36 class SalomeApp_DoubleSpinBox;
37
38 //=================================================================================
39 // class    : AdvancedGUI_4Spin
40 // purpose  :
41 //=================================================================================
42 class AdvancedGUI_4Spin : public QWidget
43 {
44   Q_OBJECT
45
46  public:
47   AdvancedGUI_4Spin ();
48   ~AdvancedGUI_4Spin();
49
50  public:
51   QGroupBox *GroupBox1;
52   QGridLayout *gridLayout1;
53
54   QLabel *TextLabel1;
55   QLabel *TextLabel2;
56   QLabel *TextLabel3;
57   QLabel *TextLabel4;
58   SalomeApp_DoubleSpinBox *SpinBox1;
59   SalomeApp_DoubleSpinBox *SpinBox2;
60   SalomeApp_DoubleSpinBox *SpinBox3;
61   SalomeApp_DoubleSpinBox *SpinBox4;
62 };
63
64 //=================================================================================
65 // class    : AdvancedGUI_PipeTShapeDlg
66 // purpose  :
67 //=================================================================================
68 class AdvancedGUI_PipeTShapeDlg: public GEOMBase_Skeleton
69 {
70   Q_OBJECT
71
72 public:
73   AdvancedGUI_PipeTShapeDlg (GeometryGUI*, QWidget* = 0);
74   ~AdvancedGUI_PipeTShapeDlg();
75
76 protected:
77   // redefined from GEOMBase_Helper
78   virtual GEOM::GEOM_IOperations_ptr createOperation();
79   virtual bool isValid (QString&);
80   virtual bool execute (ObjectList&);
81   virtual void restoreSubShapes (SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
82
83 private:
84   void Init();
85   void enterEvent (QEvent*);
86   void resizeEvent (QResizeEvent *event);
87   void updateLabelImgPipeTShape();
88   bool CheckCompatiblePosition (GEOM::GEOM_Object_var theP1, 
89                                 GEOM::GEOM_Object_var theP2,
90                                 GEOM::GEOM_Object_var theP3, double theTolerance);
91
92 private:
93   QPixmap imagePipeTShape;
94   QPixmap imageReduction;
95   QLabel* LabelImgPipeTShape;
96   QLabel* LabelImgReduction;
97
98   // Main parameters
99   DlgRef_3Spin* MainTubeGroupParams;
100   DlgRef_3Spin* IncidentTubeGroupParams;
101   DlgRef_2Spin* ChamferGroupParams;
102   DlgRef_1Spin* FilletGroupParams;
103   QCheckBox*    HexMeshCheckBox;
104
105   // Thickness reduction parameters
106   AdvancedGUI_4Spin* LReductionGroupParams;
107   AdvancedGUI_4Spin* RReductionGroupParams;
108   AdvancedGUI_4Spin* IReductionGroupParams;
109
110   // Position parameters
111   DlgRef_6Sel* JunctionPointsSel;
112
113   QString CssNormal, CssAcceptable, CssRefused;
114   GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
115   bool myOkPoint1, myOkPoint2, myOkPoint3;
116   ObjectList pipeTShapeGroupObjects;
117
118 private slots:
119   void ClickOnOk();
120   bool ClickOnApply();
121   void ActivateThisDialog();
122   void currentChanged (int);
123   void SelectionIntoArgument();
124   void SetEditCurrentArgument();
125   void DisplayPreview (const bool activate = false, const bool update = true,
126                        const bool toRemoveFromEngine = true, const double lineWidth = -1,
127                        const int displayMode = -1, const int color = -1);
128   virtual void processPreview();
129   void SetPosition (bool);
130   void ChamferOrFillet (bool);
131   void SetDoubleSpinBoxStep (double);
132   void ValueChangedInSpinBox (double);
133   void UpdatePicture (QWidget* old, QWidget* now);
134   void ApplyNewDimensions();
135   bool executeNoCheck (ObjectList& objects);
136 };
137
138 #endif // ADVANCEDGUI_PIPETSHAPEDLG_H