[vtkusers] on GetPointCells, i need your help please!
PAUL
polinzhuo at 163.com
Fri Jan 5 01:19:06 EST 2007
Hello everyone!
A cell may be a vertex , a triangle, a edge and so on.
What type is the return of GetPointCells()?
I want to get all cells adjacent to a share point. is the code below right?
but I cannot get the cells sharing the interest point "ptIdinCurrentCell".
Why? The code below:
vtkCubeSource *pCube = vtkCubeSource::New();
pCube->SetCenter(0,0,0);
pCube->SetXLength(2);
pCube->SetYLength(2);
pCube->SetZLength(2);
vtkPolyData *data = pCube->GetOutput();
data->Update();
int cellCount = data->GetNumberofCell();
for (i=0;i<cellCount-1;i++)
{
vtkIdList *CurrentcellPts = vtkIdList::New();
data->GetCellPoints(i,CurrentcellPts);
float ccc[3];
vtkIdType ptIdinCurrentCell = CurrentcellPts->GetId(0);
data->GetPoint(ptIdinCurrentCell,ccc);
data->BuildLinks();
data->GetPointCells(ptIdinCurrentCell,cellIDs);
int cellcount = cellIDs->GetNumberOfIds();
int cellID = cellIDs->GetId(0);
}
paul
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20070105/3594a860/attachment.htm>
More information about the vtkusers
mailing list