OK, I got that poly data but one I got that into the trianglefilter and then to the massproperties is where that error shows up, so what I don&#39;t get is that step between applying<br>
<div><br></div><div><span style="font-family:arial,sans-serif;font-size:13px">contourRep-&gt;</span><span style="font-family:arial,sans-serif;font-size:13px">GetContourRepresentationAsPoly</span><span style="font-family:arial,sans-serif;font-size:13px">Data()</span><br>
</div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><span style="font-family:arial,sans-serif;font-size:13px">and getting the poly into the trianglefilter.</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br>
</span></div><div><span style="font-family:arial,sans-serif;font-size:13px">For example in these contourwidget code:</span></div><div><span style="font-family:arial,sans-serif;font-size:13px"><br></span></div><div><div style="font-family:arial,sans-serif;font-size:13px">
#include &lt;vtkSmartPointer.h&gt;</div><div style="font-family:arial,sans-serif;font-size:13px">#include &lt;vtkActor.h&gt;</div><div style="font-family:arial,sans-serif;font-size:13px">#include &lt;vtkContourWidget.h&gt;</div>
<div style="font-family:arial,sans-serif;font-size:13px">#include &lt;vtkPolyData.h&gt;</div><div style="font-family:arial,sans-serif;font-size:13px">#include &lt;vtkPolyDataMapper.h&gt;</div><div style="font-family:arial,sans-serif;font-size:13px">
#include &lt;vtkProperty.h&gt;</div><div style="font-family:arial,sans-serif;font-size:13px">#include &lt;vtkRenderer.h&gt;</div><div style="font-family:arial,sans-serif;font-size:13px">#include &lt;vtkRenderWindow.h&gt;</div>
<div style="font-family:arial,sans-serif;font-size:13px">#include &lt;vtkRenderWindowInteractor.h&gt;</div><div style="font-family:arial,sans-serif;font-size:13px"> </div><div style="font-family:arial,sans-serif;font-size:13px">
int main(int, char *[])</div><div style="font-family:arial,sans-serif;font-size:13px">{  </div><div style="font-family:arial,sans-serif;font-size:13px">  // Create a renderer and render window</div><div style="font-family:arial,sans-serif;font-size:13px">
  vtkSmartPointer&lt;vtkRenderer&gt; renderer = vtkSmartPointer&lt;vtkRenderer&gt;::New();</div><div style="font-family:arial,sans-serif;font-size:13px">  vtkSmartPointer&lt;vtkRenderWindow&gt; renderWindow = vtkSmartPointer&lt;vtkRenderWindow&gt;::New();</div>
<div style="font-family:arial,sans-serif;font-size:13px">  renderWindow-&gt;AddRenderer(renderer);</div><div style="font-family:arial,sans-serif;font-size:13px"> </div><div style="font-family:arial,sans-serif;font-size:13px">
  // Create an interactor</div><div style="font-family:arial,sans-serif;font-size:13px">  vtkSmartPointer&lt;vtkRenderWindowInteractor&gt; renderWindowInteractor = </div><div style="font-family:arial,sans-serif;font-size:13px">
    vtkSmartPointer&lt;vtkRenderWindowInteractor&gt;::New();</div><div style="font-family:arial,sans-serif;font-size:13px">  renderWindowInteractor-&gt;SetRenderWindow(renderWindow);</div><div style="font-family:arial,sans-serif;font-size:13px">
<br></div><div style="font-family:arial,sans-serif;font-size:13px"><pre class="">vtkSmartPointer<span class="">&lt;</span>vtkOrientedGlyphContourRepresentation<span class="">&gt;</span> contourRep <span class="">=</span> 
      vtkSmartPointer<span class="">&lt;</span>vtkOrientedGlyphContourRepresentation<span class="">&gt;</span><span class="">::</span><span class="">New</span><span class="">(</span><span class="">)</span><span class="">;</span>
  contourRep<span class="">-</span><span class="">&gt;</span>GetLinesProperty<span class="">(</span><span class="">)</span><span class="">-</span><span class="">&gt;</span>SetColor<span class="">(</span><span class="">1</span>, <span class="">0</span>, <span class="">0</span><span class="">)</span><span class="">;</span> <span class="">//set color to red</span></pre>
</div><div style="font-family:arial,sans-serif;font-size:13px"> </div><div style="font-family:arial,sans-serif;font-size:13px">  // Create a contour widget</div><div style="font-family:arial,sans-serif;font-size:13px">  vtkSmartPointer&lt;vtkContourWidget&gt; contourWidget = </div>
<div style="font-family:arial,sans-serif;font-size:13px">      vtkSmartPointer&lt;vtkContourWidget&gt;::New();</div><div style="font-family:arial,sans-serif;font-size:13px">  contourWidget-&gt;SetInteractor(renderWindowInteractor);</div>
<div style="font-family:arial,sans-serif;font-size:13px">  contourWidget-&gt;SetRepresentation(contourRep);</div><div style="font-family:arial,sans-serif;font-size:13px"> </div><div style="font-family:arial,sans-serif;font-size:13px">
  renderWindow-&gt;Render();</div><div style="font-family:arial,sans-serif;font-size:13px">  renderWindowInteractor-&gt;Initialize();</div><div style="font-family:arial,sans-serif;font-size:13px">  renderWindow-&gt;Render();</div>
<div style="font-family:arial,sans-serif;font-size:13px">  contourWidget-&gt;On();</div><div style="font-family:arial,sans-serif;font-size:13px"> </div><div style="font-family:arial,sans-serif;font-size:13px">  // Begin mouse interaction</div>
<div style="font-family:arial,sans-serif;font-size:13px">  renderWindowInteractor-&gt;Start();</div><div style="font-family:arial,sans-serif;font-size:13px"> </div><div style="font-family:arial,sans-serif;font-size:13px">
  return EXIT_SUCCESS;</div><div style="font-family:arial,sans-serif;font-size:13px">}</div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">you start setting that points and defining the contour by mouse interaction.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px">Im trying to achieve that once you&#39;re done you get that contour as a polygon so the surface area could be measured. I&#39;m for sure missing something, but really can&#39;t see it what it is. Sorry to bother with my newbie questions but I really need to get these to work.</div>
