<div dir="ltr">I was also studying the vtkWrapTcl.c code, just the part related to the tasks described in 2). <br><br>For instance, regarding to vtkVariant value, the function int checkFunctionSignature(ClassInfo *data) reject to wrap a method call if the return value is vtkVariant or expect an argument of type vtkVariant in one of this checks:<br><br><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:36pt" id="docs-internal-guid-de4d8766-6b0d-3ac7-d9b0-51c574292f87"><span style="font-size:11px;font-family:Consolas;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">if ((returnType & VTK_PARSE_INDIRECT) != VTK_PARSE_POINTER) // the return type is value not a pointer<br></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:11px;font-family:Consolas;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">{</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:11px;font-family:Consolas;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">args_ok = 0;</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:11px;font-family:Consolas;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">}</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:36pt">....</p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:36pt" id="docs-internal-guid-de4d8766-6b0d-846c-757a-0e0d56cd2e87"><span style="font-size:11px;font-family:Consolas;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">if ((argType & VTK_PARSE_INDIRECT) != VTK_PARSE_POINTER) // the argument is a value not a pointer<br></span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:11px;font-family:Consolas;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">{</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:11px;font-family:Consolas;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">args_ok = 0;</span></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><span style="font-size:11px;font-family:Consolas;color:rgb(0,0,0);background-color:transparent;font-weight:normal;font-style:normal;font-variant:normal;text-decoration:none;vertical-align:baseline">}</span></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:6.24pt">I think that we can wrap (at least manually) some classes (vtkVariant, vtkBoundingBox, ...) not derived from vtkObject as new Tcl_ObjType and provide in vtkTclUtil some helper functions to convert from C++ instances to Tcl_Obj and the other way from Tcl_Obj to C++ instance.</p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:6.24pt"><br></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:6.24pt">I'm experimenting with this idea: implement new Tcl_ObjType to wrap vtkVariant and vtkBoundingBox.<br></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:6.24pt"><br></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:6.24pt">By the way the generated C code could be based in Tcl_Obj *objv[] interface instead of char *argv[]</p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:6.24pt"><br></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:6.24pt">best regards,</p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:6.24pt"><br></p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:6.24pt">Jorge</p><p style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:6.24pt"><br></p><p dir="ltr" style="line-height:1.38;margin-top:0pt;margin-bottom:0pt;margin-left:36pt"><br></p></div><div class="gmail_extra"><br><div class="gmail_quote">2015-03-30 15:26 GMT+02:00 David Lonie <span dir="ltr"><<a href="mailto:david.lonie@kitware.com" target="_blank">david.lonie@kitware.com</a>></span>:<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><br></div><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><br></div><div>Sound good? Anything I'm missing?</div><div><br></div><div>Thanks a ton!</div><div>Dave</div></div></div></div>
<br>_______________________________________________<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Search the list archives at: <a href="http://markmail.org/search/?q=vtk-developers" target="_blank">http://markmail.org/search/?q=vtk-developers</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://public.kitware.com/mailman/listinfo/vtk-developers" target="_blank">http://public.kitware.com/mailman/listinfo/vtk-developers</a><br>
<br>
<br></blockquote></div><br></div>