[vtkusers] VTK plus Java - Expanding VTK

Stefan Maas stefan.maas at fh-gelsenkirchen.de
Mon Jan 29 08:20:25 EST 2007


Dear VTK developers,

I am a Student of Medical IT and am Using VTK for medical visualization
purpose.
Problem: I am trying to expand vtkVolume.cxx /.h with additional functions
as follows:
In vtkVolume.h:

  int GetTEST();
  double *GetBoundsTEST();
  float *GetSGOTF(int);
  float *GetSGOTF()
    {return this->GetSGOTF(0);};
  ...
  float                SGOTF_Array[VTK_MAX_VRCOMP][256*256];

In vtkVolume.cxx:

  int vtkVolume::GetTEST(){
    return 0;
  }
  double *vtkVolume::GetBoundsTEST(){
    // equals the original "double *GetBounds()" except the name (Just for
testing purpose)
  }
  float *vtkVolume::GetSGOTF(int index)
  {
    if ( index < 0 || index >= VTK_MAX_VRCOMP )
      {
      vtkErrorMacro("Index out of range [0-" << VTK_MAX_VRCOMP << 
                    "]: " << index );
      return NULL;
      }
    return this->SGOTF_Array[index];
  }

But after using CMake 2.4 and compiling with VisualStudio7.NET 2003 only the
function GetTEST is available to Java as seen in vtkVolumeJava.cxx:

  extern "C" JNIEXPORT jint  JNICALL Java_vtk_vtkVolume_GetTEST_119(JNIEnv
*env, jobject obj)
  {
    ...
    return static_cast< jint >(0);
  }

vtkVolume.java:

  private native int GetTEST_19();
  public int GetTEST()
    { return GetTEST_19(); }

GetTEST also returns "0" when called from Java.
Any help is apreciated in why the other two functions are not visible in
java and how it should be done!
Thank you in advance!

Sincerely yours,
Martin Petschnig




More information about the vtkusers mailing list