<html><head><style type='text/css'>p { margin: 0; }</style></head><body><div style='font-family: arial,helvetica,sans-serif; font-size: 10pt; color: #000000'><span style="color: rgb(0, 0, 0);">Hi All,<br><br>I have a dumb question - how do I used vtkSmoothPolyDataFilter with...errr... polydata?<br><br>I am trying to do the equivalent of :<br></span><a style="color: rgb(0, 0, 0);" href="http://www.paraview.org/Wiki/VTK/Examples/Cxx/PolyData/ConvexHullShrinkWrap">http://www.paraview.org/Wiki/VTK/Examples/Cxx/PolyData/ConvexHullShrinkWrap</a><br style="color: rgb(0, 0, 0);"><br style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 0);">But instead of using a point source I want to load an STL and get points from that. Seems that vtkSmoothPolyDataFilter only likes <span style="color: rgb(0, 0, 0);">vtkAlgorithmOutput and not actual concrete data. Is there an easy way to make this work?</span><br style="color: rgb(0, 0, 0);"><br style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 0);">Here is my code as reference.</span><br style="color: rgb(0, 0, 0);"><br style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 0);">Cheers,</span><br style="color: rgb(0, 0, 0);"><br style="color: rgb(0, 0, 0);"><span style="color: rgb(0, 0, 0);">Paul</span><br></span><span style="color: rgb(0, 0, 128);"><br><br>#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkSmartPointer.h></span>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkPolyData.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkSphereSource.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkPointSource.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkSmoothPolyDataFilter.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkXMLPolyDataWriter.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkSTLReader.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkActor.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkRenderWindow.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkRenderer.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkRenderWindowInteractor.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkPolyDataMapper.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkCamera.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkWeightedTransformFilter.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkXMLUnstructuredGridReader.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkUnstructuredGrid.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkXMLPolyDataReader.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkDataSetMapper.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><vtkDataSetSurfaceFilter.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">C/C++</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><iostream></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><sstream></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 128);">#include</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><stdio.h></span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(128, 128, 0);">using</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">namespace</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span><span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">just</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">to</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">make</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">things</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">nicer</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">later</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">and</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">save</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">some</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">documentation</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">reading</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">;)</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(128, 128, 0);">struct</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">boundingBox</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">{</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">xmin</span><span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">xmax</span><span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">ymin</span><span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">ymax</span><span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">zmin</span><span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 0);">zmax</span><span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 0);">};</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span>main<span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(128, 128, 0);">int</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">argc</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">char</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">*</span><span style="color: rgb(0, 0, 0);">argv</span><span style="color: rgb(0, 0, 0);">[])</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 0);">{</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">check</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">and</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">get</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">options</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">provided</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">if</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">argc</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">!=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 128);">2</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">)</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">{</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span>cout<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"Required</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">parameters:"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span>endl<span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span>cout<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Filename</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">(Full</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">path</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">to</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">stl</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">file</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">e.g.</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">something.stl)"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span>endl<span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">cout</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Magnification</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">(Image</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">resolution</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">size</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">multipler</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">e.g.</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">2)"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">endl;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">cout</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">x</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">(x</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">camera</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">offset</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">position</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">from</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">centre)"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">endl;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">cout</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">y</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">(y</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">camera</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">offset</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">position</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">from</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">centre)"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">endl;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">cout</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">z</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">(z</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">camera</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">offset</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">position</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">from</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">centre)"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">endl;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">return</span><span style="color: rgb(192, 192, 192);"> </span>EXIT_FAILURE<span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">}</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span><span style="color: rgb(0, 0, 0);">::</span><span style="color: rgb(128, 0, 128);">string</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">inputfile</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">argv</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 128);">1</span><span style="color: rgb(0, 0, 0);">];</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">Read</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">STL</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span><span style="color: rgb(0, 0, 0);">::</span>cout<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"Reading:</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">inputfile</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span><span style="color: rgb(0, 0, 0);">::</span>endl<span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkSTLReader</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">stlReader</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkSTLReader</span><span style="color: rgb(0, 0, 0);">>::</span>New<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">stlReader</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetFileName</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">inputfile</span><span style="color: rgb(0, 0, 0);">.</span>c_str<span style="color: rgb(0, 0, 0);">());</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkPolyData</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">polydata</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkPolyData</span><span style="color: rgb(0, 0, 0);">>::</span>New<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">polydata</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">stlReader</span><span style="color: rgb(0, 0, 0);">-></span>GetOutput<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">stlReader</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">Update</span><span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkDataSetMapper</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">mapper</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkDataSetMapper</span><span style="color: rgb(0, 0, 0);">>::</span>New<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">mapper</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetInputConnection</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">stlReader</span><span style="color: rgb(0, 0, 0);">-></span>GetOutputPort<span style="color: rgb(0, 0, 0);">());</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">bounding</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">box</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">will</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">tell</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">us</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">where</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">object</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">is</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">and</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">how</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">big</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">it</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">is...</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">centre</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 128);">3</span><span style="color: rgb(0, 0, 0);">];</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">bounds</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 128);">6</span><span style="color: rgb(0, 0, 0);">];</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">double</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">results</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 128);">3</span><span style="color: rgb(0, 0, 0);">];</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">boundingBox</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">boxBounds</span><span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">mapper</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">GetBounds</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">bounds</span><span style="color: rgb(0, 0, 0);">);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">mapper</span><span style="color: rgb(0, 0, 0);">-></span>GetCenter<span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">centre</span><span style="color: rgb(0, 0, 0);">);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">boxBounds</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(128, 0, 0);">xmin</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">bounds</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">];</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">boxBounds</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(128, 0, 0);">xmax</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">bounds</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 128);">1</span><span style="color: rgb(0, 0, 0);">];</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">boxBounds</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(128, 0, 0);">ymin</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">bounds</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 128);">2</span><span style="color: rgb(0, 0, 0);">];</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">boxBounds</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(128, 0, 0);">ymax</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">bounds</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 128);">3</span><span style="color: rgb(0, 0, 0);">];</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">boxBounds</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(128, 0, 0);">zmin</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">bounds</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 128);">4</span><span style="color: rgb(0, 0, 0);">];</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">boxBounds</span><span style="color: rgb(0, 0, 0);">.</span><span style="color: rgb(128, 0, 0);">zmax</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">bounds</span><span style="color: rgb(0, 0, 0);">[</span><span style="color: rgb(0, 0, 128);">5</span><span style="color: rgb(0, 0, 0);">];</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">possibly</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">remesh</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">with</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">finer</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">detail</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">with</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">subdivide</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">filter?</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">convert</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">to</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">pointset</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">create</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">sphere</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">around</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">bounds</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">(possibly</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">transformed</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">to</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">a</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">better</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">shape?)</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">shrinkwrap</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">spit</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">out</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">the</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">result</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">as</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">an</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">stl</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span><span style="color: rgb(0, 0, 0);">::</span>cout<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"vtkSphereSource:</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span><span style="color: rgb(0, 0, 0);">::</span>endl<span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkSphereSource</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">sphereSource</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkSphereSource</span><span style="color: rgb(0, 0, 0);">>::</span>New<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">sphereSource</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetRadius</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 128);">1000</span><span style="color: rgb(0, 0, 0);">);</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">will</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">calculate</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">this</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">later</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">from</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">bounding</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">box</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">sphereSource</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetPhiResolution</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 128);">50</span><span style="color: rgb(0, 0, 0);">);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">sphereSource</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetThetaResolution</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 128);">50</span><span style="color: rgb(0, 0, 0);">);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">sphereSource</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetCenter</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">centre</span><span style="color: rgb(0, 0, 0);">);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">sphereSource</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">Update</span><span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">vtkSmartPointer<vtkPointSource></span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">pointSource</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">vtkSmartPointer<vtkPointSource>::New();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">pointSource->SetNumberOfPoints(40);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">pointSource->SetRadius(2);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 128, 0);">//</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">pointSource->Update();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">{</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkXMLPolyDataWriter</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkXMLPolyDataWriter</span><span style="color: rgb(0, 0, 0);">>::</span>New<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetFileName</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 128, 0);">"input.vtp"</span><span style="color: rgb(0, 0, 0);">);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetInputConnection</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">sphereSource</span><span style="color: rgb(0, 0, 0);">-></span>GetOutputPort<span style="color: rgb(0, 0, 0);">());</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(0, 0, 0);">-></span>Write<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">}</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">{</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkXMLPolyDataWriter</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkXMLPolyDataWriter</span><span style="color: rgb(0, 0, 0);">>::</span>New<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetFileName</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 128, 0);">"points.vtp"</span><span style="color: rgb(0, 0, 0);">);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetInputConnection</span><span style="color: rgb(0, 0, 0);">(</span>pointSource<span style="color: rgb(0, 0, 0);">-></span>GetOutputPort<span style="color: rgb(0, 0, 0);">());</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(0, 0, 0);">-></span>Write<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">}</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span><span style="color: rgb(0, 0, 0);">::</span>cout<span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"ShrinkWrapping:</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">"</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">inputfile</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);"><<</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">std</span><span style="color: rgb(0, 0, 0);">::</span>endl<span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkSmoothPolyDataFilter</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">smoothFilter</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkSmoothPolyDataFilter</span><span style="color: rgb(0, 0, 0);">>::</span>New<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">smoothFilter</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetInputConnection</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 128);">0</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">sphereSource</span><span style="color: rgb(0, 0, 0);">-></span>GetOutputPort<span style="color: rgb(0, 0, 0);">());</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">//smoothFilter->SetInputConnection(1,</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 128, 0);">pointSource->GetOutputPort());</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">smoothFilter</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetInputConnection</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 128);">1</span><span style="color: rgb(0, 0, 0);">,</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">polydata</span><span style="color: rgb(0, 0, 0);">);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">smoothFilter</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">Update</span><span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkXMLPolyDataWriter</span><span style="color: rgb(0, 0, 0);">></span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">=</span><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 0, 128);">vtkSmartPointer</span><span style="color: rgb(0, 0, 0);"><</span><span style="color: rgb(128, 0, 128);">vtkXMLPolyDataWriter</span><span style="color: rgb(0, 0, 0);">>::</span>New<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetFileName</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 128, 0);">"output.vtp"</span><span style="color: rgb(0, 0, 0);">);</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(0, 0, 0);">-></span><span style="font-style: italic; color: rgb(0, 0, 0);">SetInputConnection</span><span style="color: rgb(0, 0, 0);">(</span><span style="color: rgb(0, 0, 0);">smoothFilter</span><span style="color: rgb(0, 0, 0);">-></span>GetOutputPort<span style="color: rgb(0, 0, 0);">());</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(0, 0, 0);">writer</span><span style="color: rgb(0, 0, 0);">-></span>Write<span style="color: rgb(0, 0, 0);">();</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(192, 192, 192);"> </span><span style="color: rgb(128, 128, 0);">return</span><span style="color: rgb(192, 192, 192);"> </span>EXIT_SUCCESS<span style="color: rgb(0, 0, 0);">;</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><span style="color: rgb(0, 0, 0);">}</span></pre>
<pre style="margin: 0px; text-indent: 0px;"><br></pre><br><br><br>-- <br><div><span name="x"></span>Dr Paul McIntosh<br> Senior HPC Consultant, Technical Lead,<br> Multi-modal Australian ScienceS Imaging and Visualisation Environment (www.massive.org.au)<br> Monash University, Ph: 9902 0439 Mob: 0434 524935<span name="x"></span><br></div></div></body></html>