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

                                          
_______________________________________________
Powered by www.kitware.com

Visit other Kitware open-source projects at 
http://www.kitware.com/opensource/opensource.html

Please keep messages on-topic and check the ParaView Wiki at: 
http://paraview.org/Wiki/ParaView

Follow this link to subscribe/unsubscribe:
http://www.paraview.org/mailman/listinfo/paraview

Reply via email to