VtkCellLocator and Java

(Josh Steele) #1

I’ve noticed that several of the methods in vtkCellLocator (as well as some other classes) don’t come over to Java. Are there any plans to improve this in the future?

(Sebastien Jourdain) #2

Yes but only if we are aware of them so we can make sure they get properly wrapped. Could you specify the set of methods that you’ve noticed that are missing?

@dgobbi may have some idea on what could be going on.

(Josh Steele) #3

Here’s the ones we’ve patched in the past to be exposed, which has worked, but doing the same with vtk8 builds seems to (maybe?) cause some other rendering problems (I don’t see how they are connected). It would be nice though if the following were officially exposed to Java and tested by the Kitware folks.

Common/DataModel/vtkCellLocator:

  • IntersectWithLine
  • FindClosestPoint
  • FindClosestPointWithinRadius
  • FindCell
  • FindCellWithinBounds

Common/DataModel/vtkTriangle:

  • IntersectWithLine

Filters/FlowPaths/vtkModifiedBSPTree:

  • IntersectWithLine
  • FindCell

Filters/General/vtkCellTreeLocator:

  • IntersectWithLine
  • FindClosestPoint
  • FindClosestPointWithRadius
  • FindCell
  • FindCellWithinBounds

These were all needed because some of the arguments are passed in by reference in C++ (typically arrays), which I guess the make system doesn’t properly translate to Java?

(Sebastien Jourdain) #4

Just out of curiosity what kind of patching did you do to expose those methods? Just an example might be useful.

(David Gobbi) #5

Getting pass-by-reference to work with the Java wrappers is a non-trivial modification. If you have code that does this, then by all means share that code, even if it doesn’t work with the latest version of VTK.

For the Python wrappers, pass-by-reference is handled via the special PyVTKReference object and (for arrays) via the sequence protocol.

(Josh Steele) #6

I’d like to come back to this later on - I have a more pressing problem that I’ll bring up in another topic.