[vtkusers] What's wrong with my script?

s comp sscomp2004 at yahoo.com.au
Tue Oct 19 22:44:11 EDT 2004


HI Charles,
 
Thanks for the advice, but I'm not sure how to go about creating these "extraction" modules, I tried by creating two separate readers that both read from the same file, but this did not work either, I really think it should, but I am very much a begginer in VTK so I don't understand how everything works yet.
 
Thanks,
 
Sonam

Charles Boivin <Charles.Boivin at rwdiwest.com> wrote:
Hi Sonam,

I am no VTK expert, but here is where I think the source of your
problem is:

Look at:

vtkContourFilter cf
cf SetInput [$octreeSource GetOutput]
cf SetValue 0 0

and:

vtkContourFilter cf2
cf2 SetInput [$octreeSource GetOutput]
cf2 SetValue 0 0


You set the input of both cf and cf2 to the output of octreeSource.
That output is a pointer. By calling octreeSource->SetScalarsName(), you
change the values that are referenced by that pointer, but the pointer
itself does *not* change. Are both contours of the second scalar? If
that is the case, it confirms what I was thinking... Basically, the
contour filter does not store which scalar is active when you make a
call to its SetInput. It simply copies the pointer, and will do the
actual contouring on the active scalar at the moment it is computed
(which, presumably, will be at the same time for both contour filters).

The way I've handled this (on both structured and unstructured grids),
is by writing a filter that extracts a single array out of multiple
ones. By using, say two, "extraction" modules, each of their GetOutput()
*is* different, and I can then display separate values. Now, this might
not be the most efficient way to do things, but this module actually
does a few more things for me, so that's the way I have done things.

Hope this helps,

Charles Boivin





---------------------------------
Find local movie times and trailers on Yahoo! Movies.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20041020/870879c9/attachment.htm>


More information about the vtkusers mailing list