[vtkusers] Questions about vtkMolecules

Edson Contreras Cárdenas edrecon at gmail.com
Fri Mar 10 12:35:39 EST 2017


Hello world!

I'm working in a project where we used to display "atomistic data" as a
combination of vtkUnstructuredGrid points + vtkGlyph. However, now I have
to display bonds in between them and I realized that there is a class that
already does this (and much faster), but I have some questions in order to
use it appropiately, so please, I need your help.


1.- Custom colors for atoms
As I read in this github commit
<https://gitlab.kitware.com/vtk/vtk/commit/69bb2b15d94a7d20cc281501c4386271c39c3956>
there is a way to change vtkMoleculeMapper's color array and I was not able
to do it, so please can you tell me how to achieve this :-). I tried
several ways with no success. My idea is to specify specific rgb colors to
atoms no matter their atomic number (in order to display zones of data)


2.- Cell picking (mixed polydata actors and molecule actors)
As I explained above, I was using vtkUnstructuredGrid points + vtkGlyphs
and that also mixed with polydata in something like attached picture
(molecule_box.png). The image consists in a vtkMolecule ->
vtkMoleculeMapper -> vtkActor and vtkCubeSource -> vtkMapper -> vtkActor
displayed together in the same vtkRenderer. The problem is that if a use
something like:

vtkCellPicker* picker = vtkCellPicker::New();
if( picker->Pick( screen[0], screen[1], 0.0, m_renderer ) )
{
// detect cube face
}

It crashes extracting mappers input as vtkPolyData (of vtkMolecule actors)
so, do you have a clue of how to overcome it? Can I exclude actors in
vtkCellPicker to not check for Molecule actors? Should I use other actor
and/or picker?


3.- Dataset values in Atoms
Is there any way of add vtkPointData and/or vtkCellData to a vtkAtom in
order to visualize gradients later with a vtkContourBand or something like
that? My idea is to visualize experimental potential energy and kinetic
energy.

Thanks in advance for your support.

P.D.: I have been developing a very simple port of my project as an
opensource application, for detecting memory leaks and bad practices. The
attached picture comes from there. it can be found under:
https://github.com/zxnord/Qt4VTK7SimpleViewer
-- 
Atte.
Edson René Contreras Cárdenas
Ingeniero Civil Electrónico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170310/829b0eec/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: molecule_box.png
Type: image/png
Size: 43661 bytes
Desc: not available
URL: <http://public.kitware.com/pipermail/vtkusers/attachments/20170310/829b0eec/attachment.png>


More information about the vtkusers mailing list