Esempio n. 1
0
        private string GetColorHexValue(ColourGenerator colourGenerator, ChartHelper.GrowthSeries series)
        {
            string colorHexValue;

            if (DisplayItems.Count > 1)
            {
                colorHexValue = GetColorHexValueFromGenerator(colourGenerator);
            }
            else
            {
                switch (series.DataType)
                {
                case DataType.Processed:
                    colorHexValue = "#000000";
                    break;

                case DataType.Raw:
                    colorHexValue = "#ff0000";
                    break;

                case DataType.FirstDerivative:
                    colorHexValue = "#088DA5";
                    break;

                case DataType.ProcessedUnfiltered:
                    colorHexValue = "#00FF00";
                    break;

                default:
                    colorHexValue = GetColorHexValueFromGenerator(colourGenerator);
                    break;
                }
            }
            return(colorHexValue);
        }
Esempio n. 2
0
 public TerrainGenerator(PerlinNoise perlinNoise, PerlinNoise biomePerlinNoise, ColourGenerator colourGen, BiomeHelper biomeHelper)
 {
     this.perlinNoise      = perlinNoise;
     this.biomePerlinNoise = biomePerlinNoise;
     this.colourGen        = colourGen;
     this.biomeHelper      = biomeHelper;
 }
Esempio n. 3
0
    void initMesh(Transform t)
    {
        Debug.Log("init mesh");
        if (col_set == null || tgopt == null)
        {
            Debug.Log("missing variables");
            return;
        }


        terrain_mm = new MinMax();
        col_gen    = new ColourGenerator(col_set);

        col_gen.updateColours();

        mesh_obj = new GameObject("mesh");
        mesh_obj.transform.parent = t;
        Vector3 pos = new Vector3(t.position.x + x, t.position.y, t.position.z + y);

        mesh_obj.transform.position = pos;


        MeshRenderer mr = mesh_obj.AddComponent <MeshRenderer>();

        mr.sharedMaterial = col_set.material;
        //mr.sharedMaterial = new Material(Shader.Find("Standard"));
        //mr.sharedMaterial.color = col_set.colour;


        mesh_filter = mesh_obj.AddComponent <MeshFilter>();

        mesh_filter.mesh = new Mesh();
    }
    static void Main(string[] args)
    {
        ColourGenerator generator = new ColourGenerator();

        for (int i = 0; i < 896; i++)
        {
            Console.WriteLine(string.Format("{0}: {1}", i, generator.NextColour()));
        }
    }
Esempio n. 5
0
        public BasicChart()
        {
            InitializeComponent();

            ColourGenerator generator = new ColourGenerator();

            for (int i = 0; i < 20; i++)
            {
                DistinctColorList.Add(new SolidColorBrush((Color)ColorConverter.ConvertFromString("#" + generator.NextColour())));
            }
        }
Esempio n. 6
0
        private static string GetColorHexValueFromGenerator(ColourGenerator colourGenerator)
        {
            string colorHexValue;

            colorHexValue = "#" + colourGenerator.NextColour();
            if (colorHexValue == "#FFFFFF" || colorHexValue == "#FFFF00")
            {
                colorHexValue = "#" + colourGenerator.NextColour();
            }
            return(colorHexValue);
        }
    Terrain GenerateTerrain(Vector2 centre)
    {
        PerlinNoise     noise      = new PerlinNoise(seed, octaves, 70, 0.3f, centre + offset, normaliseMode);  // Change vals.
        PerlinNoise     biomeNoise = new PerlinNoise(seed, biomeOctaves, 70, 0.3f, biomeOffset, normaliseMode); // Change vals.
        ColourGenerator colourGen  = new ColourGenerator();

        TerrainGenerator terrainGen = new FlatTerrainGenerator(noise, biomeNoise, colourGen, new BiomeHelper(biomes));

        Terrain flatTerrain = terrainGen.GenerateTerrain(chunkSize);

        return(flatTerrain);
    }
            public static Color GetRandomColour()
            {
                var r    = new Random();
                int rInt = r.Next(0, 896); // the largest amount of colours this class will generate

                var    colorGen        = new ColourGenerator();
                string randomColourStr = "FFFFFF";

                for (int i = 0; i < rInt; i++)
                {
                    randomColourStr = colorGen.NextColour();
                }

                return(HexStringToColor(randomColourStr));
            }
Esempio n. 9
0
        private void FillInColorList()
        {
            SmoothColorGenerator Temp = new SmoothColorGenerator();

            SmoothColorList = Temp.ColorList;

            ColourGenerator generator = new ColourGenerator();

            UniqueColorList.Add(Color.FromRgb(0, 0, 0));
            UniqueColorList.Add(Color.FromRgb(255, 255, 255));
            for (int i = 0; i <= 895; i++)
            {
                Color c = new Color();
                c = (Color)ColorConverter.ConvertFromString("#" + generator.NextColour());
                UniqueColorList.Add(c);
            }
        }
Esempio n. 10
0
    public void UpdateUVs(ColourGenerator colourGenerator)
    {
        Vector2[] uv = mesh.uv;
        for (int y = 0; y < resolution; y++)
        {
            for (int x = 0; x < resolution; x++) //Iterate over entire face
            {
                int     i                 = x + y * resolution;
                Vector2 percent           = new Vector2(x, y) / (resolution - 1); //Tells us how far through the loop we are
                Vector3 pointOnUnitCube   = localUp + (percent.x - .5f) * 2 * axisA + (percent.y - .5f) * 2 * axisB;
                Vector3 pointOnUnitSphere = pointOnUnitCube.normalized;           //used to go from a cube to a sphere

                uv[i].x = colourGenerator.BiomePercentFromPoint(pointOnUnitSphere);
            }
        }
        mesh.uv = uv;
    }
Esempio n. 11
0
    public void UpdateUVs(ColourGenerator colourGenerator)
    {
        Vector2[] uv = mesh.uv;
        for (int y = 0; y < resolution; y++)
        {
            for (int x = 0; x < resolution; x++)
            {
                int     i                 = x + y * resolution;
                Vector2 percent           = new Vector2(x, y) / (resolution - 1);
                Vector3 pointOnUnitCube   = localUp + (percent.x - .5f) * 2 * axisA + (percent.y - .5f) * 2 * axisB;
                Vector3 pointOnUnitSphere = pointOnUnitCube.normalized;

                uv[i].x = colourGenerator.BiomePercentFromPoint(pointOnUnitSphere);
            }
        }
        mesh.uv = uv;
    }
