}
}
+std::size_t MEDCouplingPointSet::getHeapMemorySize() const
+{
+ std::size_t ret=0;
+ if(_coords)
+ ret+=_coords->getHeapMemorySize();
+ return MEDCouplingMesh::getHeapMemorySize()+ret;
+}
+
void MEDCouplingPointSet::setCoords(const DataArrayDouble *coords)
{
if( coords != _coords )
_coords->findCommonTuples(prec,limitNodeId,comm,commIndex);
}
-std::vector<int> MEDCouplingPointSet::getNodeIdsNearPoint(const double *pos, double eps) const throw(INTERP_KERNEL::Exception)
+DataArrayInt *MEDCouplingPointSet::getNodeIdsNearPoint(const double *pos, double eps) const throw(INTERP_KERNEL::Exception)
{
- std::vector<int> c,cI;
+ DataArrayInt *c=0,*cI=0;
getNodeIdsNearPoints(pos,1,eps,c,cI);
+ MEDCouplingAutoRefCountObjectPtr<DataArrayInt> cITmp(cI);
return c;
}
* Position 'pos' is expected to be of size getSpaceDimension()*nbOfNodes. If not the behabiour is not warranted.
* This method throws an exception if no coordiantes are set.
*/
-void MEDCouplingPointSet::getNodeIdsNearPoints(const double *pos, int nbOfNodes, double eps, std::vector<int>& c, std::vector<int>& cI) const throw(INTERP_KERNEL::Exception)
+void MEDCouplingPointSet::getNodeIdsNearPoints(const double *pos, int nbOfNodes, double eps, DataArrayInt *& c, DataArrayInt *& cI) const throw(INTERP_KERNEL::Exception)
{
if(!_coords)
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::getNodeIdsNearPoint : no coordiantes set !");
{
if(!_coords)
throw INTERP_KERNEL::Exception("MEDCouplingPointSet::buildNewNumberingFromCommonNodesFormat : no coords specified !");
- return DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(getNumberOfNodes(),comm,commIndex,newNbOfNodes);
+ return DataArrayInt::BuildOld2NewArrayFromSurjectiveFormat2(getNumberOfNodes(),comm->begin(),commIndex->begin(),commIndex->end(),newNbOfNodes);
}
/*
double *coords=_coords->getPointer();
int nbNodes=getNumberOfNodes();
int dim=getSpaceDimension();
- double *tmp=new double[dim];
for(int i=0;i<nbNodes;i++)
{
std::transform(coords+i*dim,coords+(i+1)*dim,point,coords+i*dim,std::minus<double>());
std::transform(coords+i*dim,coords+(i+1)*dim,coords+i*dim,std::bind2nd(std::multiplies<double>(),factor));
std::transform(coords+i*dim,coords+(i+1)*dim,point,coords+i*dim,std::plus<double>());
}
- delete [] tmp;
_coords->declareAsNew();
updateTime();
}
}
}
+void MEDCouplingPointSet::checkCoherency() const throw(INTERP_KERNEL::Exception)
+{
+ if(!_coords)
+ throw INTERP_KERNEL::Exception("MEDCouplingPointSet::checkCoherency : no coordinates set !");
+}
+
/*!
* Intersect Bounding Box given 2 Bounding Boxes.
*/