[vtkusers] about vtkDijkstraGraphGeodesicPath

Karthik Krishnan karthik.krishnan at kitware.com
Wed May 19 13:21:14 EDT 2010

On Wed, May 19, 2010 at 10:44 PM, Dajiang Zhu <djzhu at uga.edu> wrote:

> 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 :(
> Any comment?

TestDijkstraGraphGeodesicPath.cxx illustrates its usage, (although
interactively) through a contour widget, which traces shortest path curves
along the surface of a mesh.

Now, to get the geodesic distance between two points, I have not implemented
method GetGeodesicLength() to get the length between the source and target
point. I have left a TODO message in vtkDijkstraGraphGeodesicPath.h.

  // Description:
  // TODO: Get the total geodesic length.
  virtual double GetGeodesicLength() { return 0.0; }

Not to worry though, since you can use the method GetCumulativeWeights().
This method gets the geodesic distance at all vertices of the graph.

  //Fill the array with the cumulative weights.
  virtual void GetCumulativeWeights(vtkDoubleArray *weights);

Actually its quite simple really to add the implementation
GetGeodesicLength() to compute the geodesic length to the specific vertex in
question. (Simply need to query the latter method for a specific index), but
I haven't yet gotten down to committing with git. Will do so in the near
future. In the meantime, you have this solution. I'll also add better

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://www.vtk.org/pipermail/vtkusers/attachments/20100519/1d8d5fdd/attachment.htm>

More information about the vtkusers mailing list