00001 // Copyright (C) 2007-2011 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 <string> 00024 00025 // This class corresponds to a time step (dt,it) of a field 00026 // It contains the time step (dt) and the corresponding time value 00027 // It also contains methods for selecting or unselecting this time step and it hold the name of the supporting mesh. 00028 namespace ParaMEDMEM 00029 { 00030 class MEDCalculatorBrowserStep 00031 { 00032 public : 00033 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) { } 00034 ~MEDCalculatorBrowserStep(); 00035 bool operator==(int);// Equal to operator, to use with std::find on vector<CalculatorBrowserStep> to find a specific time step 00036 bool operator==(int) const;// Equal to operator, to use with std::find on vector< const CalculatorBrowserStep> to find a specific time step 00037 bool operator==(bool);// Equal to operator, to use with std::find on std::vector<CalculatorBrowseStep> to find selected time step 00038 std::string str();// Return a std::string corresponding to x/o (selected or not) timeStep ( timeValue ) 00039 void select();// Set selection flag to True (select this time step) 00040 void unselect();// Set selection flag to False (unselect this time step) 00041 bool isSelected();// Return selection (is this time step selected or not?) 00042 int getTimeStep() const;// Return the time step id 00043 int getOrder() const { return _order; } 00044 const double& getTimeValue() const;// Return the time Value 00045 const std::string& getCorrespondingMeshFromStep() const;// Return the name of the supporting mesh 00046 private : 00047 int _time_step;// time step id 00048 int _order; 00049 double _time_value;// time value for this time step 00050 bool _selection;// select flag 00051 std::string _mesh;// name of supporting mesh 00052 }; 00053 } 00054 00055 #endif