[vtkusers] on GetPointCells, i need your help please!

Dominik Szczerba domi at vision.ee.ethz.ch
Fri Jan 5 03:46:55 EST 2007


BuildLinks can be called once at the beginning, not in the loop.
You can query the number of cell points or the cell type (check the docu)
--DS

PAUL wrote:
> 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
> 
>  
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> This is the private VTK discussion list. 
> Please keep messages on-topic. Check the FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
> Follow this link to subscribe/unsubscribe:
> http://www.vtk.org/mailman/listinfo/vtkusers



More information about the vtkusers mailing list