예제 #1
0
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                NumericScaleRescaleConditions s = null != o ? (NumericScaleRescaleConditions)o : new LinearScaleRescaleConditions();

                s._userProvidedOrgRelativeTo = BoundariesRelativeTo.Absolute;
                s._userProvidedEndRelativeTo = BoundariesRelativeTo.Absolute;

                var orgRescaling  = (BoundaryRescaling)(int)info.GetEnum("OrgRescaling", typeof(BoundaryRescalingV1));
                var org           = info.GetDouble("Org");
                var endRescaling  = (BoundaryRescaling)(int)info.GetEnum("EndRescaling", typeof(BoundaryRescalingV1));
                var end           = info.GetDouble("End");
                var spanRescaling = (BoundaryRescaling)(int)info.GetEnum("SpanRescaling", typeof(BoundaryRescalingV1));
                var span          = info.GetDouble("Span");

                if (4 == (int)orgRescaling)
                {
                    orgRescaling = BoundaryRescaling.Auto;
                }
                if (4 == (int)endRescaling)
                {
                    endRescaling = BoundaryRescaling.Auto;
                }

                s._orgRescaling         = orgRescaling;
                s._endRescaling         = endRescaling;
                s._userProvidedOrgValue = org;
                s._userProvidedEndValue = end;

                s._resultingOrg = org;
                s._resultingEnd = end;

                return(s);
            }
예제 #2
0
		protected override System.Collections.Generic.IEnumerable<Main.DocumentNodeAndName> GetDocumentNodeChildrenWithName()
		{
			if (null != _dataBounds)
				yield return new Main.DocumentNodeAndName(_dataBounds, () => _dataBounds = null, "DataBounds");

			if (null != _rescaling)
				yield return new Main.DocumentNodeAndName(_rescaling, () => _rescaling = null, "Rescaling");

			if (null != _tickSpacing)
				yield return new Main.DocumentNodeAndName(_tickSpacing, () => _tickSpacing = null, "TickSpacing");
		}
예제 #3
0
		/// <summary>
		/// Creates a default linear axis with org=0 and end=1.
		/// </summary>
		public LinearScale()
		{
			_dataBounds = new FiniteNumericalBoundaries() { ParentObject = this };
			_rescaling = new LinearScaleRescaleConditions() { ParentObject = this };
			_tickSpacing = new Ticks.LinearTickSpacing() { ParentObject = this };
			UpdateTicksAndOrgEndUsingRescalingObject();
		}
예제 #4
0
파일: TextScale.cs 프로젝트: Altaxo/Altaxo
		public TextScale()
		{
			_dataBounds = new TextBoundaries();
			_dataBounds.ParentObject = this;

			_rescaling = new LinearScaleRescaleConditions();
		}
예제 #5
0
파일: TextScale.cs 프로젝트: Altaxo/Altaxo
		public void ProcessDataBounds(double xorg, double xend, NumericScaleRescaleConditions rescaling)
		{
			rescaling.OnDataBoundsChanged(xorg, xend);
			ProcessDataBounds(rescaling.ResultingOrg, rescaling.IsResultingOrgFixed, rescaling.ResultingEnd, rescaling.IsResultingEndFixed);
		}
예제 #6
0
파일: TextScale.cs 프로젝트: Altaxo/Altaxo
		protected void InternalSetRescaling(NumericScaleRescaleConditions rescaling)
		{
			this._rescaling = rescaling;
			this._rescaling.ParentObject = this;
		}
예제 #7
0
파일: TextScale.cs 프로젝트: Altaxo/Altaxo
		private void CopyFrom(TextScale from)
		{
			if (object.ReferenceEquals(this, from))
				return;

			_dataBounds = (TextBoundaries)from._dataBounds.Clone();
			_dataBounds.ParentObject = this;

			_rescaling = from._rescaling == null ? null : (NumericScaleRescaleConditions)from._rescaling.Clone();
			_rescaling.ParentObject = this;

			_cachedAxisOrg = from._cachedAxisOrg;
			_cachedAxisEnd = from._cachedAxisEnd;
			_cachedAxisSpan = from._cachedAxisSpan;
			_cachedOneByAxisSpan = from._cachedOneByAxisSpan;
		}
예제 #8
0
 public NumericScaleRescaleConditions(NumericScaleRescaleConditions from)
 {
     CopyFrom(from);
 }
예제 #9
0
파일: TextScale.cs 프로젝트: Altaxo/Altaxo
		public TextScale()
		{
			_dataBounds = new TextBoundaries() { ParentObject = this };
			_rescaling = new LinearScaleRescaleConditions() { ParentObject = this };
			_tickSpacing = new Ticks.TextTickSpacing() { ParentObject = this };
			UpdateTicksAndOrgEndUsingRescalingObject();
		}
예제 #10
0
		/// <summary>
		/// Copy constructor.
		/// </summary>
		/// <param name="from">A other linear axis from which to copy from.</param>
		public LinearScale(LinearScale from)
		{
			this.IsLinked = from.IsLinked;

			this._cachedAxisEnd = from._cachedAxisEnd;
			this._axisEndByMajor = from._axisEndByMajor;
			this._cachedAxisOrg = from._cachedAxisOrg;
			this._axisOrgByMajor = from._axisOrgByMajor;
			this._cachedAxisSpan = from._cachedAxisSpan;
			this._baseEnd = from._baseEnd;
			this._baseOrg = from._baseOrg;
			this._dataBounds = null == from._dataBounds ? new FiniteNumericalBoundaries() : (NumericalBoundaries)from._dataBounds.Clone();
			_dataBounds.ParentObject = this;
			this._majorSpan = from._majorSpan;
			this._minorTicks = from._minorTicks;
			this._cachedOneByAxisSpan = from._cachedOneByAxisSpan;

			this._rescaling = null == from.Rescaling ? new LinearScaleRescaleConditions() : (LinearScaleRescaleConditions)from.Rescaling.Clone();
			this._rescaling.ParentObject = this;
		}
예제 #11
0
		public NumericScaleRescaleConditions(NumericScaleRescaleConditions from)
		{
			CopyFrom(from);
		}