[vtkusers] problems with GetCellNeighbors

Dominik Szczerba domi at vision.ee.ethz.ch
Tue Jun 27 04:01:59 EDT 2006


OK just for others in future - I figured it out. It is nowhere clearly
stated but GetCellNeighbours needs cell face points and not cell points.
It returns cell face neighbours and not all neighbours.
Dominik

Dominik Szczerba wrote:
> I just confirmed using picking, yes, i am picking two tets and they have
> 3 point Ids in common...
> 
> Is it at all the right way of using GetCellNeighbors? What is the Cell
> here: a tet or it's face (triangle)?
> 
> Dominik
> 
> John Biddiscombe wrote:
> 
>>Are the points shared between cells? Duplicated edges won't appear as
>>shared ones
>>
>>?
>>
>>JB
>>
>>
>>Dominik Szczerba wrote:
>>
>>
>>>I did, no effect :(
>>>Dominik
>>>
>>>John Biddiscombe wrote:
>>>
>>>
>>>>Do you have to call BuildLinks first?
>>>>
>>>>Can't remember...
>>>>
>>>>JB
>>>>
>>>>
>>>>Dominik Szczerba wrote:
>>>>
>>>>
>>>>>Hi,
>>>>>
>>>>>The following code retrieves cell points, but not cell neighbours, what
>>>>>is wrong?
>>>>>
>>>>>  vtkUnstructuredGrid* grid;
>>>>>  //...
>>>>>  for(int id=0; id<NCELLS; id++){
>>>>>     vtkIdList* points = vtkIdList::New();
>>>>>     vtkIdList* cells = vtkIdList::New();
>>>>>     grid->GetCellPoints(id,points);
>>>>>     grid->GetCellNeighbors(id,points,cells);
>>>>>     int np = points->GetNumberOfIds();
>>>>>     int nc = cells->GetNumberOfIds();
>>>>>     cerr << nc << endl;// always 0
>>>>>     points->Delete();
>>>>>     cells->Delete();
>>>>>  }
>>>>>
>>>>>thanks,
>>>>>Dominik
>>>>>
>>>>
>>
> 

-- 
Dominik Szczerba, Dr.
Computer Vision Lab CH-8092 Zurich
http://www.vision.ee.ethz.ch/~domi



More information about the vtkusers mailing list