[vtkusers] Polydata input to filter is not set
Nico Schertler
nico.schertler at studentpartners.de
Wed Nov 21 05:02:27 EST 2012
Hi,
I am creating a filter that takes the result of a vtkDelaunay2D and creates a vtkImageData from that. Therefore, I chose the vtkImageAlgorithm as the base class for my filter and changed the input accordingly:
int MeshToRGBFilter::FillInputPortInformation(int port, vtkInformation* info)
{
info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(), "vtkPolyData");
return 1;
}
I connect the filter to a vtkDelaunay2D like this:
vtkSmartPointer<vtkDelaunay2D> delaunay = vtkSmartPointer <vtkDelaunay2D>::New();
//...
MeshToRGBFilter* rgbFilter = new MeshToRGBFilter();
rgbFilter->SetInputConnection(delaunay->GetOutputPort());
The Delaunay filter definitely has an output. I confirmed that by rendering it.
In the filter, in RequestData, I want to access the polydata from the Delaunay pass like this:
int MeshToRGBFilter::RequestData(
vtkInformation *vtkNotUsed(request),
vtkInformationVector **inputVector,
vtkInformationVector *outputVector)
{
vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);
vtkPolyData* input = vtkPolyData::SafeDownCast(
inInfo->Get(vtkDataObject::DATA_OBJECT()));
The input variable is then set to an instance of a vtkPolyData, but it contains just nothing:
[cid:image001.png at 01CDC7D7.72920280]
Is there something I might have missed? How can I access the poly data?
Nico
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121121/a402bc66/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image001.png
Type: image/png
Size: 16888 bytes
Desc: image001.png
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121121/a402bc66/attachment.png>
More information about the vtkusers
mailing list