Ejemplo n.º 1
0
        /// <summary>
        /// Shoots single primary ray only..
        /// </summary>
        /// <param name="x">X-coordinate inside the raster image.</param>
        /// <param name="y">Y-coordinate inside the raster image.</param>
        private void singleSample(int x, int y)
        {
            if (imf == null)
            {
                imf = FormSupport.getImageFunction(out scene, brepScene);
            }

            // determine output image size:
            int width = ImageWidth;

            if (width <= 0)
            {
                width = panel1.Width;
            }
            int height = ImageHeight;

            if (height <= 0)
            {
                height = panel1.Height;
            }
            imf.Width  = width;
            imf.Height = height;
            double[] color = new double[3];
            long     hash  = imf.GetSample(x, y, color);

            labelSample.Text = string.Format(CultureInfo.InvariantCulture, "Sample at [{0},{1}] = [{2:f},{3:f},{4:f}], {5:X}",
                                             x, y, color[0], color[1], color[2], hash);
        }
Ejemplo n.º 2
0
        /// <summary>
        /// Redraws the whole image.
        /// </summary>
        private void redraw()
        {
            Cursor.Current = Cursors.WaitCursor;

            // determine output image size:
            int width = ImageWidth;

            if (width <= 0)
            {
                width = panel1.Width;
            }
            int height = ImageHeight;

            if (height <= 0)
            {
                height = panel1.Height;
            }
            Bitmap newImage = new Bitmap(width, height, System.Drawing.Imaging.PixelFormat.Format24bppRgb);

            if (imf == null)
            {
                imf = FormSupport.getImageFunction(out scene, brepScene);
            }
            imf.Width  = width;
            imf.Height = height;

            if (rend == null)
            {
                rend = FormSupport.getRenderer(imf);
            }
            rend.Width  = width;
            rend.Height = height;
            CSGInnerNode.ResetStatistics();
            MT.InitThreadData();

            Stopwatch sw = new Stopwatch();

            sw.Start();

            rend.RenderRectangle(newImage, 0, 0, width, height);

            sw.Stop();
            labelElapsed.Text = string.Format(CultureInfo.InvariantCulture, "{0:f1}s  [ {1}x{2}, r{3:#,#}k, i{4:#,#}k, bb{5:#,#}k, t{6:#,#}k ]",
                                              1.0e-3 * sw.ElapsedMilliseconds, width, height,
                                              (Intersection.countRays + 500L) / 1000L,
                                              (Intersection.countIntersections + 500L) / 1000L,
                                              (CSGInnerNode.countBoundingBoxes + 500L) / 1000L,
                                              (CSGInnerNode.countTriangles + 500L) / 1000L);

            setImage(ref outputImage, newImage);

            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 3
0
        /// <summary>
        /// Shoots single primary ray only..
        /// </summary>
        /// <param name="x">X-coordinate inside the raster image.</param>
        /// <param name="y">Y-coordinate inside the raster image.</param>
        private void singleSample(int x, int y)
        {
            if (imf == null)
            {
                imf = FormSupport.getImageFunction(out scene);
            }

            imf.Width  = panel1.Width;
            imf.Height = panel1.Height;
            double[] color = new double[3];
            long     hash  = imf.GetSample(x, y, color);

            labelSample.Text = string.Format(CultureInfo.InvariantCulture, "Sample at [{0},{1}] = [{2:f},{3:f},{4:f}], {5:X}",
                                             x, y, color[0], color[1], color[2], hash);
        }
Ejemplo n.º 4
0
        public FilterOptionsControl(core.db.fo.FilterOptions fo)
        {
            _LayoutAssetPath = SPersistenceManager.GetDefaultAssetsPath(SPersistenceManager.AssetKind.Layout, GetType());
            _fo          = fo;
            _formSupport = new FormSupport();
            // editing form will not highlight edited field
            _formSupport.HighlightEditedField = false;
            InitializeComponent();

            simpleButtonOk.Click += SimpleButtonOk_Click;

            _formBindingSource = new xwcs.core.db.binding.DataLayoutBindingSource(this);
            _formBindingSource.LayoutContainer    = mainContainer;
            _formBindingSource.DataSource         = _fo;
            _formBindingSource.LayoutBaseFileName = "FilterOptions";

            //dxErrorProvider.DataSource = _formBindingSource;

            UpdateLayout();
        }
Ejemplo n.º 5
0
        /// <summary>
        /// Redraws the whole image.
        /// </summary>
        private void redraw()
        {
            Cursor.Current = Cursors.WaitCursor;

            int width  = panel1.Width;
            int height = panel1.Height;

            Bitmap newImage = new Bitmap(width, height, PixelFormat.Format24bppRgb);

            if (imf == null)
            {
                imf = FormSupport.getImageFunction(out scene);
            }
            imf.Width  = width;
            imf.Height = height;

            if (rend == null)
            {
                rend = FormSupport.getRenderer(imf);
            }
            rend.Width    = width;
            rend.Height   = height;
            rend.Adaptive = 0;

            MT.InitThreadData();
            Stopwatch sw = new Stopwatch();

            sw.Start();

            rend.RenderRectangle(newImage, 0, 0, width, height);

            sw.Stop();
            labelElapsed.Text = string.Format(CultureInfo.InvariantCulture, "Elapsed: {0:f2}s",
                                              1.0e-3 * sw.ElapsedMilliseconds);

            setImage(ref outputImage, newImage);

            Cursor.Current = Cursors.Default;
        }
Ejemplo n.º 6
0
        public EntityEditControl(ModelType model)
        {
            _LayoutAssetPath = SPersistenceManager.GetDefaultAssetsPath(SPersistenceManager.AssetKind.Layout, GetType());
            _model           = model;
            _formSupport     = new FormSupport(this);
            // editing form will not highlight edited field
            _formSupport.HighlightEditedField = false;
            InitializeComponent();
            simpleButtonCancel.CausesValidation = false;
            simpleButtonCancel.AllowFocus       = false;
            simpleButtonOk.AllowFocus           = false;
            simpleButtonOk.Click                 += SimpleButtonOk_Click;
            simpleButtonCancel.Click             += SimpleButtonCancel_Click;
            _formBindingSource                    = new xwcs.core.db.binding.DataLayoutBindingSource(this);
            _formBindingSource.LayoutContainer    = mainContainer;
            _formBindingSource.DataSource         = _model;
            _formBindingSource.LayoutBaseFileName = string.Format("EditControl_{0}", _model.GetType().Name);

            //dxErrorProvider.DataSource = _formBindingSource;

            UpdateLayout();
        }
Ejemplo n.º 7
0
        private void formView_DetailEvent(object sender, EventArgs e)
        {
            FormSupport form = new FormSupport();

            LoadControl(form);
        }
Ejemplo n.º 8
0
        private void dgvFormHistory_DoubleClick(object sender, EventArgs e)
        {
            if (dgvFormHistory.SelectedRows == null)
            {
                return;
            }

            string type    = dgvFormHistory.SelectedRows[0].Cells[1].Value.ToString();
            string chaseno = dgvFormHistory.SelectedRows[0].Cells[7].Value.ToString();

            if (type == "IT技術支援")
            {
                FormSupport form = new FormSupport(chaseno);
                form.ShowDialog();
            }

            if (type == "IT意見箱")
            {
                FormComment form = new FormComment(chaseno);
                form.ShowDialog();
            }

            if (type == "權限關連及軟件安裝")
            {
                FormPermission form = new FormPermission(chaseno);
                form.ShowDialog();
            }

            if (type == "工具開發/修改")
            {
            }

            if (type == "資產外借")
            {
            }

            if (type == "R3申請")
            {
                FormR3 form = new FormR3(chaseno);
                form.ShowDialog();
            }

            if (type.ToLower().StartsWith("debit") || type.ToLower().StartsWith("credit"))
            {
                DebitNoteForm2 formDebit = new DebitNoteForm2(type.ToLower(), "view", chaseno);
                //DebitCreditNoteFormView2 formDebit = new DebitCreditNoteFormView2(chaseno, "view");
                if (formDebit.ShowDialog() == DialogResult.OK)
                {
                    LoadData();
                }
            }

            if (type.StartsWith("Outstanding"))
            {
                OutstandingViewForm formOutstanding = new OutstandingViewForm(chaseno);
                if (formOutstanding.ShowDialog() == DialogResult.OK)
                {
                    LoadData();
                }
            }
        }