1401
void wxVTKRenderWindowInteractor::GetCamVectors(double camPos[4], double camDir[4], double camUp[4]) {
1402
bool available = false;
1404
if (m_pPicker != NULL && m_pImageViewer != NULL) {
1405
int x = Size[0] >> 1;
1406
int y = Size[1] >> 1;
1407
vtkRenderer* ren = FindPokedRenderer(x, y);
1410
vtkCamera* cam = ren->GetActiveCamera();
1411
cam->GetPosition(camPos);
1412
cam->GetDirectionOfProjection(camDir);
1413
cam->GetViewUp(camUp);
1414
camPos[3] = camDir[3] = camUp[3] = 1.0;
1419
for (int i = 0; i < 4; i++) {
1420
camPos[i] = camDir[i] = camUp[i] = std::numeric_limits<double>::quiet_NaN();
1425
void wxVTKRenderWindowInteractor::RayPick(double displayPos[2], double worldPos[4]) {
1429
if (m_pPicker != NULL && m_pImageViewer != NULL) {
1430
int x = (int)(displayPos[0]);
1431
int y = Size[1] - (int)(displayPos[1]) - 1;
1432
vtkRenderer* ren = FindPokedRenderer(x, y);
1435
vtkCamera* cam = ren->GetActiveCamera();
1436
double pt[3] = { x, y, 0.0f };
1437
double world[4] = {0.0f, 0.0f, 0.0f, 0.0f};
1438
m_pPicker->Pick(pt, ren);
1439
m_pPicker->GetPickPosition(world);
1443
cam->GetPosition(cpos);
1444
cam->GetDirectionOfProjection(cdir);
1445
if (cam->GetParallelProjection()) {
1446
this->m_pImageViewer->IntersectarRayo(world, cdir, worldPos);
1453
worldPos[0] = worldPos[1] = worldPos[2] = worldPos[3] = std::numeric_limits<double>::quiet_NaN();
1458
void wxVTKRenderWindowInteractor::RayPick(double worldPos[4]) {
1462
if (m_pPicker != NULL && m_pImageViewer != NULL) {
1463
int x = Size[0] >> 1;
1464
int y = Size[1] >> 1;
1465
vtkRenderer* ren = FindPokedRenderer(x, y);
1468
vtkCamera* cam = ren->GetActiveCamera();
1471
cam->GetPosition(cpos);
1472
cam->GetDirectionOfProjection(cdir);
1473
this->m_pImageViewer->IntersectarRayo(cpos, cdir, worldPos);
1479
worldPos[0] = worldPos[1] = worldPos[2] = worldPos[3] = std::numeric_limits<double>::quiet_NaN();
1403
1486
//----------------------------------------------------------------------------------------------------
1404
1487
//region "Helpers de contexto de dibujado"
1406
1490
void wxVTKRenderWindowInteractor::TransformarEvento(wxMouseEvent &event)
1408
1492
if (m_pPicker != NULL && m_pImageViewer != NULL) {