>Hi all, > >Just started to play with class renaming as we told about the last couple of >days. Just to let you know it's actually *very* simple to deals with this >>feature: SWIG has a reday '%rename' feature that does the job as expected. > >Here is the result of a very first try with the gp module: > >C:\Developpement>python >EPD Py25 (4.1.30101) -- http://www.enthought.com/epd > >Python 2.5.2 |EPD Py25 4.1.30101| (r252:60911, Dec 19 2008, 13:49:12) [MSC >v.1310 32 bit (Intel)] on win32 >Type "help", "copyright", "credits" or "license" for more information. >>>> from OCC import gp >>>> P1 = gp.Pnt(0.,0.,0.) >>>> P2 = gp.Pnt(1.,1.,1.) >>>> P1 ><OCC.gp.Pnt; proxy of <Swig Object of type 'gp_Pnt *' at 0x00DFE8E0> > >>>> P2 ><OCC.gp.Pnt; proxy of <Swig Object of type 'gp_Pnt *' at 0x00DFEAE0> > >>>> V1 = gp.Vec(P1,P2) >>>> V1 ><OCC.gp.Vec; proxy of <Swig Object of type 'gp_Vec *' at 0x00E023C0> > >>>> V1.Magnitude() >1.7320508075688772 > > >Is this something that fits your expectations (I mean Bryan, Frank, Arthur ?). >If it's ok for you, well, to be honest, it's not more than one hour of >work >to extend this to all pythonOCC modules. > >Cheers, > >Thomas
I was a bit optimistic about the modifications to made: it's more 20 lines of code to add than 10. However I tested that the following code works: """ C:\DEVELO~1\Libraries\ZSI_trunk>python EPD Py25 (4.1.30101) -- http://www.enthought.com/epd Python 2.5.2 |EPD Py25 4.1.30101| (r252:60911, Dec 19 2008, 13:49:12) [MSC v.1310 32 bit (Intel)] on win32 Type "help", "copyright", "credits" or "license" for more information. >>> from OCC import BRepPrimAPI, TopoDS >>> box = BRepPrimAPI.MakeBox(5.,5.,5.) >>> box <OCC.BRepPrimAPI.MakeBox; proxy of <Swig Object of type 'BRepPrimAPI_MakeBox *' at 0x00DEA020> > >>> box_s = box.Shape() >>> box_s <OCC.TopoDS.Shape; proxy of <Swig Object of type 'TopoDS_Shape *' at 0x00DEAA60> > """ This part of code means that inheritance and dependencies between modules are robust in the case of a wide class renaming. I have to re-generate all the swig files (for both Windows and Linux). When it's done, I will commit changes to the svn repository as well as a Windows binary in the 'daily build' folder of the pythonocc website. Then it'll be time to test this new feature before modifying all scripts based upon the Level1 wrapper. Best Regards, Thomas _______________________________________________ Pythonocc-users mailing list Pythonocc-users@gna.org https://mail.gna.org/listinfo/pythonocc-users