public void CalculateAndSaveContourForPosition(int positionIndex, double[] cDistances, System.Drawing.Color[] colors) { if (_computedDistances[positionIndex] == null) { throw new WristException("Raw distances (_computedDistancs) must be pre-computed before calculating Contour"); } Contour contour = DistanceMaps.createContourSingleBoneSinglePosition(this, _computedDistances[positionIndex], cDistances, colors); lock (_computedContours) { _computedContours[positionIndex] = contour; } }
public void CalculateAndSaveContourForAnimation(int absoluteFrameNumber, double[] cDistances, System.Drawing.Color[] colors) { if (_animationComputedDistances[absoluteFrameNumber] == null) { throw new WristException("Raw distances (_computedDistancs) must be pre-computed before calculating Contour"); } Contour contour = DistanceMaps.createContourSingleBoneSinglePosition(this, _animationComputedDistances[absoluteFrameNumber], cDistances, colors); lock (this) { if (_animationComputedContours == null) { _animationComputedContours = new Contour[_animationComputedDistances.Length]; } _animationComputedContours[absoluteFrameNumber] = contour; } }
public static Contour createContourSingleBoneSinglePosition(Bone referenceBone, double[] distanceMap, double[] cDistances, System.Drawing.Color[] colors) { float[,] points = referenceBone.GetVertices(); int[,] conn = referenceBone.GetFaceSetIndices(); return(DistanceMaps.createContourSingleBoneSinglePosition(points, conn, distanceMap, cDistances, colors)); }