<div><span class="" style="white-space:pre">        </span>//Agregar un nuevo widget</div><div><span class="" style="white-space:pre">        </span>this-&gt;ContourWidget[i] = vtkSmartPointer&lt; vtkContourWidget &gt;::New();</div><div>
<span class="" style="white-space:pre">        </span>this-&gt;ContourWidget[i]-&gt;SetInteractor(</div><div><span class="" style="white-space:pre">                </span>this-&gt;riw[i]-&gt;GetResliceCursorWidget()-&gt;GetInteractor());</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>//Crear la Representacion Geometrica para el ContourWidget</div><div><span class="" style="white-space:pre">        </span>contourRepresentation =vtkSmartPointer&lt; vtkOrientedGlyphContourRepresentation &gt;::New();</div>
<div><span class="" style="white-space:pre">        </span>contourRepresentation-&gt;GetProperty()-&gt;SetColor(0.25, 1.0, 0.25);</div><div><br></div><div><span class="" style="white-space:pre">        </span>vtkSmartPointer&lt; vtkSphereSource &gt; ss =</div>
<div><span class="" style="white-space:pre">                </span>vtkSmartPointer&lt; vtkSphereSource &gt;::New();</div><div><span class="" style="white-space:pre">        </span>ss-&gt;SetRadius(0.5);</div><div><br></div><div><span class="" style="white-space:pre">        </span>contourRepresentation-&gt;SetActiveCursorShape(ss-&gt;GetOutput());</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>contourRepresentation-&gt;GetActiveProperty()-&gt;SetAmbient(0.1);</div><div><span class="" style="white-space:pre">        </span>contourRepresentation-&gt;GetActiveProperty()-&gt;SetDiffuse(0.9);</div>
<div><span class="" style="white-space:pre">        </span>contourRepresentation-&gt;GetActiveProperty()-&gt;SetSpecular(0.0);</div><div><br></div><div>I really hope someone can help me correct these.</div><div><br></div><div>Regards</div>
<div>Rodrigo Lovera</div><div><span class="" style="white-space:pre">        </span></div><div><br></div><div><span class="" style="white-space:pre">        </span>//Configurar la prioridad mayor a la del reslice</div><div><span class="" style="white-space:pre">        </span>this-&gt;ContourWidget[i]-&gt;SetPriority(</div>
<div><span class="" style="white-space:pre">                </span>this-&gt;riw[i]-&gt;GetResliceCursorWidget()-&gt;GetPriority() + 0.01);</div><div><br></div><div><span class="" style="white-space:pre">        </span>this-&gt;ContourWidget[i]-&gt;SetRepresentation(contourRepresentation);</div>
<div><span class="" style="white-space:pre">        </span>this-&gt;ContourWidget[i]-&gt;EnabledOn();</div><div><span class="" style="white-space:pre">        </span>//this-&gt;ContourWidget[i]-&gt;ProcessEventsOn();</div><div><br></div>
<div><span class="" style="white-space:pre">        </span>this-&gt;riw[i]-&gt;GetMeasurements()-&gt;AddItem(this-&gt;ContourWidget[i]);</div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/3 Rodrigo Lovera <span dir="ltr">&lt;<a href="mailto:lobo.theslayer@gmail.com" target="_blank">lobo.theslayer@gmail.com</a>&gt;</span><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><span class="HOEnZb"><font color="#888888"><div><br>
</div><div><br></div><div><br clear="all"><div>
<br></div>-- <br><b><font face="&#39;comic sans ms&#39;, sans-serif" color="#000066">Rodrigo Lovera</font></b><br>
</div>
</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>