<div dir="ltr">Thanks David! That's a fantastically easy workaround, I should have thought to try that ;-)<div><div><br></div><div>Dave</div></div></div><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 14, 2015 at 2:19 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.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 David,<div><br></div><div>I've identified the bug in the wrappers.  They are trying to wrap the out-of-line</div><div>definition of vtkTextRenderer::Metrics as a class named "vtkRenderer::Metrics"</div><div>in the global namespace (almost as if the "::" was actually part of the identifier).</div><div>This is something that I'll fix as soon as I have time to do so (probably not today).</div><div><br></div><div>If you put the definition of "Metrics" inline, i.e. within vtkTextRender, then the</div><div>wrappers will have no problem.  They will automatically exclude Metrics, and</div><div>any methods that use it, from wrapping.</div><span class="HOEnZb"><font color="#888888"><div><br></div><div> - David</div></font></span></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Jan 14, 2015 at 9:00 AM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.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 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><span><font color="#888888"><div><br></div><div> - David</div></font></span><div><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></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>