That sounds fine to me. I was just explaining the historical reason for it for Marcus' benefit.<br><br><div><br><div class="gmail_quote">On Fri, Feb 10, 2012 at 5:11 PM, David Gobbi <span dir="ltr"><<a href="mailto:david.gobbi@gmail.com">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">Hi David,<br>
<br>
For the Tcl, Java, and ClientServer wrappers, the best solution would<br>
be to remove templated classes from the inheritance chain, as far as<br>
the wrappers are concerned. I.e. do it automatically as part of the<br>
wrapper code, rather than with #ifdef/#undef tricks in the headers.<br>
<br>
If it was only the python wrappers that we had to worry about, then<br>
we would just wrap those templated superclasses and be done with it.<br>
That's how vtkDenseArray, vtkSparseArray, and all the vtkVector-<br>
derived classes are wrapped in python.<br>
<span class="HOEnZb"><font color="#888888"><br>
- David<br>
</font></span><div class="HOEnZb"><div class="h5"><br>
<br>
On Fri, Feb 10, 2012 at 2:55 PM, David Cole <<a href="mailto:david.cole@kitware.com">david.cole@kitware.com</a>> wrote:<br>
> That define/undef pattern was previously used to keep template parameters<br>
> out of the wrapped class hierarchy.<br>
><br>
> The wrapper generators would simply use vtkSIVectorProperty as the parent<br>
> class.<br>
><br>
> Now that generators are macro-aware after this commit, something else has to<br>
> fool them instead.<br>
><br>
><br>
> On Fri, Feb 10, 2012 at 4:28 PM, Marcus D. Hanwell<br>
> <<a href="mailto:marcus.hanwell@kitware.com">marcus.hanwell@kitware.com</a>> wrote:<br>
>><br>
>> Hi David,<br>
>><br>
>> That makes sense, I wasn't quite sure why we would do things like this,<br>
>><br>
>> #define vtkSIVectorProperty vtkSIVectorPropertyTemplate<vtkIdType, bool><br>
>> class VTK_EXPORT vtkSIIdTypeVectorProperty : public vtkSIVectorProperty<br>
>> #undef vtkSIVectorProperty<br>
>><br>
>> This is what is leading to the issue I saw. I guess the major issue<br>
>> here is that the expanded name is then used to name the command, and<br>
>> so changing the <, > characters would have resulted in a valid symbol<br>
>> name.<br>
>><br>
>> Thanks for fixing this up, I am compiling the proposed patch right now<br>
>> to check it out.<br>
>><br>
>> Marcus<br>
>><br>
>> On Fri, Feb 10, 2012 at 3:27 PM, David Gobbi <<a href="mailto:david.gobbi@gmail.com">david.gobbi@gmail.com</a>><br>
>> wrote:<br>
>> > Hi Markus,<br>
>> ><br>
>> > The error looks identical to an issue that I saw in VTK where the<br>
>> > developers used macros to fool the wrappers into thinking that<br>
>> > vtkIntArray et al had vtkDataArray as their superclass, when the<br>
>> > real superclass was in fact vtkDataArrayTemplate<int>. With the<br>
>> > new macro expansion code, the wrappers aren't fooled anymore.<br>
>> ><br>
>> > I can add special-cases to the wrapper code for these Paraview<br>
>> > classes (as I did for vtkDataArray) until I up with a general solution.<br>
>> ><br>
>> > - David<br>
>> ><br>
>> ><br>
>> > On Fri, Feb 10, 2012 at 12:34 PM, Marcus D. Hanwell<br>
>> > <<a href="mailto:marcus.hanwell@kitware.com">marcus.hanwell@kitware.com</a>> wrote:<br>
>> >> Hi David,<br>
>> >><br>
>> >> It looks like there are some issues introduced in ParaView's client<br>
>> >> server wrapping with the new macro expansion code, I am seeing<br>
>> >> failures such as,<br>
>> >><br>
>> >> [ 85%] Building CXX object<br>
>> >><br>
>> >> ParaViewCore/ServerImplementation/CMakeFiles/vtkPVServerImplementationCS.dir/vtkSIDoubleVectorPropertyClientServer.cxx.o<br>
>> >><br>
>> >> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:16:40:<br>
>> >> error: invalid declarator before ‘Command’<br>
>> >><br>
>> >> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:<br>
>> >> In function ‘int<br>
>> >> vtkSIDoubleVectorPropertyCommand(vtkClientServerInterpreter*,<br>
>> >> vtkObjectBase*, const char*, const vtkClientServerStream&,<br>
>> >> vtkClientServerStream&)’:<br>
>> >><br>
>> >> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:87:42:<br>
>> >> error: expected primary-expression before ‘Command’<br>
>> >><br>
>> >> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:87:42:<br>
>> >> error: expected ‘)’ before ‘Command’<br>
>> >><br>
>> >> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:<br>
>> >> At global scope:<br>
>> >><br>
>> >> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:109:41:<br>
>> >> error: invalid declarator before ‘_Init’<br>
>> >><br>
>> >> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:<br>
>> >> In function ‘void<br>
>> >> vtkSIDoubleVectorProperty_Init(vtkClientServerInterpreter*)’:<br>
>> >><br>
>> >> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:119:49:<br>
>> >> error: no matching function for call to<br>
>> >><br>
>> >> ‘vtkSIVectorPropertyTemplate<double>::vtkSIVectorPropertyTemplate(vtkClientServerInterpreter*&)’<br>
>> >><br>
>> >> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:119:49:<br>
>> >> note: candidates are:<br>
>> >><br>
>> >> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:68:3:<br>
>> >> note: vtkSIVectorPropertyTemplate<T,<br>
>> >> force_idtype>::vtkSIVectorPropertyTemplate(const<br>
>> >> vtkSIVectorPropertyTemplate<T, force_idtype>&) [with T = double,<br>
>> >> force_idtype = int, vtkSIVectorPropertyTemplate<T, force_idtype> =<br>
>> >> vtkSIVectorPropertyTemplate<double>]<br>
>> >><br>
>> >> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:68:3:<br>
>> >> note: no known conversion for argument 1 from<br>
>> >> ‘vtkClientServerInterpreter*’ to ‘const<br>
>> >> vtkSIVectorPropertyTemplate<double>&’<br>
>> >><br>
>> >> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:46:3:<br>
>> >> note: vtkSIVectorPropertyTemplate<T,<br>
>> >> force_idtype>::vtkSIVectorPropertyTemplate() [with T = double,<br>
>> >> force_idtype = int]<br>
>> >><br>
>> >> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:46:3:<br>
>> >> note: candidate expects 0 arguments, 1 provided<br>
>> >><br>
>> >> /home/marcus/ssd/src/ParaView/ParaViewCore/ServerImplementation/vtkSIVectorPropertyTemplate.h:47:3:<br>
>> >> error: ‘vtkSIVectorPropertyTemplate<T,<br>
>> >> force_idtype>::~vtkSIVectorPropertyTemplate() [with T = double,<br>
>> >> force_idtype = int]’ is protected<br>
>> >><br>
>> >> /home/marcus/ssd/build/ParaView/ParaViewCore/ServerImplementation/vtkSIDoubleVectorPropertyClientServer.cxx:119:49:<br>
>> >> error: within this context<br>
>> >> make[2]: ***<br>
>> >> [ParaViewCore/ServerImplementation/CMakeFiles/vtkPVServerImplementationCS.dir/vtkSIDoubleVectorPropertyClientServer.cxx.o]<br>
>> >> Error 1<br>
>> >> make[1]: ***<br>
>> >> [ParaViewCore/ServerImplementation/CMakeFiles/vtkPVServerImplementationCS.dir/all]<br>
>> >> Error 2<br>
>> >> make: *** [all] Error 2<br>
>> >><br>
>> >> The generated code looks wrong too, things such as the following are<br>
>> >> appearing,<br>
>> >><br>
>> >> int<br>
>> >> vtkSIVectorPropertyTemplate<double>Command(vtkClientServerInterpreter*,<br>
>> >> vtkObjectBase*, const char*, const vtkClientServerStream&,<br>
>> >> vtkClientServerStream& resultStream);<br>
>> >><br>
>> >> and,<br>
>> >><br>
>> >> if (vtkSIVectorPropertyTemplate<double>Command(arlu,<br>
>> >> op,method,msg,resultStream))<br>
>> >> {<br>
>> >> return 1;<br>
>> >> }<br>
>> >><br>
>> >> which becomes,<br>
>> >><br>
>> >> if (vtkSIVectorPropertyCommand(arlu, op,method,msg,resultStream))<br>
>> >> {<br>
>> >> return 1;<br>
>> >> }<br>
>> >><br>
>> >> when the commit is reverted locally. Is this a special case we need to<br>
>> >> add to the ParaView code?<br>
>> >><br>
>> >> Thanks,<br>
>> >><br>
>> >> Marcus<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<br>
>> <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
>><br>
>> Follow this link to subscribe/unsubscribe:<br>
>> <a href="http://www.vtk.org/mailman/listinfo/vtk-developers" target="_blank">http://www.vtk.org/mailman/listinfo/vtk-developers</a><br>
>><br>
><br>
</div></div></blockquote></div><br></div>