[vtkusers] c++ Question, please help!

Matthew Kong mkon2233 at mail.usyd.edu.au
Sun May 18 18:46:11 EDT 2003


ctkStructuredPointsReader *eeh=ctkStructuredPointsReader::New()
eeh->SetFileName("thefile.something");

The renWin stuff should be

ren->AddActor(actor);
(along will all the other functions your using), replave the "." with "->"

And just at tip, make sure you delete all your actors, mappers, etc, otherwise 
you get silly errors at the end of the program. 

Hope this helps.

Matt



the filenames.. well they dont mean anything, but you get the point.

Matt

Quoting Sharbel Dalal <sdalal at inter.net.il>:

> I am trying to open a file in ctkStructuredPointsReader, but I don't know
> how to set the file name. 
> 
>  
> 
> I am trying to implement this script in c++ (its written in tcl - Thanks to
> Bryan Cole for giving it to me) 
> 
>  
> 
> I have created a vtkstrucutedPointsReader pointer, but I don't know how to
> set the file to it.. please help me!
> 
> See script below
> 
>  
> 
> Thanks allot
> 
>  
> 
>  
> 
> reader=vtkStructuredPointsReader()
> 
> reader.SetFileName('outputfile.vtk')
> 
>  
> 
> geom=vtkImageDataGeometryFilter()
> 
> geom.SetInput(reader.GetOutput())
> 
>  
> 
> warp=vtkWarpScalar()
> 
> warp.SetInput(geom.GetOutput())
> 
> warp.SetScaleFactor(30.0)
> 
> warp.SetNormal(1.0,0,0)
> 
>  
> 
> mapper=vtkPolyDataMapper()
> 
> mapper.SetInput(warp.GetOutput())
> 
>  
> 
> actor=vtkActor()
> 
> actor.SetMapper(mapper)
> 
>  
> 
> ren=vtkRenderer()
> 
> ren.SetBackground(0.7,0.7,0.7)
> 
> ren.AddActor(actor)
> 
>  
> 
> renwin=vtkRenderWindow()
> 
> renwin.AddRenderer(ren)
> 
>  
> 
> iren=vtkRenderWindowInteractor()
> 
> iren.SetRenderWindow(renwin)
> 
> iren.Initialize()
> 
> iren.Start()
> 
>  
> 
> 


Matthew Kong
Australian Centre for Field Robotics
A Key Centre of Teaching and Research
The Rose Street Building  J04
The University of Sydney  2006  NSW    Australia            




-------------------------------------------------
This mail sent through IMP: www-mail.usyd.edu.au



More information about the vtkusers mailing list