Exemple #1
0
 /// <summary>
 /// Restricts the values of orgRescaling, endRescaling and spanRescaling to allowed combinations.
 /// </summary>
 /// <param name="orgRes">Org rescaling.</param>
 /// <param name="endRes">End rescaling.</param>
 /// <param name="spanRes">Span Rescaling.</param>
 public static void Normalize(
     ref BoundaryRescaling orgRes,
     ref BoundaryRescaling endRes,
     ref BoundaryRescaling spanRes)
 {
     NumericAxisRescaleConditions.Normalize(ref orgRes, ref endRes, ref spanRes);
 }
        public virtual object Clone()
        {
            NumericAxisRescaleConditions result = new NumericAxisRescaleConditions();

            result.CopyFrom(this);
            return(result);
        }
Exemple #3
0
 public TextScale()
 {
   _dataBounds = new TextBoundaries();
   _dataBounds.BoundaryChanged += EhBoundariesChanged;
   
   _rescaling = new NumericAxisRescaleConditions();
 }
 public NumericAxisRescaleController(NumericAxisRescaleConditions doc, NumericalScale ax)
 {
   _doc = doc;
   _axis = ax;
   
   SetElements(true);
     
   
 }
 public bool IsEqualTo(NumericAxisRescaleConditions b)
 {
     return
         (this._orgRescaling == b._orgRescaling &&
          this._org == b._org &&
          this._endRescaling == b._endRescaling &&
          this._end == b._end &&
          this._spanRescaling == b._spanRescaling &&
          this._span == b._span);
 }
            public void Serialize(object obj, Altaxo.Serialization.Xml.IXmlSerializationInfo info)
            {
                NumericAxisRescaleConditions s = (NumericAxisRescaleConditions)obj;

                info.AddEnum("OrgRescaling", s._orgRescaling);
                info.AddValue("Org", s._org);
                info.AddEnum("EndRescaling", s._endRescaling);
                info.AddValue("End", s._end);
                info.AddEnum("SpanRescaling", s._spanRescaling);
                info.AddValue("Span", s._span);
            }
            public object Deserialize(object o, Altaxo.Serialization.Xml.IXmlDeserializationInfo info, object parent)
            {
                NumericAxisRescaleConditions s = null != o ? (NumericAxisRescaleConditions)o : new NumericAxisRescaleConditions();

                s._orgRescaling  = (BoundaryRescaling)info.GetEnum("OrgRescaling", typeof(BoundaryRescaling));
                s._org           = (double)info.GetDouble("Org");
                s._endRescaling  = (BoundaryRescaling)info.GetEnum("EndRescaling", typeof(BoundaryRescaling));
                s._end           = (double)info.GetDouble("End");
                s._spanRescaling = (BoundaryRescaling)info.GetEnum("SpanRescaling", typeof(BoundaryRescaling));
                s._span          = (double)info.GetDouble("Span");
                return(s);
            }
Exemple #8
0
    void CopyFrom(TextScale from)
    {
      _dataBounds = (TextBoundaries)from._dataBounds.Clone();
      _dataBounds.BoundaryChanged += EhBoundariesChanged;

      _rescaling = from._rescaling == null ? null : (NumericAxisRescaleConditions)from._rescaling.Clone();

      _cachedAxisOrg = from._cachedAxisOrg;
      _cachedAxisEnd = from._cachedAxisEnd;
      _cachedAxisSpan = from._cachedAxisSpan;
      _cachedOneByAxisSpan = from._cachedOneByAxisSpan;
    }
    /// <summary>
    /// Copies the data from another object.
    /// </summary>
    /// <param name="from">The object to copy the data from.</param>
    public void CopyFrom(NumericAxisRescaleConditions from)
    {
      bool bEqual = this.IsEqualTo(from);
      this._orgRescaling = from._orgRescaling;
      this._endRescaling = from._endRescaling;
      this._spanRescaling = from._spanRescaling;
      this._org = from._org;
      this._end = from._end;
      this._span = from._span;

      this._minGrace = from._minGrace;
      this._maxGrace = from._maxGrace;

      if(!bEqual)
        OnChanged();
    }
        /// <summary>
        /// Copies the data from another object.
        /// </summary>
        /// <param name="from">The object to copy the data from.</param>
        public void CopyFrom(NumericAxisRescaleConditions from)
        {
            bool bEqual = this.IsEqualTo(from);

            this._orgRescaling  = from._orgRescaling;
            this._endRescaling  = from._endRescaling;
            this._spanRescaling = from._spanRescaling;
            this._org           = from._org;
            this._end           = from._end;
            this._span          = from._span;

            this._minGrace = from._minGrace;
            this._maxGrace = from._maxGrace;

            if (!bEqual)
            {
                OnChanged();
            }
        }
 public virtual object Clone()
 {
   NumericAxisRescaleConditions result = new NumericAxisRescaleConditions();
   result.CopyFrom(this);
   return result;
 }
 public bool IsEqualTo( NumericAxisRescaleConditions b)
 {
   return
     this._orgRescaling == b._orgRescaling &&
     this._org == b._org &&
     this._endRescaling == b._endRescaling &&
     this._end == b._end &&
     this._spanRescaling == b._spanRescaling &&
     this._span == b._span;
 }
Exemple #13
0
 public void ProcessDataBounds(double xorg, double xend, NumericAxisRescaleConditions rescaling)
 {
   bool isAutoOrg, isAutoEnd;
   rescaling.Process(ref xorg, out isAutoOrg, ref xend, out isAutoEnd);
   ProcessDataBounds(xorg,!isAutoOrg,xend,!isAutoEnd);
 }
    public virtual void CopyFrom(LinearScale from)
    {
      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;
      if(null!=_dataBounds)
        _dataBounds.BoundaryChanged -= new BoundaryChangedHandler(this.OnBoundariesChanged);
      this._dataBounds     = null==from._dataBounds ? new FiniteNumericalBoundaries() : (NumericalBoundaries)from._dataBounds.Clone(); 
      _dataBounds.BoundaryChanged += new BoundaryChangedHandler(this.OnBoundariesChanged);
      this._majorSpan      = from._majorSpan;
      this._minorTicks     = from._minorTicks;
      this._cachedOneByAxisSpan  = from._cachedOneByAxisSpan;

      this._rescaling = null==from.Rescaling ? new NumericAxisRescaleConditions() : (NumericAxisRescaleConditions)from.Rescaling.Clone();
    }