#pragma once

// AT grabber parameters dialog
class IntelParamDialog : public CDialog
{
public:
  IntelParamDialog(int min, int max, bool decim, bool tempo, std::string profile) : CDialog(IDD_INTEL_PARAMETERS),
    min_depth(min), max_depth(max), enable_decimation_filter(decim), enable_temporal_filter(tempo), visual_profile(profile)
  {}

protected:
  DECLARE_MESSAGE_MAP()

  virtual BOOL OnInitDialog()
  {
    CDialog::OnInitDialog();

    ((CEdit*)GetDlgItem(IDC_MINDEPTH))->SetWindowText(std::to_wstring(min_depth).c_str());
    ((CEdit*)GetDlgItem(IDC_MAXDEPTH))->SetWindowText(std::to_wstring(max_depth).c_str());

    ((CButton*)GetDlgItem(IDC_CHECKDECIMATION))->SetCheck(enable_decimation_filter);
    ((CButton*)GetDlgItem(IDC_CHECKTEMPORAL))->SetCheck(enable_temporal_filter);

    ((CEdit*)GetDlgItem(IDC_VISUAL_PROFILE))->SetWindowText(CString(visual_profile.c_str()));

    return TRUE;
  }

  void OnOK()
  {
    CString str;
    ((CEdit*)GetDlgItem(IDC_MINDEPTH))->GetWindowText(str);
    min_depth = _wtoi(str);

    ((CEdit*)GetDlgItem(IDC_MAXDEPTH))->GetWindowText(str);
    max_depth = _wtoi(str);

    enable_decimation_filter = ((CButton*)GetDlgItem(IDC_CHECKDECIMATION))->GetCheck();
    enable_temporal_filter = ((CButton*)GetDlgItem(IDC_CHECKTEMPORAL))->GetCheck();

    ((CEdit*)GetDlgItem(IDC_VISUAL_PROFILE))->GetWindowText(str);
    visual_profile = CT2CA(str);

    CDialog::EndDialog(1);
  }

public:
  int min_depth, max_depth;
  bool enable_decimation_filter;
  bool enable_temporal_filter;
  std::string visual_profile;
};

BEGIN_MESSAGE_MAP(IntelParamDialog, CDialog)
END_MESSAGE_MAP()


