<div><span class="" style="white-space:pre">        </span>//Agregar un nuevo widget</div><div><span class="" style="white-space:pre">        </span>this->ContourWidget[i] = vtkSmartPointer< vtkContourWidget >::New();</div><div>
<span class="" style="white-space:pre">        </span>this->ContourWidget[i]->SetInteractor(</div><div><span class="" style="white-space:pre">                </span>this->riw[i]->GetResliceCursorWidget()->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< vtkOrientedGlyphContourRepresentation >::New();</div>
<div><span class="" style="white-space:pre">        </span>contourRepresentation->GetProperty()->SetColor(0.25, 1.0, 0.25);</div><div><br></div><div><span class="" style="white-space:pre">        </span>vtkSmartPointer< vtkSphereSource > ss =</div>
<div><span class="" style="white-space:pre">                </span>vtkSmartPointer< vtkSphereSource >::New();</div><div><span class="" style="white-space:pre">        </span>ss->SetRadius(0.5);</div><div><br></div><div><span class="" style="white-space:pre">        </span>contourRepresentation->SetActiveCursorShape(ss->GetOutput());</div>
<div><br></div><div><span class="" style="white-space:pre">        </span>contourRepresentation->GetActiveProperty()->SetAmbient(0.1);</div><div><span class="" style="white-space:pre">        </span>contourRepresentation->GetActiveProperty()->SetDiffuse(0.9);</div>
<div><span class="" style="white-space:pre">        </span>contourRepresentation->GetActiveProperty()->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->ContourWidget[i]->SetPriority(</div>
<div><span class="" style="white-space:pre">                </span>this->riw[i]->GetResliceCursorWidget()->GetPriority() + 0.01);</div><div><br></div><div><span class="" style="white-space:pre">        </span>this->ContourWidget[i]->SetRepresentation(contourRepresentation);</div>
<div><span class="" style="white-space:pre">        </span>this->ContourWidget[i]->EnabledOn();</div><div><span class="" style="white-space:pre">        </span>//this->ContourWidget[i]->ProcessEventsOn();</div><div><br></div>
<div><span class="" style="white-space:pre">        </span>this->riw[i]->GetMeasurements()->AddItem(this->ContourWidget[i]);</div><div class="gmail_extra"><br><br><div class="gmail_quote">2012/12/3 Rodrigo Lovera <span dir="ltr"><<a href="mailto:lobo.theslayer@gmail.com" target="_blank">lobo.theslayer@gmail.com</a>></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'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><span class="HOEnZb"><font color="#888888"><div><br>
</div><div><br></div><div><br clear="all"><div>
<br></div>-- <br><b><font face="'comic sans ms', 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="'comic sans ms', sans-serif" color="#000066">Rodrigo aka WarHearT</font></b><br>
</div>