public override void Add(IPhysicalBoundaries b) { if (b is FiniteDateTimeBoundaries) { Add((FiniteDateTimeBoundaries)b); } }
public void CalculateCachedData(IPhysicalBoundaries xBounds, IPhysicalBoundaries yBounds, IPhysicalBoundaries vBounds) { if (IsDisposeInProgress) { return; } if (_xBoundaries == null || (xBounds != null && _xBoundaries.GetType() != xBounds.GetType())) { _isCachedDataValidX = false; SetXBoundsFromTemplate(xBounds); } if (_yBoundaries == null || (yBounds != null && _yBoundaries.GetType() != yBounds.GetType())) { _isCachedDataValidY = false; SetYBoundsFromTemplate(yBounds); } if (_zBoundaries == null || (vBounds != null && _zBoundaries.GetType() != vBounds.GetType())) { _isCachedDataValidZ = false; SetZBoundsFromTemplate(yBounds); } if (!_isCachedDataValidX || !_isCachedDataValidY || !_isCachedDataValidZ) { CalculateCachedData(); } }
public void MergeYBoundsInto(IPhysicalBoundaries pb) { if (pb is NumericalBoundaries) { this.m_PlotAssociation.MergeYBoundsInto(pb as NumericalBoundaries); } }
/// <summary> /// Copy constructor. /// </summary> /// <param name="from">The object to copy from.</param> /// <remarks>Only clones the references to the data columns, not the columns itself.</remarks> public XYColumnPlotData(XYColumnPlotData from) { XColumn = from.XColumn; // also wires event, do not clone the column data here!!! YColumn = from.YColumn; // wires event, do not clone the column data here!!! this._plotRangeStart = from._plotRangeStart; this._plotRangeLength = from._plotRangeLength; // cached or temporary data if (from._xBoundaries != null) { this._xBoundaries = (IPhysicalBoundaries)from._xBoundaries.Clone(); this._xBoundaries.BoundaryChanged += new BoundaryChangedHandler(this.EhXBoundariesChanged); } if (from._yBoundaries != null) { this._yBoundaries = (IPhysicalBoundaries)from._yBoundaries.Clone(); this._yBoundaries.BoundaryChanged += new BoundaryChangedHandler(this.EhYBoundariesChanged); } this._plottablePoints = from._plottablePoints; this._pointCount = from._pointCount; this._isCachedDataValid = from._isCachedDataValid; this._parent = from._parent; }
public void SetYBoundsFromTemplate(IPhysicalBoundaries val) { if (val is NumericalBoundaries) { this.m_PlotAssociation.SetYBoundsFromTemplate(val as NumericalBoundaries); } }
public void MergeYBoundsInto(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.MergeYBoundsInto(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[] ySumArray = null; int idx = -1; foreach (IGPlotItem pi in coll) { if (pi is G2DPlotItem) { idx++; var gpi = (G2DPlotItem)pi; Processed2DPlotData pdata = plotDataList[gpi]; if (null != pdata) { // 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 (ySumArray == null) { ySumArray = new AltaxoVariant[pdata.RangeList.PlotPointCount]; int j = -1; foreach (int originalIndex in pdata.RangeList.OriginalRowIndices()) { j++; ySumArray[j] = pdata.GetYPhysical(originalIndex); pb.Add(ySumArray[j]); } } else // this is not the first item { int j = -1; foreach (int originalIndex in pdata.RangeList.OriginalRowIndices()) { j++; ySumArray[j] += pdata.GetYPhysical(originalIndex); pb.Add(ySumArray[j]); } } } } } }
public void MergeVBoundsInto(IPhysicalBoundaries pb) { if (!_isCachedDataValid) { CalculateCachedData(); } pb.Add(_vBoundaries); }
public void MergeVBoundsInto(IPhysicalBoundaries pb) { if (!this.m_bCachedDataValid) { this.CalculateCachedData(); } pb.Add(m_vBoundaries); }
public void MergeYBoundsInto(IPlotArea layer, IPhysicalBoundaries pb, PlotItemCollection coll) { Dictionary<G2DPlotItem, Processed2DPlotData> plotDataList; IPhysicalBoundaries pbclone = (IPhysicalBoundaries)pb.Clone(); // before we can use CanUseStyle, we have to give physical y boundaries template CoordinateTransformingStyleBase.MergeYBoundsInto(pbclone, coll); if (!CanUseStyle(layer, coll, out 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[] ySumArray = null; int idx = -1; foreach (IGPlotItem pi in coll) { if (pi is G2DPlotItem) { idx++; G2DPlotItem gpi = (G2DPlotItem)pi; Processed2DPlotData 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 (ySumArray == null) { ySumArray = new AltaxoVariant[pdata.RangeList.PlotPointCount]; int j = -1; foreach (int originalIndex in pdata.RangeList.OriginalRowIndices()) { j++; ySumArray[j] = pdata.GetYPhysical(originalIndex); pb.Add(ySumArray[j]); } } else // this is not the first item { int j = -1; foreach (int originalIndex in pdata.RangeList.OriginalRowIndices()) { j++; ySumArray[j] += pdata.GetYPhysical(originalIndex); pb.Add(ySumArray[j]); } } } } }
public void MergeXBoundsInto(IPlotArea layer, IPhysicalBoundaries pb, PlotItemCollection coll) { if (!(pb is NumericalBoundaries)) { CoordinateTransformingStyleBase.MergeXBoundsInto(pb, coll); return; } NumericalBoundaries xbounds = (NumericalBoundaries)pb.Clone(); xbounds.Reset(); int nItems = 0; foreach (IGPlotItem pi in coll) { if (pi is IXBoundsHolder) { IXBoundsHolder xbpi = (IXBoundsHolder)pi; xbpi.MergeXBoundsInto(xbounds); } if (pi is G2DPlotItem) { nItems++; } } if (nItems == 0) { _xinc = 0; } else { _xinc = (xbounds.UpperBound - xbounds.LowerBound) / nItems; } int idx = 0; foreach (IGPlotItem pi in coll) { if (pi is IXBoundsHolder) { IXBoundsHolder xbpi = (IXBoundsHolder)pi; xbounds.Reset(); xbpi.MergeXBoundsInto(xbounds); xbounds.Shift(_xinc * idx); pb.Add(xbounds); } if (pi is G2DPlotItem) { idx++; } } }
public void SetXBoundsFromTemplate(IPhysicalBoundaries val) { if (null == _xBoundaries || val.GetType() != _xBoundaries.GetType()) { if (ChildCopyToMember(ref _xBoundaries, val)) { _isCachedDataValid = false; EhSelfChanged(EventArgs.Empty); } } }
public static void MergeYBoundsInto(IPhysicalBoundaries pb, PlotItemCollection coll) { foreach (IGPlotItem pi in coll) { if (pi is IYBoundsHolder) { IYBoundsHolder plotItem = (IYBoundsHolder)pi; plotItem.MergeYBoundsInto(pb); } } }
public static void MergeZBoundsInto(IPhysicalBoundaries pb, PlotItemCollection coll) { foreach (IGPlotItem pi in coll) { if (pi is IZBoundsHolder) { var plotItem = (IZBoundsHolder)pi; plotItem.MergeZBoundsInto(pb); } } }
public void MergeYBoundsInto(IPhysicalBoundaries pb) { ICoordinateTransformingGroupStyle coordTransStyle; if (null != (coordTransStyle = _styles.CoordinateTransformingStyle)) { coordTransStyle.MergeYBoundsInto(this.ParentLayer, pb, this); } else { CoordinateTransformingStyleBase.MergeYBoundsInto(pb, this); } }
public void MergeYBoundsInto(IPlotArea layer, IPhysicalBoundaries pb, PlotItemCollection coll) { Dictionary<G2DPlotItem, Processed2DPlotData> plotDataList; IPhysicalBoundaries pbclone = (IPhysicalBoundaries)pb.Clone(); // before we can use CanUseStyle, we have to give physical y boundaries template CoordinateTransformingStyleBase.MergeYBoundsInto(pbclone, coll); if (!CanUseStyle(layer, coll, out plotDataList)) { pb.Add(pbclone); return; } pb.Add(0); pb.Add(100); }
public void CalculateCachedData(IPhysicalBoundaries xBounds, IPhysicalBoundaries yBounds) { if (_xBoundaries == null || _xBoundaries.GetType() != xBounds.GetType()) { this.SetXBoundsFromTemplate(xBounds); } if (_yBoundaries == null || _yBoundaries.GetType() != yBounds.GetType()) { this.SetYBoundsFromTemplate(yBounds); } CalculateCachedData(); }
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); }
/// <summary> /// This sets the y boundary object to a object of the same type as val. The inner data of the boundary, if present, /// are copied into the new y boundary object. /// </summary> /// <param name="val">The template boundary object.</param> protected void SetYBoundsFromTemplate(IPhysicalBoundaries val) { if (null == _yBoundaries || val.GetType() != _yBoundaries.GetType()) { if (null != _yBoundaries) { _yBoundaries.BoundaryChanged -= new BoundaryChangedHandler(this.EhYBoundariesChanged); } _yBoundaries = (IPhysicalBoundaries)val.Clone(); _yBoundaries.BoundaryChanged += new BoundaryChangedHandler(this.EhYBoundariesChanged); _isCachedDataValid = false; OnChanged(); } }
public void MergeYBoundsInto(IPhysicalBoundaries pb) { if (null == _yBoundaries || pb.GetType() != _yBoundaries.GetType()) { this.SetYBoundsFromTemplate(pb); } if (!this._isCachedDataValid) { _SupressBoundaryChangeEvents++; this.CalculateCachedData(); _SupressBoundaryChangeEvents--; } pb.Add(_yBoundaries); }
public void SetVBoundsFromTemplate(IPhysicalBoundaries val) { if (null == m_vBoundaries || val.GetType() != m_vBoundaries.GetType()) { if (null != m_vBoundaries) { m_vBoundaries.BoundaryChanged -= new BoundaryChangedHandler(this.OnVBoundariesChangedEventHandler); } m_vBoundaries = (NumericalBoundaries)val.Clone(); m_vBoundaries.BoundaryChanged += new BoundaryChangedHandler(this.OnVBoundariesChangedEventHandler); this.m_bCachedDataValid = false; OnChanged(); } }
public void MergeZBoundsInto(IPhysicalBoundaries pb) { if (null == _zBoundaries || pb.GetType() != _zBoundaries.GetType()) { SetZBoundsFromTemplate(pb); } if (!_isCachedDataValidY) { using (var suspendToken = SuspendGetToken()) { CalculateCachedData(); } } pb.Add(_zBoundaries); }
public void Add(IPhysicalBoundaries b) { if (b is TextBoundaries) { this.BeginUpdate(); TextBoundaries from = (TextBoundaries)b; foreach (string s in from._itemList) { if (!_itemList.Contains(s)) { _itemList.Add(s); } } this.EndUpdate(); } }
public void Add(IPhysicalBoundaries b) { if (b is TextBoundaries from) { using (var suspendToken = SuspendGetToken()) // Performance tweak; see OnSuspended and OnResumed { foreach (string s in from._itemList) { if (!_itemList.Contains(s)) { _itemList.Add(s); // it is OK that this does not trigger a changed event : Performance tweak; see OnSuspended and OnResumed } } suspendToken.Resume(); // Performance tweak; see OnResumed } } }
public void CalculateCachedData(IPhysicalBoundaries xBounds, IPhysicalBoundaries yBounds, IPhysicalBoundaries zBounds = null) { if (IsDisposeInProgress) { return; } if (_xBoundaries == null || (xBounds != null && _xBoundaries.GetType() != xBounds.GetType())) { SetXBoundsFromTemplate(xBounds); } if (_yBoundaries == null || (yBounds != null && _yBoundaries.GetType() != yBounds.GetType())) { SetYBoundsFromTemplate(yBounds); } if (_vBoundaries == null || (zBounds != null && _vBoundaries.GetType() != zBounds.GetType())) { SetVBoundsFromTemplate(zBounds); } CalculateCachedData(); }
public void Add(IPhysicalBoundaries b) { }
public void MergeYBoundsInto(IPhysicalBoundaries pb) { if (null == _yBoundaries || pb.GetType() != _yBoundaries.GetType()) this.SetYBoundsFromTemplate(pb); if(!this._isCachedDataValid) { _SupressBoundaryChangeEvents++; this.CalculateCachedData(); _SupressBoundaryChangeEvents--; } pb.Add(_yBoundaries); }
/// <summary> /// Merges another boundary object into this one here. /// </summary> /// <param name="b">The other boundary object.</param> public abstract void Add(IPhysicalBoundaries b);
public void CalculateCachedData(IPhysicalBoundaries xBounds, IPhysicalBoundaries yBounds) { if (_xBoundaries == null || _xBoundaries.GetType() != xBounds.GetType()) this.SetXBoundsFromTemplate(xBounds); if (_yBoundaries == null || _yBoundaries.GetType() != yBounds.GetType()) this.SetYBoundsFromTemplate(yBounds); CalculateCachedData(); }
public override void Add(IPhysicalBoundaries b) { Add((NumericalBoundaries)b); }
public void MergeYBoundsInto(IPhysicalBoundaries pb) { if(pb is NumericalBoundaries) this.m_PlotAssociation.MergeYBoundsInto(pb as NumericalBoundaries); }
public void SetYBoundsFromTemplate(IPhysicalBoundaries val) { if(val is NumericalBoundaries) this.m_PlotAssociation.SetYBoundsFromTemplate(val as NumericalBoundaries); }
public void MergeVBoundsInto(IPhysicalBoundaries pb) { if (!this._isCachedDataValid) this.CalculateCachedData(); pb.Add(_vBoundaries); }
public void CalculateCachedData(IPhysicalBoundaries xBounds, IPhysicalBoundaries yBounds, IPhysicalBoundaries zBounds = null) { if (this.IsDisposeInProgress) return; if (_xBoundaries == null || (xBounds != null && _xBoundaries.GetType() != xBounds.GetType())) this.SetXBoundsFromTemplate(xBounds); if (_yBoundaries == null || (yBounds != null && _yBoundaries.GetType() != yBounds.GetType())) this.SetYBoundsFromTemplate(yBounds); if (_vBoundaries == null || (zBounds != null && _vBoundaries.GetType() != zBounds.GetType())) this.SetVBoundsFromTemplate(zBounds); CalculateCachedData(); }
public void MergeYBoundsInto(IPlotArea layer, IPhysicalBoundaries pb, PlotItemCollection coll) { if (!(pb is NumericalBoundaries)) { CoordinateTransformingStyleBase.MergeYBoundsInto(pb, coll); return; } NumericalBoundaries ybounds = (NumericalBoundaries)pb.Clone(); ybounds.Reset(); int nItems = 0; foreach (IGPlotItem pi in coll) { if (pi is IYBoundsHolder) { IYBoundsHolder ybpi = (IYBoundsHolder)pi; ybpi.MergeYBoundsInto(ybounds); } if (pi is G2DPlotItem) nItems++; } if (nItems == 0) _yinc = 0; else _yinc = (ybounds.UpperBound - ybounds.LowerBound); int idx = 0; foreach (IGPlotItem pi in coll) { if (pi is IYBoundsHolder) { IYBoundsHolder ybpi = (IYBoundsHolder)pi; ybounds.Reset(); ybpi.MergeYBoundsInto(ybounds); ybounds.Shift(_yinc * _scaleYInc * idx); pb.Add(ybounds); } if (pi is G2DPlotItem) idx++; } }
public void CalculateCachedData(IPhysicalBoundaries xBounds, IPhysicalBoundaries yBounds) { if (this.IsDisposeInProgress) return; if (_xBoundaries == null || (xBounds != null && _xBoundaries.GetType() != xBounds.GetType())) { _isCachedDataValidX = false; this.SetXBoundsFromTemplate(xBounds); } if (_yBoundaries == null || (yBounds != null && _yBoundaries.GetType() != yBounds.GetType())) { _isCachedDataValidY = false; this.SetYBoundsFromTemplate(yBounds); } if (!_isCachedDataValidX || !_isCachedDataValidY) CalculateCachedData(); }
public void MergeYBoundsInto(IPhysicalBoundaries pb) { if (null == _yBoundaries || pb.GetType() != _yBoundaries.GetType()) this.SetYBoundsFromTemplate(pb); if (!this._isCachedDataValidY) { using (var suspendToken = SuspendGetToken()) { this.CalculateCachedData(); } } pb.Add(_yBoundaries); }
public void SetVBoundsFromTemplate(IPhysicalBoundaries val) { if (null == _vBoundaries || val.GetType() != _vBoundaries.GetType()) { if (ChildCopyToMember(ref _vBoundaries, val)) { this._isCachedDataValid = false; EhSelfChanged(EventArgs.Empty); } } }
public void SetYBoundsFromTemplate(IPhysicalBoundaries val) { this._plotData.SetYBoundsFromTemplate(val); }
public void MergeYBoundsInto(IPhysicalBoundaries pb) { this._plotData.MergeYBoundsInto(pb); }
public override void Add(IPhysicalBoundaries b) { if (b is FiniteDateTimeBoundaries) Add((FiniteDateTimeBoundaries)b); }
public void MergeYBoundsInto(IPlotArea layer, IPhysicalBoundaries pb, PlotItemCollection coll) { CoordinateTransformingStyleBase.MergeYBoundsInto(pb, coll); }
/// <summary> /// This sets the y boundary object to a object of the same type as val. The inner data of the boundary, if present, /// are copied into the new y boundary object. /// </summary> /// <param name="val">The template boundary object.</param> protected void SetYBoundsFromTemplate(IPhysicalBoundaries val) { if(null==_yBoundaries || val.GetType() != _yBoundaries.GetType()) { if(null!=_yBoundaries) { _yBoundaries.BoundaryChanged -= new BoundaryChangedHandler(this.EhYBoundariesChanged); } _yBoundaries = (IPhysicalBoundaries)val.Clone(); _yBoundaries.BoundaryChanged += new BoundaryChangedHandler(this.EhYBoundariesChanged); _isCachedDataValid = false; OnChanged(); } }
public void SetZBoundsFromTemplate(IPhysicalBoundaries val) { _plotData.SetVBoundsFromTemplate(val); }
/// <summary> /// This sets the y boundary object to a object of the same type as val. The inner data of the boundary, if present, /// are copied into the new y boundary object. /// </summary> /// <param name="val">The template boundary object.</param> protected void SetYBoundsFromTemplate(IPhysicalBoundaries val) { if (null == _yBoundaries || val.GetType() != _yBoundaries.GetType()) { if (ChildCopyToMember(ref _yBoundaries, val)) { _isCachedDataValidY = false; EhSelfChanged(EventArgs.Empty); } } }
public void MergeZBoundsInto(IPhysicalBoundaries pb) { _plotData.MergeZBoundsInto(pb); }
public void Add(IPhysicalBoundaries b) { if (b is TextBoundaries) { this.BeginUpdate(); TextBoundaries from = (TextBoundaries)b; foreach (string s in from._itemList) { if (!_itemList.Contains(s)) _itemList.Add(s); } this.EndUpdate(); } }