GridViewer.CatesianGrid.UpdateColor C# (CSharp) Méthode

UpdateColor() public méthode

public UpdateColor ( TracyEnergy property ) : void
property TracyEnergy
Résultat void
        public override void UpdateColor(TracyEnergy.Simba.Data.Keywords.impl.GridBlockProperty property)
        {
            float[] textures = GetTextureCoords(property);
            int gridCellCount = this.DataSource.DimenSize;

            unsafe
            {
                IntPtr pointer = this.colorBuffer.MapBuffer(MapBufferAccess.WriteOnly);
                var array = (HexahedronTexCoord*)pointer;
                for (int gridIndex = 0; gridIndex < gridCellCount; gridIndex++)
                {
                    array[gridIndex].SetCoord(textures[gridIndex]);
                }
            }
            this.colorBuffer.UnmapBuffer();
        }

Usage Example

        private void UpdateCatesianGrid(CatesianGrid grid, GridBlockProperty property)
        {
            double axisMin, axisMax, step;

            ColorIndicatorAxisAutomator.Automate(property.MinValue, property.MaxValue, out axisMin, out axisMax, out step);
            grid.MinColorCode = (float)axisMin;
            grid.MaxColorCode = (float)axisMax;
            grid.UpdateColor(property);
            this.scientificCanvas.ColorPalette.SetCodedColor(axisMin, axisMax, step);
        }
All Usage Examples Of GridViewer.CatesianGrid::UpdateColor