public static GetRotatedSamples ( ITopoArray sample, TileRotation tileRotation = null ) : IEnumerable |
||
sample | ITopoArray | |
tileRotation | TileRotation | |
return | IEnumerable |
public void AddSample(ITopoArray <Tile> sample, TileRotation tileRotation = null) { foreach (var s in OverlappingAnalysis.GetRotatedSamples(sample, tileRotation)) { AddSample(s); } }
public void AddSample(ITopoArray <Tile> sample, int rotationalSymmetry, bool reflectionalSymmetry, TileRotation tileRotation = null) { foreach (var s in OverlappingAnalysis.GetRotatedSamples(sample, rotationalSymmetry, reflectionalSymmetry, tileRotation)) { AddSample(s); } }
public void AddSample(ITopoArray <Tile> sample, TileRotation tileRotation = null) { if (sample.Topology.Depth == 1) { nz = 1; } var topology = sample.Topology.AsGridTopology(); var periodicX = topology.PeriodicX; var periodicY = topology.PeriodicY; var periodicZ = topology.PeriodicZ; foreach (var s in OverlappingAnalysis.GetRotatedSamples(sample, tileRotation)) { OverlappingAnalysis.GetPatterns(s, nx, ny, nz, periodicX, periodicY, periodicZ, patternIndices, patternArrays, frequencies); } // Update the model based on the collected data var directions = topology.Directions; // TODO: Don't regenerate this from scratch every time propagator = new List <HashSet <int>[]>(patternArrays.Count); for (var p = 0; p < patternArrays.Count; p++) { propagator.Add(new HashSet <int> [directions.Count]); for (var d = 0; d < directions.Count; d++) { var l = new HashSet <int>(); for (var p2 = 0; p2 < patternArrays.Count; p2++) { var dx = directions.DX[d]; var dy = directions.DY[d]; var dz = directions.DZ[d]; if (Aggrees(patternArrays[p], patternArrays[p2], dx, dy, dz)) { l.Add(p2); } } propagator[p][d] = l; } } patternsToTiles = patternArrays .Select((x, i) => new KeyValuePair <int, Tile>(i, x.Values[0, 0, 0])) .ToDictionary(x => x.Key, x => x.Value); tilesToPatterns = patternsToTiles.ToLookup(x => x.Value, x => x.Key); }
public void AddSample(ITopoArray <Tile> sample, TileRotation tileRotation = null) { if (sample.Topology.Depth == 1) { nz = 1; } var topology = sample.Topology.AsGridTopology(); var periodicX = topology.PeriodicX; var periodicY = topology.PeriodicY; var periodicZ = topology.PeriodicZ; foreach (var s in OverlappingAnalysis.GetRotatedSamples(sample, tileRotation)) { OverlappingAnalysis.GetPatterns(s, nx, ny, nz, periodicX, periodicY, periodicZ, patternIndices, patternArrays, frequencies); } sampleTopologyDirections = topology.Directions; propagator = null;// Mark as dirty }