<div class="gmail_quote">2010/2/22 Jordi GutiĆ©rrez Hermoso <span dir="ltr">&lt;<a href="mailto:jordigh@gmail.com">jordigh@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
I have code like this in a class:<br>
<br>
    //add the grid points to the polydata object<br>
    vtkSmartPointer&lt;vtkPolyData&gt; polydata = vtkPolyData::New();<br>
    polydata-&gt;SetPoints(points);<br>
    polydata-&gt;GetPointData() -&gt; SetScalars(scalars);<br>
<br>
    //triangulate the grid points<br>
    vtkSmartPointer&lt;vtkDelaunay2D&gt; delaunay = vtkDelaunay2D::New();<br>
    delaunay-&gt;SetInput(polydata);<br>
    delaunay-&gt;Update();<br>
<br>
And later this goes through the pipeline until I generate a plot.<br>
<br>
I want to plot a moving surface, so that the polydata object needs to<br>
be updated but only the z-coordinates, so that the actual Delaunay<br>
triangulation shouldn&#39;t have to be computed again.<br>
<br>
How can I update the polydata object with new points and scalars<br>
without recomputing a Delaunay triangulation?<br>
<br>
Thanks,<br>
- Jordi G. H.<br><br></blockquote><div class="gmail_quote"><br></div><div class="gmail_quote">First, this:</div><div class="gmail_quote">   vtkSmartPointer&lt;vtkPolyData&gt; polydata = vtkPolyData::New();</div><div class="gmail_quote">
<br></div><div class="gmail_quote">is very bad. You must use</div>   vtkSmartPointer&lt;vtkPolyData&gt; polydata = vtkSmartPointer&lt;vtkPolyData&gt;::New();<br clear="all"><br></div><div class="gmail_quote">It shouldn&#39;t be a problem to do what you are asking, I think you can just get the output of the Delaunay filter and update its points:</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">vtkPolyData* output = delaunay-&gt;GetOutput();</div><div class="gmail_quote">output-&gt;SetPoints(newPoints);</div><div class="gmail_quote">output-&gt;GetPointData()-&gt;SetScalars(newScalars);</div>
<div class="gmail_quote"><br></div><div class="gmail_quote">Maybe I misunderstood your question?</div><div class="gmail_quote"><br></div><div class="gmail_quote">Thanks,<br><br><div>David </div></div>