| 46 | |
| 47 | #if BLUE_WITH_PYTHON |
| 48 | PyObject* PyPickObjectAndAreaID( PyObject* self, PyObject* args ) |
| 49 | { |
| 50 | TriPythonContext pythonCtx; |
| 51 | EveSpaceScene* pThis = BluePythonCast<EveSpaceScene*>( self ); |
| 52 | |
| 53 | PyObject* pyProjection = NULL; |
| 54 | PyObject* pyView = NULL; |
| 55 | PyObject* pyViewport = NULL; |
| 56 | |
| 57 | int x, y, flags = PICK_TYPE_PICKING | PICK_TYPE_OPAQUE; |
| 58 | if( !PyArg_ParseTuple( args, "iiOOO|i", &x, &y, &pyProjection, &pyView, &pyViewport, &flags ) ) |
| 59 | return NULL; |
| 60 | |
| 61 | TriProjection* projection = NULL; |
| 62 | if( !BlueExtractArgument( pyProjection, projection, 3 ) ) |
| 63 | { |
| 64 | return NULL; |
| 65 | } |
| 66 | |
| 67 | TriView* view = NULL; |
| 68 | if( !BlueExtractArgument( pyView, view, 4 ) ) |
| 69 | { |
| 70 | return NULL; |
| 71 | } |
| 72 | |
| 73 | TriViewport* viewport = NULL; |
| 74 | if( !BlueExtractArgument( pyViewport, viewport, 5 ) ) |
| 75 | { |
| 76 | return NULL; |
| 77 | } |
| 78 | |
| 79 | IRoot* object = NULL; |
| 80 | unsigned int areaID = 0; |
| 81 | |
| 82 | USE_MAIN_THREAD_RENDER_CONTEXT(); |
| 83 | object = pThis->PickObjectAndArea( x, y, projection, view, viewport, areaID, Tr2PickTypes( flags ), renderContext ); |
| 84 | |
| 85 | if( object ) |
| 86 | { |
| 87 | PyObject* result = PyTuple_New( 2 ); |
| 88 | PyTuple_SET_ITEM( result, 0, PyOS->WrapBlueObject( object ) ); |
| 89 | PyTuple_SET_ITEM( result, 1, PyLong_FromUnsignedLong( areaID ) ); |
| 90 | return result; |
| 91 | } |
| 92 | |
| 93 | Py_INCREF( Py_None ); |
| 94 | return Py_None; |
| 95 | } |
| 96 | #endif |
| 97 | |
| 98 |
nothing calls this directly
no test coverage detected