<div>The statement should read:</div>
<div>itk::Point pnt = pntIterator.Value(); <font color="#ff0000" size="4"> </font><br><br> </div>
<div><span class="gmail_quote">On 2/22/07, <b class="gmail_sendername">tony hakki</b> <<a href="mailto:tony2007vtk@yahoo.com">tony2007vtk@yahoo.com</a>> wrote:</span>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<div>
<div style="FONT-SIZE: 12pt; FONT-FAMILY: times new roman, new york, times, serif">
<div>Hello dear ITK and VTK users;</div>
<div> </div>
<div>First I converted vtk polydata to itk mesh format. After some processing I want to reconvert itk mesh to vtk polydata format. TO implement that I found an code through the internet. It seems good,But one line it gives an error,I couldn't understand reason of that. Could any one help me on that problem. It will be really appreciated help for me.
</div>
<div>Here is the code and I indicated the line which gives error</div>
<div> </div>
<div><font color="#0000ff"> <strong>//Creat a new vtkPolyData</strong></font><br> vtkPolyData* newPolyData = vtkPolyData::New();<br><br> //Creat vtkPoints for insertion into newPolyData<br> vtkPoints *points = vtkPoints::New();
<br> std::cout<<"Points = "<<mesh->GetNumberOfPoints()<<std::endl;<br><br> //Copy all points into the vtkPolyData structure</div>
<div>typedef MeshType::PointsContainer::ConstIterator PointIterator;<br> PointIterator pntIterator = mesh->GetPoints()->Begin();<br> PointIterator pntItEnd = mesh->GetPoints()->End();<br> for (int i = 0; pntIterator != pntItEnd; ++i, ++pntIterator)
<br> {<br> ItkPoint pnt = pntIterator.Value(); <font color="#ff0000" size="4"> //Here it says <em>ItkPoint</em> is undeclared identifier ,how should I define that</font><br> points->InsertPoint(i, pnt[0], pnt[1], pnt[2]);
<br>// std::cout<<i<<"-th point: ";<br>// std::cout<<pnt[0]<<std::endl;<br>// std::cout<<" "<<pntIterator.Value()<<std::endl;<br>
// ++pntIterator;<br> }<br> newPolyData->SetPoints(points);<br> points->Delete();<br><br> //Copy all cells into the vtkPolyData structure<br> //Creat vtkCellArray into which the cells are copied<br> vtkCellArray* triangle = vtkCellArray::New();
<br> CellIterator cellIt = mesh->GetCells()->Begin();<br> CellIterator cellItEnd = mesh->GetCells()->End();<br> for (int it = 0; cellIt != cellItEnd; ++it, ++cellIt)<br> {<br> CellType * cellptr = cellIt.Value
();<br> // LineType * line = dynamic_cast<LineType *>( cellptr );<br> // std::cout << line->GetNumberOfPoints() << std::endl;<br> // std::cout << cellptr->GetNumberOfPoints() << std::endl;
<br> PointIdIterator pntIdIter = cellptr->PointIdsBegin();<br> PointIdIterator pntIdEnd = cellptr->PointIdsEnd();<br> vtkIdList* pts = vtkIdList::New();<br> for (; pntIdIter != pntIdEnd; ++pntIdIter)<br>
{<br> pts->InsertNextId( *pntIdIter );<br> // std::cout<<" "<<tempCell[it1]<<std::endl;<br> }<br> triangle->InsertNextCell(pts);<br> }<br> newPolyData->SetPolys(triangle);
<br> triangle->Delete();<br><span class="ad"><br> </span></div></div><span class="ad"><br>
<hr size="1">
TV dinner still cooling?<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://us.rd.yahoo.com/evt=49979/*http://tv.yahoo.com/" target="_blank">Check out "Tonight's Picks"</a> on Yahoo! TV.
</span></div><br>_______________________________________________<br>This is the private VTK discussion list.<br>Please keep messages on-topic. Check the FAQ at: <a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/Wiki/VTK_FAQ" target="_blank">
http://www.vtk.org/Wiki/VTK_FAQ</a><br>Follow this link to subscribe/unsubscribe:<br><a onclick="return top.js.OpenExtLink(window,event,this)" href="http://www.vtk.org/mailman/listinfo/vtkusers" target="_blank">http://www.vtk.org/mailman/listinfo/vtkusers
</a><br><br></blockquote></div><br>