- comment correction in PyPad.cpp

- adding getBoundingBox method in PyReference.cpp
This commit is contained in:
Damien Dupuis 2010-04-27 12:25:56 +00:00
parent 22f2a47f99
commit eed0d1b35a
2 changed files with 21 additions and 5 deletions

View File

@ -38,7 +38,7 @@ extern "C" {
DBoDestroyAttribute(PyPad_destroy, PyPad) DBoDestroyAttribute(PyPad_destroy, PyPad)
// --------------------------------------------------------------- // ---------------------------------------------------------------
// Attribute Method : "PyPad_getSourcePosition ()" // Attribute Method : "PyPad_getBoundingBox ()"
static PyObject* PyPad_getBoundingBox( PyPad *self ) { static PyObject* PyPad_getBoundingBox( PyPad *self ) {
trace << "PyPad_getBoundingBox()" << endl; trace << "PyPad_getBoundingBox()" << endl;

View File

@ -20,14 +20,11 @@ using namespace Hurricane;
#include "hurricane/isobar/PyPoint.h" #include "hurricane/isobar/PyPoint.h"
#include "hurricane/isobar/PyCell.h" #include "hurricane/isobar/PyCell.h"
#include "hurricane/isobar/PyNet.h" #include "hurricane/isobar/PyNet.h"
#include "hurricane/isobar/PyBox.h"
namespace Isobar { namespace Isobar {
extern "C" { extern "C" {
#undef ACCESS_OBJECT #undef ACCESS_OBJECT
#undef ACCESS_CLASS #undef ACCESS_CLASS
#define ACCESS_OBJECT _baseObject._object #define ACCESS_OBJECT _baseObject._object
@ -74,6 +71,24 @@ extern "C" {
} }
// ---------------------------------------------------------------
// Attribute Method : "PyReference_getBoundingBox ()"
static PyObject* PyReference_getBoundingBox( PyReference *self ) {
trace << "PyReference_getBoundingBox()" << endl;
METHOD_HEAD ( "Reference.BoundingBox()" )
PyBox* pyBox = PyObject_NEW ( PyBox, &PyTypeBox );
if (pyBox == NULL) { return NULL; }
HTRY
pyBox->_object = new Box ( reference->getBoundingBox() );
HCATCH
return ( (PyObject*)pyBox );
}
// --------------------------------------------------------------- // ---------------------------------------------------------------
@ -109,6 +124,7 @@ extern "C" {
, "destroy associated hurricane object, the python object remains." } , "destroy associated hurricane object, the python object remains." }
, { "getName" , (PyCFunction)PyReference_getName , METH_NOARGS , "Returns the name of the reference." } , { "getName" , (PyCFunction)PyReference_getName , METH_NOARGS , "Returns the name of the reference." }
, { "getPoint" , (PyCFunction)PyReference_getPoint , METH_NOARGS , "Return the reference point." } , { "getPoint" , (PyCFunction)PyReference_getPoint , METH_NOARGS , "Return the reference point." }
, { "getBoundingBox" , (PyCFunction)PyReference_getBoundingBox , METH_NOARGS , "Return the reference boundingBox." }
, { "translate" , (PyCFunction)PyReference_translate , METH_VARARGS, "Translate the reference of dx and dy." } , { "translate" , (PyCFunction)PyReference_translate , METH_VARARGS, "Translate the reference of dx and dy." }
, {NULL, NULL, 0, NULL} /* sentinel */ , {NULL, NULL, 0, NULL} /* sentinel */
}; };