<div>Hi Rafael:</div>
<div> </div>
<div> If my guess is not wrong, I feel you want to obtain a set of unique point ids for each block. Then the following segment of code might be ok. </div>
<div> </div>
<div> </div>
<div>int numPtIds = 0;<br>vtkIdList * ptIdList = vtkIdList::New();<br>ptIdList->Allocate( 1000, 1000 ); // or better estimated sizes</div>
<p>vtkMultiBlockDataSet * multiBlock = ...;</p>
<p>for ( i = 0; i < multiBlock->GetNumberOfBlocks(); i ++ )<br> {<br> ptIdList->Reset();<br> vtkDataSet * block = vtkDataSet::SafeDownCase( multiBlock->GetBlock( i ) );</p>
<p> for ( j = 0; j < block->GetNumberOfCells(); j ++ )<br> {<br> vtkCell * cell = block->GetCell( j );<br> vtkIdList * list = cell->GetPointIds();<br> for ( k = 0; k < list->GetNumberOfIds(); k ++ )<br>
{<br> vtkIdType globalPtId = list->GetId( k );<br> if ( ptIdList->IsId( globalPtId ) == -1 )<br> {<br> ptIdList->InsertNextId( globalPtId );<br> }<br> }<br> cell = NULL;<br>
list = NULL;<br> }</p>
<p> block = NULL;<br> numPtIds = ptIdList->GetNumberOfIds();<br> // now export the point ids stored in ptIdList and the number numPtIds</p>
<p> }</p>
<div>ptIdList->Delete();<br>ptIdList = NULL;</div>
<div> </div>
<div>-Zhanping</div>
<div>-- <br>Zhanping Liu, PhD<br>Kitware, Inc.<br>28 Corporate Drive<br>Clifton Park, NY 12065-8662<br>Phone: 518-371-3971 x 138<br><a href="http://www.zhanpingliu.org">http://www.zhanpingliu.org</a><br><br><br></div>
<div class="gmail_quote">On Thu, Aug 6, 2009 at 1:27 AM, Rafael March <span dir="ltr"><<a href="mailto:rafaelmarch3@yahoo.com">rafaelmarch3@yahoo.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="PADDING-LEFT: 1ex; MARGIN: 0px 0px 0px 0.8ex; BORDER-LEFT: #ccc 1px solid">
<table cellspacing="0" cellpadding="0" border="0">
<tbody>
<tr>
<td valign="top">Hi,<br><br>how to correctly generate a Points Global IDs to a vtkMultiBlockDataSet ? The IDs must, of course, be unique. I tried to iterate through the blocks and attribute to each part a vtkIntArray with the IDs, but of course this does not work when the parts have points in common. <br>
<br>Also, I'm specially interested in MultiBlock comming from Ensight files, and I discovered recently that the Ensight Reader does not associate the "true" number of points to each part. So the GetNumberOfPoints() method doesn't work in these cases.<br>
<br>How to achieve this ? I really need these Global IDs in order to uniquely identify each node of my model, to create a finite element preprocessor.<br><br>Regards,<br>Rafael March.<br><br><br></td></tr></tbody></table>
<br><br>_______________________________________________<br>Powered by <a href="http://www.kitware.com/" target="_blank">www.kitware.com</a><br><br>Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>Please keep messages on-topic and check the ParaView Wiki at: <a href="http://paraview.org/Wiki/ParaView" target="_blank">http://paraview.org/Wiki/ParaView</a><br><br>Follow this link to subscribe/unsubscribe:<br><a href="http://www.paraview.org/mailman/listinfo/paraview" target="_blank">http://www.paraview.org/mailman/listinfo/paraview</a><br>
<br></blockquote></div><br><br clear="all">
<div></div><br>