[vtkusers] visualizing a vtkRectilinearGrid

ALIZIER Julien AUSY julien.alizier-ausy at irsn.fr
Fri Jun 4 03:25:09 EDT 2004


Hi Tom, hi all,

I had a similar problem few months ago when I was testing rectilinear grids.
I had to call these lines (//***) in my constructor (without them I was
getting a segmentation fault ):

vtkRectilinearGrid * myoutput = vtkRectilinearGrid::New();
myoutput->SetDimensions(4,5,6);
//myoutput->UpdateInformation();   //*** I can't remember if that one is
really needed
myoutput->SetWholeExtent(0, 1, 0, 2, 0, 3); //*** This one is IMPORTANT


Hope this helps

-- Julien


-----Message d'origine-----
De : tom fogal [mailto:tfogal at apollo.sr.unh.edu]
Envoyé : jeudi 3 juin 2004 18:42
À : vtkusers at vtk.org
Objet : [vtkusers] visualizing a vtkRectilinearGrid


Hi all, I've managed to create a vtk object for loading a new data
format that my group uses. It's derived from vtkRectilinearGridSource,
and I can't seem to find a good way to visualize the output so that
I can see if I actually got things loaded correctly =)

I set the output within the object with code like the following:

---
vtkRectilinearGrid *output = (vtkRectilinearGrid*) this->GetOutput()
output->SetDimensions(x,y,z);
output->SetXCoordinates(data[0]);
output->SetYCoordinates(data[1]);
output->SetZCoordinates(data[2]);
---

where data is declared like 'vtkFloatArray *data[3]'. I can print out
the data within the array and they seem to be good; for example,
'print data[0]->Array[0]' works fine (and has the correct data) in
gdb.

In an attempt to visualize , I create a vtkRectilinearGridGeometryFilter
and SetInput() from my Reader's GetOutput(). A PolyDataMapper gets its
input from the GeometryFilter's output, and that gets passed to an
actor, to a renderer and then displayed.

Only I get a segmentation fault when trying to Execute() the filter.
It eventually ends up that down in vtkRectilinearGrid::GetPoint I have
'XCoordinates' as a NULL pointer and it is dereferenced.

Am I doing something wrong here, or forgetting to set some component
of my rectilinear grid? I was hoping to get some sort of IsoSurface
but I'd settle for just about anything showing up on my screen at this
point.

Any ideas would be greatly appreciated.

-tom
_______________________________________________
This is the private VTK discussion list. 
Please keep messages on-topic. Check the FAQ at:
<http://public.kitware.com/cgi-bin/vtkfaq>
Follow this link to subscribe/unsubscribe:
http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list