private void cbxShowWireframe_CheckedChanged(object sender, EventArgs e)
        {
            HexahedronGridderSource source = this.CurrentHexahedronGrid;

            if (source == null)
            {
                return;
            }

            List <SimLabGrid> gridders = this.sim3D.Scene.SceneContainer.Traverse <SimLabGrid>().ToList <SimLabGrid>();

            if (gridders.Count <= 0)
            {
                return;
            }
            SimLabGrid gridder = gridders[0];

            //if (this.IsShowWireframe)
            //{
            //    WireFrameBufferData wireFrame = source.CreateWireframe();
            //    gridder.SetWireframe(wireFrame);
            //}
            //else
            //{
            //     gridder.SetWireframe(null);
            //}
            gridder.RenderGridWireframe = this.IsShowWireframe;

            this.sim3D.Invalidate();
        }
Beispiel #2
0
        private void OnGridPropertyChanged(object sender, EventArgs e)
        {
            GridderSource source = this.sim3D.Tag as GridderSource;

            if (source == null)
            {
                return;
            }

            List <SimLabGrid> gridders = this.sim3D.Scene.SceneContainer.Traverse <SimLabGrid>().ToList <SimLabGrid>();

            if (gridders.Count <= 0)
            {
                return;
            }

            SimLabGrid grid = gridders[0];

            GridProperty prop = this.CurrentProperty;

            if (prop == null)
            {
                return;
            }
            float minValue = prop.MinValue;
            float maxValue = prop.MaxValue;
            float step     = (maxValue - minValue) / 10.0f;

            if (step <= 0.0f)
            {
                step = 1.0f;
            }

            this.sim3D.SetColorIndicator(minValue, maxValue, step);
            TexCoordBuffer textureCoordinates = source.CreateTextureCoordinates(prop.GridIndexes, prop.Values, minValue, maxValue);

            grid.SetTextureCoods(textureCoordinates);

            DynamicUnstructureGrid           dynamicUnstructureGrid          = gridders[0] as DynamicUnstructureGrid;
            DynamicUnstructuredGridderSource dynamicUnstructureGridderSource = source as DynamicUnstructuredGridderSource;

            if (dynamicUnstructureGrid != null && dynamicUnstructureGridderSource != null)
            {
                TexCoordBuffer anotherTextureCoordinates = dynamicUnstructureGridderSource.CreateFractureTextureCoordinates(prop.GridIndexes, prop.Values, minValue, maxValue);
                dynamicUnstructureGrid.SetFractionTextureCoords(anotherTextureCoordinates);
            }

            this.sim3D.Invalidate();
        }
        private void barBrightness_Scroll(object sender, EventArgs e)
        {
            this.lblBrightnessValue.Text = (this.barBrightness.Value * 1.0f / 100).ToString();

            List <SimLabGrid> gridders = this.sim3D.Scene.SceneContainer.Traverse <SimLabGrid>().ToList <SimLabGrid>();

            if (gridders.Count <= 0)
            {
                return;
            }

            SimLabGrid gridder = gridders[0] as SimLabGrid;

            gridder.Brightness = this.barBrightness.Value * 1.0f / 100;

            this.sim3D.Invalidate();
        }
        private void barOpacity_Scroll(object sender, EventArgs e)
        {
            float opacity = (float)this.barOpacity.Value / 1000.0f;

            this.lblOpacityValue.Text = opacity.ToShortString();

            List <SimLabGrid> gridders = this.sim3D.Scene.SceneContainer.Traverse <SimLabGrid>().ToList <SimLabGrid>();

            if (gridders.Count <= 0)
            {
                return;
            }

            SimLabGrid gridder = gridders[0] as SimLabGrid;

            gridder.Opacity = opacity;

            this.sim3D.Invalidate();
        }
        /// <summary>
        /// 应用切片分析
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void btnSlicesApply_Click(object sender, EventArgs e)
        {
            GridProperty prop = this.CurrentProperty;

            if (prop == null)
            {
                return;
            }


            HexahedronGridderSource source = this.CurrentHexahedronGrid;

            if (source == null)
            {
                return;
            }

            List <SimLabGrid> gridders = this.sim3D.Scene.SceneContainer.Traverse <SimLabGrid>().ToList <SimLabGrid>();

            if (gridders.Count <= 0)
            {
                return;
            }

            SimLabGrid gridder = gridders[0];
            List <int> islices = this.GetSelectedSlices(this.lbxNI);
            List <int> jslices = this.GetSelectedSlices(this.lbxNJ);
            List <int> kslices = this.GetSelectedSlices(this.lbxNZ);

            source.IBlocks = islices;
            source.JBlocks = jslices;
            source.KBlocks = kslices;
            source.RefreashSlices();
            float          minValue           = this.sim3D.uiColorIndicator.Data.MinValue;
            float          maxValue           = this.sim3D.uiColorIndicator.Data.MaxValue;
            TexCoordBuffer textureCoordinates = source.CreateTextureCoordinates(prop.GridIndexes, prop.Values, minValue, maxValue);

            gridder.SetTextureCoods(textureCoordinates);

            this.sim3D.Invalidate();
        }
Beispiel #6
0
        private void chkShowMatrix_CheckedChanged(object sender, EventArgs e)
        {
            List <SimLabGrid> gridders = this.sim3D.Scene.SceneContainer.Traverse <SimLabGrid>().ToList <SimLabGrid>();

            if (gridders.Count <= 0)
            {
                return;
            }
            SimLabGrid gridder = gridders[0];

            //if (this.IsShowWireframe)
            //{
            //    WireFrameBufferData wireFrame = source.CreateWireframe();
            //    gridder.SetWireframe(wireFrame);
            //}
            //else
            //{
            //     gridder.SetWireframe(null);
            //}
            gridder.RenderGrid = this.chkShowMatrix.Checked;

            this.sim3D.Invalidate();
        }