Salome HOME
ff0e1cfaf81ae516d377955456271b8e357bd794
[modules/med.git] / src / MEDCalculator / MEDCalculatorBrowserMesh.hxx
1 // Copyright (C) 2007-2016  CEA/DEN, EDF R&D
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 // Author : Anthony Geay (CEA/DEN)
20 #ifndef __MEDCALCULATORBROWSERMESH_HXX__
21 #define __MEDCALCULATORBROWSERMESH_HXX__
22
23 #include "MedCalculatorDefines.hxx"
24
25 #include <string>
26
27 //  This class corresponds to a MED mesh of a file
28 //  It contains the mesh name and a flag to know if it's selected or not
29 //  It's used only for selecting mesh, out of all fields.
30 namespace MEDCoupling
31 {
32   class MEDCALCULATOR_EXPORT MEDCalculatorBrowserMesh
33   {
34   public :
35     MEDCalculatorBrowserMesh();
36     ~MEDCalculatorBrowserMesh();
37     MEDCalculatorBrowserMesh(const char *mname);
38     bool operator==(const std::string&);// Equal to string operator, to test if meshname of this mesh is the same as input argument
39     std::string str();//  Return a std::string corresponding to x/o (selected or not) Mesh meshname
40     void select();//  Set selection flag to True (select this mesh)
41     void unselect();//  Set selection flag to False (unselect this mesh)
42     bool isSelected();//  Return selection (is this mesh selected or not?)
43     const std::string& getName() const;//  Return the name of this mesh
44   private :
45     std::string _name;//  name of mesh
46     bool _selection;//  select flag
47   };
48 }
49
50 #endif