private void SelectNotAll(bool notAll) { for (int i = 0; i < Width; i++) { for (int j = 0; j < Height; j++) { if (notAll) { if (GrainsInPreviousStep[i, j].PenColor.Color == Color.White) { notBoundaries.Add(new Point(i, j)); continue; } } if ((i < Width - 1 && GrainsInPreviousStep[i, j].PenColor != GrainsInPreviousStep[i + 1, j].PenColor) || (j < Height - 1 && GrainsInPreviousStep[i, j].PenColor != GrainsInPreviousStep[i, j + 1].PenColor)) { Boundaries.Add(new Point(i, j)); } else { notBoundaries.Add(new Point(i, j)); } } } }
public void AddBoundary(string ZonesFrom, Vector3 ZonesFromPoint, string ZonesTo, Vector3 ZonesToPoint) { List <ZoneBoundary> zoneBoundaries; var zoneBoundary = new ZoneBoundary { FromZone = ZonesFrom, FromPosition = ZonesFromPoint, ToZone = ZonesTo, ToPosition = ZonesToPoint }; if (Boundaries == null) { Boundaries = new List <ZoneBoundary>(); } Boundaries.Add(zoneBoundary); }
public WordDecompositionList(string original, WordSplitBehavior splitBehavior) : base(original) { if (original.Length > 0) { int lastCharType = GetCharType(original[0], splitBehavior); for (int i = 1; i < original.Length; i++) { int newCharType = GetCharType(original[i], splitBehavior); if (newCharType != lastCharType) { Boundaries.Add(i); lastCharType = newCharType; } } } }
public WordDecompositionList(SnapshotSpan original, WordSplitBehavior splitBehavior) : base(original) { if (original.Length > 0) { int start = original.Start; int lastCharType = GetCharType(original.Snapshot[start], splitBehavior); for (int i = 1; i < original.Length; i++) { int newCharType = GetCharType(original.Snapshot[i + start], splitBehavior); if (newCharType != lastCharType) { Boundaries.Add(i); lastCharType = newCharType; } } } }
public SamplerLeaf Combine(float angleErr) { for (int i = 0; i < Children.Length; ++i) { if (Children[i] == null || !(Children[i] is SamplerLeaf)) { return(null); } } for (int i = 0; i < Children.Length; ++i) { SamplerLeaf l = (SamplerLeaf)Children[i]; float dot = Vector3.Dot(l.Normal.normalized, mVertex.Normal.normalized); if (Mathf.Rad2Deg * Mathf.Acos(dot) >= angleErr) { return(null); } } SamplerLeaf leaf = new SamplerLeaf(mVertex); for (int i = 0; i < Children.Length; ++i) { SamplerLeaf l = (SamplerLeaf)Children[i]; foreach (var k in l.Boundaries.Keys) { if (Boundaries.ContainsKey(k)) { Boundaries[k].Merge(l.Boundaries[k]); } else { Boundaries.Add(k, l.Boundaries[k]); } } } leaf.Boundaries = Boundaries; return(leaf); }
private void CreateBoundaries() { increment = 2; Boundaries.Clear(); for (int i = 0; i < outsideTrack.Lines.Count - increment; i += increment) { Boundaries.Add(new Boundary(outsideTrack.Lines[i].Origin.X, outsideTrack.Lines[i].Origin.Y, outsideTrack.Lines[i + increment].EndPoint.X, outsideTrack.Lines[i + increment].EndPoint.Y)); } for (int i = 0; i < insideTrack.Lines.Count - increment; i += increment) { Boundaries.Add(new Boundary(insideTrack.Lines[i].Origin.X, insideTrack.Lines[i].Origin.Y, insideTrack.Lines[i + increment].EndPoint.X, insideTrack.Lines[i + increment].EndPoint.Y)); } OutOfBounds.Clear(); for (int i = 0; i < outSideOutOfBounds.Lines.Count - increment; i += increment) { OutOfBounds.Add(new Boundary(outSideOutOfBounds.Lines[i].Origin.X, outSideOutOfBounds.Lines[i].Origin.Y, outSideOutOfBounds.Lines[i + increment].EndPoint.X, outSideOutOfBounds.Lines[i + increment].EndPoint.Y)); } for (int i = 0; i < insideOutOfBounds.Lines.Count - increment; i += increment) { OutOfBounds.Add(new Boundary(insideOutOfBounds.Lines[i].Origin.X, insideOutOfBounds.Lines[i].Origin.Y, insideOutOfBounds.Lines[i + increment].EndPoint.X, insideOutOfBounds.Lines[i + increment].EndPoint.Y)); } }
public override void AddBoundary(int subdivision, int x, int z, byte bk, SampleVertexData vert) { Boundaries.Add(bk, vert); }
public void OnEnterBoundary(C_FlockBoundary boundary) { Boundaries.Add(boundary); }