Hey all,<div><br></div><div><div>What&#39;s the recommended best practice when appending inside of a loop with vtkAppendPolyData? Searching the archives gives me conflicting information.</div><div>The following works for me, but I don&#39;t really like it. Is there a cleaner/better way?</div>
<div>//////////////////////////////////////////</div><div><div>vtkSmartPointer&lt;vtkExtractGeometry&gt; extract_geometry = vtkSmartPointer&lt;vtkExtractGeometry&gt;::New ();</div><div>extract_geometry-&gt;SetImplicitFunction (frustum);</div>
</div><div><br></div><div><div>vtkSmartPointer&lt;vtkVertexGlyphFilter&gt; glyph_filter = vtkSmartPointer&lt;vtkVertexGlyphFilter&gt;::New ();</div><div>glyph_filter-&gt;SetInputConnection (extract_geometry-&gt;GetOutputPort ());</div>
</div><div><br></div><div>vtkSmartPointer&lt;vtkAppendPolyData&gt; append = vtkAppendPolyData::New ();</div><div><br></div><div>for (...)</div><div>{</div><div> ...</div><div><div>  extract_geometry-&gt;SetInput (poly_data);</div>
<div>        </div><div>  vtkPolyData* selected = vtkPolyData::New ();</div><div>  glyph_filter-&gt;SetOutput (selected);</div><div>  glyph_filter-&gt;Update ();</div><div>  selected-&gt;SetSource (0);</div></div><div>  append-&gt;AddInput (selected);</div>
<div>}</div><div>append-&gt;Update ();</div><div>////////////////////////////////////////////////</div><div><br></div><div>If append only does a shallow copy, this seems like it should actually be fairly efficient, right?</div>
<div>It also doesn&#39;t leak any memory as far as I can tell.</div><div><br></div><div>I just think it&#39;s kind of ugly...</div><div><br></div><div>Thanks for any help,</div><div><br></div><div>Jeremie Papon</div><div>
<br></div><br><br>
</div>