Back to index

salome-med  6.5.0
MEDCalculatorBrowserStep.hxx
Go to the documentation of this file.
00001 // Copyright (C) 2007-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #ifndef __MEDCALCULATORBROWSERSTEP_HXX__
00021 #define __MEDCALCULATORBROWSERSTEP_HXX__
00022 
00023 #include "MedCalculatorDefines.hxx"
00024 
00025 #include <string>
00026 
00027 //  This class corresponds to a time step (dt,it) of a field
00028 //  It contains the time step (dt) and the corresponding time value
00029 //  It also contains methods for selecting or unselecting this time step and it hold the name of the supporting mesh.
00030 namespace ParaMEDMEM
00031 {
00032   class MEDCALCULATOR_EXPORT MEDCalculatorBrowserStep
00033   {
00034   public :
00035     MEDCalculatorBrowserStep(int ts=0, int order=0, double tv=0.0, std::string m="") : _time_step(ts), _order(order), _time_value(tv), _selection(false), _mesh(m) { }
00036     ~MEDCalculatorBrowserStep();
00037     bool operator==(int);//  Equal to operator, to use with std::find on vector<CalculatorBrowserStep> to find a specific time step
00038     bool operator==(int) const;//  Equal to operator, to use with std::find on vector< const CalculatorBrowserStep> to find a specific time step
00039     bool operator==(bool);//  Equal to operator, to use with std::find on std::vector<CalculatorBrowseStep> to find selected time step
00040     std::string str();//  Return a std::string corresponding to x/o (selected or not) timeStep ( timeValue )
00041     void select();//  Set selection flag to True (select this time step)
00042     void unselect();//  Set selection flag to False (unselect this time step)
00043     bool isSelected();//  Return selection (is this time step selected or not?)
00044     int getTimeStep() const;//  Return the time step id
00045     int getOrder() const { return _order; }
00046     const double& getTimeValue() const;//  Return the time Value
00047     const std::string& getCorrespondingMeshFromStep() const;//  Return the name of the supporting mesh
00048   private :
00049     int _time_step;//  time step id
00050     int _order;
00051     double _time_value;//  time value for this time step
00052     bool _selection;//  select flag
00053     std::string _mesh;//  name of supporting mesh
00054   };
00055 }
00056 
00057 #endif