Esempio n. 12
0
    public void UpdateUVs(ColourGenerator colourGenerator)
    {
        var uv = mesh.uv;

        for (var y = 0; y < resolution; y++)
        {
            for (var x = 0; x < resolution; x++)
            {
                var i             = x + y * resolution;
                var percent       = new Vector2(x, y) / (resolution - 1);
                var pointOnCube   = localUp + (percent.x - .5f) * 2 * axisA + (percent.y - .5f) * 2 * axisB;
                var pointOnSphere = pointOnCube.normalized;

                uv[i].x = colourGenerator.BiomePercentFromPoint(pointOnSphere);
            }
        }

        mesh.uv = uv;
    }
Esempio n. 13
0
        public void UpdateUVs(ColourGenerator colourGenerator)
        {
            Vector2[] uv = new Vector2[_resolution * _resolution];

            for (int i = 0; i < _resolution; i++)
            {
                for (int j = 0; j < _resolution; j++)
                {
                    int     loop            = i + j * _resolution;
                    Vector2 percent         = new Vector2(i, j) / (_resolution - 1);
                    Vector3 pointOnUnitCube =
                        _localUp + (percent.x - 0.5f) * 2 * _axisA + (percent.y - 0.5f) * 2 * _axisB;
                    Vector3 pointOnUnitSphere = pointOnUnitCube.normalized;

                    uv[i] = new Vector2(colourGenerator.BiomePercentFromPoint(pointOnUnitSphere), 0);
                }
            }
            _mesh.uv = uv;
        }
Esempio n. 14
0
        public MapWindow()
        {
            InitializeComponent();

                var generator = new ColourGenerator();
                foreach (Center center in App.AppMap.Centers.Values)
                {
                    string colour = "#" + generator.NextColour();

                    //var brush = new SolidColorBrush(Color.FromArgb(255, (byte) R, (byte) G, (byte) B));
                    //Color.FromRgb(Convert.ToByte(colour.Substring(1, 2), 16),Convert.ToByte(colour.Substring(3, 2), 16),Convert.ToByte(colour.Substring(5, 2), 16));

                    var brush = (SolidColorBrush)(new BrushConverter().ConvertFrom(colour));
                    var polygonPoints = new PointCollection();

                    center.OrderCorners();

                    //foreach (var border in center.Borders)
                    //{
                    //    polygonPoints.Add(new Point(border.Point.X * 3840, border.Point.Y * 2176));
                    //}

                    foreach (var corner in center.Corners)
                    {
                        polygonPoints.Add(new Point(corner.Point.X*3840, corner.Point.Y*2176));
                    }

                    var poly = new Polygon()
                    {
                        Points = polygonPoints,
                        //Stroke = brush,
                        //StrokeThickness = 1,
                        Fill = brush

                    };

                    canvas1.Children.Add(poly);
                    canvas1.InvalidateVisual();
                    canvas1.UpdateLayout();

                }
        }
Esempio n. 15
0
    public void UpdateUVs(ColourGenerator colourGenerator)
    {
        Vector2[] uv = mesh.uv;

        for (int y = 0; y < resolution; y++)
        {
            for (int x = 0; x < resolution; x++)
            {
                int i = x + y * resolution;
                // how close to complete each of these loops is
                Vector2 percent         = new Vector2(x, y) / (resolution - 1);
                Vector3 pointOnUnitCube = localUp + (percent.x - .5f) * 2 * axisA + (percent.y - .5f) * 2 * axisB;
                // transform the current planar cube as a spherical/round plane
                Vector3 pointOnUnitSphere = pointOnUnitCube.normalized;

                uv[i].x = colourGenerator.BiomePercentFromPoint(pointOnUnitSphere);
            }
        }
        mesh.uv = uv;
    }
Esempio n. 16
0
    // ********************************************************************** //

    public void UpdateUVs(ColourGenerator colourGenerator)
    {
        // keep everything that generates colours separate from mesh generation. This way we dont have to wait for mesh to regenerate when we update colours

        Vector2[] uv = mesh.uv;

        for (int y = 0; y < resolution; y++)
        {
            for (int x = 0; x < resolution; x++)
            {
                int     i                 = x + y * resolution;                                                        // this is a counter, same as setting int i=0 outside y loop and incrementing on inner loop
                Vector2 percent           = new Vector2(x, y) / (resolution - 1);
                Vector3 pointOnUnitCube   = localUp + (percent.x - 0.5f) * 2 * axisA + (percent.y - 0.5f) * 2 * axisB; // geometry magic from youtube tutorial
                Vector3 pointOnUnitSphere = pointOnUnitCube.normalized;

                uv[i].x = colourGenerator.BiomePercentFromPoint(pointOnUnitSphere);
            }
        }
        mesh.uv = uv;
    }
Esempio n. 17
0
        public MapWindow()
        {
            InitializeComponent();

            var generator = new ColourGenerator();

            foreach (Center center in App.AppMap.Centers.Values)
            {
                string colour = "#" + generator.NextColour();

                //var brush = new SolidColorBrush(Color.FromArgb(255, (byte) R, (byte) G, (byte) B));
                //Color.FromRgb(Convert.ToByte(colour.Substring(1, 2), 16),Convert.ToByte(colour.Substring(3, 2), 16),Convert.ToByte(colour.Substring(5, 2), 16));

                var brush         = (SolidColorBrush)(new BrushConverter().ConvertFrom(colour));
                var polygonPoints = new PointCollection();

                center.OrderCorners();

                //foreach (var border in center.Borders)
                //{
                //    polygonPoints.Add(new Point(border.Point.X * 3840, border.Point.Y * 2176));
                //}

                foreach (var corner in center.Corners)
                {
                    polygonPoints.Add(new Point(corner.Point.X * 3840, corner.Point.Y * 2176));
                }

                var poly = new Polygon()
                {
                    Points = polygonPoints,
                    //Stroke = brush,
                    //StrokeThickness = 1,
                    Fill = brush
                };

                canvas1.Children.Add(poly);
                canvas1.InvalidateVisual();
                canvas1.UpdateLayout();
            }
        }
