[Paraview] problems creating a Rectilinear Grid

Natalie Happenhofer nataliehapp at hotmail.com
Fri Aug 20 09:55:00 EDT 2010


Hi!

I am writing a filter which should calculate the horizontal average of a given dataset and display it as a function of depth. In my case, the x-coordinate specifies the radius and therefore the depth. 

 I chose the output to be a rectilinear grid and tried to set it like this:

vtkInformation* outInfo = outputVector -> GetInformationObject(0);
 vtkRectilinearGrid* output = vtkRectilinearGrid::SafeDownCast(outInfo -> Get(vtkDataObject::DATA_OBJECT()));

//calculating the horizontal average

output -> SetDimensions(dims[0],1,1);
output -> SetXCoordinates(xCoord);
output -> SetYCoordinates(yCoord);
output -> SetZCoordinates(zCoord);

output -> GetPointData() -> AddArray(horizontal);
output -> Squeeze();

dims[0] is the dimension in x-direction I get from the input, xCoord, yCoord and zCoord are of the type vtkFloatArray and contain the coordinates in the according direction. I compared their number of tuples to  the dimensions I specified - they agree. 

Lamentably, I get a segmentation fault setting the dimensions in the output array. Did I forget to specify something? Does specifying the dimensions and the Coordinates not suffice to determine the Rectilinear Grid?

Once the Array is set, I would like to call the PlotData -filter or something that creates a cartesian grid and draws my function. How do I do that?

Thanks a lot and have a nice weekend,
Natalie

 		 	   		  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.paraview.org/pipermail/paraview/attachments/20100820/8cd897c9/attachment.htm>


More information about the ParaView mailing list