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)
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)
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
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;
{
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)
{
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());