Esempio n. 18
0
    public void UpdateUVs(ColourGenerator colourGenerator)
    {
        Vector2[] uv = mesh.uv;

        for (int y = 0; y < resolution; y++)
        {
            for (int x = 0; x < resolution; x++)
            {
                int i = x + y * resolution;                                                                          // number of total iterations

                Vector2 percent           = new Vector2(x, y) / (resolution - 1);                                    // percent on the x-axis and y-axis, between 0 and 1
                Vector3 pointOnUnitCube   = localUp + (percent.x - .5f) * 2 * axisA + (percent.y - .5f) * 2 * axisB; // sum of base vectors
                Vector3 pointOnUnitSphere = pointOnUnitCube.normalized;

                uv[i].x = colourGenerator.BiomePercentFromPoint(pointOnUnitSphere);
            }
        }

        // Update class parameter
        mesh.uv = uv;
    }
Esempio n. 19
0
    void SpawnSwimmers()
    {
        Quaternion spawnRotation = Quaternion.identity;

        shuffle(spawnValues);
        shuffle(colours);
        for (int i = 0; i < diffCount; i++)
        {
            Material   color         = colours[i];
            Vector3    spawnPosition = spawnValues [i];
            GameObject newSwimmer    = Instantiate(swimmer, spawnPosition, spawnRotation);
            newSwimmer.GetComponent <ColourGenerator>().SetSwimmerColour(color);
            swimmers.Add(newSwimmer);

            Vector3         decoyPosition = spawnValues[i + diffCount];
            GameObject      decoySwimmer  = Instantiate(swimmer, decoyPosition, spawnRotation);
            ColourGenerator cg            = decoySwimmer.GetComponent <ColourGenerator>();
            cg.SetSwimmerColour(color);
            cg.RemoveShark(false);
            swimmers.Add(decoySwimmer);
        }
        swimmersSpawned = true;
    }
Esempio n. 20
0
        private void OnDisplayItemsPropertyPropertyChanged(DependencyPropertyChangedEventArgs e)
        {
            if (ExperimentalRun != null && DisplayItems != null)
            {
                (chart.SecondaryYAxis as NumericAxisBase).Visibility = Visibility.Collapsed;

                var series    = new SeriesCollection <IChartSeries>();
                var generator = new ColourGenerator();
                var title     = new StringBuilder();
                if (DisplayItems.Count == 1)
                {
                    Culture culture = ExperimentalRun.Run[DisplayItems[0]];
                    AddSeriesFromCulture(culture, ref series, generator, false);
                    if (ExperimentalRun.ReferenceCultureIndex != -1)
                    {
                        var refCulture = ExperimentalRun.Run.Where(exp => exp.ContainerIndex == ExperimentalRun.ReferenceCultureIndex).FirstOrDefault();
                        if (refCulture != null)
                        {
                            AddSeriesFromCulture(refCulture, ref series, generator, true);
                        }
                    }
                    RaiseNameChangedEvent(ExperimentalRun.Run[DisplayItems[0]].Container);
                    string format = "00.00";
                    Lag.Text   = culture.Lag.ToString(format, CultureInfo.InvariantCulture);
                    Rate.Text  = culture.Rate.ToString(format, CultureInfo.InvariantCulture);
                    Yield.Text = culture.Yield.ToString(format, CultureInfo.InvariantCulture);
                    title.Append(culture.Container);
                    NavPanel.Visibility = Visibility.Visible;
                }
                else if (DisplayItems.Count > 1)
                {
                    var cultures = new List <Culture>();

                    foreach (var item in DisplayItems)
                    {
                        cultures.Add(ExperimentalRun.Run[item]);
                    }

                    title.Append(cultures.First().Container.Split(' ')[0]).Append(" ");
                    foreach (var culture in cultures)
                    {
                        AddSeriesFromCulture(culture, ref series, generator, false);
                        title.Append(culture.ContainerIndex.ToString()).Append(", ");
                    }
                    title.Remove(title.Length - 2, 2);
                    ZoomGraphControlValues.EnableFit = false;
                    NavPanel.Visibility = Visibility.Hidden;
                }

                chart.Series = series;

                UpdateYAxisType();

                ((BehaviourManager)chart.Behaviour).Behaviours[0] = new TrackballBehaviour();

                SetChartBehabiour();

                lbTitle.Content = title.ToString();

                CreateSeriesDetailsUI();
            }
        }
Esempio n. 21
0
    void OnValidate()
    {
        Debug.Log("on validate");

        if (mesh_obj == null || mesh_filter == null)
        {
            if (mesh_obj == null)
            {
                Debug.Log("mesh_obj is null");
            }

            if (mesh_filter == null)
            {
                Debug.Log("mesh_filter is null");
            }

            Debug.Log("call init");
            initMesh(transform);
        }

        if (noise_options == null)
        {
            noise_options = new NoiseOptions(0.7f, 50, 1f);
        }

        if (generators == null || generators.Length == 0)
        {
            Debug.Log("making generators from tgopts");

            generators = new TerrainGenerator[tgopt.options.Length];

            for (int i = 0; i < tgopt.options.Length; i++)
            {
                generators[i] = GeneratorCaster.makeTG(tgopt.options[i], tgopt.types[i]);
            }
        }
        else
        {
            //todo later: make this better so it doesn't always re create the generators

            generators = new TerrainGenerator[tgopt.options.Length];
            for (int i = 0; i < tgopt.options.Length; i++)
            {
                generators[i] = GeneratorCaster.makeTG(tgopt.options[i], tgopt.types[i]);
            }

            /*
             * for(int i = 0; i < generators.Length; i++) {
             * generators[i] = GeneratorCaster.castTG(generators[i]);
             * }
             */
        }

        col_gen = new ColourGenerator(col_set);


        //Debug.Log("vert length : " + mesh_filter.sharedMesh.triangles.Length);

        if (mesh_filter.sharedMesh.vertices.Length == 0)
        {
            Debug.Log("mesh null");
        }


        Debug.Log("doing something");
        original_noise_grid = new float[noise_options.res * noise_options.res];
        generateTerrainIfNotReady();
        applyTerrain();
        terrain_mm = new MinMax();
        terrain_mm.addValues(noise_grid);
        terrain_mm.log();
        constructMesh();
    }
