Salome HOME
Update of CheckDone
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ReorientFacesDlg.h
1 // Copyright (C) 2007-2024  CEA, EDF, 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, or (at your option) any later version.
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   : SMESHGUI_ReorientFacesDlg.h
24 // Author : Edward AGAPOV, Open CASCADE S.A.S.
25 //
26 #ifndef SMESHGUI_ReorientFacesDlg_H
27 #define SMESHGUI_ReorientFacesDlg_H
28
29 // SMESH includes
30
31 #include "SMESH_SMESHGUI.hxx"
32
33 #include "SMESHGUI_Dialog.h"
34 #include "SMESHGUI_SelectionOp.h"
35
36 #include <SALOMEconfig.h>
37 #include CORBA_SERVER_HEADER(SMESH_Mesh)
38
39 class QButtonGroup;
40 class QCheckBox;
41 class QLineEdit;
42 class SMESHGUI_SpinBox;
43 class SMESHGUI_ReorientFacesDlg;
44 class SMESH_TypeFilter;
45
46 /*! ================================================================================
47  * \brief Operation to reorient faces according to some criterion
48  */
49
50 class SMESHGUI_EXPORT SMESHGUI_ReorientFacesOp: public SMESHGUI_SelectionOp
51 {
52   Q_OBJECT
53
54  public:
55   SMESHGUI_ReorientFacesOp();
56   virtual ~SMESHGUI_ReorientFacesOp();
57
58   virtual LightApp_Dialog*       dlg() const;
59
60  protected:
61
62   virtual void                   startOperation();
63   virtual void                   stopOperation();
64
65   virtual SUIT_SelectionFilter*  createFilter( const int ) const;
66   virtual void                   selectionDone();
67
68   bool                           isValid( QString& );
69   void                           setRefFiltersByConstructor();
70   int                            constructorID();
71
72
73  protected slots:
74   virtual bool                   onApply();
75
76  private slots:
77   virtual void                   onActivateObject( int );
78   void                           redisplayPreview();
79   void                           onTextChange( const QString& );
80   bool                           onlyOneObjAllowed();
81
82  private:
83
84   SMESHGUI_ReorientFacesDlg* myDlg;
85
86   SMESH_Actor*               myObjectActor;
87   int                        mySelectionMode;
88
89   SMESH_TypeFilter*          myRefGroupFilter;
90   SMESH_TypeFilter*          myRefSubMeshFilter;
91   SMESH_TypeFilter*          myRefMeshFilter;
92
93   SMESH::ListOfIDSources_var myObjects;
94   SMESH::ListOfIDSources_var myRefGroups;
95 };
96
97 /*! ================================================================================
98  * \brief Dialog to reorient faces according to vector
99  */
100
101 class SMESHGUI_EXPORT SMESHGUI_ReorientFacesDlg : public SMESHGUI_Dialog
102 {
103   Q_OBJECT
104
105  public:
106   SMESHGUI_ReorientFacesDlg();
107
108 public slots:
109   void constructorChange(int id);
110
111 private:
112   QWidget*                      createMainFrame( QWidget* );
113   void                          setLabel( int object, const char* text );
114   
115   QButtonGroup*                 myConstructorGrp;
116   QFrame*                       myFaceFrm;
117   QFrame*                       myPointFrm;
118   QFrame*                       myDirFrm;
119   QFrame*                       myRefGroupFrm;
120   QCheckBox*                    myOutsideChk;
121   SMESHGUI_SpinBox*             myX;
122   SMESHGUI_SpinBox*             myY;
123   SMESHGUI_SpinBox*             myZ;
124   //QPushButton*                  myIdBtn;
125   //QLineEdit*                    myId;
126   SMESHGUI_SpinBox*             myDX;
127   SMESHGUI_SpinBox*             myDY;
128   SMESHGUI_SpinBox*             myDZ;
129
130   QString                       myHelpFileName;
131
132   friend class SMESHGUI_ReorientFacesOp;
133
134   //private slots:
135   //void                          ButtonToggled( bool );
136 };
137
138 #endif // SMESHGUI_ReorientFacesDlg_H