MEDCouplingPointSet *MEDCouplingUMesh::buildPartOfMySelf(const int *start, const int *end, bool keepCoords) const
{
- MEDCouplingUMesh *ret=buildPartOfMySelfKeepCoords(start,end);
- if(!keepCoords)
- ret->zipCoords();
- return ret;
+ if(getMeshDimension()!=-1)
+ {
+ MEDCouplingUMesh *ret=buildPartOfMySelfKeepCoords(start,end);
+ if(!keepCoords)
+ ret->zipCoords();
+ return ret;
+ }
+ else
+ {
+ if(end-start!=1)
+ throw INTERP_KERNEL::Exception("-1D mesh has only one cell !");
+ if(start[0]!=0)
+ throw INTERP_KERNEL::Exception("-1D mesh has only one cell : 0 !");
+ incrRef();
+ return (MEDCouplingUMesh *)this;
+ }
}
/*!
*/
void MEDCouplingUMesh::giveElemsInBoundingBox(const double *bbox, double eps, std::vector<int>& elems)
{
+ if(getMeshDimension()==-1)
+ {
+ elems.push_back(0);
+ return;
+ }
int dim=getSpaceDimension();
double* elem_bb=new double[2*dim];
const int* conn = getNodalConnectivity()->getConstPointer();
tinyInfo.push_back(-1);
}
+bool MEDCouplingUMesh::isEmptyMesh(const std::vector<int>& tinyInfo) const
+{
+ return tinyInfo[4]<=0;
+}
+
/*!
* @param tinyInfo must be equal to the result given by getTinySerializationInformation method.
*/
int getMeshLength() const;
//! size of returned tinyInfo must be always the same.
void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
+ bool isEmptyMesh(const std::vector<int>& tinyInfo) const;
void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings);
void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
void unserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2,
tinyInfo.push_back(getFaceMeshLength());
}
+bool MEDCouplingUMeshDesc::isEmptyMesh(const std::vector<int>& tinyInfo) const
+{
+ return tinyInfo[5]<=0;
+}
+
void MEDCouplingUMeshDesc::resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings)
{
std::vector<int> tinyInfoTmp(tinyInfo.begin()+1,tinyInfo.end());
void setConnectivity(DataArrayInt *descConn, DataArrayInt *descConnIndex, DataArrayInt *nodalFaceConn, DataArrayInt *nodalFaceConnIndx);
//tools to overload
void getTinySerializationInformation(std::vector<int>& tinyInfo, std::vector<std::string>& littleStrings) const;
+ bool isEmptyMesh(const std::vector<int>& tinyInfo) const;
void resizeForUnserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2, std::vector<std::string>& littleStrings);
void serialize(DataArrayInt *&a1, DataArrayDouble *&a2) const;
void unserialization(const std::vector<int>& tinyInfo, DataArrayInt *a1, DataArrayDouble *a2,