<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>&nbsp;</DIV>
<DIV dir=ltr><FONT face=Arial size=2></FONT>&nbsp;</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 -&gt; SetFileName(filename);</P>
<P>surf -&gt; Update(); </P>
<P>// Put it in a PolyData object</P>
<P>vtkPolyData *surf = surfreader -&gt; GetOutput(); </P>
<P>// Get the number of cells, e.g. triangles</P>
<P>ncells = surf-&gt; GetNumberOfCells();</P></FONT></DIV></FONT>
<DIV dir=ltr><FONT face=Arial color=#000000 size=2></FONT>&nbsp;</DIV></DIV>
<DIV id=idSignature97419 dir=ltr>
<DIV><FONT face=Arial color=#000000 size=2></FONT>&nbsp;</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>&nbsp;</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>&gt;<BR>&gt; This code will get the number of cells.<BR>&gt;<BR>&gt; If you only have triangles, it will be the number of triangles.<BR>&gt;<BR>&gt; // Read the surface (VTK type in this example)<BR>&gt;<BR>&gt; vtkPolyDataReader *surf = vtkPolyDataReader :: New();<BR>&gt;<BR>&gt; surf -&gt; SetFileName(filename);<BR>&gt;<BR>&gt; surf -&gt; Update();<BR>&gt;<BR>&gt; // Put surface points in Points<BR>&gt;<BR>&gt; vtkPoints Points = Surf -&gt; GetPoints();<BR>&gt;<BR>&gt; // Get the number of cells, e.g. triangles<BR>&gt;<BR>&gt; ncells = Points -&gt; GetNumberOfCells();<BR>&gt;<BR>&gt;&nbsp;<BR>&gt;&nbsp;<BR>&gt;&nbsp;<BR>&gt; Tron Darvann<BR>&gt; Research Engineer, PhD, 3D-Laboratory<BR>&gt;&nbsp;<BR>&gt; _Tel:_ (+45) 35 32 67 58 (lab) / (+45) 28 20 03 12 (mobile)<BR>&gt; _E-mail:_ trd@odont.ku.dk &lt;<A href="mailto:trd@odont.ku.dk">mailto:trd@odont.ku.dk</A>&gt;<BR>&gt; _Skype:_ tron.darvann<BR>&gt; _Fax:_ (+45) 35 32 65 05<BR>&gt; _Mailing and Visiting Address:_<BR>&gt; 3D-Lab, School of Dentistry<BR>&gt; University of Copenhagen<BR>&gt; Nørre Alle 20<BR>&gt; DK-2200 Copenhagen N<BR>&gt; Denmark<BR>&gt;<BR>&gt; ------------------------------------------------------------------------<BR>&gt; *Fra:* vtkusers-bounces+trd=odont.ku.dk@vtk.org på vegne af<BR>&gt; mam06bhv@studserv.uni-leipzig.de<BR>&gt; *Sendt:* lø 11-11-2006 20:58<BR>&gt; *Til:* vtkusers@vtk.org<BR>&gt; *Emne:* [vtkusers] using GetNumberOfTriangles()<BR>&gt;<BR>&gt; Hello,<BR>&gt; does someone know how to use the function GetNumberOfTriangles() to<BR>&gt; get the<BR>&gt; numbers of triangles for a 3D model?<BR>&gt; thanks<BR>&gt;<BR>&gt;<BR>&gt;<BR>&gt; ----------------------------------------------------------------<BR>&gt; This message was sent using IMP, the Internet Messaging Program.<BR>&gt;<BR>&gt; _______________________________________________<BR>&gt; This is the private VTK discussion list.<BR>&gt; Please keep messages on-topic. Check the FAQ at:<BR>&gt; <A href="http://www.vtk.org/Wiki/VTK_FAQ">http://www.vtk.org/Wiki/VTK_FAQ</A><BR>&gt; Follow this link to subscribe/unsubscribe:<BR>&gt; <A href="http://www.vtk.org/mailman/listinfo/vtkusers">http://www.vtk.org/mailman/listinfo/vtkusers</A><BR>&gt;<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>