[vtk-developers] vtkChemistry update

David Cole david.cole at kitware.com
Tue Jun 28 10:13:40 EDT 2011


Sounds like you're doing some good work, here. Nice!

Can somebody here spend some cycles pulling down David's changes and
submitting an Experimental dashboard with python wrapping turned on? It
would be better to sort out any problems (if any) associated with new code
and the wrapper layers sooner rather than end-of-summer...


David C.


On Mon, Jun 27, 2011 at 5:33 PM, David Lonie <loniedavid at gmail.com> wrote:

> Hi list,
>
> The vtkChemistry kit is coming along well, I think we have a good
> design that will provide an easy but powerful API for developers.
> Before I get into specifics, I want to thank everyone at Kitware who
> was a part of my visit to Clifton Park the other week -- I had a lot
> of fun and it was great to meet many of you. I've wrapped up a lot of
> the molecular structure rendering code since then, and would like to
> share the current state of the project.
>
> The current code (on github[1]) provides vtkMolecule, vtkAtom, and
> vtkBond to build and store molecular structure. Building a molecule
> can be as simple as:
>
> vtkMolecule *mol = vtkMolecule::New();
> vtkAtom h1 = mol->AddAtom(1, 0.0, 0.0, -0.5);
> vtkAtom h2 = mol->AddAtom(1, 0.0, 0.0,  0.5);
> vtkBond b  = mol->AddBond(h1, h2, 1);
>
> to create a molecule with two hydrogens, one angstrom apart on the
> z-axis, connected with a single bond. Another addition is the
> vtkPeriodicTable class, which parses the Blue Obelisk Data
> Repository[2] to provide convenient access to information about the
> elements. Using the vtkAtom interface along with vtkPeriodicTable, it
> is possible to specify atoms in the in other ways that make writing
> vtkMolecule sources easier. For instance, the h1 atom above could be
> created by:
>
> vtkAtom h1 = mol->AddAtom();
> vtkNew<vtkPeriodicTable> pTab;
> h1.SetAtomicNumber([pTab->GetAtomicNumber("Hydrogen"));
> h1.SetPosition(0.0, 0.0, -0.5);
>
> We also wanted to perform vector operations more easily when
> constructing / analyzing molecules, so vtkVector is getting an
> upgrade. The changes to the vtkVector API enables more flexible
> specification of, for instance, the atomic position of h2 from the
> earlier example:
>
> vtkAtom h2 = mol->AddAtom();
> h2.SetAtomicNumber(pTab->GetAtomicNumber("h"));
> vtkVector3d displacement (0.0, 0.0, 1.0);
> h2.SetPosition(h1.GetPositionAsVector3d() + displacement);
>
> The other major class in the vtkChemistry kit is vtkMoleculeMapper,
> which provides a simple way to render a molecule using standard
> methods, as well customization options to create more complex
> renderings. Mapping of atoms to their familar colors is handled by
> accessing the Blue Obelisk rgb data through vtkPeriodicTable. I put
> together some of the test images from the vtkChemistry unit tests in
> my blog to show some of the standard rendering styles[3], as well as
> some more complex examples of what can be done. I've also added a
> basic CML file reader, vtkCMLMoleculeReader, so an entire pipeline
> (stopping at actor) to render a molecule can be as simple as:
>
>  vtkNew<vtkCMLMoleculeReader> cmlSource;
>  cmlSource->SetFileName("path to my cml file");
>
>  vtkNew<vtkMoleculeMapper> molmapper;
>  molmapper->SetInput(cmlSource->GetOutput());
>  molmapper->UseBallAndStickSettings();
>
>  vtkNew<vtkActor> actor;
>  actor->SetMapper(molmapper.GetPointer());
>  ...
>
> The vtkMoleculeMapper currently creates and replays display lists
> using vtkGlyph3DMapper to render the molecules quickly. We may be
> extending it to use point sprites when rendering larger molecules
> later in the project, too.
>
> This week I've started working on electronic structure visualization,
> which is essentially manipulating 3D vtkImageData that are created by
> sampling the molecule's electronic wavefunctions. Interfacing Marcus's
> OpenQube library to vtkChemistry is my first goal, then we'll add some
> custom mapping functionality to simplify and tune the
> selection/generation of these data sets.
>
> The code is on github if anyone is interested[1], I welcome any and
> all feedback!
>
> Dave
>
> [1] http://github.com/dlonie/VTK/tree/chemistry-unstable
> [2] http://sourceforge.net/projects/bodr/
> [3]
> http://davidlonie.blogspot.com/2011/06/overdue-update-gsocvtkchemistry.html
> _______________________________________________
> Powered by www.kitware.com
>
> Visit other Kitware open-source projects at
> http://www.kitware.com/opensource/opensource.html
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtk-developers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20110628/2a2aa9eb/attachment.html>


More information about the vtk-developers mailing list