本文整理汇总了C++中rdgeom::Transform3D::getData方法的典型用法代码示例。如果您正苦于以下问题:C++ Transform3D::getData方法的具体用法?C++ Transform3D::getData怎么用?C++ Transform3D::getData使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类rdgeom::Transform3D
的用法示例。
在下文中一共展示了Transform3D::getData方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: transConformer
void transConformer(Conformer &conf, python::object trans) {
PyObject *transObj = trans.ptr();
if (!PyArray_Check(transObj)) {
throw_value_error("Expecting a numeric array for transformation");
}
PyArrayObject *transMat = reinterpret_cast<PyArrayObject *>(transObj);
unsigned int nrows = transMat->dimensions[0];
unsigned int dSize = nrows*nrows;
double *inData = reinterpret_cast<double *>(transMat->data);
RDGeom::Transform3D transform;
double *tData = transform.getData();
memcpy(static_cast<void *>(tData), static_cast<void *>(inData), dSize*sizeof(double));
MolTransforms::transformConformer(conf, transform);
}
示例2: _copyTransform
void _copyTransform(const PyArrayObject *transMat, RDGeom::Transform3D &trans) {
unsigned int nrows = transMat->dimensions[0];
unsigned int ncols = transMat->dimensions[1];
if ((nrows != 4) || (ncols != 4)) {
throw_value_error("The transform has to be square matrix, of size 4x4");
}
if (transMat->descr->type_num != PyArray_DOUBLE)
throw_value_error("Only double arrays allowed for transform object ");
unsigned int dSize = nrows*nrows;
const double *inData = reinterpret_cast<const double *>(transMat->data);
double *tData = trans.getData();
memcpy(static_cast<void *>(tData), static_cast<const void *>(inData), dSize*sizeof(double));
}
示例3: PyArray_Return
PyObject *computeCanonTrans(const Conformer &conf, const RDGeom::Point3D *center=0,
bool normalizeCovar=false, bool ignoreHs=true) {
RDGeom::Transform3D *trans;
trans = MolTransforms::computeCanonicalTransform(conf, center,
normalizeCovar, ignoreHs);
npy_intp dims[2];
dims[0] = 4;
dims[1] = 4;
PyArrayObject *res = (PyArrayObject *)PyArray_SimpleNew(2,dims,NPY_DOUBLE);
double *resData=reinterpret_cast<double *>(res->data);
const double *tdata = trans->getData();
memcpy(static_cast<void *>(resData), static_cast<const void *>(tdata), 4*4*sizeof(double));
delete trans;
return PyArray_Return(res);
}