private void ProcessPolygonQ(Polygon q) { TangentPair tangentPair = new TangentPair(currentPolygon, q); if (this.useLeftPTangents) { tangentPair.CalculateLeftTangents(); } else { tangentPair.CalculateRightTangents(); } Tuple <int, int> couple = useLeftPTangents ? tangentPair.leftPLeftQ : tangentPair.rightPLeftQ; Tangent t0 = new Tangent(currentPolygon[couple.Item1], q[couple.Item2]); t0.IsLow = true; t0.SeparatingPolygons = !this.useLeftPTangents; couple = useLeftPTangents ? tangentPair.leftPRightQ : tangentPair.rightPRightQ; Tangent t1 = new Tangent(currentPolygon[couple.Item1], q[couple.Item2]); t1.IsLow = false; t1.SeparatingPolygons = this.useLeftPTangents; t0.Comp = t1; t1.Comp = t0; this.tangents.Add(t0); this.tangents.Add(t1); this.diagonals.Add(new Diagonal(t0, t1)); }
private void ProcessPolygonQ(Polygon q) { TangentPair tangentPair = new TangentPair(currentPolygon, q); if (this.useLeftPTangents) tangentPair.CalculateLeftTangents(); else tangentPair.CalculateRightTangents(); Tuple<int, int> couple = useLeftPTangents ? tangentPair.leftPLeftQ : tangentPair.rightPLeftQ; Tangent t0 = new Tangent(currentPolygon[couple.Item1], q[couple.Item2]); t0.IsLow = true; t0.SeparatingPolygons = !this.useLeftPTangents; couple = useLeftPTangents ? tangentPair.leftPRightQ : tangentPair.rightPRightQ; Tangent t1 = new Tangent(currentPolygon[couple.Item1], q[couple.Item2]); t1.IsLow = false; t1.SeparatingPolygons = this.useLeftPTangents; t0.Comp = t1; t1.Comp = t0; this.tangents.Add(t0); this.tangents.Add(t1); this.diagonals.Add(new Diagonal(t0, t1)); }