<div class="gmail_quote">On Mon, Dec 3, 2012 at 2:00 PM, Rodrigo Lovera <span dir="ltr">&lt;<a href="mailto:lobo.theslayer@gmail.com" target="_blank">lobo.theslayer@gmail.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hello everyone,<div><br></div><div>I&#39;ve applied the vtkContourWidget in the same way the distancewidget is applied in the QT VTK FOUR PANE VIEW EXAMPLE</div><div><br></div><div>so far everything is fine, but I&#39;m trying now to compute the area so I connect the following code to an pushButton which &#39;ll be activated after finishing drawing the contour.</div>

<div><br></div><div><div><span style="white-space:pre-wrap">        </span>vtkSmartPointer&lt; vtkTriangleFilter &gt; triangleTrans =</div><div><span style="white-space:pre-wrap">                </span>vtkSmartPointer&lt; vtkTriangleFilter &gt;::New();</div>

<div><span style="white-space:pre-wrap">        </span>triangleTrans-&gt;SetInput(contourRepresentation-&gt;GetContourRepresentationAsPolyData());</div><div><span style="white-space:pre-wrap">        </span></div><div><span style="white-space:pre-wrap">        </span></div>

<div><span style="white-space:pre-wrap">        </span>vtkSmartPointer&lt; vtkMassProperties &gt; massProp =</div><div><span style="white-space:pre-wrap">                </span>vtkSmartPointer&lt; vtkMassProperties &gt;::New();</div><div>
<span style="white-space:pre-wrap">        </span>massProp-&gt;SetInput(triangleTrans-&gt;GetOutput());</div><div><span style="white-space:pre-wrap">        </span>massProp-&gt;GetSurfaceArea();</div><div><span style="white-space:pre-wrap">        </span></div>

<div><span style="white-space:pre-wrap">        </span>this-&gt;ui-&gt;surfaceAreaLabel-&gt;setNum(massProp-&gt;GetSurfaceArea());</div></div><div><br></div><div>What I&#39;m trying to do is convert the contour in a triangle mesh so then I can apply vtkMassProperties and get the surface area which is my goal.</div>

<div><br></div><div>Everythings build ok, but once in the gui when pushing the button... it gives me the following error:</div><div><br></div><div><div>Warning: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK 5.10\VTK\Graphics\vtkMassProperties.cxx, line 120</div>

<div>vtkMassProperties (04C64588): Input data type must be VTK_TRIANGLE not 3</div></div><div><br></div><div>What I use to draw the contours is the following code:</div></blockquote><div><br></div>As usual, I suggest you create a compilable example. It doesn&#39;t sound like this has anything to do with Qt, so it should be a single, self contained file (generate data similar to the data you are reading in your real code).<br clear="all">
<br><div>David </div></div>