Esempio n. 22
0
        private void FillData()
        {
            BLL.Cls_PublicOperations.Dt = Bll_Chart.GetSpecialChartParameterData(this.Tag.ToString());
            MainChart.Series.Clear();
            MainChart.ChartAreas.Clear();
            MainChart.Legends.Clear();
            MainChart.Titles.Clear();
            DataTable DtTrend = new DataTable();

            System.Threading.Thread.CurrentThread.CurrentCulture = new CultureInfo("en-GB");
            string TSql = BLL.Cls_PublicOperations.Dt.DefaultView[0]["TSQL"].ToString();

            TSql = TSql.Replace("01/01/2015 00:00:00", StartDate.ToString("MM/dd/yyyy"));

            TSql = TSql.Replace("01/01/2016 00:00:00", EndDate.ToString("MM/dd/yyyy"));
            if (IsSHift3)
            {
                TSql = TSql.Replace("'12/12/2005'", "'" + Shift3beginDate.ToString("MM/dd/yyyy") + "'");
                TSql = TSql.Replace("'12/13/2005'", "'" + Shift3Enddate.ToString("MM/dd/yyyy") + "'");
                TSql = TSql.Replace("01:00:00", Shift3beginTime);
                TSql = TSql.Replace("06:00:00", Shift3EndTime);
                if (IsSHift3 && Times.Length < 5)
                {
                    TSql = TSql.Replace("strtime", "AND (CAST(dbo.Tb_Client.StartTime AS time) BETWEEN '00:00:00' AND  '00:00:00' ");
                }
            }
            TSql = TSql.Replace(" 60 ", " 1 ");
            TSql = TSql.Replace(" 3600 ", " 1 ");


            TSql = TSql.Replace("strtime", Times);



            if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["chartAxisXType"].ToString() == "1")
            {
                if (Mnu_FullDate.Checked)
                {
                    TSql = TSql.Replace("strcolumns", ",StartDate ");
                }
                if (Mnu_Month.Checked)
                {
                    TSql = TSql.Replace("strcolumns", ",CalIraniMonthID ");
                }
                if (Mnu_Week.Checked)
                {
                    TSql = TSql.Replace("strcolumns", ",CalIraniWeekNum  ");
                }
                if (Mnu_Year.Checked)
                {
                    TSql = TSql.Replace("strcolumns", ",CalIraniYearID  ");
                }



                if (Mnu_FullDate.Checked)
                {
                    TSql = TSql + "  order by startdate";
                }
                if (Mnu_Month.Checked)
                {
                    TSql = TSql + " order by CalIraniMonthID";
                }
                if (Mnu_Week.Checked)
                {
                    TSql = TSql + " order by CalIraniWeekNum";
                }
                if (Mnu_Year.Checked)
                {
                    TSql = TSql + " order by CalIraniYearID";
                }
            }
            TSql = TSql.Replace("strcolumns", "");
            DataTable TempTable = new DataTable();

            TempTable = Bll_Public.GetDataTableFromTSQL(TSql);
            // TempTable.DefaultView.RowFilter = "Fullname <> '0'";

            if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ShowChartPurpose"].ToString() == "True")
            {
                Dt = TempTable.DefaultView.Table.Select("Fullname <> '0'").CopyToDataTable();

                DtTrend = TempTable.DefaultView.Table.Select("Fullname ='0'").CopyToDataTable();
            }
            else
            {
                Dt = TempTable.DefaultView.Table.Select("Fullname <> '0'").CopyToDataTable();
            }
            //   Dt = Bll_Public.GetDataTableFromTSQL(TSql);
            MainChart.DataSource = Dt;
            MainChart.DataBind();
            MainChart.Legends.Add("Default");

            Boolean IsRandomColor = false;

            if (Dt.Rows.Count > 1)
            {
                if (Dt.DefaultView[0]["StateColor"].ToString() == Dt.DefaultView[1]["StateColor"].ToString() && Dt.DefaultView[0]["ProductLineDesc"].ToString() != Dt.DefaultView[1]["ProductLineDesc"].ToString())
                {
                    IsRandomColor = true;
                }
            }
            ColourGenerator generator = new ColourGenerator();

            string LegendField, Xfield, YField, LabelType;

            YField      = "Duration";
            Xfield      = "";
            LegendField = "";
            LabelType   = "";
            try
            {
                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["chartAxisXType"].ToString() == "1")
                {
                    if (Mnu_FullDate.Checked)
                    {
                        //  MainChart.DataBindCrossTab(myReader, "Name", "Year", "Sales", "Label=Commissions");
                        /// MainChart.Series[Dt.DefaultView[i]["Fullname"].ToString()].Points.DataBindXY(  Dt.DefaultView[i]["StartDate"].ToString(), "");

                        Xfield = "StartDate";
                    }
                    if (Mnu_Month.Checked)
                    {
                        Xfield = "CalIraniMonthID";
                    }
                    if (Mnu_Week.Checked)
                    {
                        Xfield = "CalIraniWeekNum";
                    }
                    if (Mnu_Year.Checked)
                    {
                        Xfield = "CalIraniYearID";
                    }
                }

                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["chartAxisXType"].ToString() == "2")
                {
                    Xfield = "StateCaption";
                }
                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["chartAxisXType"].ToString() == "3")
                {
                    Xfield = "Fullname";
                }
                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["chartAxisXType"].ToString() == "7")
                {
                    Xfield = "ProductLineDesc";
                }

                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartLegentType"].ToString() == "1")
                {
                    LegendField = "StateCaption";
                }
                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartLegentType"].ToString() == "2")
                {
                    LegendField = "Fullname";
                }
                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartLegentType"].ToString() == "3")
                {
                    LegendField = "ProductLineDesc";
                }
                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartLegentType"].ToString() == "4")
                {
                    LegendField = "";
                }



                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartTypeDataShow"].ToString() == "1")
                {
                    LabelType = "Label=#VAL";
                }
                else
                {
                    LabelType = "Label=#PERCENT";
                }


                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["IsChartBar"].ToString() == "True")
                {
                    MainChart.DataBindCrossTable(Dt.AsEnumerable(), LegendField, Xfield, YField, "Label=Duration");
                    foreach (Series N in MainChart.Series)
                    {
                        N.AxisLabel   = "ProductLineDesc";
                        N.BorderWidth = 2;
                    }
                }
                else
                {
                    MainChart.Series.Add("Default");
                    for (int i = 0; i < Dt.Rows.Count; i++)
                    {
                        MainChart.Series["Default"].Points.AddXY(Dt.DefaultView[i][Xfield].ToString(), Convert.ToInt32(Dt.DefaultView[i][YField]));
                    }

                    MainChart.Series[0].Legend            = "Default";
                    MainChart.Series[0].IsVisibleInLegend = true;
                    MainChart.Series[0].LegendText        = "#VALX";
                }



                try
                {
                    if (IsRandomColor && BLL.Cls_PublicOperations.Dt.DefaultView[0]["IsChartBar"].ToString() == "True")
                    {
                        foreach (Series N in MainChart.Series)
                        {
                            //   N.Color = System.Drawing.ColorTranslator.FromHtml("#" + generator.NextColour());

                            N.Color = System.Drawing.ColorTranslator.FromHtml("#" + generator.NextColour());
                        }
                    }
                    if (IsRandomColor && BLL.Cls_PublicOperations.Dt.DefaultView[0]["IsChartBar"].ToString() == "False")
                    {
                        for (int x = 0; x < MainChart.Series.Count; x++)
                        {
                            for (int i = 0; i < MainChart.Series[x].Points.Count; i++)
                            {
                                foreach (Series N in MainChart.Series)
                                {
                                    //   N.Color = System.Drawing.ColorTranslator.FromHtml("#" + generator.NextColour());

                                    // N.Color = Random();
                                    MainChart.Series[x].Points[i].Color = System.Drawing.ColorTranslator.FromHtml("#" + generator.NextColour());
                                }
                            }
                        }
                    }
                    else
                    {
                        for (int x = 0; x < MainChart.Series.Count; x++)
                        {
                            for (int i = 0; i < MainChart.Series[x].Points.Count; i++)
                            {
                                for (int j = 0; j < Dt.Rows.Count; j++)
                                {
                                    if (Dt.DefaultView[j][LegendField].ToString() == MainChart.Series[x].Points[i].AxisLabel)
                                    {
                                        MainChart.Series[x].Points[i].Color = Color.FromArgb(Convert.ToInt32(Dt.DefaultView[j]["StateColor"].ToString()));
                                        //   MainChart.Series[x].Color = Color.Red;// Color.FromArgb(Convert.ToInt32(Dt.DefaultView[j]["StateColor"].ToString()));
                                    }
                                }
                            }
                        }
                    }
                }
                catch
                {
                }
                try
                {
                    foreach (Series N in MainChart.Series)
                    {
                        N.AxisLabel = "ProductLineDesc";
                        N.ChartType = (SeriesChartType)Enum.Parse(typeof(SeriesChartType), BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartType"].ToString());// Enum.GetValues (typeof(SeriesChartType), "RangeBar");// System.Windows.Forms.DataVisualization.Charting.SeriesChartType( "System.Windows.Forms.DataVisualization.Charting.SeriesChartType.RangeBar") ;
                    }
                }
                catch
                {
                }


                //  MainChart.Series [Dt.DefaultView[i]["Fullname"].ToString()].Legend = "Default";
                //      MainChart.Series [Dt.DefaultView[i]["Fullname"].ToString()].LegendText = "#VALX";
            }

            catch
            {
            }



            try
            {
                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartLegentType"].ToString() == "4")
                {
                    foreach (Series N in MainChart.Series)
                    {
                        N.IsVisibleInLegend = false;
                    }
                }
            }



            catch
            {
            }



            //  MainChart.Series[0].LegendText = "StartDate";// "#VALX";



            //if (  BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartLegentType"].ToString() == "1")
            //{
            //    MainChart.Series[0].Legend = "Default";
            //    MainChart.Series[0].LegendText = "#VALX";
            //}



            //   MainChart.Series[0].YValueMembers = "Duration";// نمایش مقدار در قسمت Y

            //  MainChart.Series[0].Points.DataBindXY(, );
            //  MainChart.Series[0].LabelToolTip  = "!StartDate";



            MainChart.ChartAreas.Add("Main Area");
            MainChart.ChartAreas[0].BackColor = Color.Transparent;


            MainChart.Legends[0].BackColor = Color.Transparent;
            MainChart.Legends[0].Docking   = System.Windows.Forms.DataVisualization.Charting.Docking.Bottom;

            if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ShowChartCaption"].ToString() == "True")
            {
                MainChart.Titles.Add("Default");
                MainChart.Titles[0].Text    = BLL.Cls_PublicOperations.Dt.DefaultView[0]["Caption"].ToString();
                MainChart.Titles[0].Visible = true;
            }


            try
            {
                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartTypeDataShow"].ToString() == "1")
                {
                    for (int x = 0; x < MainChart.Series.Count; x++)
                    {
                        for (int i = 0; i < MainChart.Series[x].Points.Count; i++)
                        {
                            MainChart.Series[x].Points[i].Label = "#VAL";
                        }
                    }
                }
            }

            catch
            {
            }

            try
            {
                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartTypeDataShow"].ToString() == "2")
                {
                    for (int x = 0; x < MainChart.Series.Count; x++)
                    {
                        for (int i = 0; i < MainChart.Series[x].Points.Count; i++)
                        {
                            MainChart.Series[x].Points[i].Label = "#PERCENT";
                        }
                    }
                }
            }
            catch
            {
            }


            try
            {
                if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartTypeDataShow"].ToString() == "3")
                {
                    for (int x = 0; x < MainChart.Series.Count; x++)
                    {
                        for (int i = 0; i < MainChart.Series[x].Points.Count; i++)
                        {
                            MainChart.Series[x].Points[i].Label = "";
                        }
                    }
                }
            }
            catch
            {
            }



            //if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ChartLegentType"].ToString() == "1")
            //{
            //    MainChart.Series[0].LegendText = "StartDate";// "#VALX";

            //}
            //else
            //{

            //    MainChart.Series[0].LegendText = "StartDate";// "#VALX";

            //}



            if (BLL.Cls_PublicOperations.Dt.DefaultView[0]["ShowChart3D"].ToString() == "True")
            {
                MainChart.ChartAreas[0].Area3DStyle.Enable3D = true;
            }



            // Set drawing style
            //  MainChart.Series["Default"]["PieDrawingStyle"] = "SoftEdge";
            // MainChart.Series["Default"].IsVisibleInLegend = true;

            //Lbl_ParameterDesc.ForeColor = System.Drawing.Color.FromArgb(((int)(((byte)(255)))), ((int)(((byte)(192)))), ((int)(((byte)(255)))));
            //Lbl_ParameterDesc.Location = new System.Drawing.Point(8, 7);
            //Lbl_ParameterDesc.Name = "Lbl_ParameterDesc";
            //Lbl_ParameterDesc.Size = new System.Drawing.Size(91, 26);
            //Lbl_ParameterDesc.TabIndex = 6;
            //Lbl_ParameterDesc.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;



            //if (Dt.Rows.Count > 0)
            //{
            //    decimal Data = Decimal.Parse(Utility.NZ(Dt.DefaultView[0][0].ToString(), 0).ToString());

            //    // Lbl_ParameterDesc.Text = Decimal.Round(Data, 2).ToString();

            //    if (BLL.Cls_PublicOperations.Dt.DefaultView[i]["ParameterName"].ToString().Trim().Contains("(%)"))
            //    {
            //        Lbl_ParameterDesc.Text = Decimal.Round(Data, 1).ToString();
            //    }
            //    else
            //    {
            //        TimeSpan span = TimeSpan.FromSeconds(Convert.ToDouble(Data));

            //        string label = String.Format("{0:D2}:{1:D2}:{2:D2}:{3}", span.Days, span.Hours, span.Minutes, span.Seconds);// span.ToString(@"hh\:mm\:ss");
            //        Lbl_ParameterDesc.Text = label;

            //    }



            //}
            //else
            //{
            //    Lbl_ParameterDesc.Text = "عدم خروجی دستور ایجاد شده";
            //}

            //Lbl_ParameterDesc.TextAlign = System.Drawing.ContentAlignment.MiddleLeft;
            //Pnl_State.Controls.Add(Lbl_ParameterCaption);
            //Pnl_State.Controls.Add(Lbl_ParameterDesc);

            //   Pnl_Main.Controls.Add(Pnl_State);


            if (DtTrend.Rows.Count > 0)
            {
                int x = MainChart.Series.Count;
                for (int i = 0; i <= x - 1; i++)
                {
                    DtTrend = TempTable.DefaultView.Table.Select(LegendField + "='" + MainChart.Series[i].Name + "' ").CopyToDataTable();
                    DtTrend = DtTrend.DefaultView.Table.Select("Fullname = '0' ").CopyToDataTable();

                    MainChart.Series.Add("زمان در دسترس " + MainChart.Series[i].Name);
                    for (int j = 0; j < DtTrend.DefaultView.Table.Rows.Count; j++)
                    {
                        MainChart.Series["زمان در دسترس " + MainChart.Series[i].Name].Points.AddXY(DtTrend.DefaultView.Table.Rows[j][Xfield].ToString(), Convert.ToInt32(DtTrend.DefaultView.Table.Rows[j][YField]));
                        MainChart.Series["زمان در دسترس " + MainChart.Series[i].Name].ChartType = SeriesChartType.Line;
                        MainChart.Series["زمان در دسترس " + MainChart.Series[i].Name].Color     = System.Drawing.ColorTranslator.FromHtml("#" + generator.NextColour());
                    }
                }
            }
        }
