<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Mar 30, 2015 at 7:26 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"><div class="gmail_extra"><span class=""><div class="gmail_quote">On Fri, Mar 27, 2015 at 12:00 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com" target="_blank">david.gobbi@gmail.com</a>></span> wrote:<br></div></span><div class="gmail_quote"><span class=""><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Fri, Mar 27, 2015 at 9:35 AM, David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></span> wrote:<br></span><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span><span>On Fri, Mar 27, 2015 at 11:21 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:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><span>On Fri, Mar 27, 2015 at 8:49 AM, David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></span> wrote:</span></div></div></div></blockquote></span></span><span><div>Would you have time to do this? It looks like we're going to need to bite the bullet and train the wrappers one way or another. No worries, If you're too busy, I can give it a shot, though I may need to bug you a bit while going through. But I really wouldn't mind taking some time to learn how the wrapping mechanisms work.</div></span></div></div></div></blockquote><div><br></div><div>No, I don't have time.  Feel free to bug me with specific questions.</div></div></div></div></blockquote><div><br></div></span><div>I've started looking into the wrapping code to add support for methods returning vtkBoundingBox. I think I see what needs to happen, let me know if anything here sounds wrong:</div><div><br></div><div>1) Teach the parser about vtkBoundingBox: (basically duplicating what I see for vtkUnicodeString)</div><div>1a) Add #define VTK_BOUNDING_BOX to vtkType.h</div><div>1b) Add VTK_PARSE_BOUNDING_BOX to vtkParseTypeMap in vtkParse.y</div><div>1c) Add BoundingBox to the type_name definition in vtkParse.y</div><div>1d) Add BoundingBox detection to the guess_id_type method in vtkParse.y.</div><div>1e) Add vtkBoundingBox entry in vtkParse.l</div></div></div></div></blockquote><div><br></div><div>The situation with vtkUnicodeString is very different from the situation with vtkBoundingBox.  Most languages have the concept of a "unicode string", so we want vtkUnicodeString to be directly converted into e.g. a Python unicode string or a Java string.  </div><div><br></div><div>The type list in vtkType.h is for types that can be converted to native types in the wrapper language.  Consider the python wrappers: they do not convert vtkBoundingBox into an existing python type, instead they wrap it as a new python type.  If you add VTK_PARSE_BOUNDING_BOX, then you'd also have to check for it in vtkWrapPython.c, which is messier that the current situation where all we had to do was add it to the CMakeLists file.</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div class="gmail_extra"><div class="gmail_quote"><div>2) Teach the wrapper about vtkBoundingBox (Tcl as an example, assuming others are similar...)</div><div>2a) Modify CheckFunctionSignature to allow vtkBoundingBox return types.</div><div>2b) Modify output_temp to declare the vtkBoundingBox temporary variable.</div><div>2c) Add a special case for vtkBoundingBox return types in outputFunction that converts to a bounds array.</div></div></div></div></blockquote><div><br></div><div>CheckFunctionSignature() can recognize vtkBoundingBox by using strcmp to check whether the class name of the type is "vtkBoundingBox".  In other words, modify the place where CheckFunctionSignature() looks at VTK_PARSE_OBJECT types (starting at line 888) and have it check for "vtkBoundingBox" there.   This makes everything in (1) completely unnecessary.   The list for (2) is good, though.</div><div><br></div><div> - David</div></div><br></div></div>