<div class="gmail_quote">On Mon, Dec 3, 2012 at 2:00 PM, Rodrigo Lovera <span dir="ltr"><<a href="mailto:lobo.theslayer@gmail.com" target="_blank">lobo.theslayer@gmail.com</a>></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'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'm trying now to compute the area so I connect the following code to an pushButton which 'll be activated after finishing drawing the contour.</div>
<div><br></div><div><div><span style="white-space:pre-wrap">        </span>vtkSmartPointer< vtkTriangleFilter > triangleTrans =</div><div><span style="white-space:pre-wrap">                </span>vtkSmartPointer< vtkTriangleFilter >::New();</div>
<div><span style="white-space:pre-wrap">        </span>triangleTrans->SetInput(contourRepresentation->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< vtkMassProperties > massProp =</div><div><span style="white-space:pre-wrap">                </span>vtkSmartPointer< vtkMassProperties >::New();</div><div>
<span style="white-space:pre-wrap">        </span>massProp->SetInput(triangleTrans->GetOutput());</div><div><span style="white-space:pre-wrap">        </span>massProp->GetSurfaceArea();</div><div><span style="white-space:pre-wrap">        </span></div>
<div><span style="white-space:pre-wrap">        </span>this->ui->surfaceAreaLabel->setNum(massProp->GetSurfaceArea());</div></div><div><br></div><div>What I'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'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>