hi,<br>
thanks for the answer. i use the Java wrapper classes so i have a problem with the method <br>
InsertNextCell(num,cellIDs) because i don´t know i can handle the cellids in java. i try it this way <br>
but i get an error:<br>
...<br>
<FONT size=2>
<div align=left>vtkPolyData dat = </FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> vtkPolyData();</div>
<div align=left></div>
<div align=left></div>
<div align=left>vtkPoints points = </FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> vtkPoints();</div>
<div align=left>points.InsertNextPoint(0, 0, 0);</div>
<div align=left>points.InsertNextPoint(1, 1, 1);</div>
<div align=left>points.InsertNextPoint(2, 2, 2);</div>
<div align=left></div>
<div align=left>vtkPolygon p = </FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> vtkPolygon();</div>
<div align=left>p.GetPointIds().SetId(0, 0);</div>
<div align=left>p.GetPointIds().SetId(1 1);</div>
<div align=left>p.GetPointIds().SetId(2, 2);</div>
<div align=left></div>
<div align=left>dat.SetPoints(points);</div>
<div align=left>vtkCellArray polys = </FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> vtkCellArray();</div>
<div align=left>polys.InsertNextCell(p);</div>
<div align=left>dat.SetPolys(polys);</div>
<div align=left></div>
<div align=left>vtkPolyDataMapper objectmapper = </FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> vtkPolyDataMapper();</div>
<div>objectmapper.SetInput(dat);<br>
</div>
</FONT>...<br>
<br>
an alternativ
e approach i tried was the following but also got an error:<br>
...<br>
<FONT size=2>
<div align=left>vtkPolyData dat = </FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> vtkPolyData();</div>
<div align=left></div>
<div align=left>vtkPoints points = </FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> vtkPoints();</div>
<div align=left>points.InsertNextPoint(0, 0, 0);</div>
<div align=left>points.InsertNextPoint(1, 0, 0);</div>
<div align=left>points.InsertNextPoint(1, 0, 1);</div>
<div align=left></div>
<div align=left>dat.SetPoints(points);</div>
<div align=left></div>
<div align=left>vtkIdList list = </FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> vtkIdList();</div>
<div align=left>list.InsertNextId(0);</div>
<div align=left>list.InsertNextId(1);</div>
<div align=left>list.InsertNextId(2);</div>
<div align=left></div>
<div align=left>dat.InsertNextCell(3, list);</div>
<div align=left></div>
<div align=left>vtkPolyDataMapper objectmapper = </FONT><B><FONT color=#7f0055 size=2>new</B></FONT><FONT size=2> vtkPolyDataMapper();</div>
<div>objectmapper.SetInput(dat);</div>
</FONT>...<br>
bye then arne<br>
<br>
<BLOCKQUOTE style="PADDING-LEFT: 3px; BORDER-LEFT: blue 2px solid"><PRE><TT><TT></TT></PRE></TT></BLOCKQUOTE><br>
<br>
<div id=AOLMsgPart_0_e2bbbaa6-0510-464d-89f1-b960f3c2cdf0 style="FONT-SIZE: 12px; MARGIN: 0px; COLOR: #000; FONT-FAMILY: Tahoma, Verdana, Arial, Sans-Serif; BACKGROUND-COLOR: #fff"><PRE style="FONT-SIZE: 9pt"><TT>you can use the InsertNextCell(num,cellIDs) function of=2
0vtkPolyData...
num is the number of points foming the cell, so three in your case of triangles.
cellIDs is an array of the pointIDs.
Hi,
i am still new to VTK but i have al little problem. i want to create a
vtkPolyData DataSet from scratch. In my programm
i have a list of point with their coordinates and a list of triangles. A
triangle is defined by the indices of the pointlist points.
My question is how can I create the DataSet. I use the Java wrapper classes. My
first step was to create an vtkPoints
object and use the insertnextpoint method with the coordinates. Now i have the
problem with the triangles/polygons.
I don´t know to handle with the vtkCellArray or how i can create a
triangle/polygon and insert it in vtkCellArray.
Bye then arne.
</TT></PRE></div>
<!-- end of AOLMsgPart_0_e2bbbaa6-0510-464d-89f1-b960f3c2cdf0 --><div id='MAILCIADB047-5c6c49d5221f1bd' class='aol_ad_footer'><br/><font style="color:black;font:normal 10pt arial,san-serif;"> <hr style="margin-top:10px"/>Die AOL Toolbar bietet Ihnen schnellen Zugriff auf Ihre Lieblings-Internetseiten und integrierte Google Websuche. <a href="http://www.aol.de/aoltoolbar/5-0/?ncid=CRMDEToolbar1>Jetzt die kostenlose AOL Toolbar herunterladen.</a></font> </div>