[vtkusers] Saving Polydata

Michael Györffy 4mg19 at qlink.queensu.ca
Wed Apr 24 16:49:20 EDT 2002


Thank you Rasmus:

	I have tried your suggestion and it still doesn't work.

	Here is the layout of my program:
I have a FOR loop that calls:
	vtkSpheresource,
	vtkTransform,
	vtkTransformPolyDataFilter,
	vtkAppendPolyData
	and finally vtkPolyDataMapper.

	This loop runs for a desired number for ellipsoids and rendering it looks
great!

	I then wish to limit the range of the data set with:

vtkClipPolyData *clipper=vtkClipPolyData::New();
    clipper->SetInput[appendSpheres->GetOutput()];
    clipper->SetClipFunction(plane1);
etc...

where "appendSpheres" is the appended polydata and use:

vtkPolyDataWriter *writer=vtkPolyDataWriter::New();
	writer->SetInput(clipper->GetOutput());
        writer->SetFileName("3Dimage.dat");
        writer->write();

The error I keep getting is:
"DynamicMem.c:248: invalid types `{unknown type}[vtkPolyData *]' for
array subscript"

Where line 248 is "clipper->SetInput[appendSpheres->GetOutput()];". If I
ignore Clipping the data and use the similar statement in the writer, the
one you suggested, I get
the same error.

I don't think the writer or clipper is recognising that vtkAppendPolyData
is PolyData.
How should I convert what I've generated into Polydata? Or what
alternatives saving methods do I have?

I am running VTK 4.0 with Linex redhat.

Thank you again,

Mike




On Wed, 24 Apr 2002, Rasmus Reinhold Paulsen wrote:

>
> On Wed, 24 Apr 2002, Michael Györffy wrote:
>
> > 	What should I do with AppendPolyData to save it as a dataset?
> > Currently, I am trying to send it to vtkPolyDataWriter or vtkDataSetWriter
> > and this generates errors as the writer doesn't know what to do with
> > AppendPolyData.
>
> Use the GetOutput() method from your AppendPolyData object. f.ex.
>
> ...
> writer->SetInput(append->GetOutput());
> ...
>
> where writer is a vtkPolyDataWriter object
>
> regards
> Rasmus
>




More information about the vtkusers mailing list