protected override string SetScaleOrgEnd(Altaxo.Data.AltaxoVariant org, Altaxo.Data.AltaxoVariant end)
        {
            double o = org.ToDouble();
            double e = end.ToDouble();

            if (o <= 0)
            {
                o = CumulativeProbabilityScaleRescaleConditions.DefaultOrgValue;
            }
            else if (o >= 1)
            {
                o = CumulativeProbabilityScaleRescaleConditions.DefaultEndValue;
            }

            if (e <= 0)
            {
                e = CumulativeProbabilityScaleRescaleConditions.DefaultOrgValue;
            }
            else if (e >= 1)
            {
                e = CumulativeProbabilityScaleRescaleConditions.DefaultEndValue;
            }

            if (o == e)
            {
                double h = o / 2;
                o = o - h;
                e = e + h;
            }

            InternalSetOrgEnd(o, e);

            return(null);
        }
Beispiel #2
0
        protected override string SetScaleOrgEnd(Altaxo.Data.AltaxoVariant org, Altaxo.Data.AltaxoVariant end)
        {
            double o = org.ToDouble();
            double e = end.ToDouble();

            InternalSetOrgEnd(o, e);

            return(null);
        }
Beispiel #3
0
        protected override string SetScaleOrgEnd(Altaxo.Data.AltaxoVariant org, Altaxo.Data.AltaxoVariant end)
        {
            double o = org.ToDouble();
            double e = end.ToDouble();

            if (!(o < e))
            {
                return("org is not less than end");
            }

            InternalSetOrgEnd(o, e, false, false);

            return(null);
        }
 public override bool Add(Altaxo.Data.AltaxoVariant item)
 {
     return(Add(item.ToDouble()));
 }
Beispiel #5
0
 /// <summary>
 /// PhysicalVariantToNormal translates physical values into a normal value linear along the axis
 /// a physical value of the axis origin must return a value of zero
 /// a physical value of the axis end must return a value of one
 /// the function physicalToNormal must be provided by any derived class
 /// </summary>
 /// <param name="x">the physical value</param>
 /// <returns>
 /// the normalized value linear along the axis,
 /// 0 for axis origin, 1 for axis end</returns>
 public override double PhysicalVariantToNormal(Altaxo.Data.AltaxoVariant x)
 {
     return(PhysicalToNormal(x.ToDouble()));
 }
Beispiel #6
0
        public void Paint(System.Drawing.Graphics g, IPlotArea layer, Processed2DPlotData pdata)
        {
            PlotRangeList rangeList = pdata.RangeList;

            System.Drawing.PointF[] ptArray = pdata.PlotPointsInAbsoluteLayerCoordinates;

            // paint the drop style


            double xleft, xright, ytop, ybottom;

            layer.CoordinateSystem.LogicalToLayerCoordinates(new Logical3D(0, 0), out xleft, out ybottom);
            layer.CoordinateSystem.LogicalToLayerCoordinates(new Logical3D(1, 1), out xright, out ytop);
            float xe = (float)xright;
            float ye = (float)ybottom;

            GraphicsPath path = new GraphicsPath();

            double globalBaseValue;

            if (_usePhysicalBaseValue)
            {
                globalBaseValue = layer.YAxis.PhysicalVariantToNormal(_baseValue);
                if (double.IsNaN(globalBaseValue))
                {
                    globalBaseValue = 0;
                }
            }
            else
            {
                globalBaseValue = _baseValue.ToDouble();
            }


            int j = -1;

            foreach (int originalRowIndex in pdata.RangeList.OriginalRowIndices())
            {
                j++;

                double xcn = layer.XAxis.PhysicalVariantToNormal(pdata.GetXPhysical(originalRowIndex));
                double xln = xcn + _position;
                double xrn = xln + _width;

                double ycn    = layer.YAxis.PhysicalVariantToNormal(pdata.GetYPhysical(originalRowIndex));
                double ynbase = globalBaseValue;

                if (_startAtPreviousItem && pdata.PreviousItemData != null)
                {
                    double prevstart = layer.YAxis.PhysicalVariantToNormal(pdata.PreviousItemData.GetYPhysical(originalRowIndex));
                    if (!double.IsNaN(prevstart))
                    {
                        ynbase  = prevstart;
                        ynbase += Math.Sign(ynbase - globalBaseValue) * _previousItemYGap;
                    }
                }


                path.Reset();
                layer.CoordinateSystem.GetIsoline(path, new Logical3D(xln, ynbase), new Logical3D(xln, ycn));
                layer.CoordinateSystem.GetIsoline(path, new Logical3D(xln, ycn), new Logical3D(xrn, ycn));
                layer.CoordinateSystem.GetIsoline(path, new Logical3D(xrn, ycn), new Logical3D(xrn, ynbase));
                layer.CoordinateSystem.GetIsoline(path, new Logical3D(xrn, ynbase), new Logical3D(xln, ynbase));
                path.CloseFigure();

                _fillBrush.Rectangle = path.GetBounds();
                g.FillPath(_fillBrush, path);

                if (_framePen != null)
                {
                    _framePen.BrushRectangle = path.GetBounds();
                    g.DrawPath(_framePen, path);
                }
            }
        }