DataArrayInt *MEDCouplingUMesh::computeFetchedNodeIds() const
{
checkConnectivityFullyDefined();
- int nbOfCells=getNumberOfCells();
- const int *connIndex=_nodal_connec_index->getConstPointer();
- const int *conn=_nodal_connec->getConstPointer();
- const int *maxEltPt=std::max_element(_nodal_connec->begin(),_nodal_connec->end());
- int maxElt=maxEltPt==_nodal_connec->end()?0:std::abs(*maxEltPt)+1;
+ const int *maxEltPt(std::max_element(_nodal_connec->begin(),_nodal_connec->end()));
+ int maxElt(maxEltPt==_nodal_connec->end()?0:std::abs(*maxEltPt)+1);
std::vector<bool> retS(maxElt,false);
- for(int i=0;i<nbOfCells;i++)
- for(int j=connIndex[i]+1;j<connIndex[i+1];j++)
- if(conn[j]>=0)
- retS[conn[j]]=true;
- int sz=0;
- for(int i=0;i<maxElt;i++)
- if(retS[i])
- sz++;
- DataArrayInt *ret=DataArrayInt::New();
- ret->alloc(sz,1);
- int *retPtr=ret->getPointer();
- for(int i=0;i<maxElt;i++)
- if(retS[i])
- *retPtr++=i;
- return ret;
+ computeNodeIdsAlg(retS);
+ return DataArrayInt::BuildListOfSwitchedOn(retS);
}
/*!
MCAuto<DataArrayDouble> coo=_coords->deepCopy();
double normm2(sqrt(vec2[0]*vec2[0]+vec2[1]*vec2[1]+vec2[2]*vec2[2]));
if(normm2/normm>1e-6)
- MEDCouplingPointSet::Rotate3DAlg(origin,vec2,angle,coo->getNumberOfTuples(),coo->getPointer());
+ DataArrayDouble::Rotate3DAlg(origin,vec2,angle,coo->getNumberOfTuples(),coo->getPointer(),coo->getPointer());
MCAuto<MEDCouplingUMesh> mw=clone(false);//false -> shallow copy
mw->setCoords(coo);
mw->getBoundingBox(bbox);
* \throw If \a a[ *i* ]->getMeshDimension() < 0.
* \throw If the meshes in \a a are of different dimension (getMeshDimension()).
*/
-MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(std::vector<const MEDCouplingUMesh *>& a)
+MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshes(const std::vector<const MEDCouplingUMesh *>& a)
{
std::size_t sz=a.size();
if(sz==0)
/// @cond INTERNAL
-MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesLL(std::vector<const MEDCouplingUMesh *>& a)
+MEDCouplingUMesh *MEDCouplingUMesh::MergeUMeshesLL(const std::vector<const MEDCouplingUMesh *>& a)
{
if(a.empty())
throw INTERP_KERNEL::Exception("MEDCouplingUMesh::MergeUMeshes : input array must be NON EMPTY !");