- getNumberOfCells();//only to check that all is well defined.
- //
- int nbElemsIn(getNumberOfNodes()),nbOfTuples(_conn->getNumberOfTuples());
- int *pt(_conn->getPointer());
- for(int i=0;i<nbOfTuples;i++,pt++)
- {
- if(*pt==-1) continue;
- if(*pt>=0 && *pt<nbElemsIn)
- {
- INTERP_KERNEL::HashMap<int,int>::const_iterator it(newNodeNumbersO2N.find(*pt));
- if(it!=newNodeNumbersO2N.end())
- *pt=(*it).second;
- else
- {
- std::ostringstream oss; oss << "MEDCoupling1DGTUMesh::renumberNodesInConn : At pos #" << i << " of connectivity, node id is " << *pt << ". Not in keys of input map !";
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- }
- else
- {
- std::ostringstream oss; oss << "MEDCoupling1DGTUMesh::renumberNodesInConn : error on tuple #" << i << " value is " << *pt << " and indirectionnal array as a size equal to " << nbElemsIn;
- throw INTERP_KERNEL::Exception(oss.str().c_str());
- }
- }
- //
- updateTime();
+ this->renumberNodesInConnT< INTERP_KERNEL::HashMap<mcIdType,mcIdType> >(newNodeNumbersO2N);
+}
+
+/*!
+ * Same than renumberNodesInConn(const mcIdType *) except that here the format of old-to-new traducer is using map instead
+ * of array. This method is dedicated for renumbering from a big set of nodes the a tiny set of nodes which is the case during extraction
+ * of a big mesh.
+ */
+void MEDCoupling1DGTUMesh::renumberNodesInConn(const std::map<mcIdType,mcIdType>& newNodeNumbersO2N)
+{
+ this->renumberNodesInConnT< std::map<mcIdType,mcIdType> >(newNodeNumbersO2N);