[vtkusers] vtkApproximatingSubdivisionFilter::FindEdge

Dmitry Gurulev patalog at electropulse.tomsk.ru
Wed Nov 26 00:42:37 EST 2008

Hi All!

I have the same problem as http://www.vtk.org/pipermail/vtkusers/2001-September/057336.html.
In vtkLoopSubdivisionFilter::GenerateSubdivisionPoints for given points p1, p2 edgeTable returns
that this edge already added, but FindEdge return incorrect value since there is no such cell id 
in edgeData array. Mentioned message dated 2001 year, but all moder library code has the same thing.

Possible solution (is this correct?) -
function vtkLoopSubdivisionFilter::GenerateSubdivisionPoints

edgeTable->InitEdgeInsertion(inputDS->GetNumberOfPoints(), 1); //initialize edgeTable for 
storing vtkIdType attribute

// Generate odd points loop...

//check we already add this edge, newId is -1 if not or prev. saved id
if ((newId = edgeTable->IsEdge (p1, p2)) == -1)
	//remove edgeTable->InsertEdge (p1, p2); from here and ...
	newId = this->InterpolatePosition (inputPts, outputPts,
                                            stencil, weights);
	//... add here when we have correct newId, put this edge in table with this id
	edgeTable->InsertEdge (p1, p2, newId);
else // we have already created a point on this edge. find it
	//we don't need this at all
         //newId = this->FindEdge (inputDS, cellId, p1, p2, edgeData, cellIds);

More information about the vtkusers mailing list