mirror of
https://github.com/rdkit/rdkit.git
synced 2026-06-03 21:44:30 +08:00
add isotope info to depictions
This commit is contained in:
@@ -187,8 +187,12 @@ namespace RDKit {
|
||||
}
|
||||
}
|
||||
}
|
||||
double massDiff=fabs(PeriodicTable::getTable()->getAtomicWeight(mol[*bAts]->getAtomicNum()) -
|
||||
mol[*bAts]->getMass());
|
||||
static double massTol=0.001;
|
||||
if(mol[*bAts]->getAtomicNum()!=6 ||
|
||||
mol[*bAts]->getFormalCharge()!=0 ){
|
||||
mol[*bAts]->getFormalCharge()!=0 ||
|
||||
massDiff>massTol ){
|
||||
res.push_back(ATOM);
|
||||
res.push_back(mol[*bAts]->getAtomicNum());
|
||||
res.push_back(static_cast<ElementType>(dotsPerAngstrom*a1.x));
|
||||
@@ -198,6 +202,10 @@ namespace RDKit {
|
||||
if(mol[*bAts]->getDegree()==1 && nbrSum.x>0){
|
||||
leftToRight=false;
|
||||
}
|
||||
|
||||
if(massDiff>massTol){
|
||||
symbol = boost::lexical_cast<std::string>(int(mol[*bAts]->getMass()+.1))+symbol;
|
||||
}
|
||||
if(mol[*bAts]->getAtomicNum()!=6){
|
||||
int nHs=mol[*bAts]->getTotalNumHs();
|
||||
if(nHs>0){
|
||||
|
||||
@@ -358,7 +358,7 @@ void DrawDemo(){
|
||||
delete mol;
|
||||
}
|
||||
{
|
||||
RWMol *mol=SmilesToMol("c1ccccn1");
|
||||
RWMol *mol=SmilesToMol("c1c[12cH]ccn1");
|
||||
cairo_surface_t *surface =
|
||||
cairo_image_surface_create (CAIRO_FORMAT_ARGB32, 300, 300);
|
||||
cairo_t *cr = cairo_create (surface);
|
||||
|
||||
Reference in New Issue
Block a user