| 24 | #if BLUE_WITH_PYTHON |
| 25 | |
| 26 | static PyObject* PyGetAreas( PyObject* self, PyObject* args ) |
| 27 | { |
| 28 | Tr2Mesh* pThis = BluePythonCast<Tr2Mesh*>( self ); |
| 29 | if( !pThis ) |
| 30 | { |
| 31 | return NULL; |
| 32 | } |
| 33 | |
| 34 | int areaIndex; |
| 35 | |
| 36 | if( !PyArg_ParseTuple( args, "i", &areaIndex ) ) |
| 37 | { |
| 38 | PyErr_SetString( PyExc_TypeError, "Arguments must be (i)." ); |
| 39 | return 0; |
| 40 | } |
| 41 | |
| 42 | TriBatchType type( static_cast<TriBatchType>( areaIndex ) ); |
| 43 | |
| 44 | Tr2MeshAreaVector* areas( pThis->GetAreas( type ) ); |
| 45 | |
| 46 | if( !areas ) |
| 47 | { |
| 48 | Py_RETURN_NONE; |
| 49 | } |
| 50 | |
| 51 | return PyOS->WrapBlueObject( areas->GetRawRoot() ); |
| 52 | } |
| 53 | #endif |
| 54 | |
| 55 | const Be::ClassInfo* Tr2Mesh::ExposeToBlue() |