/*
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 { __extends } from "tslib";
import { Base, markType } from "igniteui-angular-core";
import { PointData } from "igniteui-angular-core";
import { PrimitiveAppearanceData } from "igniteui-angular-core";
import { LabelAppearanceData } from "igniteui-angular-core";
import { RectData } from "igniteui-angular-core";
import { Rect } from "igniteui-angular-core";
import { StringBuilder } from "igniteui-angular-core";
/**
 * @hidden
 */
var FunnelSliceVisualData = /** @class */ /*@__PURE__*/ (function (_super) {
    __extends(FunnelSliceVisualData, _super);
    function FunnelSliceVisualData() {
        var _this = _super.call(this) || this;
        _this._isSelected = false;
        _this._index = 0;
        _this._top = 0;
        _this._bottom = 0;
        _this._sliceCenterPoint = null;
        _this._upperRight = null;
        _this._lowerRight = null;
        _this._upperLeft = null;
        _this._lowerLeft = null;
        _this._height = 0;
        _this._upperWidth = 0;
        _this._lowerWidth = 0;
        _this._innerLabel = null;
        _this._outerLabel = null;
        _this._sliceBorderBrush = null;
        _this._sliceBorderThickness = 0;
        _this._appearance = null;
        _this._innerLabelAppearance = null;
        _this._outerLabelAppearance = null;
        _this._slicePoints = null;
        _this._innerLabelPosition = null;
        _this._outerLabelPosition = null;
        _this._outerLabelBounds = null;
        _this._innerLabelBounds = null;
        _this._isVisibile = false;
        _this.appearance = new PrimitiveAppearanceData();
        _this.slicePoints = new Array(0);
        _this.innerLabelAppearance = new LabelAppearanceData();
        _this.outerLabelBounds = RectData.b(Rect.empty);
        _this.innerLabelBounds = RectData.b(Rect.empty);
        return _this;
    }
    Object.defineProperty(FunnelSliceVisualData.prototype, "isSelected", {
        get: function () {
            return this._isSelected;
        },
        set: function (a) {
            this._isSelected = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "index", {
        get: function () {
            return this._index;
        },
        set: function (a) {
            this._index = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "top", {
        get: function () {
            return this._top;
        },
        set: function (a) {
            this._top = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "bottom", {
        get: function () {
            return this._bottom;
        },
        set: function (a) {
            this._bottom = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "sliceCenterPoint", {
        get: function () {
            return this._sliceCenterPoint;
        },
        set: function (a) {
            this._sliceCenterPoint = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "upperRight", {
        get: function () {
            return this._upperRight;
        },
        set: function (a) {
            this._upperRight = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "lowerRight", {
        get: function () {
            return this._lowerRight;
        },
        set: function (a) {
            this._lowerRight = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "upperLeft", {
        get: function () {
            return this._upperLeft;
        },
        set: function (a) {
            this._upperLeft = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "lowerLeft", {
        get: function () {
            return this._lowerLeft;
        },
        set: function (a) {
            this._lowerLeft = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "height", {
        get: function () {
            return this._height;
        },
        set: function (a) {
            this._height = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "upperWidth", {
        get: function () {
            return this._upperWidth;
        },
        set: function (a) {
            this._upperWidth = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "lowerWidth", {
        get: function () {
            return this._lowerWidth;
        },
        set: function (a) {
            this._lowerWidth = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "innerLabel", {
        get: function () {
            return this._innerLabel;
        },
        set: function (a) {
            this._innerLabel = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "outerLabel", {
        get: function () {
            return this._outerLabel;
        },
        set: function (a) {
            this._outerLabel = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "sliceBorderBrush", {
        get: function () {
            return this._sliceBorderBrush;
        },
        set: function (a) {
            this._sliceBorderBrush = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "sliceBorderThickness", {
        get: function () {
            return this._sliceBorderThickness;
        },
        set: function (a) {
            this._sliceBorderThickness = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "appearance", {
        get: function () {
            return this._appearance;
        },
        set: function (a) {
            this._appearance = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "innerLabelAppearance", {
        get: function () {
            return this._innerLabelAppearance;
        },
        set: function (a) {
            this._innerLabelAppearance = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "outerLabelAppearance", {
        get: function () {
            return this._outerLabelAppearance;
        },
        set: function (a) {
            this._outerLabelAppearance = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "slicePoints", {
        get: function () {
            return this._slicePoints;
        },
        set: function (a) {
            this._slicePoints = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "innerLabelPosition", {
        get: function () {
            return this._innerLabelPosition;
        },
        set: function (a) {
            this._innerLabelPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "outerLabelPosition", {
        get: function () {
            return this._outerLabelPosition;
        },
        set: function (a) {
            this._outerLabelPosition = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "outerLabelBounds", {
        get: function () {
            return this._outerLabelBounds;
        },
        set: function (a) {
            this._outerLabelBounds = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "innerLabelBounds", {
        get: function () {
            return this._innerLabelBounds;
        },
        set: function (a) {
            this._innerLabelBounds = a;
        },
        enumerable: false,
        configurable: true
    });
    Object.defineProperty(FunnelSliceVisualData.prototype, "isVisibile", {
        get: function () {
            return this._isVisibile;
        },
        set: function (a) {
            this._isVisibile = a;
        },
        enumerable: false,
        configurable: true
    });
    FunnelSliceVisualData.prototype.scaleByViewport = function (a) {
        if (this.outerLabelBounds != null) {
            var b = (this.outerLabelBounds.left - a.left) / a.width;
            var c = ((this.outerLabelBounds.left + this.outerLabelBounds.width) - a.left) / a.width;
            var d = (this.outerLabelBounds.top - a.top) / a.height;
            var e = ((this.outerLabelBounds.top + this.outerLabelBounds.height) - a.top) / a.height;
            this.outerLabelBounds = new RectData(b, d, c - b, e - d);
        }
        if (this.outerLabelPosition != null) {
            var f = (this.outerLabelPosition.x - a.left) / a.width;
            var g = (this.outerLabelPosition.y - a.top) / a.height;
            this.outerLabelPosition = new PointData(f, g);
        }
        if (this.innerLabelBounds != null) {
            var h = (this.innerLabelBounds.left - a.left) / a.width;
            var i = ((this.innerLabelBounds.left + this.innerLabelBounds.width) - a.left) / a.width;
            var j = (this.innerLabelBounds.top - a.top) / a.height;
            var k = ((this.innerLabelBounds.top + this.innerLabelBounds.height) - a.top) / a.height;
            this.innerLabelBounds = new RectData(h, j, i - h, k - j);
        }
        if (this.innerLabelPosition != null) {
            var l = (this.innerLabelPosition.x - a.left) / a.width;
            var m = (this.innerLabelPosition.y - a.top) / a.height;
            this.innerLabelPosition = new PointData(l, m);
        }
        var n = new Array(this.slicePoints.length);
        var o = 0;
        var r = this.slicePoints;
        for (var q = 0; q < r.length; q++) {
            var p = r[q];
            var s = (p.x - a.left) / a.width;
            var t = (p.y - a.top) / a.height;
            n[o] = new PointData(s, t);
            o++;
        }
        this.slicePoints = n;
    };
    FunnelSliceVisualData.prototype.serialize = function () {
        var a = new StringBuilder(0);
        a.u("{");
        a.u("index: " + this.index + ", ");
        if (this.innerLabel != null) {
            a.u("innerLabel: \"" + this.innerLabel + "\", ");
        }
        if (this.outerLabel != null) {
            a.u("outerLabel: \"" + this.innerLabel + "\", ");
        }
        if (this.appearance != null) {
            a.u("appearance: " + this.appearance.serialize() + ", ");
        }
        if (this.innerLabelAppearance != null) {
            a.u("innerLabelAppearance: " + this.innerLabelAppearance.serialize() + ", ");
        }
        if (this.outerLabelAppearance != null) {
            a.u("outerLabelAppearance: " + this.outerLabelAppearance.serialize() + ", ");
        }
        if (this.slicePoints != null) {
            a.u("slicePoints: [");
            for (var b = 0; b < this.slicePoints.length; b++) {
                a.u("{ x: " + this.slicePoints[b].x + ", y: " + this.slicePoints[b].y + " }");
                if (b < this.slicePoints.length - 1) {
                    a.l(",");
                }
            }
            a.u("], ");
        }
        if (this.innerLabelBounds != null) {
            a.u("innerLabelBounds: { left: " + this.innerLabelBounds.left + ", top: " + this.innerLabelBounds.top + ", width: " + this.innerLabelBounds.width + ", height: " + this.innerLabelBounds.height + "}, ");
        }
        if (this.outerLabelBounds != null) {
            a.u("outerLabelBounds: { left: " + this.outerLabelBounds.left + ", top: " + this.outerLabelBounds.top + ", width: " + this.outerLabelBounds.width + ", height: " + this.outerLabelBounds.height + "}, ");
        }
        if (this.innerLabelPosition != null) {
            a.u("innerLabelPosition: { x: " + this.innerLabelPosition.x + ", y: " + this.innerLabelPosition.y + "}, ");
        }
        if (this.outerLabelPosition != null) {
            a.u("outerLabelPosition: { x: " + this.outerLabelPosition.x + ", y: " + this.outerLabelPosition.y + "}, ");
        }
        a.u("isSelected: " + (this.isSelected ? "true" : "false"));
        a.u("}");
        return a.toString();
    };
    FunnelSliceVisualData.$t = markType(FunnelSliceVisualData, 'FunnelSliceVisualData');
    return FunnelSliceVisualData;
}(Base));
export { FunnelSliceVisualData };
//# sourceMappingURL=FunnelSliceVisualData.js.map
