[prev in list] [next in list] [prev in thread] [next in thread] 

List:       vtkusers
Subject:    [vtkusers] vtkApproximatingSubdivisionFilter::FindEdge
From:       Dmitry Gurulev <patalog () electropulse ! tomsk ! ru>
Date:       2008-11-26 5:42:37
Message-ID: 492CE1CD.1080101 () electropulse ! tomsk ! ru
[Download RAW message or body]

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
//...skip

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);
}
_______________________________________________
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
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic