[vtkusers] Problems with massProperties at getting area from ContourWidget

Rodrigo Lovera lobo.theslayer at gmail.com
Mon Dec 3 14:00:37 EST 2012


Hello everyone,

I've applied the vtkContourWidget in the same way the distancewidget is
applied in the QT VTK FOUR PANE VIEW EXAMPLE

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.

vtkSmartPointer< vtkTriangleFilter > triangleTrans =
vtkSmartPointer< vtkTriangleFilter >::New();
triangleTrans->SetInput(contourRepresentation->GetContourRepresentationAsPolyData());
 vtkSmartPointer< vtkMassProperties > massProp =
vtkSmartPointer< vtkMassProperties >::New();
massProp->SetInput(triangleTrans->GetOutput());
massProp->GetSurfaceArea();
 this->ui->surfaceAreaLabel->setNum(massProp->GetSurfaceArea());

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.

Everythings build ok, but once in the gui when pushing the button... it
gives me the following error:

Warning: In C:\Users\RODRIGO LOVERA\Documents\PUCP\Tesis\VTK
5.10\VTK\Graphics\vtkMassProperties.cxx, line 120
vtkMassProperties (04C64588): Input data type must be VTK_TRIANGLE not 3

What I use to draw the contours is the following code:




-- 
*Rodrigo Lovera*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20121203/abe532e0/attachment.htm>


More information about the vtkusers mailing list