Salome HOME
Merge from V7_2_BR 09/08/2013 BR_new_bop4
authorvsr <vsr@opencascade.com>
Mon, 12 Aug 2013 10:29:47 +0000 (10:29 +0000)
committervsr <vsr@opencascade.com>
Mon, 12 Aug 2013 10:29:47 +0000 (10:29 +0000)
src/genericgui/LinkMatrix.cxx
src/genericgui/SceneLinkItem.cxx

index 5b21893349d513ba6c77d9d36277adadc9e1c4b5..e1e5b9c5581f8b600ba9527fe841710259f3342e 100644 (file)
@@ -72,7 +72,7 @@ void LinkMatrix::compute()
   explore(_bloc);        // --- define the boundaries _xm[i] and _ym[j]
   if (Scene::_addRowCols) addRowCols();
   _im = _sxm.size();
-  _xm.reserve(_im);
+  _xm.resize(_im);
   DEBTRACE("_sxm.size()=" << _im);
   int i =0;
   for(std::set<double>::iterator it = _sxm.begin(); it != _sxm.end(); ++it)
@@ -83,7 +83,7 @@ void LinkMatrix::compute()
       i++;
     }
   _jm = _sym.size();
-  _ym.reserve(_jm);
+  _ym.resize(_jm);
   DEBTRACE("_sym.size()=" << _jm);
   i =0;
   for(std::set<double>::iterator it = _sym.begin(); it != _sym.end(); ++it)
@@ -93,7 +93,7 @@ void LinkMatrix::compute()
       DEBTRACE("_ym[" << i << "] = " << _ym[i]);
       i++;
     }
-  _cost.reserve(_im*_jm);
+  _cost.resize(_im*_jm);
   for (int ij=0; ij < _im*_jm; ij++)
     _cost[ij] = 1;       // --- set the _cost matrix open everywhere (no obstacles)
   explore(_bloc, true);  // --- fill the cells cost(i,j) with obstacles
index 534a22316a99cdfb227de4ce4dab892c94451b8d..c1468b3598c2d061eb29b1fb6024519812564d89 100644 (file)
@@ -270,8 +270,8 @@ void SceneLinkItem::setPath(LinkPath lp)
   CHRONO(10);
   prepareGeometryChange();
   _nbPoints = lp.size();
-  _lp.reserve(_nbPoints+1);
-  _directions.reserve(_nbPoints +2);
+  _lp.resize(_nbPoints+1);
+  _directions.resize(_nbPoints +2);
   std::list<linkPoint>::const_iterator it = lp.begin();
   int k=0;
   qreal prevx = 0;
@@ -366,8 +366,8 @@ void SceneLinkItem::minimizeDirectionChanges()
 {
   vector<QPointF> newlp;
   vector<Direction> newdir;
-  newlp.reserve(_nbPoints);
-  newdir.reserve(_nbPoints +1);
+  newlp.resize(_nbPoints);
+  newdir.resize(_nbPoints +1);
 
   bool modified = true;
   while (modified)
@@ -499,10 +499,10 @@ void SceneLinkItem::force2points()
         {
           vector<QPointF> newlp;
           vector<Direction> newdir;
-          newlp.reserve(_nbPoints+1);
-          newdir.reserve(_nbPoints +2);
-          //_lp.reserve(_nbPoints +1);         // --- not OK : data may be lost! pre reserve enough before!
-          //_directions.reserve(_nbPoints +2);
+          newlp.resize(_nbPoints+1);
+          newdir.resize(_nbPoints +2);
+          //_lp.resize(_nbPoints +1);         // --- not OK : data may be lost! pre reserve enough before!
+          //_directions.resize(_nbPoints +2);
           newlp[0] = _lp[0];
           newlp[1] = _lp[0];
           newlp[0].setY(a.y());