<div style="font-family:arial,sans-serif;font-size:13px"><br></div><div style="font-family:arial,sans-serif;font-size:13px"><div>  vtkSmartPointer&lt; vtkTriangleFilter &gt; triangles =</div><div><span class="" style="white-space:pre">        </span>  vtkSmartPointer&lt; vtkTriangleFilter &gt;::New();</div>
<div>  triangles-&gt;SetInput(contourRep-&gt;GetContourRepresentationAsPolyData());</div><div>  vtkSmartPointer&lt; vtkMassProperties &gt; massProp =</div><div><span class="" style="white-space:pre">        </span>  vtkSmartPointer&lt; vtkMassProperties &gt;::New();</div>
<div>  massProp-&gt;SetInput(triangles-&gt;GetOutput());</div><div>  double area = massProp-&gt;GetSurfaceArea();</div></div><div style="font-family:arial,sans-serif;font-size:13px"><br></div><div><font face="arial, sans-serif">  std::cout&lt;&lt; area;</font><br>
</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/3 David Doria <span dir="ltr">&lt;<a href="mailto:daviddoria@gmail.com" target="_blank">daviddoria@gmail.com</a>&gt;</span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div class="im">On Mon, Dec 3, 2012 at 3:26 PM, Rodrigo Lovera &lt;<a href="mailto:lobo.theslayer@gmail.com">lobo.theslayer@gmail.com</a>&gt; wrote:<br>
&gt; But, how could I get the polygon out of a contour?? I mean applying the<br>
&gt; contour widget lets you define points and you can close that to forma a 2D<br>
&gt; contour. Once that&#39;s finished how to get the polygon out of that contour??<br>
<br>
</div>Like you had done, right?<br>
<br>
contourRep-&gt;GetContourRepresentationAsPolyData()<br>
<span class="HOEnZb"><font color="#888888"><br>
David<br>
</font></span></blockquote></div><br><br clear="all"><div><br></div>-- <br><b><font face="&#39;comic sans ms&#39;, sans-serif" color="#000066">Rodrigo aka WarHearT</font></b><br>
</div>