protected bool TransformPoints(IList <DoubleVector4> points, List <Vector4> output, Rect viewRect, DoubleVector3 min, DoubleVector3 max)
        {
            output.Clear();
            DoubleVector3 range = max - min;

            if (Math.Abs(range.x) <= 0.0001f || Math.Abs(range.y) < 0.0001f)
            {
                return(false);
            }
            double radiusMultiplier = Math.Min(viewRect.width / Math.Abs(range.x), viewRect.height / Math.Abs(range.y));
            bool   HasSize          = false;

            for (int i = 0; i < points.Count; i++)
            {
                DoubleVector4 point = points[i];
                DoubleVector4 res   = ChartCommon.interpolateInRect(viewRect, new DoubleVector3((point.x - min.x) / range.x, (point.y - min.y) / range.y));
                res.z = 0.0;
                res.w = point.w * radiusMultiplier;
                if (point.w > 0f)
                {
                    HasSize = true;
                }
                output.Add(res.ToVector4());
            }
            return(HasSize);
        }
Exemplo n.º 2
0
        protected void TransformPoints(IList <DoubleVector4> points, List <Vector4> output, Rect viewRect, DoubleVector3 min, DoubleVector3 max)
        {
            output.Clear();
            DoubleVector3 range = max - min;

            if (range.x <= 0.0001f || range.y < 0.0001f)
            {
                return;
            }
            double radiusMultiplier = Math.Min(viewRect.width / range.x, viewRect.height / range.y);

            for (int i = 0; i < points.Count; i++)
            {
                DoubleVector4 point = points[i];
                DoubleVector4 res   = interpolateInRect(viewRect, new DoubleVector3((point.x - min.x) / range.x, (point.y - min.y) / range.y));
                res.z = 0.0;
                res.w = point.w * radiusMultiplier;
                output.Add(res.ToVector4());
            }
        }