[vtkusers] Implementing user ImageAlgorithm in Java - impossible?

David Gobbi david.gobbi at gmail.com
Thu Jun 2 09:15:56 EDT 2011


Hi Maksim,

 A method is not wrapped if
 1) its parameter list contains a pointer that isn't a vtkObject
    pointer, char pointer, or void pointer
 2) it returns a pointer that is not a vtkObject pointer, char pointer,
    or void pointer, unless the method has an entry in the wrapping
    hints file
 3) its parameter list contains an array that is not const
 4) its parameter list or return value contains a reference
 5) its parameter list contains a named enum constant
 6) it is an operator method

Parameters like "float", "int", "const int arg[3]", "vtkObject *" are
wrapped.  Also, the vtkSetXX and vtkGetXX macros are always
wrapped, take a look at some of the VTK class header files like
vtkCamera to see how they are used (I believe the user's guide
documents them in some detail).

The hints file, and especially how to use it your own projects, is
an advanced topic.  I don't think anyone has documented it.  Its
only purpose is to assist in wrapping pointer return values, which
you can usually do by using a vtkGetVector() macro.

If you are really brave enough to try to create your own hints file,
the hexadecimal constants are listed in Wrapping/vtkParseType.h
in the VTK development head (not in VTK 5.6).  But your best
option is to just avoid situations that require it (i.e. use the
vtkSet/Get macros instead).

 - David


On Wed, Jun 1, 2011 at 10:24 PM, Sebastien Jourdain
<sebastien.jourdain at kitware.com> wrote:
> Hi,
>
> I don't know much about the wrapping part, but David Gobbi might have
> some insight.
>
> Seb
>
> On Wed, Jun 1, 2011 at 5:53 PM, EvilMax <maxim.privalov at gmail.com> wrote:
>> Thank you for wrapping answer!
>>
>> After implementing some algorithms I actually prefer writing computationally
>> and data read/write intensive algorithms in C++, wrap them and then use in
>> Desktop/GUI apps written in Java, so Java code contains only VTK pipeline
>> configuration.
>>
>> About wrapping I mean something other - pass/return types restrictions. For
>> example, I found that method that gets not fixed-length array but scalar
>> type pointer (void foo(int* a, int length) ) is not wrapped - it is absent
>> in *.java output. This forced me to use always pointer to vtkDataArray
>> object which could result in some not desired array copying (one to data
>> array class, in Java, other - to required class in pipeline). And there are
>> also some other allowed argumets/return types restrictions.  I've also found
>> that 'hints' file is somehow involved, but did not completely understand its
>> purpose and structure. So need some pointers to docs for writing C++ code
>> that will be wrapped in Java as expected.
>>
>>
>>
>> --
>> View this message in context: http://vtk.1045678.n5.nabble.com/Implementing-user-ImageAlgorithm-in-Java-impossible-tp4439921p4446532.html
>> Sent from the VTK - Users mailing list archive at Nabble.com.
>> _______________________________________________
>> Powered by www.kitware.com
>>
>> Visit other Kitware open-source projects at http://www.kitware.com/opensource/opensource.html
>>
>> Please keep messages on-topic and check the VTK FAQ at: http://www.vtk.org/Wiki/VTK_FAQ
>>
>> Follow this link to subscribe/unsubscribe:
>> http://www.vtk.org/mailman/listinfo/vtkusers
>>
>



More information about the vtkusers mailing list