Beispiel #1
0
bool ViewerIBA::OnMouseDoubleClicked(const CVD::ImageRef &where, const int button) {
  if (button == VW_MOUSE_BUTTON_MIDDLE_UP || button == VW_MOUSE_BUTTON_MIDDLE_DOWN) {
    return false;
  } else if (button == VW_MOUSE_BUTTON_RIGHT) {
    const Point2D x = Point2D(where.x * m_factorWinToImg.x(), where.y * m_factorWinToImg.y());
    x.Print("x = ", false, true);
#ifdef CFG_DEPTH_MAP
    const CVD::Image<ushort> &Z = m_LFs[m_iLFActive].m_ZIP[0];
    if (m_keyDrawViewType == DRAW_VIEW_2D && m_iFrmActive >= int(m_KFs.size()) && UT::ImageValid(Z)) {
      const float d = Depth::InterpolateDepth(Z, x, m_work);
      if (d != 0.0f) {
        const float z = 1.0f / d;
        UT::Print("z = %f\n", z);
        const Point3D X = Point3D(m_KIP[0].GetImageToNormalized(x), z);
        X.Print("X = ", false);
      }
    }
#endif
    return true;
  } else {
    SearchActiveFeatureStart();
    const bool found = SearchActiveFeature(where);
    SearchActiveFeatureStop();
    return found;
  }
}