void My_TestGLDrawing::OffscreenTest() { SdfPath primId; int instanceIndex = -1; int elementIndex = -1; bool refined = (_reprName == HdTokens->refined); primId = PickScene(180, 100, &instanceIndex, &elementIndex); TF_VERIFY(primId == SdfPath("/cube1") && instanceIndex == 0 && elementIndex == 3); primId = PickScene(250, 190, &instanceIndex, &elementIndex); if (refined) { TF_VERIFY(primId == SdfPath("/protoTop") && instanceIndex == 2 && elementIndex == 4); } else { TF_VERIFY(primId == SdfPath("/protoTop") && instanceIndex == 2 && elementIndex == 3); } primId = PickScene(320, 290, &instanceIndex, &elementIndex); TF_VERIFY(primId == SdfPath("/protoBottom") && instanceIndex == 1 && elementIndex == 3); }
void My_TestGLDrawing::MousePress(int button, int x, int y, int modKeys) { Hdx_UnitTestGLDrawing::MousePress(button, x, y, modKeys); int instanceIndex = 0; int elementIndex = -1; SdfPath primId = PickScene(x, y, &instanceIndex, &elementIndex); if (!primId.IsEmpty()) { std::cout << "pick(" << x << ", " << y << "): " << "primId == " << primId << " " << "instance == " << instanceIndex << " " << "element == " << elementIndex << "\n"; } }