// DepthDiag.cpp : implementation file // #include "stdafx.h" #include "imagegrinder.h" #include "DepthDiag.h" #include "imagegrinderDoc.h" ///////////////////////////////////////////////////////////////////////////// // CDepthDiag dialog CDepthDiag::CDepthDiag(CWnd* pParent /*=NULL*/) : CDialog(CDepthDiag::IDD, pParent) { //{{AFX_DATA_INIT(CDepthDiag) //}}AFX_DATA_INIT } void CDepthDiag::DoDataExchange(CDataExchange* pDX) { CDialog::DoDataExchange(pDX); //{{AFX_DATA_MAP(CDepthDiag) DDX_Control(pDX, IDC_DLIST, m_DList); //}}AFX_DATA_MAP } BEGIN_MESSAGE_MAP(CDepthDiag, CDialog) //{{AFX_MSG_MAP(CDepthDiag) ON_LBN_SELCHANGE(IDC_DLIST, OnSelchangeDlist) //}}AFX_MSG_MAP END_MESSAGE_MAP() ///////////////////////////////////////////////////////////////////////////// // CDepthDiag message handlers int CDepthDiag::DoModal(CImageGrinderDoc *Doc,CPoint &pnt) { int i,depth; pDoc=Doc; depth=pDoc->FGrid->ShootRay((unsigned short)pnt.x,(unsigned short)pnt.y); SelCount=0; for(i=depth-1;i>0;i--) { if(!pDoc->IsLocked(pDoc->FGrid->GetCollectedNr(i))) SelectedFeature[SelCount++]=pDoc->FGrid->GetCollectedNr(i); } return CDialog::DoModal(); } BOOL CDepthDiag::OnInitDialog() { CDialog::OnInitDialog(); int itm; // TODO: Add extra initialization here for(int i=0;ifeature->GetName())); m_DList.SetItemDataPtr(itm,(void *)SelectedFeature[i]); if(SelectedFeature[i]->StatFlags&FIF_SELECTED) m_DList.SetSel(itm,TRUE); BackupSel[i]=*(SelectedFeature[i]); } return TRUE; // return TRUE unless you set the focus to a control // EXCEPTION: OCX Property Pages should return FALSE } void CDepthDiag::OnOK() { CDialog::OnOK(); } void CDepthDiag::OnSelchangeDlist() { // TODO: Add your control notification handler code here for(int i=0;iAddSelection((Compost::FeatureInstance *)m_DList.GetItemDataPtr(i)); else pDoc->SubSelection((Compost::FeatureInstance *)m_DList.GetItemDataPtr(i)); } pDoc->UpdateAllViews(NULL); } void CDepthDiag::OnCancel() { // pDoc->SelectionCount=BackupCount; for(int i=0;iUpdateAllViews(NULL); CDialog::OnCancel(); }