private void ChangeLayout(AbstractLayout newLayout, AbstractHeatMap heatmap) { Layout = newLayout; HeatMap = heatmap; Renderlayout(); ResetCamera(null, null); }
public override void ModelCity(Model3DGroup cityScape, CodeBase codeBase, AbstractHeatMap heatMap) { Reset(cityScape); SetCityLights(cityScape); var maxHeight = codeBase.Graph.MaxLinesOfCode; var minHeight = codeBase.Graph.MinLinesOfCode; var namespaces = codeBase.ByNamespace(); var plots = GeneratePlots(namespaces); var rows = plots.Batch((int)Math.Ceiling(Math.Sqrt(plots.Count()))); if (rows == null) { return; } var previous = Plot.Empty; var maxZ = 0d; var totalZ = 0d; foreach (var row in rows) { foreach (var plot in row) { plot.Adjust(previous, totalZ); RenderSquareBlock(cityScape, plot.Classes, plot.Bounds.Location, minHeight, maxHeight, heatMap); previous = plot; maxZ = Math.Max(maxZ, previous.SizeZ); } previous = Plot.Empty; totalZ -= maxZ + Spacer; maxZ = 0; } }
public override void ModelCity(Model3DGroup cityScape, CodeBase codeBase, AbstractHeatMap heatMap) { Reset(cityScape); SetCityLights(cityScape); var maxHeight = codeBase.Graph.MaxLinesOfCode; var minHeight = codeBase.Graph.MinLinesOfCode; var namespaces = codeBase.ByNamespace(); var squaredNamespaces = (int)Math.Sqrt(namespaces.Keys.Count); var offset = namespaces.Keys.Count * -Spacer / 2; var namespaceCounter = 0; var arrayofClasses = namespaces.Values.ToArray(); var origin = new Point3D(offset, 0, offset); for (var columnCounter = 0; columnCounter < squaredNamespaces; columnCounter++) { double tallestX = 0; for (var rowCounter = 0; rowCounter < squaredNamespaces; rowCounter++) { var listToRender = arrayofClasses[namespaceCounter]; RenderRectangularBlock(cityScape, listToRender, origin, minHeight, maxHeight, heatMap); namespaceCounter++; var zOffeset = Math.Sqrt(listToRender.Count()); if (zOffeset > tallestX) { tallestX = zOffeset; } origin.Z += Math.Sqrt(listToRender.Count()) * Spacer; } origin.X += tallestX * Spacer; origin.Z = offset; } }
protected Rect3D RenderRectangularBlock(Model3DGroup cityScape, IEnumerable <Instance> classes, Point3D center, int minHeight, int maxHeight, AbstractHeatMap heatMap) { var list = classes.ToList(); var rectangleDimensions = CalculateWidthAndLength(list.Count); return(RenderRectangle(cityScape, list, center, minHeight, maxHeight, rectangleDimensions[0], rectangleDimensions[1], heatMap)); }
public override void ModelCity(Model3DGroup cityScape, CodeBase codeBase, AbstractHeatMap heatMap) { Reset(cityScape); SetCityLights(cityScape); if (codeBase.InstanceCount() == 0) { return; } RenderSquareBlock(cityScape, codeBase.AllInstances, new Point3D(0, 0, 0), codeBase.Graph.MinLinesOfCode, codeBase.Graph.MaxLinesOfCode, heatMap); }
private Rect3D RenderRectangle(Model3DGroup cityScape, List <Instance> classes, Point3D center, int minHeight, int maxHeight, double width, double length, AbstractHeatMap heatMap) { var counter = 0; var zOffset = center.Z - width; for (var column = 0 - width; column < width; column++) { var currentX = center.X + Spacer * column; for (var row = 0 - length; row < length; row++) { if (counter >= classes.Count) { break; } var currentZ = zOffset + Spacer * row; cityScape.Children.Add(CreateCube(currentX, currentZ, minHeight, maxHeight, classes[counter++], heatMap)); } } return(new Rect3D(center, new Size3D(width, 0, length))); }
private Model3D CreateCube(double x, double z, int minHeight, int maxHeight, Instance c, AbstractHeatMap heatMap) { var color = heatMap.GetBrush(c); var scaledHeight = LinearScale.Apply(c.LinesOfCode, minHeight, maxHeight); var result = CreateCube(x, z, scaledHeight, color); modelClassXRef.Add(result, c); return(result); }
protected Rect3D RenderSquareBlock(Model3DGroup cityScape, IEnumerable <Instance> classes, Point3D center, int minHeight, int maxHeight, AbstractHeatMap heatMap) { var list = classes.ToList(); var blocksFromCenter = Math.Sqrt(list.Count) / 2d; return(RenderRectangle(cityScape, list, center, minHeight, maxHeight, blocksFromCenter, blocksFromCenter, heatMap)); }
public abstract void ModelCity(Model3DGroup model, CodeBase workspaceCodebase, AbstractHeatMap heatMap);