コード例 #1
0
        /// <summary>
        /// This method is invoked if changes occur in the HWndCtrl instance
        /// or the ROIController. In either case, the HALCON
        /// window needs to be updated/repainted.
        /// </summary>
        public void UpdateViewData(int val)
        {
            switch (val)
            {
            case ROIController.EVENT_CHANGED_ROI_SIGN:
            case ROIController.EVENT_DELETED_ACTROI:
            case ROIController.EVENT_DELETED_ALL_ROIS:
            case ROIController.EVENT_UPDATE_ROI:
                ModelContour     = null;
                DetectionContour = null;
                bool genROI = roiController.defineModelROI();
                ModelRegion = roiController.getModelRegion();
                mAssistant.setModelROI(ModelRegion);
                CreateModelGraphics();
                if (!genROI)
                {
                    mView.repaint();
                }

                break;

            case HWndCtrl.ERR_READING_IMG:
                MessageBox.Show("Problem occured while reading file! \n" + mView.exceptionText,
                                "Matching assistant",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                break;

            default:
                break;
            }
        }
コード例 #2
0
        /// <summary>
        /// Sets the sign of a ROI object to the value 'mode' (MODE_ROI_NONE,
        /// MODE_ROI_POS,MODE_ROI_NEG)
        /// </summary>
        public void setROISign(int mode)
        {
            stateROI = mode;

            if (activeROIidx != -1)
            {
                ((ROI)ROIList[activeROIidx]).setOperatorFlag(stateROI);
                viewController.repaint();
                NotifyRCObserver(ROIController.EVENT_CHANGED_ROI_SIGN);
            }
        }