2010/3/2 Chen Xu <chen...@ymail.com> > Dear friends > I have been introduced recently to the pythonocc project. It is a pleasure > to get access to your excellent work. > > But I have some doubt about how the swig wrappers are implemented. Please > allow me to list the Convert methods of the class OCC.V3d.V3d_View and > indicate my doubt about overloaded signatures. > > I search the opencascade reference documentation at > http://adl.serveftp.org/lab/opencascade/doc/ReferenceDocumentation/Visualization/html/classV3d__View.html > : > Standard_EXPORT Quantity_Length Convert (const Standard_Integer Vp) > const > Standard_EXPORT void Convert (const Standard_Integer Xp, const > Standard_Integer Yp, V3d_Coordinate &Xv, V3d_Coordinate &Yv) const > Standard_EXPORT Standard_Integer Convert (const Quantity_Length Vv) > const > Standard_EXPORT void Convert (const V3d_Coordinate Xv, const > V3d_Coordinate Yv, Standard_Integer &Xp, Standard_Integer &Yp) const > Standard_EXPORT void Convert (const Standard_Integer Xp, const > Standard_Integer Yp, V3d_Coordinate &X, V3d_Coordinate &Y, V3d_Coordinate > &Z) const > Standard_EXPORT void Convert (const V3d_Coordinate X, const > V3d_Coordinate Y, const V3d_Coordinate Z, Standard_Integer &Xp, > Standard_Integer &Yp) const > > Next I search the pythonocc documentation at > http://www.pythonocc.org/APIREF/OCC.V3d.V3d_View-class.html: > Convert(Standard_Integer Vp) -> Quantity_Length > Convert(Standard_Integer Xp, Standard_Integer Yp) -> > [Standard_RealStandard_Real] > Convert(Quantity_Length Vv) -> Standard_Integer > Convert(V3d_Coordinate Xv, V3d_Coordinate Yv) -> > [Standard_IntegerStandard_Integer] > Convert(Standard_Integer Xp, Standard_Integer Yp) -> > [Standard_RealStandard_RealStandard_Real] > Convert(V3d_Coordinate X, V3d_Coordinate Y, V3d_Coordinate Z) -> > [Standard_IntegerStandard_Integer] > > I see the swig implementation attempts to imitate the reference > documentation. I doubt how to call X,Y,Z=Convert(Xp,Yp) with three output > values, because Xv,Yv=Convert(Xp,Yp) hides the other call. There are other > doubts, how to tell Convert(Vp) from Convert(Vv), and some more. > > I apologise to be the first to show these doubts. I would be honored to > read your opinion weather it is still possible to call the other overloaded > methods in pythonocc? > > Can you publish a patch to make all Convert methods available if it is not > possible with the current pythonocc code? > A solution is very urgent to my studies. > > Yours > Chen > > Hi Chen,
Thanks for reporting this issue. C++ that take byref parameters (Standard_Interger & for instance) are transformed to become pythonic: they return Standard_Integer. However, I did not take into account the case where the resulting method has exactly the same resulting prototype. I don't know whether it's specific to the Convert method, there might be other methods affected. I will submit a patch in order to fix this issue. My idea is to rename the Convert method to Convert_2, Convert_3 etc. in the case where the function prototype has already be generated. However, I agree with Jelle's: we aim at improving the pythonOCC project and helping users. I don't know what your project deal with, but I'm sure it can be of interest: none of us ever contributed some code with coord conversion from the viewer. I mean, I submit a patch, you contribute a sample. Fair deal, don't you think? Best Regards, Thomas
_______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users