当前位置: 首页>>代码示例>>C#>>正文


C# Form1.SetBoolean_surface方法代码示例

本文整理汇总了C#中Form1.SetBoolean_surface方法的典型用法代码示例。如果您正苦于以下问题:C# Form1.SetBoolean_surface方法的具体用法?C# Form1.SetBoolean_surface怎么用?C# Form1.SetBoolean_surface使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Form1的用法示例。


在下文中一共展示了Form1.SetBoolean_surface方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Surface

        public Surface(int w, int h, string pathToFile, System.Windows.Forms.ToolStripProgressBar bar = null, System.Windows.Forms.ToolStripLabel label = null, Form1 form = null, bool shaderOption = false)
        {
            this.shaderOption = shaderOption;
            this.form = form;
            toolStripBar = bar;
            toolStripLabel = label;
            WhatToDraw = 1;
            Status = colrscl = rotate = false;
            minX = minY = min = float.MaxValue;
            maxX = maxY = max = float.MinValue;
            scale = 1.0f;
            angleX = angleY = 0.0f;
            width = w; height = h;
            NumOfIndexes = NumOfVertices = Xwidth = Ywidth = 0;
            //svetlo - smer,ambient,specular,diffuse
            light = new DirectionalLight(new Vector3(0.0f, 0.0f, -1.0f), new Vector3(1.0f, 1.0f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f), new Vector3(1.0f, 1.0f, 1.0f));
            //material - ambient,specular,diffuse,koeficienty - ambient, specular, diffuse, shininess
            material = new Material(0.29f, 0.86f, 0.57f, 128);
            //BigBrother = new Kamera(new Vector3(0.0f, 0.0f, 3.5f), new Vector3(0.0f, 0.0f, 0.0f), new Vector3(0.0f, 1.0f, 0.0f));

            coords = new List<Vector3>();
            VBO = new int[4];
            VAO = new int[1];
            VertexShader = new Shaders.Shader();
            FragmentShader = new Shaders.Shader();
            spMain = new Shaders.ShaderProgram();

            var bw = new System.ComponentModel.BackgroundWorker();

            bw.DoWork += (sender, args) =>
            {
                // do your lengthy stuff here -- this will happen in a separate thread
                LoadData(pathToFile);
                if (Status = SetWidth())
                {
                    vertices = new Vector3[NumOfVertices];
                    color = new Vector3[NumOfVertices];
                    normals = new Vector3[NumOfVertices];
                    Indices = new List<int>();
                    Indexes = new int[NumOfIndexes];
                    //SetIndices();
                    SetIndexes();
                    if (Ywidth > Xwidth)
                    {
                        rotate = true;
                        MatrixStore_Rotations = Matrix4.CreateFromAxisAngle(new Vector3(0.0f, 0.0f, 1.0f), -90.0f * (float)Math.PI / 180.0f);
                    }
                }
                else
                {
                    //dorobit sem este resetovanie progressBaru/labelu
                    System.Windows.Forms.MessageBox.Show("Súbor " + pathToFile + " nemá podporu!", "Vnimanie!", System.Windows.Forms.MessageBoxButtons.OK, System.Windows.Forms.MessageBoxIcon.Warning);
                    label lab = new label(SetToolStripLabel);
                    progres progres = new progres(SetProgressBar);
                    form.statusStrip1.Invoke(lab, "Súbor nemá podporu...");
                    form.statusStrip1.Invoke(progres, 0);
                }
            };

            bw.RunWorkerCompleted += (sender, args) =>
            {
                if (args.Error != null)  // if an exception occurred during DoWork,
                    System.Windows.Forms.MessageBox.Show(args.Error.ToString());  // do your error handling here

                if (Status)
                {
                    colorScale = new ColorScale(min, max, width, height);
                    CalculateColor();
                    ScaleHeights(10.0f);
                    CalculateNormals();
                    InitScene(false);
                    FirstDraw();
                    form.SetBoolean_surface(true);
                }
                else
                    form.SetMenuStrip_Enabled(true);
            };

            bw.RunWorkerAsync(); // starts the background worker
        }
开发者ID:xmatakt,项目名称:bakalarka,代码行数:80,代码来源:Surface.cs


注:本文中的Form1.SetBoolean_surface方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。