[vtkusers] OfficeTubes.tcl - TCL vs. C++ Anomaly

Divya Rathore divyaksr at iitk.ac.in
Mon Sep 5 04:10:07 EDT 2005


Just a thought..

Could it be that straight typecasting to (vtkDataSet *)  as in:

streamer->SetSource((vtkDataSet *)seeds->GetOutput());

be causing the problem? To be noted is that SetSource accepts vtkDataSet* 
and Getoutput returns vtkPolyData*

warm regards,
D. Rathore


----- Original Message ----- 
From: "Divya Rathore" <divyaksr at iitk.ac.in>
To: <vtkusers at vtk.org>
Sent: Monday, September 05, 2005 12:59 PM
Subject: [vtkusers] OfficeTubes.tcl - TCL vs. C++ Anomaly


> Dear Folks,
>
>    Kindly excuse me for re-posting this mail but I wanted to get clarified 
> about a few doubts of mine. It would be really nice if some user or 
> somebody form Kitware could attend to this problem of mine.
>
> I tried to convert officeTubes.tcl to a C++ program using MS VC++ 6.0. It 
> seems that the C++ version gets different start points than the TCL 
> version and hence the stream-tubes.
>
> I digged further and found that 'officeTube.tcl' when converted to C++ 
> works perfectly fine. So we see that the following lines in 
> 'officeTubes.tcl' could be causing the problem:
>
> -----
> vtkPointSource seeds
>    seeds SetRadius 0.15
>    eval seeds SetCenter 0.1 2.1 0.5
>    seeds SetNumberOfPoints 6
> ..
> ..
> ..
> vtkStreamLine streamer
>    streamer SetInput [reader GetOutput]
>    streamer SetSource [seeds GetOutput]
> -----
>
> How exactly does the class vtkPointSource generates 6 points inside a 
> sphere of given center and radius? Is it random? If so, is that what is 
> causing the problem in TCL to C++ conversion of 'officeTubes.tcl' and and 
> that 'officeTube.tcl' doesn't use this makes it work?
>
> It would be really nice if some user or somebody form Kitware could attend 
> to this problem of mine and suggest a solution.
>
> warm regards,
> D. Rathore
>
>
>
>
> ----- Original Message ----- 
> From: "Divya Rathore" <divyaksr at iitk.ac.in>
> To: <vtkusers at vtk.org>
> Sent: Saturday, September 03, 2005 3:02 AM
> Subject: [vtkusers] TCL vs. C++
>
> Dear Users,
>
>    We tried to convert a TCL script to C++ regarding StreamTubes [Examples
> >> VisualizationAlgorithms >> TCL >> officeTubes.tcl]. What we found is
> that
> the results are different.
>
> Kindly suggest corrections in our code, if any. See attached lines of 
> code.
>
>
> warm regards,
> - D. Rathore
> - G. Bayu
>
> --
>
>
> The lines of code which we feel are causing the problem are:
> ******************
> officeTubes.TCL
> ******************
>
> vtkPointSource seeds
>    seeds SetRadius 0.15
>    eval seeds SetCenter 0.1 2.1 0.5
>    seeds SetNumberOfPoints 6
> vtkRungeKutta4 integ
> vtkStreamLine streamer
>    streamer SetInput [reader GetOutput]
>    streamer SetSource [seeds GetOutput]
>    streamer SetMaximumPropagationTime 500
>    streamer SetStepLength 0.5
>    streamer SetIntegrationStepLength 0.05
>    streamer SetIntegrationDirectionToIntegrateBothDirections
>    streamer SetIntegrator integ
>
>
>
>
> ******************
> Following is our converted C++ code.
> ******************
>
> vtkPointSource *seeds = vtkPointSource::New();
> seeds->SetRadius(0.15);
> seeds->SetCenter(0.1, 2.1, 0.5);
> seeds->SetNumberOfPoints(6);
>
> vtkRungeKutta4 *integ = vtkRungeKutta4::New();
> vtkStreamLine *streamer = vtkStreamLine::New();
> streamer->SetInput(reader->GetOutput());
>
> streamer->SetSource((vtkDataSet *)seeds->GetOutput());
>
> streamer->SetMaximumPropagationTime(500);
> streamer->SetStepLength(0.5);
> streamer->SetIntegrationStepLength(0.05);
> streamer->SetIntegrationDirectionToIntegrateBothDirections();
> streamer->SetIntegrator(integ);
>
>
>
>
> _______________________________________________
> 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
> 





More information about the vtkusers mailing list