Exemplo n.º 1
0
 public void showROIShape(ROI r)
 {
     ROIList.Add(r);
     roiMode      = null;
     activeROIidx = ROIList.Count - 1;
     viewController.repaint();
 }
Exemplo n.º 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);
            }
        }
        /// <summary> 
        /// Defines the initial settings for the window 
        /// control. In the very beginning, the window control needs 
        /// to know the view mode of the application form to perform 
        /// the right behavior for incoming mouse events on the 
        /// HALCON window.
        /// </summary>
        private void InteractiveForm_Load(object sender, System.EventArgs e)
        {
            String fileName = "patras";
            HImage image;

            viewController = new HWndCtrl(viewPort);
            roiController  = new ROIController();
            viewController.useROIController(roiController);
            viewController.setViewState(HWndCtrl.MODE_VIEW_NONE);

            try
            {
                image   = new HImage(fileName);
            }
            catch(HOperatorException)
            {
                MessageBox.Show("Problem occured while reading file!",
                    "InteractROIForm",
                    MessageBoxButtons.OK,
                    MessageBoxIcon.Information);
                return;
            }

            viewController.addIconicVar(image);
            viewController.repaint();
        }
        /**************************************************************************/
        /* Setup the GUI for the SmartWindow application
         **************************************************************************/
        private void SmartWindowForm_Load(object sender, System.EventArgs e)
        {
            hWndControl = new HWndCtrl(viewPort);
            String fileName = "patras";
            HImage image;

            try
            {
                image   = new HImage(fileName);
            }
            catch(HOperatorException)
            {
                MessageBox.Show("Problem occured while reading file!",
                                "SmartWindow2",
                                MessageBoxButtons.OK,
                                MessageBoxIcon.Information);
                return;
            }

            hWndControl.addIconicVar(image);
            hWndControl.repaint();
        }
Exemplo n.º 5
0
        //

        public void dispObject(HObject obj)
        {
            hWndControl.addIconicVar(obj);
            hWndControl.repaint();
        }
Exemplo n.º 6
0
 public void SetROIList(ArrayList roiList)
 {
     ROIList = roiList;
     viewController.repaint();
 }
Exemplo n.º 7
0
 public void AddROIShape(ROI r)          //增加一个ROI到ROIlist中
 {
     ROIList.Add(r);
     activeROIidx = ROIList.Count - 1;
     viewController.repaint();
 }