[vtkusers] vtkPolyData::IsEdge fix

Luca Antiga lucantiga at hotmail.com
Wed Jun 26 10:56:49 EDT 2002


Hi,
here's a simple fix for IsEdge behaviour
(hope not too simple)

inline int vtkPolyData::IsEdge(int p1, int p2)
{
  unsigned short int ncells;
  int npts;
  int i, j;
  vtkIdType *cells, *pts;

  this->GetPointCells(p1,ncells,cells);
  for (i=0; i<ncells; i++)
  {
    this->GetCellPoints(cells[i],npts,pts);
    for (j=0; j<npts; j++)
    {
      if (p1==pts[j])
        if ((pts[(j-1)%npts]==p2)||(pts[(j+1)%npts]==p2))
          return 1;
    }
  }

  return 0;
}

Luca

_________________________________________________________________
Chat with friends online, try MSN Messenger: http://messenger.msn.com




More information about the vtkusers mailing list