[vtkusers] Polydata input to filter is not set

Alex Malyushytskyy alexmalvtk at gmail.com
Wed Nov 21 17:33:59 EST 2012


There is no enough information in your post to reproduce or understand  the
problem.
For example I believe there are cases when vtkDelaunay2D
will produce empty output.
More of that it is not even clear that you provide any input to vtkDelaunay2D
and update it.
And I am not great in guessing.

What I would highly recommend, if you derive class from vtk class,
follow the vtk guidelines.
If you did this you would never be able to write:
MeshToRGBFilter* rgbFilter = new MeshToRGBFilter();

Alex


On Wed, Nov 21, 2012 at 2:02 AM, Nico Schertler <
nico.schertler at studentpartners.de> wrote:

>  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:****
>
> ****
>
> ** **
>
> Is there something I might have missed? How can I access the poly data?***
> *
>
> ** **
>
> Nico****
>
> _______________________________________________
> 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 VTK FAQ at:
> http://www.vtk.org/Wiki/VTK_FAQ
>
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121121/ca80031a/attachment.htm>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: image/png
Size: 16888 bytes
Desc: not available
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121121/ca80031a/attachment.png>


More information about the vtkusers mailing list