[vtkusers] Looping Visualization Networks

Ryan Barr ryan_barr_eac at hotmail.com
Tue Jul 1 14:02:53 EDT 2008


Thanks a lot Randall, your advice worked out great.

For anyone that is interested,  below is my solution...

in the main function, before initializing and starting the renderwindowinteractor i call

    reader= vtkDataSetReader::New();
    reader->SetFileName(argv[1]);
    ...
    transformPolyDataFilter->SetInputConnection(reader->GetOutputPort());
    ...
    transformPolyDataFilter->SetTransform(vtkIdentityTransform::New());
    transformPolyDataFilter->Update();
    polyData= vtkPolyData::New();
    polyData->DeepCopy(transformPolyDataFilter->GetOutput());
    transformPolyDataFilter->SetInput(polyData);

then in one of my callback functions i call

    transformPolyDataFilter->SetTransform(thinPlateDeform(polyData, selectedPoints, vector));
    transformPolyDataFilter->Update();
    polyData->DeepCopy(transformPolyDataFilter->GetOutput());
    transformPolyDataFilter->SetInput(polyData);

Date: Mon, 30 Jun 2008 12:59:24 -0500
From: randall.hand at gmail.com
To: ryan_barr_eac at hotmail.com
Subject: Re: [vtkusers] Looping Visualization Networks
CC: vtkusers at vtk.org

VTK5 relies very heavily on "pipelines", and everything is "pulled" from the end of the pipeline.. so if it loops, it gets stuck in an infinite loop trying to follow the pipeline back to it's source.


What you may have to do is call "GetOutput()" on the final element of your pipeline, and then perform a DeepCopy to get another dataset, and then you can delete your pipeline.  Then that copied dataset can be the input to your next pipeline.


----------------
Listening to: KT Tunstall - One Day
posted with FoxyTunes    

----------------------------------------
Randall Hand 
Visualization Scientist
ERDC MSRC-ITL


On Mon, Jun 30, 2008 at 12:46 PM, Ryan Barr <ryan_barr_eac at hotmail.com> wrote:






I am deforming a sphereSource using a vtkTransformPolyDataFilter and a
vtkThinPlateSplineTransform (thanks to Marius Erdt, Karthik Krishnan
& Miguel Rodriguez). This works fine the first time, but subsequent
deformations are applied to the original sphere and not the previous
deformed sphere. In other words, regardless of what is displayed on
screen, the deformations are being applied to a perfect sphere.



While at the moment I am handling a simple sphere of 50 points, in
the future I plan on applying this to far more complex models, so I
need a solution that will work with far more points.

In my
search for a solution I read the example in the VTK : An Object Orientated
Approach to 3D Graphics book on page 115. In this example, after the
first pass through the filter, the sphereSource is disconnected and a
filter loop is created. However, for figure 4-22, on page 115, it
states that looping visualization networks are no longer allowed as of
VTK 5.0.

When I try implementing a looping visualization network, similar to the example, I get an unhandled exception in vtkAlgorithm::ComputePipelineMTime



My questions are,
why are looping visualization networks no longer allowed?
what are we supposed to do instead?
and
are there other (better) ways of maintaining a modified model? Perhaps
I have to use ITK classes (i.e. DeformableModelSimplexMesh example in
ITK's InsightApplications)?


thank you
Are you ready for Windows Live Messenger Beta 8.5 ? Get the latest for free today!

_______________________________________________

This is the private VTK discussion list.

Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ

Follow this link to subscribe/unsubscribe:

http://www.vtk.org/mailman/listinfo/vtkusers





_________________________________________________________________
Have fun while connecting on Messenger! Click here to learn more.
http://entertainment.sympatico.msn.ca/WindowsLiveMessenger
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20080701/4b4e8c17/attachment.htm>


More information about the vtkusers mailing list