Esempio n. 23
0
 public void ConstructMeshMono(int meshCoords, int divisionsLOD, ColourGenerator colourGenerator, MonoBehaviour mono)
 {
     mono.StopAllCoroutines();
     mono.StartCoroutine(ConstructMeshCo(meshCoords, meshCoords, divisionsLOD, Vector3.zero, colourGenerator));
 }
Esempio n. 24
0
    public IEnumerator ConstructMeshCo(int xMesh, int yMesh, int divisions, Vector3 center, ColourGenerator colourGenerator)
    {
        //Debug.Log("coroutine starting");
        Vector3[] vertices  = new Vector3[resolution * resolution];
        int[]     triangles = new int[(resolution - 1) * (resolution - 1) * 6];
        int       triIndex  = 0;

        Vector2[] uv   = (mesh.uv.Length == vertices.Length) ? mesh.uv : new Vector2[vertices.Length];
        Vector2[] uvxy = new Vector2[vertices.Length]; //uv that gives the shader the x and y position of the current vertex.
        Vector2[] uvze = new Vector2[vertices.Length]; //z position and elevation of terrain. (I couldn't find a good way to pass anything other than a vector2 into a shader)

        Vector3[] norms = new Vector3[resolution * resolution];
        for (int y = 0; y < resolution; y++)
        {
            for (int x = 0; x < resolution; x++)
            {
                int     i                 = x + y * resolution;
                Vector2 percent           = new Vector2(x, y) / (resolution - 1);
                Vector3 pointOnUnitCube   = localUp + ((float)xMesh / divisions + percent.x / divisions - .5f) * 2 * axisA + ((float)yMesh / divisions + percent.y / divisions - .5f) * 2 * axisB;
                Vector3 pointOnUnitSphere = pointOnUnitCube.normalized;
                float   unscaledElevation = shapeGenerator.CalculateUnscaledElevation(pointOnUnitSphere);
                vertices[i] = pointOnUnitSphere * shapeGenerator.GetScaledElevation(unscaledElevation);
                uv[i].x     = (unscaledElevation > 0) ? unscaledElevation + 0.0002f : unscaledElevation - 0.00009f;
                //if (unscaledElevation > 0)
                //{
                uvxy[i].x = vertices[i].x;
                uvxy[i].y = vertices[i].y;
                uvze[i].x = vertices[i].z;
                uvze[i].y = unscaledElevation;
                //}

                if (x != resolution - 1 && y != resolution - 1)
                {
                    triangles[triIndex]     = i;
                    triangles[triIndex + 1] = i + resolution + 1;
                    triangles[triIndex + 2] = i + resolution;

                    triangles[triIndex + 3] = i;
                    triangles[triIndex + 4] = i + 1;
                    triangles[triIndex + 5] = i + resolution + 1;
                    triIndex += 6;
                }
            }
            if (y % 10 == 0)
            {
                //Debug.Log("loop" + y);
                yield return(null);
            }
        }
        //Debug.Log("coroutine ending");
        mesh.Clear();
        mesh.vertices  = vertices;
        mesh.triangles = triangles;
        mesh.RecalculateNormals();
        mesh.uv  = uv;
        mesh.uv2 = uvxy;
        mesh.uv3 = uvze;
        UpdateUVs(colourGenerator, xMesh, yMesh);

        norms = mesh.normals;
        for (int y = 0; y < resolution; y++)
        {
            for (int x = 0; x < resolution; x++)
            {
                if (x == 0 || x == (resolution - 1) || y == 0 || y == (resolution - 1))
                {
                    int     i                 = x + y * resolution;
                    Vector2 percent           = new Vector2(x - 0, y - 0) / (resolution - 1 - 0);
                    Vector3 pointOnUnitCube   = localUp + ((float)xMesh / divisions + percent.x / divisions - .5f) * 2 * axisA + ((float)yMesh / divisions + percent.y / divisions - .5f) * 2 * axisB;
                    Vector3 pointOnUnitSphere = pointOnUnitCube.normalized;
                    norms[i] = pointOnUnitSphere;
                }
            }
        }
        mesh.normals = norms;
    }
