public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { Log10Scale s = null != o ? (Log10Scale)o : new Log10Scale(); s._log10Org = (double)info.GetDouble("Log10Org"); s._log10End = (double)info.GetDouble("Log10End"); s._decadesPerMajorTick = (int)info.GetInt32("DecadesPerMajor"); bool AxisOrgFixed = (bool)info.GetBoolean("OrgFixed"); bool AxisEndFixed = (bool)info.GetBoolean("EndFixed"); s._dataBounds = (PositiveFiniteNumericalBoundaries)info.GetValue("Bounds", typeof(PositiveFiniteNumericalBoundaries)); s._dataBounds.BoundaryChanged += new BoundaryChangedHandler(s.OnBoundariesChanged); s._rescaling = new LogarithmicAxisRescaleConditions(); s._rescaling.SetOrgAndEnd(AxisOrgFixed ? BoundaryRescaling.Fixed : BoundaryRescaling.Auto, s.Org, AxisEndFixed ? BoundaryRescaling.Fixed:BoundaryRescaling.Auto, s.End); LogarithmicAxisRescaleConditions rescaling = new LogarithmicAxisRescaleConditions(); rescaling.SetOrgAndEnd(AxisOrgFixed ? BoundaryRescaling.Fixed : BoundaryRescaling.Auto, s.Org, AxisEndFixed ? BoundaryRescaling.Fixed:BoundaryRescaling.Auto, s.End); s._rescaling = rescaling; return(s); }
/// <summary> /// Copy constructor. /// </summary> /// <param name="from">The axis to copy from.</param> public Log10Scale(Log10Scale from) { this.IsLinked = from.IsLinked; this._dataBounds = null == from._dataBounds ? new PositiveFiniteNumericalBoundaries() : (NumericalBoundaries)from._dataBounds.Clone(); _dataBounds.BoundaryChanged += new BoundaryChangedHandler(this.OnBoundariesChanged); this._decadesPerMajorTick = from._decadesPerMajorTick; this._log10End = from._log10End; this._log10Org = from._log10Org; this._rescaling = null == from.Rescaling ? new LogarithmicAxisRescaleConditions() : (LogarithmicAxisRescaleConditions)from.Rescaling.Clone(); }
public void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info) { Log10Scale s = (Log10Scale)obj; info.AddValue("Log10Org", s._log10Org); info.AddValue("Log10End", s._log10End); info.AddValue("DecadesPerMajor", s._decadesPerMajorTick); //info.AddValue("OrgFixed",s.m_AxisOrgFixed); //info.AddValue("EndFixed",s.m_AxisEndFixed); info.AddValue("Bounds", s._dataBounds); }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { Log10Scale s = null != o ? (Log10Scale)o : new Log10Scale(info); s._log10Org = info.GetDouble("Log10Org"); s._cachedOrg = Math.Pow(10, s._log10Org); s._log10End = info.GetDouble("Log10End"); s._cachedEnd = Math.Pow(10, s._log10End); s._dataBounds = (PositiveFiniteNumericalBoundaries)info.GetValue("Bounds", s); s._dataBounds.ParentObject = s; s._rescaling = (LogarithmicScaleRescaleConditions)info.GetValue("Rescaling", s); s._rescaling.ParentObject = s; s._tickSpacing = (Ticks.TickSpacing)info.GetValue("TickSpacing", s); s._tickSpacing.ParentObject = s; s.UpdateTicksAndOrgEndUsingRescalingObject(); return(s); }
private void SetupOldAxis(int idx, Altaxo.Graph.Scales.Deprecated.Scale axis, bool isLinked, double orgA, double orgB, double endA, double endB) { Scale transScale = null; if (axis is Altaxo.Graph.Scales.Deprecated.TextScale) transScale = new TextScale(); else if (axis is Altaxo.Graph.Scales.Deprecated.DateTimeScale) transScale = new DateTimeScale(); else if (axis is Altaxo.Graph.Scales.Deprecated.Log10Scale) transScale = new Log10Scale(); else if (axis is Altaxo.Graph.Scales.Deprecated.AngularScale) transScale = (axis as Altaxo.Graph.Scales.Deprecated.AngularScale).UseDegrees ? (Scale)new AngularDegreeScale() : (Scale)new AngularRadianScale(); else if (axis is Altaxo.Graph.Scales.Deprecated.LinearScale) transScale = new LinearScale(); else throw new ArgumentException("Axis type unknown"); if (transScale.RescalingObject is IUnboundNumericScaleRescaleConditions) (transScale.RescalingObject as IUnboundNumericScaleRescaleConditions).SetUserParameters(BoundaryRescaling.AutoTempFixed, BoundariesRelativeTo.Absolute, axis.OrgAsVariant, BoundaryRescaling.AutoTempFixed, BoundariesRelativeTo.Absolute, axis.EndAsVariant); if (transScale.RescalingObject is Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions && axis.RescalingObject is Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions) { ((Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)transScale.RescalingObject).CopyFrom((Altaxo.Graph.Scales.Rescaling.NumericScaleRescaleConditions)axis.RescalingObject); } if (isLinked) { #pragma warning disable CS0618 // Type or member is obsolete LinkedScale ls = new LinkedScale(transScale, idx); #pragma warning restore CS0618 // Type or member is obsolete ls.SetLinkParameter(orgA, orgB, endA, endB); transScale = ls; } _scales[idx] = transScale; }
public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent) { Log10Scale s = null != o ? (Log10Scale)o : new Log10Scale(info); s._log10Org = info.GetDouble("Log10Org"); s._cachedOrg = Math.Pow(10, s._log10Org); s._log10End = info.GetDouble("Log10End"); s._cachedEnd = Math.Pow(10, s._log10End); s._rescaling = (LogarithmicScaleRescaleConditions)info.GetValue("Rescaling", s); s._rescaling.ParentObject = s; s._dataBounds = (PositiveFiniteNumericalBoundaries)info.GetValue("Bounds", s); s._dataBounds.ParentObject = s; s._tickSpacing = new Ticks.Log10TickSpacing { ParentObject = s }; s.EhChildChanged(s._dataBounds, EventArgs.Empty); // for this old version, rescaling is not fully serialized, thus we have to simulate a DataBoundChanged event to get _rescaling updated, and finally _tickSpacing updated return(s); }
/// <summary> /// Copy constructor. /// </summary> /// <param name="from">The axis to copy from.</param> public Log10Scale(Log10Scale from) { CopyFrom(from); }
/// <summary> /// Copy constructor. /// </summary> /// <param name="from">The axis to copy from.</param> public Log10Scale(Log10Scale from) { this.IsLinked = from.IsLinked; this._dataBounds = null==from._dataBounds ? new PositiveFiniteNumericalBoundaries() : (NumericalBoundaries)from._dataBounds.Clone(); _dataBounds.BoundaryChanged += new BoundaryChangedHandler(this.OnBoundariesChanged); this._decadesPerMajorTick = from._decadesPerMajorTick; this._log10End = from._log10End; this._log10Org = from._log10Org; this._rescaling = null==from.Rescaling ? new LogarithmicAxisRescaleConditions() : (LogarithmicAxisRescaleConditions)from.Rescaling.Clone(); }