[vtkusers] converting vtkCallBackCommand into java

James Potota tr_jun-jiang.ee at vitrox.com
Mon Jul 6 23:28:15 EDT 2015


I want to implement a clipping function in my java_wrapped vtk program
exactly like this
http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/ImplicitPlaneWidget2
<http://www.vtk.org/Wiki/VTK/Examples/Cxx/Widgets/ImplicitPlaneWidget2>  

However I don't know how to convert the following code snippet (callback for
interactor) into java:

/// Callback for the interaction
// This does the actual work: updates the vtkPlane implicit function.
// This in turn causes the pipeline to update and clip the object.

class vtkIPWCallback : public vtkCommand
{
public:
  static vtkIPWCallback *New() 
    { return new vtkIPWCallback; }
  virtual void Execute(vtkObject *caller, unsigned long, void*)
    {
    vtkImplicitPlaneWidget2 *planeWidget = 
      reinterpret_cast<vtkImplicitPlaneWidget2*>(caller);
    vtkImplicitPlaneRepresentation *rep = 
     
reinterpret_cast<vtkImplicitPlaneRepresentation*>(planeWidget->GetRepresentation());
    rep->GetPlane(this->Plane);
    }
  vtkIPWCallback():Plane(0),Actor(0) {}
  vtkPlane *Plane;
  vtkActor *Actor;
};/

If I'm not mistaken addObserver() in Java does the same function, however I
don't know where to start as I have difficulty to understand the syntax such
as Virtual Void. Can someone pls give me a hint or guide or example? thank
you. Sorry for my noobies.



--
View this message in context: http://vtk.1045678.n5.nabble.com/converting-vtkCallBackCommand-into-java-tp5732734.html
Sent from the VTK - Users mailing list archive at Nabble.com.


More information about the vtkusers mailing list