#include <vtkJavaProgrammableFilter.h>
vtkJavaProgrammableFilter executes code from a Java class. The Java class must be a subclass of vtk.Algorithm, which is defined in the VTK jar file built when VTK_WRAP_JAVA is on. The subclass of vtk.Algorithm works just as if it was a vtkAlgorithm subclass, with the following exceptions: Inside the Java class, you have access to the "real" algorithm which is an attribute called VTKAlgorithm. Use this to set parameters, get filter input and output, etc. You initialize parameters and set the number of input/output ports in the method named "initialize" instead of the constructor. Parameters are set using SetParameter(name, value) and are retrieved in Java by GetXParameter(name), where X is Int, Double, or String.
The default algorithm will take one input and produce an output. You must minimally override
bool requestData(vtkInformation, vtkInformationVector[], vtkInformationVector)
which performs the same function as vtkAlgorithm::RequestData(). See VTK/Wrapping/Java/vtk/SampleAlgorithm.java as an example Algorithm subclass.
To use this filter, the application must first call the static methods vtkJVMManager::AddLibraryPath() and vtkJVMManager::AddClassPath() with the paths to the VTK libraries and vtk.jar, respectively. Then, on this filter you must call SetJavaClassPath() with the location of the .jar file or .class files which contain your vtk.Algorithm subclass. Also use SetJavaClassName() to set the name of the vtk.Algorithm subclass. See VTK/Graphics/Testing/Cxx/TestJavaProgrammableFilter.cxx for an example of how to set up the programmable filter.
Definition at line 66 of file vtkJavaProgrammableFilter.h.
Public Types | |
typedef vtkAlgorithm | Superclass |
Public Member Functions | |
virtual const char * | GetClassName () |
virtual int | IsA (const char *type) |
void | PrintSelf (ostream &os, vtkIndent indent) |
bool | Initialize () |
void | SetParameter (const char *name, int value) |
void | SetParameter (const char *name, double value) |
void | SetParameter (const char *name, const char *value) |
int | GetIntParameter (const char *name) |
double | GetDoubleParameter (const char *name) |
const char * | GetStringParameter (const char *name) |
virtual void | SetJavaClassName (const char *name) |
virtual const char * | GetJavaClassName () |
virtual void | SetJavaClassPath (const char *path) |
virtual const char * | GetJavaClassPath () |
void | SetNumberOfInputPorts (int n) |
void | SetNumberOfOutputPorts (int n) |
virtual int | ProcessRequest (vtkInformation *request, vtkInformationVector **inputVector, vtkInformationVector *outputVector) |
Static Public Member Functions | |
static vtkJavaProgrammableFilter * | New () |
static int | IsTypeOf (const char *type) |
static vtkJavaProgrammableFilter * | SafeDownCast (vtkObject *o) |
Protected Member Functions | |
vtkJavaProgrammableFilter () | |
~vtkJavaProgrammableFilter () | |
virtual int | FillInputPortInformation (int port, vtkInformation *info) |
virtual int | FillOutputPortInformation (int port, vtkInformation *info) |
virtual void | SetJavaClassNameInternal (const char *) |
virtual void | SetJavaClassPathInternal (const char *) |
virtual int | RequestData (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
virtual int | RequestDataObject (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
virtual int | RequestInformation (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
virtual int | RequestUpdateExtent (vtkInformation *, vtkInformationVector **, vtkInformationVector *) |
Protected Attributes | |
char * | JavaClassNameInternal |
char * | JavaClassPathInternal |
vtkJVMManager * | JVM |
vtkJavaProgrammableFilterInternals * | Internals |
vtkJavaProgrammableFilter::vtkJavaProgrammableFilter | ( | ) | [protected] |
vtkJavaProgrammableFilter::~vtkJavaProgrammableFilter | ( | ) | [protected] |
static vtkJavaProgrammableFilter* vtkJavaProgrammableFilter::New | ( | ) | [static] |
Create an object with Debug turned off, modified time initialized to zero, and reference counting on.
Reimplemented from vtkAlgorithm.
virtual const char* vtkJavaProgrammableFilter::GetClassName | ( | ) | [virtual] |
Reimplemented from vtkAlgorithm.
static int vtkJavaProgrammableFilter::IsTypeOf | ( | const char * | name | ) | [static] |
Return 1 if this class type is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkAlgorithm.
virtual int vtkJavaProgrammableFilter::IsA | ( | const char * | name | ) | [virtual] |
Return 1 if this class is the same type of (or a subclass of) the named class. Returns 0 otherwise. This method works in combination with vtkTypeMacro found in vtkSetGet.h.
Reimplemented from vtkAlgorithm.
static vtkJavaProgrammableFilter* vtkJavaProgrammableFilter::SafeDownCast | ( | vtkObject * | o | ) | [static] |
Reimplemented from vtkAlgorithm.
void vtkJavaProgrammableFilter::PrintSelf | ( | ostream & | os, | |
vtkIndent | indent | |||
) | [virtual] |
Methods invoked by print to print information about the object including superclasses. Typically not called by the user (use Print() instead) but used in the hierarchical print process to combine the output of several classes.
Reimplemented from vtkAlgorithm.
void vtkJavaProgrammableFilter::SetParameter | ( | const char * | name, | |
int | value | |||
) |
Sets and retrieves parameters for the algorithm as name/value pairs. This API allows the Java code to access arbitrary parameters.
void vtkJavaProgrammableFilter::SetParameter | ( | const char * | name, | |
double | value | |||
) |
Sets and retrieves parameters for the algorithm as name/value pairs. This API allows the Java code to access arbitrary parameters.
void vtkJavaProgrammableFilter::SetParameter | ( | const char * | name, | |
const char * | value | |||
) |
Sets and retrieves parameters for the algorithm as name/value pairs. This API allows the Java code to access arbitrary parameters.
int vtkJavaProgrammableFilter::GetIntParameter | ( | const char * | name | ) |
Sets and retrieves parameters for the algorithm as name/value pairs. This API allows the Java code to access arbitrary parameters.
double vtkJavaProgrammableFilter::GetDoubleParameter | ( | const char * | name | ) |
Sets and retrieves parameters for the algorithm as name/value pairs. This API allows the Java code to access arbitrary parameters.
const char* vtkJavaProgrammableFilter::GetStringParameter | ( | const char * | name | ) |
Sets and retrieves parameters for the algorithm as name/value pairs. This API allows the Java code to access arbitrary parameters.
virtual void vtkJavaProgrammableFilter::SetJavaClassName | ( | const char * | name | ) | [virtual] |
The name of the vtk.Algorithm subclass. The class name should be fully qualified, and should contain a "/" for package separators. (e.g. com/kitware/mypackage/MyAlgorithm).
virtual const char* vtkJavaProgrammableFilter::GetJavaClassName | ( | ) | [inline, virtual] |
The name of the vtk.Algorithm subclass. The class name should be fully qualified, and should contain a "/" for package separators. (e.g. com/kitware/mypackage/MyAlgorithm).
Definition at line 89 of file vtkJavaProgrammableFilter.h.
virtual void vtkJavaProgrammableFilter::SetJavaClassPath | ( | const char * | path | ) | [virtual] |
The class path (.jar file or path to .class files) containing the vtk.Algorithm subclass. This string may contain multiple paths separated by ":".
virtual const char* vtkJavaProgrammableFilter::GetJavaClassPath | ( | ) | [inline, virtual] |
The class path (.jar file or path to .class files) containing the vtk.Algorithm subclass. This string may contain multiple paths separated by ":".
Definition at line 98 of file vtkJavaProgrammableFilter.h.
bool vtkJavaProgrammableFilter::Initialize | ( | ) |
Make an instance of the Java vtk.Algorithm subclass. This should not be called until the class name and class path are set. It is automatically called once the two parameters are initially set.
void vtkJavaProgrammableFilter::SetNumberOfInputPorts | ( | int | n | ) | [inline, virtual] |
We need to make these methods public so the Java algorithm can access them to set the number of inputs and outputs for the algorithm.
Reimplemented from vtkAlgorithm.
Definition at line 110 of file vtkJavaProgrammableFilter.h.
void vtkJavaProgrammableFilter::SetNumberOfOutputPorts | ( | int | n | ) | [inline, virtual] |
We need to make these methods public so the Java algorithm can access them to set the number of inputs and outputs for the algorithm.
Reimplemented from vtkAlgorithm.
Definition at line 112 of file vtkJavaProgrammableFilter.h.
virtual int vtkJavaProgrammableFilter::ProcessRequest | ( | vtkInformation * | request, | |
vtkInformationVector ** | inputVector, | |||
vtkInformationVector * | outputVector | |||
) | [virtual] |
Delegates requests to several protected functions. Each function in turn calls an equivalent function in the Java class.
Reimplemented from vtkAlgorithm.
virtual int vtkJavaProgrammableFilter::RequestData | ( | vtkInformation * | , | |
vtkInformationVector ** | , | |||
vtkInformationVector * | ||||
) | [protected, virtual] |
Calls requestData() on the Java object.
virtual int vtkJavaProgrammableFilter::RequestDataObject | ( | vtkInformation * | , | |
vtkInformationVector ** | , | |||
vtkInformationVector * | ||||
) | [protected, virtual] |
Calls requestDataObject() on the Java object.
virtual int vtkJavaProgrammableFilter::RequestInformation | ( | vtkInformation * | , | |
vtkInformationVector ** | , | |||
vtkInformationVector * | ||||
) | [protected, virtual] |
Calls requestInformation() on the Java object.
virtual int vtkJavaProgrammableFilter::RequestUpdateExtent | ( | vtkInformation * | , | |
vtkInformationVector ** | , | |||
vtkInformationVector * | ||||
) | [protected, virtual] |
Calls requestUpdateExtent() on the Java object.
virtual int vtkJavaProgrammableFilter::FillInputPortInformation | ( | int | port, | |
vtkInformation * | info | |||
) | [protected, virtual] |
Calls fillInputPortInformation() on the Java object.
Reimplemented from vtkAlgorithm.
virtual int vtkJavaProgrammableFilter::FillOutputPortInformation | ( | int | port, | |
vtkInformation * | info | |||
) | [protected, virtual] |
Calls fillOutputPortInformation() on the Java object.
Reimplemented from vtkAlgorithm.
virtual void vtkJavaProgrammableFilter::SetJavaClassNameInternal | ( | const char * | ) | [protected, virtual] |
virtual void vtkJavaProgrammableFilter::SetJavaClassPathInternal | ( | const char * | ) | [protected, virtual] |
char* vtkJavaProgrammableFilter::JavaClassNameInternal [protected] |
Definition at line 166 of file vtkJavaProgrammableFilter.h.
char* vtkJavaProgrammableFilter::JavaClassPathInternal [protected] |
Definition at line 168 of file vtkJavaProgrammableFilter.h.
vtkJVMManager* vtkJavaProgrammableFilter::JVM [protected] |
Definition at line 170 of file vtkJavaProgrammableFilter.h.
vtkJavaProgrammableFilterInternals* vtkJavaProgrammableFilter::Internals [protected] |
Definition at line 172 of file vtkJavaProgrammableFilter.h.