<HTML dir=ltr><HEAD><TITLE>Re: SV: [vtkusers] using GetNumberOfTriangles()</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.5730.11" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText66842 dir=ltr>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2>Sorry, there seems to have been many errors in the example, I was too quick!</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2>It should have been like this:</FONT></DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT> </DIV>
<DIV dir=ltr><FONT face=Arial size=2><FONT size=2>
<P>// Read the surface (VTK type in this example)</P>
<P>vtkPolyDataReader *surfreader = vtkPolyDataReader :: New();</P>
<P>surf -> SetFileName(filename);</P>
<P>surf -> Update(); </P>
<P>// Put it in a PolyData object</P>
<P>vtkPolyData *surf = surfreader -> GetOutput(); </P>
<P>// Get the number of cells, e.g. triangles</P>
<P>ncells = surf-> GetNumberOfCells();</P></FONT></DIV></FONT>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2></FONT> </DIV></DIV>
<DIV id=idSignature97419 dir=ltr>
<DIV><FONT face=Arial color=#000000 size=2></FONT> </DIV>
<DIV><FONT face=Arial color=#000000 size=2>Tron Darvann</FONT></DIV>
<DIV><FONT face=Arial size=2>Research Engineer, PhD, 3D-Laboratory</FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><U>Tel:</U> (+45) 35 32 67 58 (lab) / (+45) 28 20 03 12 (mobile)</FONT></DIV>
<DIV><FONT face=Arial size=2><U>E-mail:</U> <A href="mailto:trd@odont.ku.dk">trd@odont.ku.dk</A></FONT></DIV>
<DIV><FONT face=Arial size=2><U>Skype:</U> tron.darvann</FONT></DIV>
<DIV><FONT face=Arial size=2><U>Fax:</U> (+45) 35 32 65 05</FONT></DIV>
<DIV><FONT face=Arial size=2><U>Mailing and Visiting Address:</U></FONT></DIV>
<DIV><FONT face=Arial size=2>3D-Lab, School of Dentistry</FONT></DIV>
<DIV><FONT face=Arial size=2>University of Copenhagen</FONT></DIV>
<DIV><FONT face=Arial size=2>Nørre Alle 20</FONT></DIV>
<DIV><FONT face=Arial size=2>DK-2200 Copenhagen N</FONT></DIV>
<DIV><FONT face=Arial size=2>Denmark</FONT></DIV></DIV>
<DIV dir=ltr><BR>
<HR tabIndex=-1>
<FONT face=Tahoma size=2><B>Fra:</B> Markus voigt [mailto:markus-voigt@gmx.net]<BR><B>Sendt:</B> sø 12-11-2006 19:51<BR><B>Til:</B> Tron Darvann<BR><B>Cc:</B> vtkusers@vtk.org<BR><B>Emne:</B> Re: SV: [vtkusers] using GetNumberOfTriangles()<BR></FONT><BR></DIV>
<DIV>
<P><FONT size=2>Hi Darvann<BR>thanks for your help.<BR>I used the vtkSTLReader to load the file and the vtkPolyDataMapper<BR>Now I used your code but I got this error message:<BR>"'GetPoints' : is not a member of 'vtkPolyDataReader'"<BR><BR><BR>Tron Darvann schrieb:<BR>><BR>> This code will get the number of cells.<BR>><BR>> If you only have triangles, it will be the number of triangles.<BR>><BR>> // Read the surface (VTK type in this example)<BR>><BR>> vtkPolyDataReader *surf = vtkPolyDataReader :: New();<BR>><BR>> surf -> SetFileName(filename);<BR>><BR>> surf -> Update();<BR>><BR>> // Put surface points in Points<BR>><BR>> vtkPoints Points = Surf -> GetPoints();<BR>><BR>> // Get the number of cells, e.g. triangles<BR>><BR>> ncells = Points -> GetNumberOfCells();<BR>><BR>> <BR>> <BR>> <BR>> Tron Darvann<BR>> Research Engineer, PhD, 3D-Laboratory<BR>> <BR>> _Tel:_ (+45) 35 32 67 58 (lab) / (+45) 28 20 03 12 (mobile)<BR>> _E-mail:_ trd@odont.ku.dk <<A href="mailto:trd@odont.ku.dk">mailto:trd@odont.ku.dk</A>><BR>> _Skype:_ tron.darvann<BR>> _Fax:_ (+45) 35 32 65 05<BR>> _Mailing and Visiting Address:_<BR>> 3D-Lab, School of Dentistry<BR>> University of Copenhagen<BR>> Nørre Alle 20<BR>> DK-2200 Copenhagen N<BR>> Denmark<BR>><BR>> ------------------------------------------------------------------------<BR>> *Fra:* vtkusers-bounces+trd=odont.ku.dk@vtk.org på vegne af<BR>> mam06bhv@studserv.uni-leipzig.de<BR>> *Sendt:* lø 11-11-2006 20:58<BR>> *Til:* vtkusers@vtk.org<BR>> *Emne:* [vtkusers] using GetNumberOfTriangles()<BR>><BR>> Hello,<BR>> does someone know how to use the function GetNumberOfTriangles() to<BR>> get the<BR>> numbers of triangles for a 3D model?<BR>> thanks<BR>><BR>><BR>><BR>> ----------------------------------------------------------------<BR>> This message was sent using IMP, the Internet Messaging Program.<BR>><BR>> _______________________________________________<BR>> This is the private VTK discussion list.<BR>> Please keep messages on-topic. Check the FAQ at:<BR>> <A href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A><BR>> Follow this link to subscribe/unsubscribe:<BR>> <A href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>><BR><BR><BR>--<BR>Dipl.-Inf.(FH) Markus Voigt, BSc(Hons)<BR>Reichpietschstraße 63<BR>04317 Leipzig<BR><BR>markus-voigt@gmx.net<BR><BR></FONT></P></DIV></BODY></HTML>