- // --- SMDS_MeshNode and myNodes, myNodeIdFactory
-
- if ( true )
- {
- SetOfNodes newNodes(newNodeSize+1,NULL); // 0 not used, SMDS numbers 1..n
- int newSmdsId = 0;
- for (int i = 0; i < nbNodes; i++)
- {
- if (myNodes[i])
- {
- newSmdsId++; // SMDS id starts from 1
- int oldVtkId = myNodes[i]->getVtkId();
- int newVtkId = idNodesOldToNew[oldVtkId];
- myNodes[i]->setVtkId(newVtkId);
- myNodes[i]->setId(newSmdsId);
- newNodes[newSmdsId] = myNodes[i];
- }
- }
- myNodes.swap(newNodes);
- this->myNodeIDFactory->emptyPool(newSmdsId); // newSmdsId = number of nodes
- }
-
- // --- SMDS_MeshCell, myCellIdVtkToSmds, myCellIdSmdsToVtk, myCells
-
- int vtkIndexSize = myCellIdVtkToSmds.size();
- for (int oldVtkId = 0; oldVtkId < vtkIndexSize; oldVtkId++)
- {
- int oldSmdsId = this->myCellIdVtkToSmds[oldVtkId];
- if (oldSmdsId > 0)
- {
- int newVtkId = idCellsOldToNew[oldVtkId];
- myCells[oldSmdsId]->setVtkId(newVtkId);
- }
- }
-
- SetOfCells newCells(newCellSize+1, NULL); // 0 not used, SMDS numbers 1..n
- vector<int> newVtkToSmds(newCellSize+1, -1);
-
- int myCellsSize = myCells.size();
- int newSmdsId = 0;
- for (int i = 0; i < myCellsSize; i++)
- {
- if ( myCells[i] )
- {
- newSmdsId++; // SMDS id starts from 1
- assert(newSmdsId <= newCellSize);
- newCells[newSmdsId] = myCells[i];
- newCells[newSmdsId]->setId(newSmdsId);
- int idvtk = myCells[i]->getVtkId();
- assert(idvtk < newCellSize);
- newVtkToSmds[idvtk] = newSmdsId;
- }
- }
-
- myCells.swap(newCells);
- myCellIdVtkToSmds.swap(newVtkToSmds);
- this->myElementIDFactory->emptyPool(newSmdsId);