Esempio n. 25
0
        protected override void OnAppearing()
        {
            base.OnAppearing();
            StackLayout graph = new StackLayout();

            graph.Orientation       = StackOrientation.Vertical;
            graph.HorizontalOptions = LayoutOptions.FillAndExpand;
            ColourGenerator generator = new ColourGenerator();

            decimal total = 0.0M;

            foreach (var currencyAmount in AccountWallet)
            {
                total += currencyAmount.Amount;
            }

            foreach (var currencyAmount in AccountWallet)
            {
                var grid = new Grid();
                var row  = new RowDefinition {
                    Height = new GridLength(1, GridUnitType.Star)
                };
                grid.RowDefinitions.Add(row);
                var labelColumn = new ColumnDefinition {
                    Width = GridLength.Auto
                };
                var barColumn = new ColumnDefinition {
                    Width = new GridLength(1, GridUnitType.Star)
                };
                grid.ColumnDefinitions.Add(labelColumn);
                grid.ColumnDefinitions.Add(barColumn);


                Label label = new Label();
                label.Text = currencyAmount.Currency;
                grid.Children.Add(label, 1, 0);

                StackLayout boxViewWrapper = new StackLayout();
                boxViewWrapper.Orientation       = StackOrientation.Horizontal;
                boxViewWrapper.HorizontalOptions = LayoutOptions.FillAndExpand;
                boxViewWrapper.VerticalOptions   = LayoutOptions.Center;
                RelativeLayout relativeLayout = new RelativeLayout();
                BoxView        bv             = new BoxView();
                bv.VerticalOptions = LayoutOptions.StartAndExpand;
                bv.BackgroundColor = Color.FromHex(generator.NextColour());
                relativeLayout.Children.Add(bv, Constraint.RelativeToParent((parent) =>
                {
                    return(0);
                }), Constraint.RelativeToParent((parent) =>
                {
                    return(0);
                }), Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Width * (double)(currencyAmount.Amount / total));
                }), Constraint.RelativeToParent((parent) =>
                {
                    return(parent.Height);
                }));
                boxViewWrapper.Children.Add(relativeLayout);

                grid.Children.Add(boxViewWrapper, 1, 1);

                graph.Children.Add(grid);
            }
            Content = graph;
        }
