/*
THIS INFRAGISTICS ULTIMATE SOFTWARE LICENSE  AGREEMENT ("AGREEMENT") LOCATED HERE:
https://www.infragistics.com/legal/license/igultimate-la
https://www.infragistics.com/legal/license/igultimate-eula
GOVERNS THE LICENSING, INSTALLATION AND USE OF INFRAGISTICS SOFTWARE. BY DOWNLOADING AND/OR INSTALLING AND USING INFRAGISTICS SOFTWARE:  you are indicating that you have read and understand this Agreement, and agree to be legally bound by it on behalf of the yourself and your company.
*/
import { ScatterFrameBase$1 } from "./ScatterFrameBase$1";
import { List$1 } from "igniteui-react-core/ES2015/List$1";
import { Point_$type, typeCast, markType } from "igniteui-react-core/ES2015/type";
import { Frame } from "./Frame";
import { isNaN_, isInfinity } from "igniteui-react-core/ES2015/number";
/**
 * @hidden
 */
export class PolarFrame extends ScatterFrameBase$1 {
    constructor() {
        super(PolarFrame.$);
        this.w = null;
        this.v = false;
        this.x = null;
        this.w = new List$1(Point_$type, 0);
        this.v = true;
    }
    r(a, b, c) {
        let d = typeCast(PolarFrame.$, b);
        let e = typeCast(PolarFrame.$, c);
        if (d == null || e == null) {
            return;
        }
        Frame.a(this.w, a, d.w, e.w);
    }
    q(a, b, c, d) {
        if (this.v) {
            super.q(a, b, c, d);
        }
        else {
            super.q(a, b, c, d);
            if (c != null && d != null && (c.b.x != d.b.x || c.b.y != d.b.y)) {
                let e = 1 - b;
                a.b = { $type: Point_$type, x: c.b.x * e + d.b.x * b, y: c.b.y * e + d.b.y * b };
            }
        }
    }
    u(a) {
        return !isNaN_(a.x) && !isNaN_(a.y) && !isInfinity(a.x) && !isInfinity(a.y);
    }
    t(a, b, c, d) {
        if (this.v) {
            super.t(a, b, c, d);
        }
        else {
            if (c != null && d != null && (c.c.x != d.c.x || c.c.y != d.c.y) && this.u(a.b)) {
                a.c = this.x(a.b);
            }
            else {
                super.t(a, b, c, d);
            }
        }
    }
}
PolarFrame.$t = markType(PolarFrame, 'PolarFrame', ScatterFrameBase$1.$.specialize(-1)).initSelfReferences();
