Salome HOME
imn/auto-reorder_of_nodes_ver2
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshOrderOp.h
1 // Copyright (C) 2007-2014  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 // File   : SMESHGUI_MeshOrderOp.h
21 // Author : Pavel TELKOV, Open CASCADE S.A.S.
22 //
23 #ifndef SMESHGUI_MeshOrderOp_H
24 #define SMESHGUI_MeshOrderOp_H
25
26
27 // SMESH includes
28 #include "SMESH_SMESHGUI.hxx"
29
30 #include "SMESHGUI_Operation.h"
31 #include "SMESHGUI_MeshOrderDlg.h"
32
33 // IDL includes
34 #include <SALOMEconfig.h>
35 #include CORBA_SERVER_HEADER(SMESH_Gen)
36 #include CORBA_SERVER_HEADER(SMESH_Mesh)
37
38 /*!
39  * \brief Operator to check and modify mesh computation submesh priority (order)
40  */
41 class SMESHGUI_EXPORT SMESHGUI_MeshOrderMgr
42 {
43 public:
44   SMESHGUI_MeshOrderMgr( SMESHGUI_MeshOrderBox* );
45   virtual ~SMESHGUI_MeshOrderMgr();
46   //! Set root mesh object
47   void                   SetMesh( SMESH::SMESH_Mesh_var& theMesh );
48   //! Check for concurents between submesh objects
49   bool                   GetMeshOrder();
50   //! Check for concurents between submesh objects
51   bool                   GetMeshOrder( ListListId& theIds );
52   //! Store submesh priority order
53   bool                   SetMeshOrder();
54   //! Store given submesh priority order
55   bool                   SetMeshOrder( const  ListListId& theIds );
56
57   //! Returns status is order changed by user
58   bool                   IsOrderChanged() const;
59
60 private:
61   SMESH::SMESH_Mesh_var  myMesh;
62   SMESHGUI_MeshOrderBox* myBox;
63 };
64
65 /*!
66  * \brief Operator to check and modify mesh computation submesh priority (order)
67  */
68 class SMESHGUI_EXPORT SMESHGUI_MeshOrderOp: public SMESHGUI_Operation
69 {
70   Q_OBJECT
71
72 public:
73   SMESHGUI_MeshOrderOp();
74   virtual ~SMESHGUI_MeshOrderOp();
75
76 protected:
77   virtual LightApp_Dialog* dlg() const;
78
79   virtual void           startOperation();
80
81   //! sets the dialog widgets to state just after operation start
82   virtual void           initDialog();
83
84  protected slots:
85   virtual bool           onApply();
86   virtual void           onCancel();
87
88  private:
89   SMESHGUI_MeshOrderDlg* myDlg;
90   SMESHGUI_MeshOrderMgr* myMgr;
91 };
92
93 #endif // SMESHGUI_MeshOrderOp_H