[vtkusers] TCL vs. C++

Divya Rathore divyaksr at iitk.ac.in
Fri Sep 2 17:32:02 EDT 2005


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);









More information about the vtkusers mailing list