コード例 #1
0
ファイル: MainWindow.xaml.cs プロジェクト: mahoo168/mahoo
        //コンストラクタ
        public MainWindow()
        {
            InitializeComponent();

            this.ellipseR = 5;
            this.InputE = new Ellipse[4];
            this.OutputE = new Ellipse[4];
            //インスタンス
            #region
            this.systemMain = new SystemMain();
            this.calibration = new Calibration((int)this.OutputImage.Width, (int)this.OutputImage.Height);
            #endregion
            //window 追加はここから
            #region
            this.imageForms = new ImageWindow[3];
            this.imageForms[0] = (this.wscs2 = new ImageWindow("wscs2"));
            this.imageForms[1] = (this.wscs3_0 = new ImageWindow("wscs3_back"));
            this.imageForms[2] = (this.wscs3_1 = new ImageWindow("wscs3_floor"));
            #endregion
            //Ellipse 追加はここから
            #region
            this.InputE[0] = this.InputE_0;
            this.InputE[1] = this.InputE_1;
            this.InputE[2] = this.InputE_2;
            this.InputE[3] = this.InputE_3;

            this.OutputE[0] = this.OutputE_0;
            this.OutputE[1] = this.OutputE_1;
            this.OutputE[2] = this.OutputE_2;
            this.OutputE[3] = this.OutputE_3;
            //Pt初期化
            #region
            this.backPt_In = new System.Windows.Point[this.InputE.Length];
            this.backPt_Out = new System.Windows.Point[this.OutputE.Length];
            this.floorPt_In = new System.Windows.Point[this.InputE.Length];
            this.floorPt_Out = new System.Windows.Point[this.OutputE.Length];
            this.backPt_In = this.GetEllipsePosition(InOutPutMode.input);
            this.floorPt_In = this.backPt_In;
            this.backPt_Out = this.GetEllipsePosition(InOutPutMode.output);
            this.floorPt_Out = this.backPt_Out;
            #endregion
            #endregion
            //イベント登録 
            this._sumMat += this.calibration.SumMat;
            //SystemMain
            #region
            this.systemMain._calibrationUpdate += this.calibration.CaliblationUpdate;
            this.systemMain._getCalibedBackImage += this.calibration.GetCalibedBackImage;
            this.systemMain._getCalibedFloorImage += this.calibration.GetCalibedFloorImage;
            this.systemMain._showInputImage += this.SetInputImage;
            this.systemMain._showOutputImage += this.SetOutputImage;
            this.systemMain._sumMat += this.calibration.SumMat;
            #endregion
            //Calibration
            #region
            this.calibration._getPtForCalib += this.GetEllipsePositionForCalib;
            #endregion
            //window
            #region
            for (int i = 0; i < this.imageForms.Length; i++)
            {
                this._OnClose += this.imageForms[i].OnClose;
            }
            for (int i = 0; i < this.imageForms.Length; i++)
            {
                this._ToFullScreen += this.imageForms[i].ToFullScreen;
            }
            for (int i = 0; i < this.imageForms.Length; i++)
            {
                this._ToWindow += this.imageForms[i].ToWindow;
            }
            for (int i = 0; i < this.imageForms.Length; i++)
            {
                 this._ShowWindow += this.imageForms[i].ShowWindow;
                
            }
            for (int i = 0; i < this.imageForms.Length; i++)
            {
                this._HideWindow += this.imageForms[i].HideWindow;
            }
            #endregion
            //shadowlist
            //this.MakeShadowList(this.systemMain.ShadowList);
            this.wscsMode = WSCSmode.wscs3;
            this.DrawLine(this.GetEllipsePosition(InOutPutMode.input), InOutPutMode.input);
            this.DrawLine(this.GetEllipsePosition(InOutPutMode.output), InOutPutMode.output);

        }
コード例 #2
0
ファイル: MainWindow.xaml.cs プロジェクト: mahoo168/mahoo
        //コンストラクタ
        public MainWindow()
        {
            InitializeComponent();

            this.ellipseR = 5;
            this.InputE   = new Ellipse[4];
            this.OutputE  = new Ellipse[4];
            //インスタンス
            #region
            this.systemMain  = new SystemMain();
            this.calibration = new Calibration((int)this.OutputImage.Width, (int)this.OutputImage.Height);
            #endregion
            //window 追加はここから
            #region
            this.imageForms    = new ImageWindow[3];
            this.imageForms[0] = (this.wscs2 = new ImageWindow("wscs2"));
            this.imageForms[1] = (this.wscs3_0 = new ImageWindow("wscs3_back"));
            this.imageForms[2] = (this.wscs3_1 = new ImageWindow("wscs3_floor"));
            #endregion
            //Ellipse 追加はここから
            #region
            this.InputE[0] = this.InputE_0;
            this.InputE[1] = this.InputE_1;
            this.InputE[2] = this.InputE_2;
            this.InputE[3] = this.InputE_3;

            this.OutputE[0] = this.OutputE_0;
            this.OutputE[1] = this.OutputE_1;
            this.OutputE[2] = this.OutputE_2;
            this.OutputE[3] = this.OutputE_3;
            //Pt初期化
            #region
            this.backPt_In   = new System.Windows.Point[this.InputE.Length];
            this.backPt_Out  = new System.Windows.Point[this.OutputE.Length];
            this.floorPt_In  = new System.Windows.Point[this.InputE.Length];
            this.floorPt_Out = new System.Windows.Point[this.OutputE.Length];
            this.backPt_In   = this.GetEllipsePosition(InOutPutMode.input);
            this.floorPt_In  = this.backPt_In;
            this.backPt_Out  = this.GetEllipsePosition(InOutPutMode.output);
            this.floorPt_Out = this.backPt_Out;
            #endregion
            #endregion
            //イベント登録
            this._sumMat += this.calibration.SumMat;
            //SystemMain
            #region
            this.systemMain._calibrationUpdate    += this.calibration.CaliblationUpdate;
            this.systemMain._getCalibedBackImage  += this.calibration.GetCalibedBackImage;
            this.systemMain._getCalibedFloorImage += this.calibration.GetCalibedFloorImage;
            this.systemMain._showInputImage       += this.SetInputImage;
            this.systemMain._showOutputImage      += this.SetOutputImage;
            this.systemMain._sumMat += this.calibration.SumMat;
            #endregion
            //Calibration
            #region
            this.calibration._getPtForCalib += this.GetEllipsePositionForCalib;
            #endregion
            //window
            #region
            for (int i = 0; i < this.imageForms.Length; i++)
            {
                this._OnClose += this.imageForms[i].OnClose;
            }
            for (int i = 0; i < this.imageForms.Length; i++)
            {
                this._ToFullScreen += this.imageForms[i].ToFullScreen;
            }
            for (int i = 0; i < this.imageForms.Length; i++)
            {
                this._ToWindow += this.imageForms[i].ToWindow;
            }
            for (int i = 0; i < this.imageForms.Length; i++)
            {
                this._ShowWindow += this.imageForms[i].ShowWindow;
            }
            for (int i = 0; i < this.imageForms.Length; i++)
            {
                this._HideWindow += this.imageForms[i].HideWindow;
            }
            #endregion
            //shadowlist
            //this.MakeShadowList(this.systemMain.ShadowList);
            this.wscsMode = WSCSmode.wscs3;
            this.DrawLine(this.GetEllipsePosition(InOutPutMode.input), InOutPutMode.input);
            this.DrawLine(this.GetEllipsePosition(InOutPutMode.output), InOutPutMode.output);
        }