Esempio n. 1
0
        private void Label_IlluminationZ_MouseMove(object sender, MouseEventArgs e)
        {
            //
            // 鼠标经过 Label_IlluminationZ。
            //

            if (AdjustNow && !BackgroundWorker_RepaintBmpDelay.IsBusy)
            {
                double angle = (e.X - CursorX) * RadPerPixel;

                double Z = Com.Geometry.AngleMapping(IlluminationDirectionCopy.Y + angle);

                if (Z <= Math.PI)
                {
                    IlluminationDirection.Y = Z;
                    IlluminationDirection.Z = IlluminationDirectionCopy.Z;
                }
                else
                {
                    IlluminationDirection.Y = 2 * Math.PI - Z;
                    IlluminationDirection.Z = Com.Geometry.AngleMapping(IlluminationDirectionCopy.Z + Math.PI);
                }

                ((Label)sender).Text = (IlluminationDirection.Y / Math.PI * 180).ToString("F0") + "°";

                BackgroundWorker_RepaintBmpDelay.RunWorkerAsync();
            }
        }
Esempio n. 2
0
        private void Label_Exposure_MouseMove(object sender, MouseEventArgs e)
        {
            //
            // 鼠标经过 Label_Exposure。
            //

            if (AdjustNow && !BackgroundWorker_RepaintBmpDelay.IsBusy)
            {
                double shift = (e.X - CursorX) * ShiftPerPixel;

                Exposure = Math.Max(-100, Math.Min(ExposureCopy + shift, 100));

                ((Label)sender).Text = (Exposure >= 0 ? "+ " : "- ") + Math.Abs(Exposure) + "%";

                BackgroundWorker_RepaintBmpDelay.RunWorkerAsync();
            }
        }
Esempio n. 3
0
        private void Label_Sz_MouseMove(object sender, MouseEventArgs e)
        {
            //
            // 鼠标经过 Label_Sz。
            //

            if (AdjustNow && !BackgroundWorker_RepaintBmpDelay.IsBusy)
            {
                double ratio = Math.Max(0.01, 1 + (e.X - CursorX) * RatioPerPixel);

                ((Label)sender).Text = "× " + ratio.ToString("F2");

                CubeSize = Com.PointD3D.Max(new Com.PointD3D(0.001, 0.001, 0.001), new Com.PointD3D(CubeSizeCopy.X, CubeSizeCopy.Y, CubeSizeCopy.Z * ratio).Normalize);

                BackgroundWorker_RepaintBmpDelay.RunWorkerAsync();
            }
        }
Esempio n. 4
0
        private void Label_Rz_MouseMove(object sender, MouseEventArgs e)
        {
            //
            // 鼠标经过 Label_Rz。
            //

            if (AdjustNow && !BackgroundWorker_RepaintBmpDelay.IsBusy)
            {
                double angle = (e.X - CursorX) * RadPerPixel;

                ((Label)sender).Text = (angle >= 0 ? "+ " : "- ") + (Math.Abs(angle) / Math.PI * 180).ToString("F0") + "°";

                Com.Matrix matrixLeft = Com.PointD3D.RotateZMatrix(angle);

                AffineMatrix3D = Com.Matrix.Multiply(matrixLeft, AffineMatrix3DCopy);

                if (!Com.Matrix.IsNullOrEmpty(AffineMatrix3D))
                {
                    BackgroundWorker_RepaintBmpDelay.RunWorkerAsync();
                }
            }
        }