public void MergeZBoundsInto(IPlotArea layer, IPhysicalBoundaries pb, PlotItemCollection coll) { var pbclone = (IPhysicalBoundaries)pb.Clone(); // before we can use CanUseStyle, we have to give physical y boundaries template CoordinateTransformingStyleBase.MergeZBoundsInto(pbclone, coll); if (!CanUseStyle(layer, coll, out var plotDataList)) { pb.Add(pbclone); return; } // we put zero into the y-Boundaries, since the addition starts with that value pb.Add(new AltaxoVariant(0.0)); AltaxoVariant[] vSumArray = null; int idx = -1; foreach (IGPlotItem pi in coll) { if (pi is G3DPlotItem) { idx++; var gpi = (G3DPlotItem)pi; Processed3DPlotData pdata = plotDataList[gpi]; // Note: we can not use AddUp function here, since // when we have positive/negative items, the intermediate bounds // might be wider than the bounds of the end result if (vSumArray == null) { vSumArray = new AltaxoVariant[pdata.RangeList.PlotPointCount]; int j = -1; foreach (int originalIndex in pdata.RangeList.OriginalRowIndices()) { j++; vSumArray[j] = pdata.GetZPhysical(originalIndex); pb.Add(vSumArray[j]); } } else // this is not the first item { int j = -1; foreach (int originalIndex in pdata.RangeList.OriginalRowIndices()) { j++; vSumArray[j] += pdata.GetZPhysical(originalIndex); pb.Add(vSumArray[j]); } } } } }
public void MergeZBoundsInto(IPlotArea layer, IPhysicalBoundaries pb, PlotItemCollection coll) { var pbclone = (IPhysicalBoundaries)pb.Clone(); // before we can use CanUseStyle, we have to give physical y boundaries template CoordinateTransformingStyleBase.MergeZBoundsInto(pbclone, coll); if (!CanUseStyle(layer, coll, out var plotDataList)) { pb.Add(pbclone); return; } pb.Add(0); pb.Add(100); }