From: Matthias B. <mb...@us...> - 2004-07-27 15:19:14
|
Update of /cvsroot/pyode/pyode/src In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14817 Modified Files: declarations.pyx geoms.pyx Log Message: Added setInfo()/getInfo() and a few doc strings to the GeomTransform class Index: geoms.pyx =================================================================== RCS file: /cvsroot/pyode/pyode/src/geoms.pyx,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** geoms.pyx 19 Jul 2004 15:02:05 -0000 1.4 --- geoms.pyx 27 Jul 2004 15:19:03 -0000 1.5 *************** *** 517,520 **** --- 517,524 ---- cdef class GeomTransform(GeomObject): """GeomTransform. + + A geometry transform "T" is a geom that encapsulates another geom + "E", allowing E to be positioned and rotated arbitrarily with + respect to its point of reference. """ *************** *** 530,533 **** --- 534,540 ---- sid = sp.sid self.gid = dCreateGeomTransform(sid) + # Set cleanup mode to 0 as a contained geom will be deleted + # by its Python wrapper class + dGeomTransformSetCleanup(self.gid, 0) # if space!=None: # space._addgeom(self) *************** *** 551,554 **** --- 558,567 ---- def setGeom(self, geom): + """setGeom(geom) + + Set the geom that the geometry transform encapsulates. The geom must + not be inserted into any space, and must not be associated with any + body. + """ cdef long id *************** *** 558,563 **** --- 571,611 ---- def getGeom(self): + """getGeom() -> GeomObject + + Get the geom that the geometry transform encapsulates. + """ return self.geom + def setInfo(self, int mode): + """setInfo(mode) + + Set the "information" mode of the geometry transform. + + With mode 0, when a transform object is collided with another + object, the geom field of the ContactGeom structure is set to the + geom that is encapsulated by the transform object. + + With mode 1, the geom field of the ContactGeom structure is set + to the transform object itself. + + @param mode: Information mode (0 or 1) + @type mode: int + """ + dGeomTransformSetInfo(self.gid, mode) + + def getInfo(self): + """getInfo() -> int + + Get the "information" mode of the geometry transform (0 or 1). + + With mode 0, when a transform object is collided with another + object, the geom field of the ContactGeom structure is set to the + geom that is encapsulated by the transform object. + + With mode 1, the geom field of the ContactGeom structure is set + to the transform object itself. + """ + return dGeomTransformGetInfo(self.gid) + include "trimeshdata.pyx" Index: declarations.pyx =================================================================== RCS file: /cvsroot/pyode/pyode/src/declarations.pyx,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** declarations.pyx 24 Jul 2004 11:53:38 -0000 1.5 --- declarations.pyx 27 Jul 2004 15:19:03 -0000 1.6 *************** *** 347,350 **** --- 347,352 ---- void dGeomTransformSetCleanup (dGeomID g, int mode) int dGeomTransformGetCleanup (dGeomID g) + void dGeomTransformSetInfo (dGeomID g, int mode) + int dGeomTransformGetInfo (dGeomID g) int dCollide (dGeomID o1, dGeomID o2, int flags, dContactGeom *contact, int skip) |