Esempio n. 26
0
        private void AddSeriesFromCulture(Culture culture, ref SeriesCollection <IChartSeries> addToSeries, ColourGenerator colourGenerator, bool isReference)
        {
            var validTypes = GetValidTypes();

            if (culture.GetType() == typeof(MergedCulture))
            {
                ControlEnableFitData = false;
            }

            AddPrimaryAxisSeries(culture, addToSeries, colourGenerator, isReference, validTypes);

            if (ZoomGraphControlValues.DisplayFD)
            {
                AddSecundaryAxisSeries(culture, addToSeries);
            }
        }
Esempio n. 27
0
        private void AddPrimaryAxisSeries(Culture culture, SeriesCollection <IChartSeries> addToSeries, ColourGenerator colourGenerator, bool isReference, List <DataType> validTypes)
        {
            var growthGraphPrimary = ChartHelper.AsGrowthGraph(culture, null, validTypes);

            if (isReference)
            {
                growthGraphPrimary.ContainerName = "Ref: " + growthGraphPrimary.ContainerName;
            }

            foreach (var series in growthGraphPrimary.GrowthSeries)
            {
                if (isReference)
                {
                    series.Series.Title = "Ref: " + series.Series.Title;
                }

                var newSerieRaw = new LineSeries
                {
                    DataSeries         = series.Series,
                    LegendItemTemplate = (ControlTemplate)this.FindResource("LegendItemTemplate")
                };

                var colorHexValue = GetColorHexValue(colourGenerator, series);
                var colorBrush    = new SolidColorBrush((Color)ColorConverter.ConvertFromString(colorHexValue));
                newSerieRaw.LineStroke          = colorBrush;
                newSerieRaw.LineStrokeThickness = 1.5;
                newSerieRaw.ShowPoints          = false;
                addToSeries.Add(newSerieRaw);
            }

            if (DisplayFirstDervivative)
            {
                if (!ControlDisplayMetaRateData)
                {
                    return;
                }
                var dataType = culture.GrowthMeasurements.VariableMetaDatas.ContainsKey(DataType.ProcessedThinned)
                    ? DataType.ProcessedThinned
                    : DataType.Processed;
                var metaSerieRateRawFD = MetaSerieRate(dataType, culture.GrowthMeasurements, true);
                addToSeries.Add(metaSerieRateRawFD);
                return;
            }

            if (culture.GetType() == typeof(MergedCulture))
            {
                foreach (var growthMeasurements in ((MergedCulture)culture).MergedGrowthMeasurements.Values)
                {
                    if (validTypes.Contains(DataType.MetaDataLag))
                    {
                        var metaSerieLag = MetaSerieLag(DataType.Processed, growthMeasurements);
                        addToSeries.Add(metaSerieLag);
                    }
                    if (validTypes.Contains(DataType.MetaDataRate))
                    {
                        var metaSerieRate = MetaSerieRate(DataType.Processed, growthMeasurements);
                        addToSeries.Add(metaSerieRate);
                    }
                    if (validTypes.Contains(DataType.MetaDataYield))
                    {
                        var metaSerieYield = MetaSerieYield(DataType.Processed, growthMeasurements);
                        addToSeries.Add(metaSerieYield);
                    }
                }
            }
            else
            {
                if (validTypes.Contains(DataType.MetaDataLag))
                {
                    var metaSerieLag = MetaSerieLag(DataType.Processed, culture.GrowthMeasurements);
                    addToSeries.Add(metaSerieLag);
                    if (culture.GrowthMeasurements.VariableMetaDatas.ContainsKey(DataType.ProcessedThinned))
                    {
                        var metaSerieLagThinned = MetaSerieLag(DataType.ProcessedThinned, culture.GrowthMeasurements);
                        addToSeries.Add(metaSerieLagThinned);
                    }
                    if (culture.GrowthMeasurements.VariableMetaDatas.ContainsKey(DataType.Raw))
                    {
                        var metaSerieLagRaw = MetaSerieLag(DataType.Raw, culture.GrowthMeasurements);
                        addToSeries.Add(metaSerieLagRaw);
                    }
                }
                if (validTypes.Contains(DataType.MetaDataRate))
                {
                    var metaSerieRate = MetaSerieRate(DataType.Processed, culture.GrowthMeasurements);
                    addToSeries.Add(metaSerieRate);
                    if (culture.GrowthMeasurements.VariableMetaDatas.ContainsKey(DataType.ProcessedThinned))
                    {
                        var metaSerieRateThinned = MetaSerieRate(DataType.ProcessedThinned, culture.GrowthMeasurements);
                        addToSeries.Add(metaSerieRateThinned);
                    }
                    if (culture.GrowthMeasurements.VariableMetaDatas.ContainsKey(DataType.Raw))
                    {
                        var metaSerieRateRaw = MetaSerieRate(DataType.Raw, culture.GrowthMeasurements);
                        addToSeries.Add(metaSerieRateRaw);
                    }
                }
                if (validTypes.Contains(DataType.MetaDataYield))
                {
                    var metaSerieYield = MetaSerieYield(DataType.Processed, culture.GrowthMeasurements);
                    addToSeries.Add(metaSerieYield);
                    if (culture.GrowthMeasurements.VariableMetaDatas.ContainsKey(DataType.ProcessedThinned))
                    {
                        var metaSerieYieldThinned = MetaSerieYield(DataType.ProcessedThinned, culture.GrowthMeasurements);
                        addToSeries.Add(metaSerieYieldThinned);
                    }
                    if (culture.GrowthMeasurements.VariableMetaDatas.ContainsKey(DataType.Raw))
                    {
                        var metaSerieYieldRaw = MetaSerieYield(DataType.Raw, culture.GrowthMeasurements);
                        addToSeries.Add(metaSerieYieldRaw);
                    }
                }
            }
        }
