Salome HOME
Merge branch 'V9_9_BR'
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_OffsetDlg.h
1 // Copyright (C) 2007-2022  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 // SMESH SMESHGUI : GUI for SMESH component
21 // File   : SMESHGUI_OffsetDlg.h
22 //
23 #ifndef SMESHGUI_OffsetDLG_H
24 #define SMESHGUI_OffsetDLG_H
25
26 // SMESH includes
27 #include "SMESH_SMESHGUI.hxx"
28 #include "SMESHGUI_PreviewDlg.h"
29
30 // IDL includes
31 #include <SALOMEconfig.h>
32 #include CORBA_SERVER_HEADER(SMESH_Mesh)
33
34 class QButtonGroup;
35 class QGroupBox;
36 class QLabel;
37 class QLineEdit;
38 class QPushButton;
39 class QRadioButton;
40 class QCheckBox;
41 class SMESHGUI;
42 class SMESHGUI_IdValidator;
43 class SMESHGUI_SpinBox;
44 class SMESHGUI_FilterDlg;
45 class SMESH_Actor;
46 class SVTK_Selector;
47 class LightApp_SelectionMgr;
48 class SMESH_LogicalFilter;
49
50 //=================================================================================
51 // class    : SMESHGUI_OffsetDlg
52 // purpose  :
53 //=================================================================================
54 class SMESHGUI_EXPORT SMESHGUI_OffsetDlg : public SMESHGUI_MultiPreviewDlg
55 {
56   Q_OBJECT
57
58  public:
59   SMESHGUI_OffsetDlg( SMESHGUI* );
60   ~SMESHGUI_OffsetDlg();
61
62  private:
63   void                   Init( bool = true );
64   void                   enterEvent( QEvent* );           /* mouse enter the QWidget */
65   void                   keyPressEvent( QKeyEvent* );
66   int                    GetConstructorId();
67   void                   setNewMeshName();
68
69   bool                   isValid();
70   void                   getOffset( SMESH::PointStruct& thePoint,
71                                     SMESH::double_array_var& theOffsetFact);
72
73   SMESHGUI_IdValidator*  myIdValidator;
74   LightApp_SelectionMgr* mySelectionMgr;          /* User shape selection */
75   QString                myElementsId;
76   int                    myNbOkElements;          /* to check when elements are defined */
77
78   SVTK_Selector*         mySelector;
79
80   QWidget*               myEditCurrentArgument;
81
82   bool                   myBusy;
83   SMESH_Actor*           myActor;
84   SMESH_LogicalFilter*   myMeshOrSubMeshOrGroupFilter;
85
86   QList<SMESH::SMESH_IDSource_var> myObjects;
87   QList<QString>                   myObjectsNames;
88   QList<SMESH::SMESH_Mesh_var>     myMeshes;
89
90
91   QGroupBox*             ConstructorsBox;
92   QGroupBox*             GroupButtons;
93   QPushButton*           buttonOk;
94   QPushButton*           buttonCancel;
95   QPushButton*           buttonApply;
96   QPushButton*           buttonHelp;
97   QGroupBox*             GroupArguments;
98   QLabel*                TextLabelElements;
99   //QPushButton*           SelectElementsButton;
100   QLineEdit*             LineEditElements;
101   QCheckBox*             CheckBoxMesh;
102   SMESHGUI_SpinBox*      SpinBox;
103   QGroupBox*             ActionBox;
104   QButtonGroup*          ActionGroup;
105   QCheckBox*             MakeGroupsCheck;
106   QLineEdit*             LineEditNewMesh;
107
108   QString                myHelpFileName;
109
110   QPushButton*           myFilterBtn;
111   SMESHGUI_FilterDlg*    myFilterDlg;
112
113
114 protected slots:
115   virtual void           onDisplaySimulation( bool );
116   virtual void           reject();
117   void                   onFilterAccepted();
118    
119 private slots:
120   void                   ClickOnOk();
121   bool                   ClickOnApply();
122   void                   ClickOnHelp();
123   void                   SelectionIntoArgument();
124   void                   DeactivateActiveDialog();
125   void                   ActivateThisDialog();
126   void                   onTextChange( const QString& );
127   void                   onSelectMesh( bool );
128   void                   onActionClicked( int );
129   void                   onOpenView();
130   void                   onCloseView();
131   void                   setFilters();
132 };
133
134 #endif // SMESHGUI_OffsetDLG_H