private void computeEdges(PointHolder ph) { int i0 = ph.Intensity(v[0]); int i1 = ph.Intensity(v[1]); int i2 = ph.Intensity(v[2]); int i3 = ph.Intensity(v[3]); int i4 = ph.Intensity(v[4]); int i5 = ph.Intensity(v[5]); int i6 = ph.Intensity(v[6]); int i7 = ph.Intensity(v[7]); this.computeEdge(v[0], i0, v[1], i1, ref e[0], ph); this.computeEdge(v[1], i1, v[2], i2, ref e[1], ph); this.computeEdge(v[2], i2, v[3], i3, ref e[2], ph); this.computeEdge(v[3], i3, v[0], i0, ref e[3], ph); this.computeEdge(v[4], i4, v[5], i5, ref e[4], ph); this.computeEdge(v[5], i5, v[6], i6, ref e[5], ph); this.computeEdge(v[6], i6, v[7], i7, ref e[6], ph); this.computeEdge(v[7], i7, v[4], i4, ref e[7], ph); this.computeEdge(v[0], i0, v[4], i4, ref e[8], ph); this.computeEdge(v[1], i1, v[5], i5, ref e[9], ph); this.computeEdge(v[3], i3, v[7], i7, ref e[10], ph); this.computeEdge(v[2], i2, v[6], i6, ref e[11], ph); }
//Формирования индекса для каждого случая пересечения куба private int caseNumber(PointHolder ph) { int caseNumber = 0; for (int index = -1; ++index < v.Length; caseNumber += (ph.Intensity(v[index]) - ph.threshold > 0) ? 1 << index : 0) { ; } return(caseNumber); }