Output is generated when filter is executed either through the pipeline or calling Update().<br>This why it is important to see the code.<br><br>For debugging purposes remove all irrelevant code. For example create polydata manually. <br>
This would also allow to post questions with self-sufficient test code.<br><br>As far as I can see there is no any problem with RequestData implementation.<br>To proof it - check any available vtk polydata filter ( for example vtkTriangleFilter )which looks like exactly as yours.<br>
It might be different for vtk version 5 though. If it is the case check source code of version you have installed.<br><br>Alex<br><br><br><br><div class="gmail_quote">On Wed, Nov 21, 2012 at 2:54 PM, Nico Schertler <span dir="ltr"><<a href="mailto:nico.schertler@studentpartners.de" target="_blank">nico.schertler@studentpartners.de</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div link="blue" vlink="purple" lang="DE">
<div>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">Hi
Alex,<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">to
answer your questions. Of course, I provided input to the Delaunay filter. But because this is not directly connected to the problem and it would require introduction to some other classes and so on, I decided to omit this in the question. But I stated that
the filter has an output which I could render. Furthermore, I am able to work on the output (as I would do in the filter) and produce a vtkImageData directly (without the filter). So there must be something wrong with passing the output to the filter.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">I
will implement the static New() if everything else works. For now, it is just a test class.<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US">Nico<u></u><u></u></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri","sans-serif";color:#1f497d" lang="EN-US"><u></u> <u></u></span></p>
<p class="MsoNormal"><a name="13b253d63994f01f__MailOriginal"><b><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">Von:</span></b></a><span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"">
<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a> [mailto:<a href="mailto:vtkusers-bounces@vtk.org" target="_blank">vtkusers-bounces@vtk.org</a>] <b>Im Auftrag von </b>
Alex Malyushytskyy<br>
<b>Gesendet:</b> Mittwoch, 21. </span></span><span><span style="font-size:11.0pt;font-family:"Calibri","sans-serif"" lang="EN-US">November 2012 23:34<br>
<b>An:</b> <a href="mailto:vtkusers@vtk.org" target="_blank">vtkusers@vtk.org</a><br>
<b>Betreff:</b> Re: [vtkusers] Polydata input to filter is not set<u></u><u></u></span></span></p><div><div class="h5">
<p class="MsoNormal"><span><span lang="EN-US"><u></u> <u></u></span></span></p>
<p class="MsoNormal" style="margin-bottom:12.0pt"><span><span lang="EN-US">There is no enough information in your post to reproduce or understand the problem.<br>
For example I believe there are cases when </span></span><span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">vtkDelaunay2D
</span></span><span><span lang="EN-US"><br>
will produce empty output.<br>
More of that it is not even clear that you provide any input to </span></span><span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">vtkDelaunay2D and update it.</span></span><span><span lang="EN-US"><br>
And I am not great in guessing.<br>
<br>
What I would highly recommend, if you derive class from vtk class,<br>
follow the vtk guidelines. <br>
If you did this you would never be able to write:<br>
</span></span><span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">MeshToRGBFilter* rgbFilter =
<span style="color:blue">new</span> MeshToRGBFilter();<br>
<br>
Alex<br>
<u></u><br>
<u></u></span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
</div></div><div><div><div class="h5">
<p class="MsoNormal"><span><span lang="EN-US">On Wed, Nov 21, 2012 at 2:02 AM, Nico Schertler <</span></span><a href="mailto:nico.schertler@studentpartners.de" target="_blank"><span><span lang="EN-US">nico.schertler@studentpartners.de</span></span><span></span></a><span><span lang="EN-US">>
wrote:<u></u><u></u></span></span></p>
</div></div><blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0cm 0cm 0cm 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0cm;margin-bottom:5.0pt">
<div>
<div><div><div class="h5">
<p class="MsoNormal"><span><span lang="EN-US">Hi,<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US"> <u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US">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:<u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas;color:blue" lang="EN-US"> </span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas;color:blue" lang="EN-US">int</span></span><span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">
MeshToRGBFilter::FillInputPortInformation(<span style="color:blue">int</span> port, vtkInformation* info)</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">{</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US"> info->Set(vtkAlgorithm::INPUT_REQUIRED_DATA_TYPE(),
<span style="color:#a31515">"vtkPolyData"</span>);</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">
<span style="color:blue">return</span> 1;</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">}</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US"> <u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US">I connect the filter to a vtkDelaunay2D like this:<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US"> <u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">vtkSmartPointer<vtkDelaunay2D> delaunay = vtkSmartPointer <vtkDelaunay2D>::New();</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas;color:green" lang="EN-US">//...</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">MeshToRGBFilter* rgbFilter =
<span style="color:blue">new</span> MeshToRGBFilter();</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">rgbFilter->SetInputConnection(delaunay->GetOutputPort());</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US"> <u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US">The Delaunay filter definitely has an output. I confirmed that by rendering it.<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US">In the filter, in RequestData, I want to access the polydata from the Delaunay pass like
this:<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US"> <u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas;color:blue" lang="EN-US">int</span></span><span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">
MeshToRGBFilter::RequestData(</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US"> vtkInformation *vtkNotUsed(request),</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US"> vtkInformationVector **inputVector,</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US"> vtkInformationVector *outputVector)</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US">{</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US"> vtkInformation *inInfo = inputVector[0]->GetInformationObject(0);</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US"> vtkPolyData* input = vtkPolyData::SafeDownCast(</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal" style="text-autospace:none">
<span><span style="font-size:9.5pt;font-family:Consolas" lang="EN-US"> inInfo->Get(vtkDataObject::DATA_OBJECT()));</span></span><span><span lang="EN-US"><u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US"> <u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US">The input variable is then set to an instance of a vtkPolyData, but it contains just
nothing:<u></u><u></u></span></span></p>
</div></div><p class="MsoNormal"><span><span><img src="cid:image001.png@01CDC842.A1A38F60" alt="cid:image001.png@01CDC842.A1A38F60" border="0" height="188" width="716"></span><u></u><u></u></span></p><div class="im">
<p class="MsoNormal"><span><span lang="EN-US"> <u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span lang="EN-US">Is there something I might have missed? How can I access the poly data?<u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="color:#888888" lang="EN-US"> <u></u><u></u></span></span></p>
<p class="MsoNormal"><span><span style="color:#888888" lang="EN-US">Nico<u></u><u></u></span></span></p>
</div></div>
</div><div class="im">
<p class="MsoNormal" style="margin-bottom:12.0pt"><span><span lang="EN-US"><br>
_______________________________________________<br>
Powered by </span></span><a href="http://www.kitware.com" target="_blank"><span><span lang="EN-US">www.kitware.com</span></span><span></span></a><span><span lang="EN-US"><br>
<br>
Visit other Kitware open-source projects at </span></span><a href="http://www.kitware.com/opensource/opensource.html" target="_blank"><span><span lang="EN-US">http://www.kitware.com/opensource/opensource.html</span></span><span></span></a><span><span lang="EN-US"><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: </span></span><a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank"><span><span lang="EN-US">http://www.vtk.org/Wiki/VTK_FAQ</span></span><span></span></a><span><span lang="EN-US"><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
</span></span><a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank"><span><span lang="EN-US">http://www.vtk.org/mailman/listinfo/vtkusers</span></span><span></span></a><span><span lang="EN-US"><u></u><u></u></span></span></p>
</div></blockquote>
</div>
<span></span>
<p class="MsoNormal"><span lang="EN-US"><u></u> <u></u></span></p>
</div>
</div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the VTK FAQ at: <a href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">http://www.vtk.org/Wiki/VTK_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers</a><br>
<br></blockquote></div><br>