<div dir="ltr">Hi David,<div><br></div><div>This suggests a bug in the wrappers, because the wrappers should be excluding</div><div>these methods automatically. The use of "#ifndef __WRAP__" should be avoided,</div><div>if there is an option to instead fix the wrappers themselves. I'll take a look at the</div><div>code sometime today in the hope that there is a simple fix.</div><div><br></div><div>The wrappers cannot wrap nested classes or structs yet, because they use a flat</div><div>global namespace for object types.  I did a bunch of work to fix this three years ago,</div><div>but never finished because the "flat namespace" assumption worked well for VTK.</div><div>I've always wanted an excuse to go back and finish this code.</div><div><br></div><div> - David</div><div><br></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 14, 2015 at 8:24 AM, David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr">Hi folks,<div><br></div><div>I'm looking for some advice on getting a patch to play nicely with the wrappers.</div><div><br></div><div>I have a vtkObject derived class that contains a nested struct:</div><div><br></div><div>class EXPORT_MACRO vtkTextRenderer : public vtkObject</div><div>{</div><div>public:</div><div>  struct Metrics;</div><div><br></div><div>  ...</div><div><br></div><div>  bool GetMetrics(..., Metrics &);</div><div>}</div><div><br></div><div>struct vtkTextRenderer::Metrics</div><div>{</div><div>  ...</div><div>}</div><div><br></div><div>It looks like the python wrappers aren't happy about this, see:</div><div><br></div><div><a href="https://open.cdash.org/viewBuildError.php?buildid=3651284" target="_blank">https://open.cdash.org/viewBuildError.php?buildid=3651284</a><br></div><div><br></div><div>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:</div><div><br></div><div>1) Exclude all usages of Metrics with __WRAP__</div><div><br></div><div>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.</div><div><br></div><div>2) Change Metrics to a stand-alone vtkObject derived class.</div><div><br></div><div>Cons: It's a really lightweight object, I'd like to avoid having the overhead of vtkObject enter into this.</div><div><br></div><div>3) Special wrapping for the metrics class.</div><div><br></div><div>Cons: Work. Also, maintenance would be a headache as I expect this struct to have new members added over time.</div><div><br></div><div>Any options I'm missing? I'm leaning towards 2, but a more lightweight solution would be great, if it exists!</div><div><br></div><div>Thanks,</div><div>Dave</div></div>
<br></blockquote></div><br></div></div>