return ret;
}
+static PyObject *convertDblArrToPyList2(const std::vector<double>& v)
+{
+ int size=v.size();
+ PyObject *ret=PyList_New(size);
+ for(int i=0;i<size;i++)
+ PyList_SetItem(ret,i,PyFloat_FromDouble(v[i]));
+ return ret;
+}
+
static double *convertPyToNewDblArr2(PyObject *pyLi, int *size)
{
if(PyList_Check(pyLi))
virtual INTERP_KERNEL::NormalizedCellType getTypeOfCell(int cellId) const = 0;
virtual std::string simpleRepr() const = 0;
virtual std::string advancedRepr() const = 0;
- virtual void getNodeIdsOfCell(int cellId, std::vector<int>& conn) const = 0;
- virtual void getCoordinatesOfNode(int nodeId, std::vector<double>& coo) const = 0;
// tools
virtual void getBoundingBox(double *bbox) const = 0;
virtual MEDCouplingFieldDouble *getMeasureField(bool isAbs) const = 0;
delete [] tmp;
return ret;
}
+ PyObject *getNodeIdsOfCell(int cellId) const
+ {
+ std::vector<int> conn;
+ self->getNodeIdsOfCell(cellId,conn);
+ return convertIntArrToPyList2(conn);
+ }
+
+ PyObject *getCoordinatesOfNode(int nodeId) const
+ {
+ std::vector<double> coo;
+ self->getCoordinatesOfNode(nodeId,coo);
+ return convertDblArrToPyList2(coo);
+ }
}
};
}