2 // Copyright (C) 2009-2012 CEA/DEN, EDF R&D
4 // This library is free software; you can redistribute it and/or
5 // modify it under the terms of the GNU Lesser General Public
6 // License as published by the Free Software Foundation; either
7 // version 2.1 of the License.
9 // This library is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 // Lesser General Public License for more details.
14 // You should have received a copy of the GNU Lesser General Public
15 // License along with this library; if not, write to the Free Software
16 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
25 int Law::last_law_id = 0;
27 // ================================================== Constructeur
28 Law::Law (Document* dad, cpchar name, int nbnodes) : EltBase (dad, EL_LAW)
31 law_id = last_law_id++;
33 //Initialisation du nom: un nom par défaut est donné s'il n'est pas fourni
34 std::string _nom = std::string(name);
35 _nom.erase (_nom.find_last_not_of (" \n\r\t" ) + 1);
36 _nom.erase (0, _nom.find_first_not_of (" \n\r\t" ));
41 sprintf (buffer, "l%04d", law_id);
42 law_name = std::string(buffer);
46 law_coefficient = 0.0;
49 // ================================================== Constructeur 2
52 nbr_nodes = other->nbr_nodes;
53 law_name = other->law_name ;
54 law_type = other->law_type ;
55 law_coefficient = other->law_coefficient;
56 el_root = other->el_root;
59 // ========================================================= getNextName
60 char* Law::getNextName (pchar buffer)
62 sprintf (buffer, "l%04d", last_law_id);