[Rdkit-devel] New MolDrawing.h
Open-Source Cheminformatics and Machine Learning
Brought to you by:
glandrum
|
From: David C. <dav...@gm...> - 2012-08-07 09:32:37
|
Hi, 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. 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'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! 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. I'm not sure how I should go about this sort of contribution, I hope a post like this is ok. Regards, Dave |