public void Initialise() { for (int z = 0; z < GridId.GridZRange; z++) { for (int x = 0; x < GridId.GridXRange; x++) { int id = GridId.IdFromComponents(x, z); float xp = 0, zp = 0; bool ok = GridId.XZ(id, out xp, out zp); Debug.Assert(ok); StarGrid grd = new StarGrid(id, xp, zp, Color.Transparent, 1.0F); //A=0 means use default colour array if (xp == 0 && zp == 0) // sol grid, unpopulated stars please { grd.dBAsk = SystemsDB.SystemAskType.UnpopulatedStars; } grids.Add(grd); } } systemlistgrid = new StarGrid(-1, 0, 0, Color.Orange, 1.0F); // grid ID -1 means it won't be filled by the Update task grids.Add(systemlistgrid); int solid = GridId.Id(0, 0); populatedgrid = new StarGrid(solid, 0, 0, Color.Transparent, 1.0F); // Duplicate grid id but asking for populated stars populatedgrid.dBAsk = SystemsDB.SystemAskType.PopulatedStars; grids.Add(populatedgrid); // add last so shown last Console.WriteLine("Grids " + grids.Count + " mid " + midpercentage + " far " + farpercentage); }
public void FillFromDB() // does not affect the display object { GridId.XZ(Id, out float x, out float z); if (array1displayed) { SystemsDB.GetSystemVector(Id, ref array2, ref carray2, Percentage, FromIntXYZScalar); // MAY return array/carray is null array2vertices = array2.Length; // System.Diagnostics.Debug.WriteLine("Grid " + Id + " " + x + "," + z + " into 2 at " + Percentage + " for " + array2vertices); } else { SystemsDB.GetSystemVector(Id, ref array1, ref carray1, Percentage, FromIntXYZScalar); array1vertices = array1.Length; // System.Diagnostics.Debug.WriteLine("Grid " + Id + " " + x + "," + z + " into 1 at " + Percentage + " for " + array1vertices); } }
public void Initialise() { for (int z = 0; z < GridId.gridzrange; z++) { for (int x = 0; x < GridId.gridxrange; x++) { int id = GridId.IdFromComponents(x, z); double xp = 0, zp = 0; bool ok = GridId.XZ(id, out xp, out zp); Debug.Assert(ok); StarGrid grd = new StarGrid(id, xp, zp, Color.Transparent, 1.0F); //A=0 means use default colour array if (xp == 0 && zp == 0) // sol grid, unpopulated stars please { grd.dBAsk = SystemClass.SystemAskType.UnPopulatedStars; } grids.Add(grd); } } visitedsystemsgrid = new StarGrid(-1, 0, 0, Color.Orange, 1.0F); // grid ID -1 means it won't be filled by the Update task grids.Add(visitedsystemsgrid); int solid = GridId.Id(0, 0); populatedgrid = new StarGrid(solid, 0, 0, Color.Transparent, 1.0F); // Duplicate grid id but asking for populated stars populatedgrid.dBAsk = SystemClass.SystemAskType.PopulatedStars; grids.Add(populatedgrid); // add last, so displayed last, so overwrites anything else long total = SystemClass.GetTotalSystems(); total = Math.Min(total, 10000000); // scaling limit at 10mil long offset = (total - 1000000) / 100000; // scale down slowly.. experimental! midpercentage -= (int)(offset / 2); farpercentage -= (int)(offset / 3); //midpercentage = 10; // agressive debugging options //farpercentage = 1; Console.WriteLine("Grids " + grids.Count + "Database Stars " + total + " mid " + midpercentage + " far " + farpercentage); }
public void Initialise() { for (int z = 0; z < GridId.GridZRange; z++) { for (int x = 0; x < GridId.GridXRange; x++) { int id = GridId.IdFromComponents(x, z); float xp = 0, zp = 0; bool ok = GridId.XZ(id, out xp, out zp); Debug.Assert(ok); StarGrid grd = new StarGrid(id, xp, zp, Color.Transparent, 1.0F); //A=0 means use default colour array grids.Add(grd); } } systemlistgrid = new StarGrid(-1, 0, 0, Color.Orange, 1.0F); // grid ID -1 means it won't be filled by the Update task grids.Add(systemlistgrid); Trace.WriteLine("Grids " + grids.Count + " mid " + midpercentage + " far " + farpercentage); }