[vtkusers] Wrapping parser fails on methods with std::string

Gerrick Bivins gbivins at objectreservoir.com
Tue Jun 2 17:54:21 EDT 2009


Hi Kent,
Thanks for the feed back. (I agree completely with what you mentioned about
minimal documentation for wrapping).

I've actually ended up doing what you've mentioned below. This works so far
and I had to do the things you mentioned as far as changing std::string to
char* and then moved some of my methods inside of the //BTX //ETX sections
etc...uggggh. 
Works so far as the wrapping goes.

Sorry about the misinformation, I'm wrapping a custom reader that I created
to import our data into vtk.
Thanks for the input,
Gerrick

On 6/2/09 4:47 PM, "kent williams" <nkwmailinglists at gmail.com> wrote:

> VTK Wrapping isn't smart enough to wrap functions with C++ classes as
> parameters.   Do you really need wrapped access to that particular
> method? If not, you can bracket the declaration in the header with
> //BTX and //ETX. For example:
> 
> class SomeReaderOrOther
> {
> public:
> //BTX
> void SomeFunctionTooFancyForVTKWrapping(const std::string &aString,
> const std::map &aMap);
> //ETX
> };
> 
> You'll need to change the std::string to 'const char *', and I don't
> know what you'll do about the std::map parameter.
> 
> This sort of question comes up all the time and once again points out
> that there's very close to no documentation of VTK wrapping, and any
> new VTK user who needs to wrap classes spends considerable time
> wandering around in the wilderness before figuring it out.
> 
> 
> 
> What reader class are you talking about, anyway?
> 
> On Tue, Jun 2, 2009 at 2:39 PM, Gerrick Bivins
> <gbivins at objectreservoir.com> wrote:
>> Hello all,
>> I¹m trying to wrap one of reader classes using VTKWrapJava but it¹s failing
>> during the parsing.
>> syntax error
>> *** SYNTAX ERROR found in parsing the header file
>> /Users/gbivins/work/APIs/VTK/Examples/Build/vtkMy/Unsorted/vtkORModelReader.h
>> before line 95 ***
>> 
>> This points to a method that has std::string and a std::map as parameters.
>> How can I work around this?
>> I saw that VTKWrapJava can accept a ³hint² file to help with parsing but it
>> is unclear what/how to populate this file.
>> Thanks in advance,
>> Gerrick
>> 
>> _______________________________________________
>> 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