Hey all,<div><br></div><div><div>What'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't really like it. Is there a cleaner/better way?</div>
<div>//////////////////////////////////////////</div><div><div>vtkSmartPointer<vtkExtractGeometry> extract_geometry = vtkSmartPointer<vtkExtractGeometry>::New ();</div><div>extract_geometry->SetImplicitFunction (frustum);</div>
</div><div><br></div><div><div>vtkSmartPointer<vtkVertexGlyphFilter> glyph_filter = vtkSmartPointer<vtkVertexGlyphFilter>::New ();</div><div>glyph_filter->SetInputConnection (extract_geometry->GetOutputPort ());</div>
</div><div><br></div><div>vtkSmartPointer<vtkAppendPolyData> append = vtkAppendPolyData::New ();</div><div><br></div><div>for (...)</div><div>{</div><div> ...</div><div><div> extract_geometry->SetInput (poly_data);</div>
<div> </div><div> vtkPolyData* selected = vtkPolyData::New ();</div><div> glyph_filter->SetOutput (selected);</div><div> glyph_filter->Update ();</div><div> selected->SetSource (0);</div></div><div> append->AddInput (selected);</div>
<div>}</div><div>append->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't leak any memory as far as I can tell.</div><div><br></div><div>I just think it'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>