Salome HOME
Update copyright
[modules/smesh.git] / src / SMESH_I / SMESH_Gen_i_1.cxx
index 2b216fe268d77330f4480a45880151cf4f2ecf69..b19214c452620f96e3d3217d437022ebcbacbd5e 100644 (file)
@@ -1,31 +1,30 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
-//  This library is free software; you can redistribute it and/or
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// License along with this library; if not, write to the Free Software
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//  SMESH SMESH_I : idl implementation based on 'SMESH' unit's calsses
-// File      : SMESH_Gen_i_1.cxx
-// Created   : Thu Oct 21 17:24:06 2004
-// Author    : Edward AGAPOV (eap)
-// Module    : SMESH
-// $Header: 
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  File      : SMESH_Gen_i_1.cxx
+//  Created   : Thu Oct 21 17:24:06 2004
+//  Author    : Edward AGAPOV (eap)
+//  Module    : SMESH
+//  $Header   : $
+
 #include "SMESH_Gen_i.hxx"
 
 #include "SMESH_Mesh_i.hxx"
@@ -922,7 +921,30 @@ void SMESH_Gen_i::UpdateParameters(CORBA::Object_ptr theObject, const char* theP
   if(!hasAttr)
     aNewParams = anInputParams;
   else 
-    aNewParams = aOldParameters+"|"+anInputParams;
+    {
+      int pos = aOldParameters.SearchFromEnd("|");
+      if(pos==-1) pos = 0;
+      TCollection_AsciiString previousParamFull(aOldParameters.Split(pos));
+      TCollection_AsciiString previousParam(previousParamFull);
+      TCollection_AsciiString theRepet("1");
+      pos = previousParam.SearchFromEnd(";*=");
+      if(pos >= 0)
+        {
+          theRepet = previousParam.Split(pos+2);
+          pos = pos-1;
+          if(pos==-1) pos = 0;
+          previousParam.Split(pos);
+        }
+      if(previousParam == anInputParams)
+        {
+          theRepet = theRepet.IntegerValue()+1;
+          aNewParams = aOldParameters + previousParam + ";*=" + theRepet;
+        }
+      else
+        {
+          aNewParams = aOldParameters + previousParamFull + "|" + anInputParams;
+        }
+    }
 
   if(VARIABLE_DEBUG)
   {