[vtkusers] X-Y Plots problem

Lledo Museros Cabedo lledo.museros at itc.uji.es
Mon Apr 30 06:51:45 EDT 2007


Hello,
 
I am new using VTK, therefore I am reading the VTK books and trying to
do examples. I have written the example xyPlot.tcl (which is in
VTK/Examples/Annotation/TCl/) in C++, and now I have a compiler error
which I do not know how to solve. The error says that
'vtkProbeFilter::SetSource' : cannot translate the parameter from
'vtkStructuredGrid *' to 'vtkDataObject *'. I have read the doxygen
manuals and in fact SetSource needs as parameter a vtkDataObject but
GetOutput from a vtkPLOT3DReader returns a vtkStructuredGrid. 

I send the part of the code pointing out where the error is:

//
// Create a PLOT3D reader and load the data.
//

vtkPLOT3DReader *pl3d=vtkPLOT3DReader::New();
pl3d->SetXYZFileName("C:/VTKData/Data/combxyz.bin");
pl3d->SetQFileName("C:/VTKData/Data/combq.bin");
pl3d->SetScalarFunctionNumber(100);
pl3d->SetVectorFunctionNumber(202);
pl3d->Update();

// Create three the line source to use for the probe lines.
vtkLineSource *line=vtkLineSource::New();
line->SetResolution(30);

// Move the line into place and create the probe filter. For
vtkProbeFilter, // the probe line is the input, and the underlying data
set is the source.

vtkTransform *transL1=vtkTransform::New();
transL1->Translate(3.7, 0.0, 28.37);
transL1->Scale(5,5,5);
transL1->RotateY(90);
vtkTransformPolyDataFilter *tf=vtkTransformPolyDataFilter::New();
tf->SetInputConnection(line->GetOutputPort());
tf->SetTransform(transL1);
vtkProbeFilter *probe=vtkProbeFilter::New();
probe->SetInputConnection(tf->GetOutputPort());
probe->SetSource(pl3d->GetOutput());   ----> In this line is the ERROR.

Can anyone help me?

Thank you in advance. 

Best regards,
LLEDO







More information about the vtkusers mailing list