[vtk-developers] ARB-Request: Blessing of vtkPolyData->IsEdge fix
Rasmus Reinhold Paulsen
rrp at imm.dtu.dk
Wed Mar 12 07:15:20 EST 2003
Luca Antiga and I would like to apply the following fix to
vtkPolyData->IsEdge :
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)%npts]==p2)||(pts[(j+1)%npts]==p2))
return 1;
}
}
return 0;
}
This fix solves the problem of two points being classified on an edge
eventhough they just belong to the same N-sided poly. No regression tests
fail with the above method.
Since this is a basic member function of a fundemental class I believe
that it needs some kind of blessing from the ARB.
An alternative method called IsInSamePoly that simulates the current
behaviour of IsEdge can also be implemented.
Comments?
Best regards,
Rasmus
More information about the vtk-developers
mailing list