Hi Dave,

On Tue, Aug 7, 2012 at 11:32 AM, David Cosgrove
<davidacosgrov...@gmail.com> wrote:
>
> As discussed with Greg, I've tweaked
> $RDBASE/Code/Demos/RDKit/Draw/MolDrawing.h so that for acyclic double and
> triple bonds the offset is symmetrical about the bond, which I think looks
> neater. The two PNGs attached show the effect.

Indeed. The new version definitely looks better. I just checked in a
slightly modified version (the lines in triple bonds were being drawn
too close to each other).

> The amended header is in the
> tarball attached, along with a toy program demonstrating drawing into a Qt
> widget via a QPainter.  If you would like to include that with the cairo and
> SVG demonstrators, I'd be very happy.  I do all my GUI development in Qt, so
> I would have found this example useful, hopefully others might too.

I'd be happy to add the Qt example (which looks good), but the files
need to have something added to the header to make the license a bit
clearer. Could you please add (or are you ok with me adding):
//  This file is part of the RDKit.
//  The contents are covered by the terms of the BSD license
//  which is included in the file license.txt, found at the root
//  of the RDKit source tree.
//
at the top of each file?

> I'm
> guessing that there are Python drawing modules, too, though I haven't
> looked.  If someone can point me at the Python equivalents for drawing the
> WEDGE bonds, I'll have a crack at that at some point soon, too.  I would
> rather not have to work through the chirality designations from scratch if
> someone has already done it!

The Python drawing code is in $RDBASE/rdkit/Chem/Draw/MolDrawing.py
The function to draw a wedged bond is _drawWedgedBond()
That is called from around line 180, which shows the logic for
figuring out when a bond should be wedged.
Actually figuring out which bonds should be wedged is accomplished
with the function RDKit::WedgeMolBonds()
http://www.rdkit.org/C++_Docs/namespaceRDKit.html#aa07f087fff07281ab8889e6488dbb8f5
defined in GraphMol/FileParsers/MolFileStereochem.h (that's probably
the wrong place for this function to live).

> When building my application originally, using -Wall which I do as a matter
> of course, I got a number of compiler warnings about unsigned ints not going
> below zero, which obscured a lot of other more useful error messages and
> warnings. They turned out to be due to Numerics/Vector.h and
> Numerics/Matrix.h calling RANGE_CHECK with unsigned ints with the first
> parameter 0, the purpose in this case being to see if the second parameter
> exceeded the size of a vector.  So I've added a new macro HIGH_CHECK to
> RDGeneral/Invariant.h and used it in Vector.h and Matrix.h, new versions
> attached.  If nothing else, it saves an unnecessary comparison.

Thanks for pointing that out. Rather than add the new HIGH_CHECK
macro, I just switched all of those RANGE_CHECKs involving unsigned
ints to PRECONDITIONs with the appropriate single test. This
accomplishes the same thing without requiring a special purpose macro.
Those changes are also checked in.

>  I'm not sure
> how I should go about this sort of contribution, I hope a post like this is
> ok.

It's perfect.

Thanks again for the contributions!
-greg

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
Rdkit-devel mailing list
Rdkit-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/rdkit-devel

Reply via email to