Salome HOME
Added a mechanism to store AIS_AngleDimension objects and display them all along...
[modules/geom.git] / src / AdvancedGUI / AdvancedGUI_PipeTShapeDlg.h
1 // Copyright (C) 2007-2012  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.
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_3Sel;
29 class DlgRef_6Sel;
30 class QCheckBox;
31 class QLineEdit;
32 class QLabel;
33
34 //=================================================================================
35 // class    : AdvancedGUI_PipeTShapeDlg
36 // purpose  :
37 //=================================================================================
38 class AdvancedGUI_PipeTShapeDlg: public GEOMBase_Skeleton {
39 Q_OBJECT
40
41 public:
42         AdvancedGUI_PipeTShapeDlg(GeometryGUI*, QWidget* = 0);
43         ~AdvancedGUI_PipeTShapeDlg();
44
45 protected:
46         // redefined from GEOMBase_Helper
47         virtual GEOM::GEOM_IOperations_ptr createOperation();
48         virtual bool isValid(QString&);
49         virtual bool execute(ObjectList&);
50         virtual void restoreSubShapes(SALOMEDS::Study_ptr, SALOMEDS::SObject_ptr);
51
52 private:
53         void Init();
54         void enterEvent(QEvent*);
55     void resizeEvent(QResizeEvent *event);
56     void updateTshapeScreenshotLabel();
57         bool CheckCompatiblePosition(GEOM::GEOM_Object_var theP1, 
58                                  GEOM::GEOM_Object_var theP2,
59                                  GEOM::GEOM_Object_var theP3, double theTolerance);
60
61 private:
62         QPixmap imagePipeTShape;
63     QLabel* tshapeScreenShotLabel;
64         DlgRef_3Spin* MainTubeGroupParams;
65         DlgRef_3Spin* IncidentTubeGroupParams;
66         DlgRef_2Spin* ChamferGroupParams;
67         DlgRef_1Spin* FilletGroupParams;
68         DlgRef_6Sel*  JunctionPointsSel;
69     QPixmap imageImp;
70     QString CssNormal, CssAcceptable, CssRefused;
71         QCheckBox* HexMeshCheckBox;
72         GEOM::GEOM_Object_var myPoint1, myPoint2, myPoint3;
73         bool myOkPoint1, myOkPoint2, myOkPoint3;
74         bool isPreview;
75         ObjectList pipeTShapeGroupObjects;
76
77 private slots:
78         void ClickOnOk();
79         bool ClickOnApply();
80         void ActivateThisDialog();
81         void SelectionIntoArgument();
82         void SetEditCurrentArgument();
83         void DisplayPreview(const bool activate = false, const bool update = true,
84                         const bool toRemoveFromEngine = true, const double lineWidth = -1,
85                         const int displayMode = -1, const int color = -1);
86         virtual void processPreview();
87         void SetPosition(bool);
88         void ChamferOrFillet(bool);
89         void SetDoubleSpinBoxStep(double);
90         void ValueChangedInSpinBox( double );
91         void UpdatePicture(QWidget* old, QWidget* now);
92     void ApplyNewDimensions();
93     bool executeNoCheck( ObjectList& objects );
94 };
95
96 #endif // ADVANCEDGUI_PIPETSHAPEDLG_H