13#ifndef RDKIT_SHAPEINPUT_GUARD
14#define RDKIT_SHAPEINPUT_GUARD
23#include <boost/dynamic_bitset.hpp>
24#ifdef RDK_USE_BOOST_SERIALIZATION
25#include <boost/archive/text_oarchive.hpp>
26#include <boost/archive/text_iarchive.hpp>
27#include <boost/serialization/vector.hpp>
28#include <boost/serialization/array.hpp>
29#include <boost/serialization/unique_ptr.hpp>
41template <
class Archive,
typename Block,
typename Allocator>
42void serialize(Archive &ar, boost::dynamic_bitset<Block, Allocator> &bs,
43 const unsigned int ) {
44 size_t num_bits = bs.size();
47 std::vector<Block> blocks;
49 if (Archive::is_saving::value) {
50 to_block_range(bs, std::back_inserter(blocks));
55 if (Archive::is_loading::value) {
57 from_block_range(blocks.begin(), blocks.end(), bs);
71constexpr double P = 2.7;
72constexpr double KAPPA = 2.41798793102;
74 std::vector<std::tuple<unsigned int, RDGeom::Point3D, double>>;
94 std::vector<unsigned int>
97 std::vector<std::pair<unsigned int, double>>
118#ifndef RDK_USE_BOOST_SERIALIZATION
121 std::stringstream ss(str);
122 boost::archive::text_iarchive ia(ss);
133#ifndef RDK_USE_BOOST_SERIALIZATION
136 std::stringstream ss;
137 boost::archive::text_oarchive oa(ss);
145 const std::vector<double> &
getCoords()
const {
return d_coords; }
147 std::vector<RDGeom::Point3D>
getAtomPoints(
bool includeColors =
false)
const;
149 const std::vector<int> &
getTypes()
const {
return d_types; }
155 return d_carbonRadii.get();
176 virtual std::unique_ptr<RWMol>
shapeToMol(
bool includeColors =
true)
const;
178#ifdef RDK_USE_BOOST_SERIALIZATION
179 template <
class Archive>
180 void serialize(Archive &ar,
const unsigned int) {
185 ar & d_selfOverlapVol;
186 ar & d_selfOverlapColor;
187 ar & d_extremePoints;
190 ar & d_normalizationOK;
198 void extractAtoms(
const ROMol &mol,
int confId,
202 void extractFeatures(
const ROMol &mol,
int confId,
206 void calcNormalization();
208 void calculateExtremes();
210 std::vector<double> d_coords;
214 std::vector<int> d_types;
217 unsigned int d_numAtoms;
218 unsigned int d_numFeats;
219 double d_selfOverlapVol{0.0};
220 double d_selfOverlapColor{0.0};
223 std::array<size_t, 6> d_extremePoints;
224 std::unique_ptr<boost::dynamic_bitset<>>
231 bool d_normalized{
false};
234 bool d_normalizationOK{
false};
236 std::array<double, 9> d_canonRot;
237 std::array<double, 3> d_canonTrans;
239 std::array<double, 3> d_eigenValues;
244 const ROMol &mol,
int confId,
const std::vector<unsigned int> &ats);
247 const double *quat,
const double *trans);
254 const double *inShape,
double *outShape,
size_t numPoints,
259 const double *inShape,
double *outShape,
size_t numPoints,
#define PRECONDITION(expr, mess)
RWMol is a molecule class that is intended to be edited.
#define RDKIT_GAUSSIANSHAPE_EXPORT
std::vector< std::tuple< unsigned int, RDGeom::Point3D, double > > CustomFeatures
RDKIT_GAUSSIANSHAPE_EXPORT void translateShape(std::vector< double > &shape, const RDGeom::Point3D &translation)
RDKIT_GAUSSIANSHAPE_EXPORT RDGeom::Transform3D quatTransToTransform(const double *quat, const double *trans)
RDKIT_GAUSSIANSHAPE_EXPORT void applyTransformToShape(std::vector< double > &shape, RDGeom::Transform3D &xform)
RDKIT_GAUSSIANSHAPE_EXPORT RDGeom::Point3D computeFeaturePos(const ROMol &mol, int confId, const std::vector< unsigned int > &ats)
void serialize(Archive &ar, boost::dynamic_bitset< Block, Allocator > &bs, const unsigned int)