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

kent williams nkwmailinglists at gmail.com
Tue Jun 2 17:47:50 EDT 2009


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