| | |
| | | |
| | | void CEdgeImageViewer::UpdateView_NotchMeasure(CDC* memDC) |
| | | { |
| | | if(m_pBuffer == NULL || memDC == NULL || m_pGlassData == NULL) |
| | | if(m_pBuffer == NULL || memDC == NULL || m_pGlassData == NULL || m_pGlassData->GetSideData((DimensionDir)m_nSideIdx) == NULL) |
| | | return; |
| | | |
| | | if(m_MenuStatus[MODE_VIEW_NOTCH_MEASURE] == FALSE) |
| | |
| | | |
| | | memDC->SetTextColor(RGB(0,0,255)); |
| | | |
| | | int nNotchCount = m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nNotchCount; |
| | | CSide_Data* pSideData = m_pGlassData->GetSideData((DimensionDir)m_nSideIdx); |
| | | int nNotchCount = pSideData->m_nNotchCount; |
| | | |
| | | for(int i=0; i<nNotchCount; i++) |
| | | { |
| | | for(int j=0; j<MAX_SIDE_NOTCH_MEASURE_COUNT; j++) |
| | | { |
| | | CPoint ptRef_pxl = m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_ptNotch_Reference[i][j]; |
| | | CPoint ptDimension_Edge_pxl = m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_ptNotch_Dimension_Edge[i][j]; |
| | | CPoint ptChamfer_Edge_pxl = m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_ptNotch_Chamfer_Edge[i][j]; |
| | | CPoint ptRef_pxl = pSideData->m_ptNotch_Reference[i][j]; |
| | | CPoint ptDimension_Edge_pxl = pSideData->m_ptNotch_Dimension_Edge[i][j]; |
| | | CPoint ptChamfer_Edge_pxl = pSideData->m_ptNotch_Chamfer_Edge[i][j]; |
| | | |
| | | CPoint ptRef_wnd = GetWndPos(ptRef_pxl); |
| | | CPoint ptDimension_Edge_wnd = GetWndPos(ptDimension_Edge_pxl); |
| | |
| | | memDC->SelectObject(brush_Ref_Rect); |
| | | memDC->FillRect(&rectRef, &brush_Ref_Rect); |
| | | |
| | | if(m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nNotch_Dimension_Edge_Judge[i][j] != 0) |
| | | if(pSideData->m_nNotch_Dimension_Edge_Judge[i][j] != 0) |
| | | { |
| | | if(m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nNotch_Dimension_Edge_Judge[i][j] == 1) |
| | | if(pSideData->m_nNotch_Dimension_Edge_Judge[i][j] == 1) |
| | | memDC->SelectObject(&pen_Solid_Green); |
| | | else |
| | | memDC->SelectObject(&pen_Solid_Red); |
| | |
| | | memDC->LineTo(ptDimension_Edge_wnd.x,ptDimension_Edge_wnd.y); |
| | | } |
| | | |
| | | if(m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nNotch_Chamfer_Edge_Judge[i][j] != 0) |
| | | if(pSideData->m_nNotch_Chamfer_Edge_Judge[i][j] != 0) |
| | | { |
| | | if(m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nNotch_Chamfer_Edge_Judge[i][j] == 1) |
| | | if(pSideData->m_nNotch_Chamfer_Edge_Judge[i][j] == 1) |
| | | memDC->SelectObject(&pen_Solid_Green); |
| | | else |
| | | memDC->SelectObject(&pen_Solid_Red); |
| | |
| | | memDC->LineTo(ptChamfer_Edge_wnd.x,ptChamfer_Edge_wnd.y); |
| | | } |
| | | |
| | | if(m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nNotch_Dimension_Edge_Judge[i][j] != 0 || |
| | | m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nNotch_Chamfer_Edge_Judge[i][j] != 0) |
| | | if(pSideData->m_nNotch_Dimension_Edge_Judge[i][j] != 0 || pSideData->m_nNotch_Chamfer_Edge_Judge[i][j] != 0) |
| | | { |
| | | if(1 < m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nNotch_Dimension_Edge_Judge[i][j] || 1 < m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_nNotch_Chamfer_Edge_Judge[i][j]) |
| | | if(1 < pSideData->m_nNotch_Dimension_Edge_Judge[i][j] || 1 < pSideData->m_nNotch_Chamfer_Edge_Judge[i][j]) |
| | | memDC->SetTextColor(RGB(255,0,0)); |
| | | else |
| | | memDC->SetTextColor(RGB(0,255,0)); |
| | | |
| | | CString strTemp; |
| | | strTemp.Format(_T("%s"), (CString) m_pGlassData->GetSideData((DimensionDir) m_nSideIdx)->m_strNotchMeasure_Comment[i][j]); |
| | | strTemp.Format(_T("%s"), (CString)pSideData->m_strNotchMeasure_Comment[i][j]); |
| | | CRect rtTemp(ptRef_wnd.x + 10, ptRef_wnd.y-10, ptRef_wnd.x + 1024, ptRef_wnd.y + 20); |
| | | memDC->DrawText(strTemp, rtTemp, DT_LEFT | DT_BOTTOM); |
| | | } |