[vtk-developers] Nested structs and python wrapping

David Lonie david.lonie at kitware.com
Wed Jan 14 10:24:52 EST 2015


Hi folks,

I'm looking for some advice on getting a patch to play nicely with the
wrappers.

I have a vtkObject derived class that contains a nested struct:

class EXPORT_MACRO vtkTextRenderer : public vtkObject
{
public:
  struct Metrics;

  ...

  bool GetMetrics(..., Metrics &);
}

struct vtkTextRenderer::Metrics
{
  ...
}

It looks like the python wrappers aren't happy about this, see:

https://open.cdash.org/viewBuildError.php?buildid=3651284

Ben pointed out that I can use the __WRAP__ define to exclude these, but
I'm interested in hearing more options. I see a couple of paths forward:

1) Exclude all usages of Metrics with __WRAP__

Cons: Functionality can't be used from wrapped languages. Maintenance would
be a chore, as the Metrics struct is used in a number of text rendering
related headers.

2) Change Metrics to a stand-alone vtkObject derived class.

Cons: It's a really lightweight object, I'd like to avoid having the
overhead of vtkObject enter into this.

3) Special wrapping for the metrics class.

Cons: Work. Also, maintenance would be a headache as I expect this struct
to have new members added over time.

Any options I'm missing? I'm leaning towards 2, but a more lightweight
solution would be great, if it exists!

Thanks,
Dave
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://public.kitware.com/pipermail/vtk-developers/attachments/20150114/83ee4493/attachment-0001.html>


More information about the vtk-developers mailing list