Esempio n. 28
0
        public string GetRandomColorAsString()
        {
            var colorGenerator = new ColourGenerator();

            return(colorGenerator.NextColour());
        }
Esempio n. 29
0
 public FlatTerrainGenerator(PerlinNoise perlinNoise, PerlinNoise biomePerlinNoise, ColourGenerator colourGen, BiomeHelper biomeHelper)
     : base(perlinNoise, biomePerlinNoise, colourGen, biomeHelper)
 {
 }
Esempio n. 30
0
    void Initialize()
    {
        //Si es la primera vez y hay variables a null se instancian
        if (shapeGenerator == null)
        {
            shapeGenerator  = new ShapeGenerator();
            colourGenerator = new ColourGenerator();
            floraGenerator  = new FloraGenerator();

            faces = new GameObject[6];
        }

        //Actualizamos las opciones
        shapeGenerator.UpdateSettings(shapeSettings);
        colourGenerator.UpdateSettings(colourSettings);

        if (floraSettings.generateFlora)
        {
            floraGenerator.UpdateSettings(floraSettings, transform);
        }

        //Si no hay mallas para cada cara se crean
        if (meshFilters == null || meshFilters.Length == 0)
        {
            meshFilters = new MeshFilter[6];
        }
        terrainFaces = new TerrainFace[6];

        Vector3[] directions = { Vector3.up, Vector3.down, Vector3.left, Vector3.right, Vector3.forward, Vector3.back };

        //Por cada cara creamos una malla y la colocamos en su posicion
        for (int i = 0; i < 6; i++)
        {
            if (meshFilters[i] == null)
            {
                faces[i] = new GameObject("face");

                if (i != 0)
                {
                    if (i != 1)
                    {
                        faces[i].transform.Rotate(Vector3.Cross(Vector3.up, directions[i]), 90);
                    }
                    else
                    {
                        faces[i].transform.Rotate(Vector3.Cross(Vector3.up, Vector3.right), 180);
                    }
                }
                faces[i].transform.parent = transform;

                GameObject meshObj = new GameObject("mesh");
                meshObj.transform.parent = faces[i].transform;
                if (transform.gameObject.layer == 0)
                {
                    meshObj.layer = 8;
                }
                else
                {
                    meshObj.layer = transform.gameObject.layer;
                }

                meshObj.AddComponent <MeshRenderer>();
                meshFilters[i]            = meshObj.AddComponent <MeshFilter>();
                meshFilters[i].sharedMesh = new Mesh();
            }

            meshFilters[i].GetComponent <MeshRenderer>().sharedMaterial = colourSettings.planetMaterial;

            terrainFaces[i] = new TerrainFace(shapeGenerator, meshFilters[i].sharedMesh, resolution, directions[i]);
            bool renderFace = faceRenderMask == FaceRenderMask.All || (int)faceRenderMask - 1 == i;
            meshFilters[i].gameObject.SetActive(renderFace);
        }
    }