[vtkusers] about vtkDijkstraGraphGeodesicPath

Dajiang Zhu djzhu at uga.edu
Wed May 19 13:14:05 EDT 2010


oh, Thanks, I got nothing because I went to a wrong place:
http://www.vtk.org/Wiki/VTK/Examples/Graph/DijkstraGraphGeodesicPath
Anyway, below is part of my test code, it seems does not work at all: the
length is always 0 :(

vtkPolyDataReader* TReader=vtkPolyDataReader::New();
    TReader->SetFileName(strTarget.c_str());
    TReader->Update();
    vtkPolyData* TsurfaceData=vtkPolyData::New();
    TsurfaceData=TReader->GetOutput();
    int nPoints = TsurfaceData->GetNumberOfPoints();
    int nCell = TsurfaceData->GetNumberOfCells();

    double dLength1 = -1.0;
    double dLength2 = -1.0;
    double dLength3 = -1.0;
    vtkDijkstraGraphGeodesicPath* geodesicVtkTool =
vtkDijkstraGraphGeodesicPath::New();
    geodesicVtkTool->SetInput(TsurfaceData);
    geodesicVtkTool->SetStartVertex(18575);
    geodesicVtkTool->SetEndVertex(12238);
    geodesicVtkTool->Update();
    dLength1 = geodesicVtkTool->GetGeodesicLength();
Any comment?


On Wed, May 19, 2010 at 12:55 PM, David Doria
<daviddoria+vtk at gmail.com<daviddoria%2Bvtk at gmail.com>
> wrote:

> On Wed, May 19, 2010 at 12:20 PM, Dajiang Zhu <djzhu at uga.edu> wrote:
> > hi,
> >   Does anyone know how to use vtkDijkstraGraphGeodesicPath? I can not
> find
> > any example code on the web. Actually I want to calculate the geodesic
> > distance  between two points on a surface(polydata) so I think this class
> > should help, right? Thanks
> >
> >
> > Best,
> >
> >
> > DJ
>
> Did your search lead you to the VTK Wiki Examples?
> http://www.vtk.org/Wiki/VTK/Examples
>
> There is an example here:
>
> http://www.vtk.org/Wiki/VTK/Examples/Graphs/DijkstraGraphGeodesicPath
>
> David
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100519/e636161a/attachment.htm>


More information about the vtkusers mailing list