Forráskód Böngészése

removed .js from canvas2D

David Catuhe 8 éve
szülő
commit
85a8078b56

+ 1 - 1
Tools/Gulp/config.json

@@ -463,7 +463,7 @@
     "libraries": [  
     {
       "files": [
-        "../../canvas2D/src/Tools/babylon.iPropertyChanged.ts",
+        "../../canvas2D/src/Tools/babylon.IPropertyChanged.ts",
         "../../canvas2D/src/Tools/babylon.observableArray.ts",
         "../../canvas2D/src/Tools/babylon.observableStringDictionary.ts",
         "../../canvas2D/src/Engine/babylon.bounding2d.ts",

+ 0 - 211
canvas2D/src/Engine/babylon.bounding2d.js

@@ -1,211 +0,0 @@
-var BABYLON;
-(function (BABYLON) {
-    /**
-     * Stores 2D Bounding Information.
-     * This class handles a circle area and a bounding rectangle one.
-     */
-    var BoundingInfo2D = (function () {
-        function BoundingInfo2D() {
-            this.radius = 0;
-            this.center = BABYLON.Vector2.Zero();
-            this.extent = BABYLON.Vector2.Zero();
-        }
-        /**
-         * Create a BoundingInfo2D object from a given size
-         * @param size the size that will be used to set the extend, radius will be computed from it.
-         */
-        BoundingInfo2D.CreateFromSize = function (size) {
-            var r = new BoundingInfo2D();
-            BoundingInfo2D.CreateFromSizeToRef(size, r);
-            return r;
-        };
-        /**
-         * Create a BoundingInfo2D object from a given radius
-         * @param radius the radius to use, the extent will be computed from it.
-         */
-        BoundingInfo2D.CreateFromRadius = function (radius) {
-            var r = new BoundingInfo2D();
-            BoundingInfo2D.CreateFromRadiusToRef(radius, r);
-            return r;
-        };
-        /**
-         * Create a BoundingInfo2D object from a list of points.
-         * The resulted object will be the smallest bounding area that includes all the given points.
-         * @param points an array of points to compute the bounding object from.
-         */
-        BoundingInfo2D.CreateFromPoints = function (points) {
-            var r = new BoundingInfo2D();
-            BoundingInfo2D.CreateFromPointsToRef(points, r);
-            return r;
-        };
-        /**
-         * Update a BoundingInfo2D object using the given Size as input
-         * @param size the bounding data will be computed from this size.
-         * @param b must be a valid/allocated object, it will contain the result of the operation
-         */
-        BoundingInfo2D.CreateFromSizeToRef = function (size, b) {
-            if (!size) {
-                size = BABYLON.Size.Zero();
-            }
-            b.center.x = +size.width / 2;
-            b.center.y = +size.height / 2;
-            b.extent.x = b.center.x;
-            b.extent.y = b.center.y;
-            b.radius = b.extent.length();
-        };
-        /**
-         * Update a BoundingInfo2D object using the given radius as input
-         * @param radius the bounding data will be computed from this radius
-         * @param b must be a valid/allocated object, it will contain the result of the operation
-         */
-        BoundingInfo2D.CreateFromRadiusToRef = function (radius, b) {
-            b.center.x = b.center.y = 0;
-            var r = +radius;
-            b.extent.x = r;
-            b.extent.y = r;
-            b.radius = r;
-        };
-        /**
-         * Update a BoundingInfo2D object using the given points array as input
-         * @param points the point array to use to update the bounding data
-         * @param b must be a valid/allocated object, it will contain the result of the operation
-         */
-        BoundingInfo2D.CreateFromPointsToRef = function (points, b) {
-            var xmin = Number.MAX_VALUE, ymin = Number.MAX_VALUE, xmax = Number.MIN_VALUE, ymax = Number.MIN_VALUE;
-            for (var _i = 0, points_1 = points; _i < points_1.length; _i++) {
-                var p = points_1[_i];
-                xmin = Math.min(p.x, xmin);
-                xmax = Math.max(p.x, xmax);
-                ymin = Math.min(p.y, ymin);
-                ymax = Math.max(p.y, ymax);
-            }
-            BoundingInfo2D.CreateFromMinMaxToRef(xmin, xmax, ymin, ymax, b);
-        };
-        /**
-         * Update a BoundingInfo2D object using the given min/max values as input
-         * @param xmin the smallest x coordinate
-         * @param xmax the biggest x coordinate
-         * @param ymin the smallest y coordinate
-         * @param ymax the buggest y coordinate
-         * @param b must be a valid/allocated object, it will contain the result of the operation
-         */
-        BoundingInfo2D.CreateFromMinMaxToRef = function (xmin, xmax, ymin, ymax, b) {
-            var w = xmax - xmin;
-            var h = ymax - ymin;
-            b.center = new BABYLON.Vector2(xmin + w / 2, ymin + h / 2);
-            b.extent = new BABYLON.Vector2(xmax - b.center.x, ymax - b.center.y);
-            b.radius = b.extent.length();
-        };
-        /**
-         * Duplicate this instance and return a new one
-         * @return the duplicated instance
-         */
-        BoundingInfo2D.prototype.clone = function () {
-            var r = new BoundingInfo2D();
-            r.center = this.center.clone();
-            r.radius = this.radius;
-            r.extent = this.extent.clone();
-            return r;
-        };
-        BoundingInfo2D.prototype.clear = function () {
-            this.center.copyFromFloats(0, 0);
-            this.radius = 0;
-            this.extent.copyFromFloats(0, 0);
-        };
-        BoundingInfo2D.prototype.copyFrom = function (src) {
-            this.center.copyFrom(src.center);
-            this.radius = src.radius;
-            this.extent.copyFrom(src.extent);
-        };
-        /**
-         * return the max extend of the bounding info
-         */
-        BoundingInfo2D.prototype.max = function () {
-            var r = BABYLON.Vector2.Zero();
-            this.maxToRef(r);
-            return r;
-        };
-        /**
-         * Update a vector2 with the max extend of the bounding info
-         * @param result must be a valid/allocated vector2 that will contain the result of the operation
-         */
-        BoundingInfo2D.prototype.maxToRef = function (result) {
-            result.x = this.center.x + this.extent.x;
-            result.y = this.center.y + this.extent.y;
-        };
-        /**
-         * Apply a transformation matrix to this BoundingInfo2D and return a new instance containing the result
-         * @param matrix the transformation matrix to apply
-         * @return the new instance containing the result of the transformation applied on this BoundingInfo2D
-         */
-        BoundingInfo2D.prototype.transform = function (matrix) {
-            var r = new BoundingInfo2D();
-            this.transformToRef(matrix, r);
-            return r;
-        };
-        /**
-         * Compute the union of this BoundingInfo2D with a given one, returns a new BoundingInfo2D as a result
-         * @param other the second BoundingInfo2D to compute the union with this one
-         * @return a new instance containing the result of the union
-         */
-        BoundingInfo2D.prototype.union = function (other) {
-            var r = new BoundingInfo2D();
-            this.unionToRef(other, r);
-            return r;
-        };
-        /**
-         * Transform this BoundingInfo2D with a given matrix and store the result in an existing BoundingInfo2D instance.
-         * This is a GC friendly version, try to use it as much as possible, specially if your transformation is inside a loop, allocate the result object once for good outside of the loop and use it every time.
-         * @param matrix The matrix to use to compute the transformation
-         * @param result A VALID (i.e. allocated) BoundingInfo2D object where the result will be stored
-         */
-        BoundingInfo2D.prototype.transformToRef = function (matrix, result) {
-            // Construct a bounding box based on the extent values
-            var p = BoundingInfo2D._transform;
-            p[0].x = this.center.x + this.extent.x;
-            p[0].y = this.center.y + this.extent.y;
-            p[1].x = this.center.x + this.extent.x;
-            p[1].y = this.center.y - this.extent.y;
-            p[2].x = this.center.x - this.extent.x;
-            p[2].y = this.center.y - this.extent.y;
-            p[3].x = this.center.x - this.extent.x;
-            p[3].y = this.center.y + this.extent.y;
-            // Transform the four points of the bounding box with the matrix
-            for (var i = 0; i < 4; i++) {
-                BABYLON.Vector2.TransformToRef(p[i], matrix, p[i]);
-            }
-            BoundingInfo2D.CreateFromPointsToRef(p, result);
-        };
-        /**
-         * Compute the union of this BoundingInfo2D with another one and store the result in a third valid BoundingInfo2D object
-         * This is a GC friendly version, try to use it as much as possible, specially if your transformation is inside a loop, allocate the result object once for good outside of the loop and use it every time.
-         * @param other the second object used to compute the union
-         * @param result a VALID BoundingInfo2D instance (i.e. allocated) where the result will be stored
-         */
-        BoundingInfo2D.prototype.unionToRef = function (other, result) {
-            var xmax = Math.max(this.center.x + this.extent.x, other.center.x + other.extent.x);
-            var ymax = Math.max(this.center.y + this.extent.y, other.center.y + other.extent.y);
-            var xmin = Math.min(this.center.x - this.extent.x, other.center.x - other.extent.x);
-            var ymin = Math.min(this.center.y - this.extent.y, other.center.y - other.extent.y);
-            BoundingInfo2D.CreateFromMinMaxToRef(xmin, xmax, ymin, ymax, result);
-        };
-        /**
-         * Check if the given point is inside the BoundingInfo.
-         * The test is first made on the radius, then inside the rectangle described by the extent
-         * @param pickPosition the position to test
-         * @return true if the point is inside, false otherwise
-         */
-        BoundingInfo2D.prototype.doesIntersect = function (pickPosition) {
-            // is it inside the radius?
-            var pickLocal = pickPosition.subtract(this.center);
-            if (pickLocal.lengthSquared() <= (this.radius * this.radius)) {
-                // is it inside the rectangle?
-                return ((Math.abs(pickLocal.x) <= this.extent.x) && (Math.abs(pickLocal.y) <= this.extent.y));
-            }
-            return false;
-        };
-        BoundingInfo2D._transform = new Array(BABYLON.Vector2.Zero(), BABYLON.Vector2.Zero(), BABYLON.Vector2.Zero(), BABYLON.Vector2.Zero());
-        return BoundingInfo2D;
-    }());
-    BABYLON.BoundingInfo2D = BoundingInfo2D;
-})(BABYLON || (BABYLON = {}));

+ 0 - 212
canvas2D/src/Engine/babylon.brushes2d.js

@@ -1,212 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    /**
-     * Base class implementing the ILocable interface.
-     * The particularity of this class is to call the protected onLock() method when the instance is about to be locked for good.
-     */
-    var LockableBase = (function () {
-        function LockableBase() {
-        }
-        LockableBase.prototype.isLocked = function () {
-            return this._isLocked;
-        };
-        LockableBase.prototype.lock = function () {
-            if (this._isLocked) {
-                return true;
-            }
-            this.onLock();
-            this._isLocked = true;
-            return false;
-        };
-        /**
-         * Protected handler that will be called when the instance is about to be locked.
-         */
-        LockableBase.prototype.onLock = function () {
-        };
-        return LockableBase;
-    }());
-    BABYLON.LockableBase = LockableBase;
-    var SolidColorBrush2D = (function (_super) {
-        __extends(SolidColorBrush2D, _super);
-        function SolidColorBrush2D(color, lock) {
-            if (lock === void 0) { lock = false; }
-            _super.call(this);
-            this._color = color;
-            if (lock) {
-                {
-                    this.lock();
-                }
-            }
-        }
-        /**
-         * Return true if the brush is transparent, false if it's totally opaque
-         */
-        SolidColorBrush2D.prototype.isTransparent = function () {
-            return this._color && this._color.a < 1.0;
-        };
-        Object.defineProperty(SolidColorBrush2D.prototype, "color", {
-            /**
-             * The color used by this instance to render
-             * @returns the color object. Note that it's not a clone of the actual object stored in the instance so you MUST NOT modify it, otherwise unexpected behavior might occurs.
-             */
-            get: function () {
-                return this._color;
-            },
-            set: function (value) {
-                if (this.isLocked()) {
-                    return;
-                }
-                this._color = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * Return a unique identifier of the instance, which is simply the hexadecimal representation (CSS Style) of the solid color.
-         */
-        SolidColorBrush2D.prototype.toString = function () {
-            return this._color.toHexString();
-        };
-        SolidColorBrush2D = __decorate([
-            BABYLON.className("SolidColorBrush2D", "BABYLON")
-        ], SolidColorBrush2D);
-        return SolidColorBrush2D;
-    }(LockableBase));
-    BABYLON.SolidColorBrush2D = SolidColorBrush2D;
-    var GradientColorBrush2D = (function (_super) {
-        __extends(GradientColorBrush2D, _super);
-        function GradientColorBrush2D(color1, color2, translation, rotation, scale, lock) {
-            if (translation === void 0) { translation = BABYLON.Vector2.Zero(); }
-            if (rotation === void 0) { rotation = 0; }
-            if (scale === void 0) { scale = 1; }
-            if (lock === void 0) { lock = false; }
-            _super.call(this);
-            this._color1 = color1;
-            this._color2 = color2;
-            this._translation = translation;
-            this._rotation = rotation;
-            this._scale = scale;
-            if (lock) {
-                this.lock();
-            }
-        }
-        /**
-         * Return true if the brush is transparent, false if it's totally opaque
-         */
-        GradientColorBrush2D.prototype.isTransparent = function () {
-            return (this._color1 && this._color1.a < 1.0) || (this._color2 && this._color2.a < 1.0);
-        };
-        Object.defineProperty(GradientColorBrush2D.prototype, "color1", {
-            /**
-             * First color, the blend will start from this color
-             */
-            get: function () {
-                return this._color1;
-            },
-            set: function (value) {
-                if (this.isLocked()) {
-                    return;
-                }
-                this._color1 = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GradientColorBrush2D.prototype, "color2", {
-            /**
-             * Second color, the blend will end to this color
-             */
-            get: function () {
-                return this._color2;
-            },
-            set: function (value) {
-                if (this.isLocked()) {
-                    return;
-                }
-                this._color2 = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GradientColorBrush2D.prototype, "translation", {
-            /**
-             * Translation vector to apply on the blend
-             * Default is [0;0]
-             */
-            get: function () {
-                return this._translation;
-            },
-            set: function (value) {
-                if (this.isLocked()) {
-                    return;
-                }
-                this._translation = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GradientColorBrush2D.prototype, "rotation", {
-            /**
-             * Rotation in radian to apply to the brush
-             * Default direction of the brush is vertical, you can change this using this property.
-             * Default is 0.
-             */
-            get: function () {
-                return this._rotation;
-            },
-            set: function (value) {
-                if (this.isLocked()) {
-                    return;
-                }
-                this._rotation = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GradientColorBrush2D.prototype, "scale", {
-            /**
-             * Scale factor to apply to the gradient.
-             * Default is 1: no scale.
-             */
-            get: function () {
-                return this._scale;
-            },
-            set: function (value) {
-                if (this.isLocked()) {
-                    return;
-                }
-                this._scale = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * Return a string describing the brush
-         */
-        GradientColorBrush2D.prototype.toString = function () {
-            return "C1:" + this._color1 + ";C2:" + this._color2 + ";T:" + this._translation.toString() + ";R:" + this._rotation + ";S:" + this._scale + ";";
-        };
-        /**
-         * Build a unique key string for the given parameters
-         */
-        GradientColorBrush2D.BuildKey = function (color1, color2, translation, rotation, scale) {
-            return "C1:" + color1 + ";C2:" + color2 + ";T:" + translation.toString() + ";R:" + rotation + ";S:" + scale + ";";
-        };
-        GradientColorBrush2D = __decorate([
-            BABYLON.className("GradientColorBrush2D", "BABYLON")
-        ], GradientColorBrush2D);
-        return GradientColorBrush2D;
-    }(LockableBase));
-    BABYLON.GradientColorBrush2D = GradientColorBrush2D;
-})(BABYLON || (BABYLON = {}));

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 1600
canvas2D/src/Engine/babylon.canvas2d.js


+ 0 - 184
canvas2D/src/Engine/babylon.canvas2dLayoutEngine.js

@@ -1,184 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var LayoutEngineBase = (function () {
-        function LayoutEngineBase() {
-            this.layoutDirtyOnPropertyChangedMask = 0;
-        }
-        LayoutEngineBase.prototype.updateLayout = function (prim) {
-        };
-        Object.defineProperty(LayoutEngineBase.prototype, "isChildPositionAllowed", {
-            get: function () {
-                return false;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        LayoutEngineBase.prototype.isLocked = function () {
-            return this._isLocked;
-        };
-        LayoutEngineBase.prototype.lock = function () {
-            if (this._isLocked) {
-                return false;
-            }
-            this._isLocked = true;
-            return true;
-        };
-        LayoutEngineBase = __decorate([
-            BABYLON.className("LayoutEngineBase", "BABYLON")
-        ], LayoutEngineBase);
-        return LayoutEngineBase;
-    }());
-    BABYLON.LayoutEngineBase = LayoutEngineBase;
-    var CanvasLayoutEngine = (function (_super) {
-        __extends(CanvasLayoutEngine, _super);
-        function CanvasLayoutEngine() {
-            _super.apply(this, arguments);
-        }
-        // A very simple (no) layout computing...
-        // The Canvas and its direct children gets the Canvas' size as Layout Area
-        // Indirect children have their Layout Area to the actualSize (margin area) of their parent
-        CanvasLayoutEngine.prototype.updateLayout = function (prim) {
-            // If this prim is layoutDiry we update  its layoutArea and also the one of its direct children
-            if (prim._isFlagSet(BABYLON.SmartPropertyPrim.flagLayoutDirty)) {
-                for (var _i = 0, _a = prim.children; _i < _a.length; _i++) {
-                    var child = _a[_i];
-                    this._doUpdate(child);
-                }
-                prim._clearFlags(BABYLON.SmartPropertyPrim.flagLayoutDirty);
-            }
-        };
-        CanvasLayoutEngine.prototype._doUpdate = function (prim) {
-            // Canvas ?
-            if (prim instanceof BABYLON.Canvas2D) {
-                prim.layoutArea = prim.actualSize;
-            }
-            else if (prim.parent instanceof BABYLON.Canvas2D) {
-                prim.layoutArea = prim.owner.actualSize;
-            }
-            else {
-                prim.layoutArea = prim.parent.contentArea;
-            }
-        };
-        Object.defineProperty(CanvasLayoutEngine.prototype, "isChildPositionAllowed", {
-            get: function () {
-                return true;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        CanvasLayoutEngine.Singleton = new CanvasLayoutEngine();
-        CanvasLayoutEngine = __decorate([
-            BABYLON.className("CanvasLayoutEngine", "BABYLON")
-        ], CanvasLayoutEngine);
-        return CanvasLayoutEngine;
-    }(LayoutEngineBase));
-    BABYLON.CanvasLayoutEngine = CanvasLayoutEngine;
-    var StackPanelLayoutEngine = (function (_super) {
-        __extends(StackPanelLayoutEngine, _super);
-        function StackPanelLayoutEngine() {
-            _super.call(this);
-            this._isHorizontal = true;
-            this.layoutDirtyOnPropertyChangedMask = BABYLON.Prim2DBase.sizeProperty.flagId;
-        }
-        Object.defineProperty(StackPanelLayoutEngine, "Horizontal", {
-            get: function () {
-                if (!StackPanelLayoutEngine._horizontal) {
-                    StackPanelLayoutEngine._horizontal = new StackPanelLayoutEngine();
-                    StackPanelLayoutEngine._horizontal.isHorizontal = true;
-                    StackPanelLayoutEngine._horizontal.lock();
-                }
-                return StackPanelLayoutEngine._horizontal;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(StackPanelLayoutEngine, "Vertical", {
-            get: function () {
-                if (!StackPanelLayoutEngine._vertical) {
-                    StackPanelLayoutEngine._vertical = new StackPanelLayoutEngine();
-                    StackPanelLayoutEngine._vertical.isHorizontal = false;
-                    StackPanelLayoutEngine._vertical.lock();
-                }
-                return StackPanelLayoutEngine._vertical;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(StackPanelLayoutEngine.prototype, "isHorizontal", {
-            get: function () {
-                return this._isHorizontal;
-            },
-            set: function (val) {
-                if (this.isLocked()) {
-                    return;
-                }
-                this._isHorizontal = val;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        StackPanelLayoutEngine.prototype.updateLayout = function (prim) {
-            if (prim._isFlagSet(BABYLON.SmartPropertyPrim.flagLayoutDirty)) {
-                var x = 0;
-                var y = 0;
-                var h = this.isHorizontal;
-                var max = 0;
-                for (var _i = 0, _a = prim.children; _i < _a.length; _i++) {
-                    var child = _a[_i];
-                    var layoutArea = void 0;
-                    if (child._hasMargin) {
-                        child.margin.computeWithAlignment(prim.layoutArea, child.actualSize, child.marginAlignment, StackPanelLayoutEngine.dstOffset, StackPanelLayoutEngine.dstArea, true);
-                        layoutArea = StackPanelLayoutEngine.dstArea.clone();
-                        child.layoutArea = layoutArea;
-                    }
-                    else {
-                        layoutArea = child.layoutArea;
-                        child.margin.computeArea(child.actualSize, layoutArea);
-                    }
-                    max = Math.max(max, h ? layoutArea.height : layoutArea.width);
-                }
-                for (var _b = 0, _c = prim.children; _b < _c.length; _b++) {
-                    var child = _c[_b];
-                    child.layoutAreaPos = new BABYLON.Vector2(x, y);
-                    var layoutArea = child.layoutArea;
-                    if (h) {
-                        x += layoutArea.width;
-                        child.layoutArea = new BABYLON.Size(layoutArea.width, max);
-                    }
-                    else {
-                        y += layoutArea.height;
-                        child.layoutArea = new BABYLON.Size(max, layoutArea.height);
-                    }
-                }
-                prim._clearFlags(BABYLON.SmartPropertyPrim.flagLayoutDirty);
-            }
-        };
-        Object.defineProperty(StackPanelLayoutEngine.prototype, "isChildPositionAllowed", {
-            get: function () {
-                return false;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        StackPanelLayoutEngine._horizontal = null;
-        StackPanelLayoutEngine._vertical = null;
-        StackPanelLayoutEngine.dstOffset = BABYLON.Vector2.Zero();
-        StackPanelLayoutEngine.dstArea = BABYLON.Size.Zero();
-        StackPanelLayoutEngine = __decorate([
-            BABYLON.className("StackPanelLayoutEngine", "BABYLON")
-        ], StackPanelLayoutEngine);
-        return StackPanelLayoutEngine;
-    }(LayoutEngineBase));
-    BABYLON.StackPanelLayoutEngine = StackPanelLayoutEngine;
-})(BABYLON || (BABYLON = {}));

+ 0 - 355
canvas2D/src/Engine/babylon.ellipse2d.js

@@ -1,355 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var Ellipse2DRenderCache = (function (_super) {
-        __extends(Ellipse2DRenderCache, _super);
-        function Ellipse2DRenderCache(engine, modelKey) {
-            _super.call(this, engine, modelKey);
-            this.effectsReady = false;
-            this.fillVB = null;
-            this.fillIB = null;
-            this.fillIndicesCount = 0;
-            this.instancingFillAttributes = null;
-            this.effectFillInstanced = null;
-            this.effectFill = null;
-            this.borderVB = null;
-            this.borderIB = null;
-            this.borderIndicesCount = 0;
-            this.instancingBorderAttributes = null;
-            this.effectBorderInstanced = null;
-            this.effectBorder = null;
-        }
-        Ellipse2DRenderCache.prototype.render = function (instanceInfo, context) {
-            // Do nothing if the shader is still loading/preparing 
-            if (!this.effectsReady) {
-                if ((this.effectFill && (!this.effectFill.isReady() || (this.effectFillInstanced && !this.effectFillInstanced.isReady()))) ||
-                    (this.effectBorder && (!this.effectBorder.isReady() || (this.effectBorderInstanced && !this.effectBorderInstanced.isReady())))) {
-                    return false;
-                }
-                this.effectsReady = true;
-            }
-            var canvas = instanceInfo.owner.owner;
-            var engine = canvas.engine;
-            var depthFunction = 0;
-            if (this.effectFill && this.effectBorder) {
-                depthFunction = engine.getDepthFunction();
-                engine.setDepthFunctionToLessOrEqual();
-            }
-            var curAlphaMode = engine.getAlphaMode();
-            if (this.effectFill) {
-                var partIndex = instanceInfo.partIndexFromId.get(BABYLON.Shape2D.SHAPE2D_FILLPARTID.toString());
-                var pid = context.groupInfoPartData[partIndex];
-                if (context.renderMode !== BABYLON.Render2DContext.RenderModeOpaque) {
-                    engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE, true);
-                }
-                var effect = context.useInstancing ? this.effectFillInstanced : this.effectFill;
-                engine.enableEffect(effect);
-                engine.bindBuffersDirectly(this.fillVB, this.fillIB, [1], 4, effect);
-                if (context.useInstancing) {
-                    if (!this.instancingFillAttributes) {
-                        this.instancingFillAttributes = this.loadInstancingAttributes(BABYLON.Shape2D.SHAPE2D_FILLPARTID, effect);
-                    }
-                    var glBuffer = context.instancedBuffers ? context.instancedBuffers[partIndex] : pid._partBuffer;
-                    var count = context.instancedBuffers ? context.instancesCount : pid._partData.usedElementCount;
-                    canvas._addDrawCallCount(1, context.renderMode);
-                    engine.updateAndBindInstancesBuffer(glBuffer, null, this.instancingFillAttributes);
-                    engine.draw(true, 0, this.fillIndicesCount, count);
-                    engine.unbindInstanceAttributes();
-                }
-                else {
-                    canvas._addDrawCallCount(context.partDataEndIndex - context.partDataStartIndex, context.renderMode);
-                    for (var i = context.partDataStartIndex; i < context.partDataEndIndex; i++) {
-                        this.setupUniforms(effect, partIndex, pid._partData, i);
-                        engine.draw(true, 0, this.fillIndicesCount);
-                    }
-                }
-            }
-            if (this.effectBorder) {
-                var partIndex = instanceInfo.partIndexFromId.get(BABYLON.Shape2D.SHAPE2D_BORDERPARTID.toString());
-                var pid = context.groupInfoPartData[partIndex];
-                if (context.renderMode !== BABYLON.Render2DContext.RenderModeOpaque) {
-                    engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE, true);
-                }
-                var effect = context.useInstancing ? this.effectBorderInstanced : this.effectBorder;
-                engine.enableEffect(effect);
-                engine.bindBuffersDirectly(this.borderVB, this.borderIB, [1], 4, effect);
-                if (context.useInstancing) {
-                    if (!this.instancingBorderAttributes) {
-                        this.instancingBorderAttributes = this.loadInstancingAttributes(BABYLON.Shape2D.SHAPE2D_BORDERPARTID, effect);
-                    }
-                    var glBuffer = context.instancedBuffers ? context.instancedBuffers[partIndex] : pid._partBuffer;
-                    var count = context.instancedBuffers ? context.instancesCount : pid._partData.usedElementCount;
-                    canvas._addDrawCallCount(1, context.renderMode);
-                    engine.updateAndBindInstancesBuffer(glBuffer, null, this.instancingBorderAttributes);
-                    engine.draw(true, 0, this.borderIndicesCount, count);
-                    engine.unbindInstanceAttributes();
-                }
-                else {
-                    canvas._addDrawCallCount(context.partDataEndIndex - context.partDataStartIndex, context.renderMode);
-                    for (var i = context.partDataStartIndex; i < context.partDataEndIndex; i++) {
-                        this.setupUniforms(effect, partIndex, pid._partData, i);
-                        engine.draw(true, 0, this.borderIndicesCount);
-                    }
-                }
-            }
-            engine.setAlphaMode(curAlphaMode, true);
-            if (this.effectFill && this.effectBorder) {
-                engine.setDepthFunction(depthFunction);
-            }
-            return true;
-        };
-        Ellipse2DRenderCache.prototype.dispose = function () {
-            if (!_super.prototype.dispose.call(this)) {
-                return false;
-            }
-            if (this.fillVB) {
-                this._engine._releaseBuffer(this.fillVB);
-                this.fillVB = null;
-            }
-            if (this.fillIB) {
-                this._engine._releaseBuffer(this.fillIB);
-                this.fillIB = null;
-            }
-            this.effectFill = null;
-            this.effectFillInstanced = null;
-            this.effectBorder = null;
-            this.effectBorderInstanced = null;
-            if (this.borderVB) {
-                this._engine._releaseBuffer(this.borderVB);
-                this.borderVB = null;
-            }
-            if (this.borderIB) {
-                this._engine._releaseBuffer(this.borderIB);
-                this.borderIB = null;
-            }
-            return true;
-        };
-        return Ellipse2DRenderCache;
-    }(BABYLON.ModelRenderCache));
-    BABYLON.Ellipse2DRenderCache = Ellipse2DRenderCache;
-    var Ellipse2DInstanceData = (function (_super) {
-        __extends(Ellipse2DInstanceData, _super);
-        function Ellipse2DInstanceData(partId) {
-            _super.call(this, partId, 1);
-        }
-        Object.defineProperty(Ellipse2DInstanceData.prototype, "properties", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        __decorate([
-            BABYLON.instanceData()
-        ], Ellipse2DInstanceData.prototype, "properties", null);
-        return Ellipse2DInstanceData;
-    }(BABYLON.Shape2DInstanceData));
-    BABYLON.Ellipse2DInstanceData = Ellipse2DInstanceData;
-    var Ellipse2D = (function (_super) {
-        __extends(Ellipse2D, _super);
-        /**
-         * Create an Ellipse 2D Shape primitive
-         * @param settings a combination of settings, possible ones are
-         * - parent: the parent primitive/canvas, must be specified if the primitive is not constructed as a child of another one (i.e. as part of the children array setting)
-         * - children: an array of direct children
-         * - id: a text identifier, for information purpose
-         * - position: the X & Y positions relative to its parent. Alternatively the x and y properties can be set. Default is [0;0]
-         * - rotation: the initial rotation (in radian) of the primitive. default is 0
-         * - scale: the initial scale of the primitive. default is 1. You can alternatively use scaleX &| scaleY to apply non uniform scale
-         * - dontInheritParentScale: if set the parent's scale won't be taken into consideration to compute the actualScale property
-         * - opacity: set the overall opacity of the primitive, 1 to be opaque (default), less than 1 to be transparent.
-         * - zOrder: override the zOrder with the specified value
-         * - origin: define the normalized origin point location, default [0.5;0.5]
-         * - size: the size of the group. Alternatively the width and height properties can be set. Default will be [10;10].
-         * - subdivision: the number of subdivision to create the ellipse perimeter, default is 64.
-         * - fill: the brush used to draw the fill content of the ellipse, you can set null to draw nothing (but you will have to set a border brush), default is a SolidColorBrush of plain white. can also be a string value (see Canvas2D.GetBrushFromString)
-         * - border: the brush used to draw the border of the ellipse, you can set null to draw nothing (but you will have to set a fill brush), default is null. can be a string value (see Canvas2D.GetBrushFromString)
-         * - borderThickness: the thickness of the drawn border, default is 1.
-         * - isVisible: true if the group must be visible, false for hidden. Default is true.
-         * - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
-         * - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
-         * - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
-         * - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginBottom: bottom margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - margin: top, left, right and bottom margin formatted as a single string (see PrimitiveThickness.fromString)
-         * - marginHAlignment: one value of the PrimitiveAlignment type's static properties
-         * - marginVAlignment: one value of the PrimitiveAlignment type's static properties
-         * - marginAlignment: a string defining the alignment, see PrimitiveAlignment.fromString
-         * - paddingTop: top padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingLeft: left padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingRight: right padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingBottom: bottom padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - padding: top, left, right and bottom padding formatted as a single string (see PrimitiveThickness.fromString)
-         */
-        function Ellipse2D(settings) {
-            // Avoid checking every time if the object exists
-            if (settings == null) {
-                settings = {};
-            }
-            _super.call(this, settings);
-            if (settings.size != null) {
-                this.size = settings.size;
-            }
-            else if (settings.width || settings.height) {
-                var size = new BABYLON.Size(settings.width, settings.height);
-                this.size = size;
-            }
-            var sub = (settings.subdivisions == null) ? 64 : settings.subdivisions;
-            this.subdivisions = sub;
-        }
-        Object.defineProperty(Ellipse2D.prototype, "actualSize", {
-            get: function () {
-                if (this._actualSize) {
-                    return this._actualSize;
-                }
-                return this.size;
-            },
-            set: function (value) {
-                this._actualSize = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Ellipse2D.prototype, "subdivisions", {
-            get: function () {
-                return this._subdivisions;
-            },
-            set: function (value) {
-                this._subdivisions = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Ellipse2D.prototype.levelIntersect = function (intersectInfo) {
-            var w = this.size.width / 2;
-            var h = this.size.height / 2;
-            var x = intersectInfo._localPickPosition.x - w;
-            var y = intersectInfo._localPickPosition.y - h;
-            return ((x * x) / (w * w) + (y * y) / (h * h)) <= 1;
-        };
-        Ellipse2D.prototype.updateLevelBoundingInfo = function () {
-            BABYLON.BoundingInfo2D.CreateFromSizeToRef(this.actualSize, this._levelBoundingInfo);
-        };
-        Ellipse2D.prototype.createModelRenderCache = function (modelKey) {
-            var renderCache = new Ellipse2DRenderCache(this.owner.engine, modelKey);
-            return renderCache;
-        };
-        Ellipse2D.prototype.setupModelRenderCache = function (modelRenderCache) {
-            var renderCache = modelRenderCache;
-            var engine = this.owner.engine;
-            // Need to create WebGL resources for fill part?
-            if (this.fill) {
-                var vbSize = this.subdivisions + 1;
-                var vb = new Float32Array(vbSize);
-                for (var i = 0; i < vbSize; i++) {
-                    vb[i] = i;
-                }
-                renderCache.fillVB = engine.createVertexBuffer(vb);
-                var triCount = vbSize - 1;
-                var ib = new Float32Array(triCount * 3);
-                for (var i = 0; i < triCount; i++) {
-                    ib[i * 3 + 0] = 0;
-                    ib[i * 3 + 2] = i + 1;
-                    ib[i * 3 + 1] = i + 2;
-                }
-                ib[triCount * 3 - 2] = 1;
-                renderCache.fillIB = engine.createIndexBuffer(ib);
-                renderCache.fillIndicesCount = triCount * 3;
-                // Get the instanced version of the effect, if the engine does not support it, null is return and we'll only draw on by one
-                var ei = this.getDataPartEffectInfo(BABYLON.Shape2D.SHAPE2D_FILLPARTID, ["index"], null, true);
-                if (ei) {
-                    renderCache.effectFillInstanced = engine.createEffect({ vertex: "ellipse2d", fragment: "ellipse2d" }, ei.attributes, ei.uniforms, [], ei.defines, null);
-                }
-                // Get the non instanced version
-                ei = this.getDataPartEffectInfo(BABYLON.Shape2D.SHAPE2D_FILLPARTID, ["index"], null, false);
-                renderCache.effectFill = engine.createEffect({ vertex: "ellipse2d", fragment: "ellipse2d" }, ei.attributes, ei.uniforms, [], ei.defines, null);
-            }
-            // Need to create WebGL resource for border part?
-            if (this.border) {
-                var vbSize = this.subdivisions * 2;
-                var vb = new Float32Array(vbSize);
-                for (var i = 0; i < vbSize; i++) {
-                    vb[i] = i;
-                }
-                renderCache.borderVB = engine.createVertexBuffer(vb);
-                var triCount = vbSize;
-                var rs = triCount / 2;
-                var ib = new Float32Array(triCount * 3);
-                for (var i = 0; i < rs; i++) {
-                    var r0 = i;
-                    var r1 = (i + 1) % rs;
-                    ib[i * 6 + 0] = rs + r1;
-                    ib[i * 6 + 1] = rs + r0;
-                    ib[i * 6 + 2] = r0;
-                    ib[i * 6 + 3] = r1;
-                    ib[i * 6 + 4] = rs + r1;
-                    ib[i * 6 + 5] = r0;
-                }
-                renderCache.borderIB = engine.createIndexBuffer(ib);
-                renderCache.borderIndicesCount = (triCount * 3);
-                // Get the instanced version of the effect, if the engine does not support it, null is return and we'll only draw on by one
-                var ei = this.getDataPartEffectInfo(BABYLON.Shape2D.SHAPE2D_BORDERPARTID, ["index"], null, true);
-                if (ei) {
-                    renderCache.effectBorderInstanced = engine.createEffect("ellipse2d", ei.attributes, ei.uniforms, [], ei.defines, null);
-                }
-                // Get the non instanced version
-                ei = this.getDataPartEffectInfo(BABYLON.Shape2D.SHAPE2D_BORDERPARTID, ["index"], null, false);
-                renderCache.effectBorder = engine.createEffect("ellipse2d", ei.attributes, ei.uniforms, [], ei.defines, null);
-            }
-            return renderCache;
-        };
-        Ellipse2D.prototype.createInstanceDataParts = function () {
-            var res = new Array();
-            if (this.border) {
-                res.push(new Ellipse2DInstanceData(BABYLON.Shape2D.SHAPE2D_BORDERPARTID));
-            }
-            if (this.fill) {
-                res.push(new Ellipse2DInstanceData(BABYLON.Shape2D.SHAPE2D_FILLPARTID));
-            }
-            return res;
-        };
-        Ellipse2D.prototype.refreshInstanceDataPart = function (part) {
-            if (!_super.prototype.refreshInstanceDataPart.call(this, part)) {
-                return false;
-            }
-            if (part.id === BABYLON.Shape2D.SHAPE2D_BORDERPARTID) {
-                var d = part;
-                var size = this.actualSize;
-                var s = this.actualScale;
-                d.properties = new BABYLON.Vector3(size.width * s.x, size.height * s.y, this.subdivisions);
-            }
-            else if (part.id === BABYLON.Shape2D.SHAPE2D_FILLPARTID) {
-                var d = part;
-                var size = this.actualSize;
-                var s = this.actualScale;
-                d.properties = new BABYLON.Vector3(size.width * s.x, size.height * s.y, this.subdivisions);
-            }
-            return true;
-        };
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.Shape2D.SHAPE2D_PROPCOUNT + 1, function (pi) { return Ellipse2D.acutalSizeProperty = pi; }, false, true)
-        ], Ellipse2D.prototype, "actualSize", null);
-        __decorate([
-            BABYLON.modelLevelProperty(BABYLON.Shape2D.SHAPE2D_PROPCOUNT + 2, function (pi) { return Ellipse2D.subdivisionsProperty = pi; })
-        ], Ellipse2D.prototype, "subdivisions", null);
-        Ellipse2D = __decorate([
-            BABYLON.className("Ellipse2D", "BABYLON")
-        ], Ellipse2D);
-        return Ellipse2D;
-    }(BABYLON.Shape2D));
-    BABYLON.Ellipse2D = Ellipse2D;
-})(BABYLON || (BABYLON = {}));

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 943
canvas2D/src/Engine/babylon.group2d.js


A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 1180
canvas2D/src/Engine/babylon.lines2d.js


+ 0 - 321
canvas2D/src/Engine/babylon.modelRenderCache.js

@@ -1,321 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var BABYLON;
-(function (BABYLON) {
-    var GroupInstanceInfo = (function () {
-        function GroupInstanceInfo(owner, mrc, partCount) {
-            this._partCount = partCount;
-            this.owner = owner;
-            this.modelRenderCache = mrc;
-            this.modelRenderCache.addRef();
-            this.partIndexFromId = new BABYLON.StringDictionary();
-            this._usedShaderCategories = new Array(partCount);
-            this._strides = new Array(partCount);
-            this._opaqueData = null;
-            this._alphaTestData = null;
-            this._transparentData = null;
-            this.opaqueDirty = this.alphaTestDirty = this.transparentDirty = this.transparentOrderDirty = false;
-        }
-        GroupInstanceInfo.prototype.dispose = function () {
-            if (this._isDisposed) {
-                return false;
-            }
-            if (this.modelRenderCache) {
-                this.modelRenderCache.dispose();
-                this.modelRenderCache = null;
-            }
-            var engine = this.owner.owner.engine;
-            if (this._opaqueData) {
-                this._opaqueData.forEach(function (d) { return d.dispose(engine); });
-                this._opaqueData = null;
-            }
-            if (this._alphaTestData) {
-                this._alphaTestData.forEach(function (d) { return d.dispose(engine); });
-                this._alphaTestData = null;
-            }
-            if (this._transparentData) {
-                this._transparentData.forEach(function (d) { return d.dispose(engine); });
-                this._transparentData = null;
-            }
-            this.partIndexFromId = null;
-            this._isDisposed = true;
-            return true;
-        };
-        Object.defineProperty(GroupInstanceInfo.prototype, "hasOpaqueData", {
-            get: function () {
-                return this._opaqueData != null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GroupInstanceInfo.prototype, "hasAlphaTestData", {
-            get: function () {
-                return this._alphaTestData != null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GroupInstanceInfo.prototype, "hasTransparentData", {
-            get: function () {
-                return this._transparentData != null;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GroupInstanceInfo.prototype, "opaqueData", {
-            get: function () {
-                if (!this._opaqueData) {
-                    this._opaqueData = new Array(this._partCount);
-                    for (var i = 0; i < this._partCount; i++) {
-                        this._opaqueData[i] = new GroupInfoPartData(this._strides[i]);
-                    }
-                }
-                return this._opaqueData;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GroupInstanceInfo.prototype, "alphaTestData", {
-            get: function () {
-                if (!this._alphaTestData) {
-                    this._alphaTestData = new Array(this._partCount);
-                    for (var i = 0; i < this._partCount; i++) {
-                        this._alphaTestData[i] = new GroupInfoPartData(this._strides[i]);
-                    }
-                }
-                return this._alphaTestData;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GroupInstanceInfo.prototype, "transparentData", {
-            get: function () {
-                if (!this._transparentData) {
-                    this._transparentData = new Array(this._partCount);
-                    for (var i = 0; i < this._partCount; i++) {
-                        var zoff = this.modelRenderCache._partData[i]._zBiasOffset;
-                        this._transparentData[i] = new TransparentGroupInfoPartData(this._strides[i], zoff);
-                    }
-                }
-                return this._transparentData;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        GroupInstanceInfo.prototype.sortTransparentData = function () {
-            if (!this.transparentOrderDirty) {
-                return;
-            }
-            for (var i = 0; i < this._transparentData.length; i++) {
-                var td = this._transparentData[i];
-                td._partData.sort();
-            }
-            this.transparentOrderDirty = false;
-        };
-        Object.defineProperty(GroupInstanceInfo.prototype, "usedShaderCategories", {
-            get: function () {
-                return this._usedShaderCategories;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(GroupInstanceInfo.prototype, "strides", {
-            get: function () {
-                return this._strides;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return GroupInstanceInfo;
-    }());
-    BABYLON.GroupInstanceInfo = GroupInstanceInfo;
-    var TransparentSegment = (function () {
-        function TransparentSegment() {
-            this.groupInsanceInfo = null;
-            this.startZ = 0;
-            this.endZ = 0;
-            this.startDataIndex = BABYLON.Prim2DBase._bigInt;
-            this.endDataIndex = 0;
-            this.partBuffers = null;
-        }
-        TransparentSegment.prototype.dispose = function (engine) {
-            if (this.partBuffers) {
-                this.partBuffers.forEach(function (b) { return engine._releaseBuffer(b); });
-                this.partBuffers.splice(0);
-                this.partBuffers = null;
-            }
-        };
-        return TransparentSegment;
-    }());
-    BABYLON.TransparentSegment = TransparentSegment;
-    var GroupInfoPartData = (function () {
-        function GroupInfoPartData(stride) {
-            this._partData = null;
-            this._partBuffer = null;
-            this._partBufferSize = 0;
-            this._partData = new BABYLON.DynamicFloatArray(stride / 4, 50);
-            this._isDisposed = false;
-        }
-        GroupInfoPartData.prototype.dispose = function (engine) {
-            if (this._isDisposed) {
-                return false;
-            }
-            if (this._partBuffer) {
-                engine._releaseBuffer(this._partBuffer);
-                this._partBuffer = null;
-            }
-            this._partData = null;
-            this._isDisposed = true;
-        };
-        return GroupInfoPartData;
-    }());
-    BABYLON.GroupInfoPartData = GroupInfoPartData;
-    var TransparentGroupInfoPartData = (function (_super) {
-        __extends(TransparentGroupInfoPartData, _super);
-        function TransparentGroupInfoPartData(stride, zoff) {
-            _super.call(this, stride);
-            this._partData.compareValueOffset = zoff;
-            this._partData.sortingAscending = false;
-        }
-        return TransparentGroupInfoPartData;
-    }(GroupInfoPartData));
-    BABYLON.TransparentGroupInfoPartData = TransparentGroupInfoPartData;
-    var ModelRenderCache = (function () {
-        function ModelRenderCache(engine, modelKey) {
-            this._engine = engine;
-            this._modelKey = modelKey;
-            this._nextKey = 1;
-            this._refCounter = 1;
-            this._partData = null;
-        }
-        ModelRenderCache.prototype.dispose = function () {
-            if (--this._refCounter !== 0) {
-                return false;
-            }
-            // Remove the Model Render Cache from the global dictionary
-            var edata = this._engine.getExternalData("__BJSCANVAS2D__");
-            if (edata) {
-                edata.DisposeModelRenderCache(this);
-            }
-            return true;
-        };
-        Object.defineProperty(ModelRenderCache.prototype, "isDisposed", {
-            get: function () {
-                return this._refCounter <= 0;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        ModelRenderCache.prototype.addRef = function () {
-            return ++this._refCounter;
-        };
-        Object.defineProperty(ModelRenderCache.prototype, "modelKey", {
-            get: function () {
-                return this._modelKey;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * Render the model instances
-         * @param instanceInfo
-         * @param context
-         * @return must return true is the rendering succeed, false if the rendering couldn't be done (asset's not yet ready, like Effect)
-         */
-        ModelRenderCache.prototype.render = function (instanceInfo, context) {
-            return true;
-        };
-        ModelRenderCache.prototype.getPartIndexFromId = function (partId) {
-            for (var i = 0; i < this._partData.length; i++) {
-                if (this._partData[i]._partId === partId) {
-                    return i;
-                }
-            }
-            return null;
-        };
-        ModelRenderCache.prototype.loadInstancingAttributes = function (partId, effect) {
-            var i = this.getPartIndexFromId(partId);
-            if (i === null) {
-                return null;
-            }
-            var ci = this._partsClassInfo[i];
-            var categories = this._partData[i]._partUsedCategories;
-            var res = ci.classContent.getInstancingAttributeInfos(effect, categories);
-            return res;
-        };
-        ModelRenderCache.prototype.setupUniforms = function (effect, partIndex, data, elementCount) {
-            var pd = this._partData[partIndex];
-            var offset = (pd._partDataStride / 4) * elementCount;
-            var pci = this._partsClassInfo[partIndex];
-            var self = this;
-            pci.fullContent.forEach(function (k, v) {
-                if (!v.category || pd._partUsedCategories.indexOf(v.category) !== -1) {
-                    switch (v.dataType) {
-                        case 4 /* float */:
-                            {
-                                var attribOffset = v.instanceOffset.get(pd._partJoinedUsedCategories);
-                                effect.setFloat(v.attributeName, data.buffer[offset + attribOffset]);
-                                break;
-                            }
-                        case 0 /* Vector2 */:
-                            {
-                                var attribOffset = v.instanceOffset.get(pd._partJoinedUsedCategories);
-                                ModelRenderCache.v2.x = data.buffer[offset + attribOffset + 0];
-                                ModelRenderCache.v2.y = data.buffer[offset + attribOffset + 1];
-                                effect.setVector2(v.attributeName, ModelRenderCache.v2);
-                                break;
-                            }
-                        case 5 /* Color3 */:
-                        case 1 /* Vector3 */:
-                            {
-                                var attribOffset = v.instanceOffset.get(pd._partJoinedUsedCategories);
-                                ModelRenderCache.v3.x = data.buffer[offset + attribOffset + 0];
-                                ModelRenderCache.v3.y = data.buffer[offset + attribOffset + 1];
-                                ModelRenderCache.v3.z = data.buffer[offset + attribOffset + 2];
-                                effect.setVector3(v.attributeName, ModelRenderCache.v3);
-                                break;
-                            }
-                        case 6 /* Color4 */:
-                        case 2 /* Vector4 */:
-                            {
-                                var attribOffset = v.instanceOffset.get(pd._partJoinedUsedCategories);
-                                ModelRenderCache.v4.x = data.buffer[offset + attribOffset + 0];
-                                ModelRenderCache.v4.y = data.buffer[offset + attribOffset + 1];
-                                ModelRenderCache.v4.z = data.buffer[offset + attribOffset + 2];
-                                ModelRenderCache.v4.w = data.buffer[offset + attribOffset + 3];
-                                effect.setVector4(v.attributeName, ModelRenderCache.v4);
-                                break;
-                            }
-                        default:
-                    }
-                }
-            });
-        };
-        //setupUniformsLocation(effect: Effect, uniforms: string[], partId: number) {
-        //    let i = this.getPartIndexFromId(partId);
-        //    if (i === null) {
-        //        return null;
-        //    }
-        //    let pci = this._partsClassInfo[i];
-        //    pci.fullContent.forEach((k, v) => {
-        //        if (uniforms.indexOf(v.attributeName) !== -1) {
-        //            v.uniformLocation = effect.getUniform(v.attributeName);
-        //        }
-        //    });
-        //}
-        ModelRenderCache.v2 = BABYLON.Vector2.Zero();
-        ModelRenderCache.v3 = BABYLON.Vector3.Zero();
-        ModelRenderCache.v4 = BABYLON.Vector4.Zero();
-        return ModelRenderCache;
-    }());
-    BABYLON.ModelRenderCache = ModelRenderCache;
-    var ModelRenderCachePartData = (function () {
-        function ModelRenderCachePartData() {
-        }
-        return ModelRenderCachePartData;
-    }());
-    BABYLON.ModelRenderCachePartData = ModelRenderCachePartData;
-})(BABYLON || (BABYLON = {}));

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 3381
canvas2D/src/Engine/babylon.prim2dBase.js


+ 0 - 453
canvas2D/src/Engine/babylon.rectangle2d.js

@@ -1,453 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var Rectangle2DRenderCache = (function (_super) {
-        __extends(Rectangle2DRenderCache, _super);
-        function Rectangle2DRenderCache(engine, modelKey) {
-            _super.call(this, engine, modelKey);
-            this.effectsReady = false;
-            this.fillVB = null;
-            this.fillIB = null;
-            this.fillIndicesCount = 0;
-            this.instancingFillAttributes = null;
-            this.effectFill = null;
-            this.effectFillInstanced = null;
-            this.borderVB = null;
-            this.borderIB = null;
-            this.borderIndicesCount = 0;
-            this.instancingBorderAttributes = null;
-            this.effectBorder = null;
-            this.effectBorderInstanced = null;
-        }
-        Rectangle2DRenderCache.prototype.render = function (instanceInfo, context) {
-            // Do nothing if the shader is still loading/preparing 
-            if (!this.effectsReady) {
-                if ((this.effectFill && (!this.effectFill.isReady() || (this.effectFillInstanced && !this.effectFillInstanced.isReady()))) ||
-                    (this.effectBorder && (!this.effectBorder.isReady() || (this.effectBorderInstanced && !this.effectBorderInstanced.isReady())))) {
-                    return false;
-                }
-                this.effectsReady = true;
-            }
-            var canvas = instanceInfo.owner.owner;
-            var engine = canvas.engine;
-            var depthFunction = 0;
-            if (this.effectFill && this.effectBorder) {
-                depthFunction = engine.getDepthFunction();
-                engine.setDepthFunctionToLessOrEqual();
-            }
-            var curAlphaMode = engine.getAlphaMode();
-            if (this.effectFill) {
-                var partIndex = instanceInfo.partIndexFromId.get(BABYLON.Shape2D.SHAPE2D_FILLPARTID.toString());
-                var pid = context.groupInfoPartData[partIndex];
-                if (context.renderMode !== BABYLON.Render2DContext.RenderModeOpaque) {
-                    engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE, true);
-                }
-                var effect = context.useInstancing ? this.effectFillInstanced : this.effectFill;
-                engine.enableEffect(effect);
-                engine.bindBuffersDirectly(this.fillVB, this.fillIB, [1], 4, effect);
-                if (context.useInstancing) {
-                    if (!this.instancingFillAttributes) {
-                        this.instancingFillAttributes = this.loadInstancingAttributes(BABYLON.Shape2D.SHAPE2D_FILLPARTID, effect);
-                    }
-                    var glBuffer = context.instancedBuffers ? context.instancedBuffers[partIndex] : pid._partBuffer;
-                    var count = context.instancedBuffers ? context.instancesCount : pid._partData.usedElementCount;
-                    canvas._addDrawCallCount(1, context.renderMode);
-                    engine.updateAndBindInstancesBuffer(glBuffer, null, this.instancingFillAttributes);
-                    engine.draw(true, 0, this.fillIndicesCount, count);
-                    engine.unbindInstanceAttributes();
-                }
-                else {
-                    canvas._addDrawCallCount(context.partDataEndIndex - context.partDataStartIndex, context.renderMode);
-                    for (var i = context.partDataStartIndex; i < context.partDataEndIndex; i++) {
-                        this.setupUniforms(effect, partIndex, pid._partData, i);
-                        engine.draw(true, 0, this.fillIndicesCount);
-                    }
-                }
-            }
-            if (this.effectBorder) {
-                var partIndex = instanceInfo.partIndexFromId.get(BABYLON.Shape2D.SHAPE2D_BORDERPARTID.toString());
-                var pid = context.groupInfoPartData[partIndex];
-                if (context.renderMode !== BABYLON.Render2DContext.RenderModeOpaque) {
-                    engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE, true);
-                }
-                var effect = context.useInstancing ? this.effectBorderInstanced : this.effectBorder;
-                engine.enableEffect(effect);
-                engine.bindBuffersDirectly(this.borderVB, this.borderIB, [1], 4, effect);
-                if (context.useInstancing) {
-                    if (!this.instancingBorderAttributes) {
-                        this.instancingBorderAttributes = this.loadInstancingAttributes(BABYLON.Shape2D.SHAPE2D_BORDERPARTID, effect);
-                    }
-                    var glBuffer = context.instancedBuffers ? context.instancedBuffers[partIndex] : pid._partBuffer;
-                    var count = context.instancedBuffers ? context.instancesCount : pid._partData.usedElementCount;
-                    canvas._addDrawCallCount(1, context.renderMode);
-                    engine.updateAndBindInstancesBuffer(glBuffer, null, this.instancingBorderAttributes);
-                    engine.draw(true, 0, this.borderIndicesCount, count);
-                    engine.unbindInstanceAttributes();
-                }
-                else {
-                    canvas._addDrawCallCount(context.partDataEndIndex - context.partDataStartIndex, context.renderMode);
-                    for (var i = context.partDataStartIndex; i < context.partDataEndIndex; i++) {
-                        this.setupUniforms(effect, partIndex, pid._partData, i);
-                        engine.draw(true, 0, this.borderIndicesCount);
-                    }
-                }
-            }
-            engine.setAlphaMode(curAlphaMode, true);
-            if (this.effectFill && this.effectBorder) {
-                engine.setDepthFunction(depthFunction);
-            }
-            return true;
-        };
-        Rectangle2DRenderCache.prototype.dispose = function () {
-            if (!_super.prototype.dispose.call(this)) {
-                return false;
-            }
-            if (this.fillVB) {
-                this._engine._releaseBuffer(this.fillVB);
-                this.fillVB = null;
-            }
-            if (this.fillIB) {
-                this._engine._releaseBuffer(this.fillIB);
-                this.fillIB = null;
-            }
-            this.effectFill = null;
-            this.effectFillInstanced = null;
-            this.effectBorder = null;
-            this.effectBorderInstanced = null;
-            if (this.borderVB) {
-                this._engine._releaseBuffer(this.borderVB);
-                this.borderVB = null;
-            }
-            if (this.borderIB) {
-                this._engine._releaseBuffer(this.borderIB);
-                this.borderIB = null;
-            }
-            return true;
-        };
-        return Rectangle2DRenderCache;
-    }(BABYLON.ModelRenderCache));
-    BABYLON.Rectangle2DRenderCache = Rectangle2DRenderCache;
-    var Rectangle2DInstanceData = (function (_super) {
-        __extends(Rectangle2DInstanceData, _super);
-        function Rectangle2DInstanceData(partId) {
-            _super.call(this, partId, 1);
-        }
-        Object.defineProperty(Rectangle2DInstanceData.prototype, "properties", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        __decorate([
-            BABYLON.instanceData()
-        ], Rectangle2DInstanceData.prototype, "properties", null);
-        return Rectangle2DInstanceData;
-    }(BABYLON.Shape2DInstanceData));
-    BABYLON.Rectangle2DInstanceData = Rectangle2DInstanceData;
-    var Rectangle2D = (function (_super) {
-        __extends(Rectangle2D, _super);
-        /**
-         * Create an Rectangle 2D Shape primitive. May be a sharp rectangle (with sharp corners), or a rounded one.
-         * @param settings a combination of settings, possible ones are
-         * - parent: the parent primitive/canvas, must be specified if the primitive is not constructed as a child of another one (i.e. as part of the children array setting)
-         * - children: an array of direct children
-         * - id a text identifier, for information purpose
-         * - position: the X & Y positions relative to its parent. Alternatively the x and y settings can be set. Default is [0;0]
-         * - rotation: the initial rotation (in radian) of the primitive. default is 0
-         * - scale: the initial scale of the primitive. default is 1. You can alternatively use scaleX &| scaleY to apply non uniform scale
-         * - dontInheritParentScale: if set the parent's scale won't be taken into consideration to compute the actualScale property
-         * - opacity: set the overall opacity of the primitive, 1 to be opaque (default), less than 1 to be transparent.
-         * - zOrder: override the zOrder with the specified value
-         * - origin: define the normalized origin point location, default [0.5;0.5]
-         * - size: the size of the group. Alternatively the width and height settings can be set. Default will be [10;10].
-         * - roundRadius: if the rectangle has rounded corner, set their radius, default is 0 (to get a sharp edges rectangle).
-         * - fill: the brush used to draw the fill content of the rectangle, you can set null to draw nothing (but you will have to set a border brush), default is a SolidColorBrush of plain white. can also be a string value (see Canvas2D.GetBrushFromString)
-         * - border: the brush used to draw the border of the rectangle, you can set null to draw nothing (but you will have to set a fill brush), default is null. can also be a string value (see Canvas2D.GetBrushFromString)
-         * - borderThickness: the thickness of the drawn border, default is 1.
-         * - isVisible: true if the primitive must be visible, false for hidden. Default is true.
-         * - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
-         * - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
-         * - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
-         * - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginBottom: bottom margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - margin: top, left, right and bottom margin formatted as a single string (see PrimitiveThickness.fromString)
-         * - marginHAlignment: one value of the PrimitiveAlignment type's static properties
-         * - marginVAlignment: one value of the PrimitiveAlignment type's static properties
-         * - marginAlignment: a string defining the alignment, see PrimitiveAlignment.fromString
-         * - paddingTop: top padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingLeft: left padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingRight: right padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingBottom: bottom padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - padding: top, left, right and bottom padding formatted as a single string (see PrimitiveThickness.fromString)
-         */
-        function Rectangle2D(settings) {
-            // Avoid checking every time if the object exists
-            if (settings == null) {
-                settings = {};
-            }
-            _super.call(this, settings);
-            if (settings.size != null) {
-                this.size = settings.size;
-            }
-            else if (settings.width || settings.height) {
-                var size = new BABYLON.Size(settings.width, settings.height);
-                this.size = size;
-            }
-            //let size            = settings.size || (new Size((settings.width === null) ? null : (settings.width || 10), (settings.height === null) ? null : (settings.height || 10)));
-            var roundRadius = (settings.roundRadius == null) ? 0 : settings.roundRadius;
-            var borderThickness = (settings.borderThickness == null) ? 1 : settings.borderThickness;
-            //this.size            = size;
-            this.roundRadius = roundRadius;
-            this.borderThickness = borderThickness;
-        }
-        Object.defineProperty(Rectangle2D.prototype, "actualSize", {
-            get: function () {
-                if (this._actualSize) {
-                    return this._actualSize;
-                }
-                return this.size;
-            },
-            set: function (value) {
-                this._actualSize = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Rectangle2D.prototype, "notRounded", {
-            get: function () {
-                return this._notRounded;
-            },
-            set: function (value) {
-                this._notRounded = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Rectangle2D.prototype, "roundRadius", {
-            get: function () {
-                return this._roundRadius;
-            },
-            set: function (value) {
-                this._roundRadius = value;
-                this.notRounded = value === 0;
-                this._positioningDirty();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Rectangle2D.prototype.levelIntersect = function (intersectInfo) {
-            // If we got there it mean the boundingInfo intersection succeed, if the rectangle has not roundRadius, it means it succeed!
-            if (this.notRounded) {
-                return true;
-            }
-            // If we got so far it means the bounding box at least passed, so we know it's inside the bounding rectangle, but it can be outside the roundedRectangle.
-            // The easiest way is to check if the point is inside on of the four corners area (a little square of roundRadius size at the four corners)
-            // If it's the case for one, check if the mouse is located in the quarter that we care about (the one who is visible) then finally make a distance check with the roundRadius radius to see if it's inside the circle quarter or outside.
-            // First let remove the origin out the equation, to have the rectangle with an origin at bottom/left
-            var size = this.size;
-            Rectangle2D._i0.x = intersectInfo._localPickPosition.x;
-            Rectangle2D._i0.y = intersectInfo._localPickPosition.y;
-            var rr = this.roundRadius;
-            var rrs = rr * rr;
-            // Check if the point is in the bottom/left quarter area
-            Rectangle2D._i1.x = rr;
-            Rectangle2D._i1.y = rr;
-            if (Rectangle2D._i0.x <= Rectangle2D._i1.x && Rectangle2D._i0.y <= Rectangle2D._i1.y) {
-                // Compute the intersection point in the quarter local space
-                Rectangle2D._i2.x = Rectangle2D._i0.x - Rectangle2D._i1.x;
-                Rectangle2D._i2.y = Rectangle2D._i0.y - Rectangle2D._i1.y;
-                // It's a hit if the squared distance is less/equal to the squared radius of the round circle
-                return Rectangle2D._i2.lengthSquared() <= rrs;
-            }
-            // Check if the point is in the top/left quarter area
-            Rectangle2D._i1.x = rr;
-            Rectangle2D._i1.y = size.height - rr;
-            if (Rectangle2D._i0.x <= Rectangle2D._i1.x && Rectangle2D._i0.y >= Rectangle2D._i1.y) {
-                // Compute the intersection point in the quarter local space
-                Rectangle2D._i2.x = Rectangle2D._i0.x - Rectangle2D._i1.x;
-                Rectangle2D._i2.y = Rectangle2D._i0.y - Rectangle2D._i1.y;
-                // It's a hit if the squared distance is less/equal to the squared radius of the round circle
-                return Rectangle2D._i2.lengthSquared() <= rrs;
-            }
-            // Check if the point is in the top/right quarter area
-            Rectangle2D._i1.x = size.width - rr;
-            Rectangle2D._i1.y = size.height - rr;
-            if (Rectangle2D._i0.x >= Rectangle2D._i1.x && Rectangle2D._i0.y >= Rectangle2D._i1.y) {
-                // Compute the intersection point in the quarter local space
-                Rectangle2D._i2.x = Rectangle2D._i0.x - Rectangle2D._i1.x;
-                Rectangle2D._i2.y = Rectangle2D._i0.y - Rectangle2D._i1.y;
-                // It's a hit if the squared distance is less/equal to the squared radius of the round circle
-                return Rectangle2D._i2.lengthSquared() <= rrs;
-            }
-            // Check if the point is in the bottom/right quarter area
-            Rectangle2D._i1.x = size.width - rr;
-            Rectangle2D._i1.y = rr;
-            if (Rectangle2D._i0.x >= Rectangle2D._i1.x && Rectangle2D._i0.y <= Rectangle2D._i1.y) {
-                // Compute the intersection point in the quarter local space
-                Rectangle2D._i2.x = Rectangle2D._i0.x - Rectangle2D._i1.x;
-                Rectangle2D._i2.y = Rectangle2D._i0.y - Rectangle2D._i1.y;
-                // It's a hit if the squared distance is less/equal to the squared radius of the round circle
-                return Rectangle2D._i2.lengthSquared() <= rrs;
-            }
-            // At any other locations the point is guarantied to be inside
-            return true;
-        };
-        Rectangle2D.prototype.updateLevelBoundingInfo = function () {
-            BABYLON.BoundingInfo2D.CreateFromSizeToRef(this.actualSize, this._levelBoundingInfo);
-        };
-        Rectangle2D.prototype.createModelRenderCache = function (modelKey) {
-            var renderCache = new Rectangle2DRenderCache(this.owner.engine, modelKey);
-            return renderCache;
-        };
-        Rectangle2D.prototype.setupModelRenderCache = function (modelRenderCache) {
-            var renderCache = modelRenderCache;
-            var engine = this.owner.engine;
-            // Need to create WebGL resources for fill part?
-            if (this.fill) {
-                var vbSize = ((this.notRounded ? 1 : Rectangle2D.roundSubdivisions) * 4) + 1;
-                var vb = new Float32Array(vbSize);
-                for (var i = 0; i < vbSize; i++) {
-                    vb[i] = i;
-                }
-                renderCache.fillVB = engine.createVertexBuffer(vb);
-                var triCount = vbSize - 1;
-                var ib = new Float32Array(triCount * 3);
-                for (var i = 0; i < triCount; i++) {
-                    ib[i * 3 + 0] = 0;
-                    ib[i * 3 + 2] = i + 1;
-                    ib[i * 3 + 1] = i + 2;
-                }
-                ib[triCount * 3 - 2] = 1;
-                renderCache.fillIB = engine.createIndexBuffer(ib);
-                renderCache.fillIndicesCount = triCount * 3;
-                // Get the instanced version of the effect, if the engine does not support it, null is return and we'll only draw on by one
-                var ei = this.getDataPartEffectInfo(BABYLON.Shape2D.SHAPE2D_FILLPARTID, ["index"], null, true);
-                if (ei) {
-                    renderCache.effectFillInstanced = engine.createEffect("rect2d", ei.attributes, ei.uniforms, [], ei.defines, null);
-                }
-                // Get the non instanced version
-                ei = this.getDataPartEffectInfo(BABYLON.Shape2D.SHAPE2D_FILLPARTID, ["index"], null, false);
-                renderCache.effectFill = engine.createEffect("rect2d", ei.attributes, ei.uniforms, [], ei.defines, null);
-            }
-            // Need to create WebGL resource for border part?
-            if (this.border) {
-                var vbSize = (this.notRounded ? 1 : Rectangle2D.roundSubdivisions) * 4 * 2;
-                var vb = new Float32Array(vbSize);
-                for (var i = 0; i < vbSize; i++) {
-                    vb[i] = i;
-                }
-                renderCache.borderVB = engine.createVertexBuffer(vb);
-                var triCount = vbSize;
-                var rs = triCount / 2;
-                var ib = new Float32Array(triCount * 3);
-                for (var i = 0; i < rs; i++) {
-                    var r0 = i;
-                    var r1 = (i + 1) % rs;
-                    ib[i * 6 + 0] = rs + r1;
-                    ib[i * 6 + 1] = rs + r0;
-                    ib[i * 6 + 2] = r0;
-                    ib[i * 6 + 3] = r1;
-                    ib[i * 6 + 4] = rs + r1;
-                    ib[i * 6 + 5] = r0;
-                }
-                renderCache.borderIB = engine.createIndexBuffer(ib);
-                renderCache.borderIndicesCount = triCount * 3;
-                // Get the instanced version of the effect, if the engine does not support it, null is return and we'll only draw on by one
-                var ei = this.getDataPartEffectInfo(BABYLON.Shape2D.SHAPE2D_BORDERPARTID, ["index"], null, true);
-                if (ei) {
-                    renderCache.effectBorderInstanced = engine.createEffect("rect2d", ei.attributes, ei.uniforms, [], ei.defines, null);
-                }
-                // Get the non instanced version
-                ei = this.getDataPartEffectInfo(BABYLON.Shape2D.SHAPE2D_BORDERPARTID, ["index"], null, false);
-                renderCache.effectBorder = engine.createEffect("rect2d", ei.attributes, ei.uniforms, [], ei.defines, null);
-            }
-            return renderCache;
-        };
-        // We override this method because if there's a roundRadius set, we will reduce the initial Content Area to make sure the computed area won't intersect with the shape contour. The formula is simple: we shrink the incoming size by the amount of the roundRadius
-        Rectangle2D.prototype._getInitialContentAreaToRef = function (primSize, initialContentPosition, initialContentArea) {
-            // Fall back to default implementation if there's no round Radius
-            if (this._notRounded) {
-                _super.prototype._getInitialContentAreaToRef.call(this, primSize, initialContentPosition, initialContentArea);
-            }
-            else {
-                var rr = Math.round((this.roundRadius - (this.roundRadius / Math.sqrt(2))) * 1.3);
-                initialContentPosition.x = initialContentPosition.y = rr;
-                initialContentArea.width = Math.max(0, primSize.width - (rr * 2));
-                initialContentArea.height = Math.max(0, primSize.height - (rr * 2));
-            }
-        };
-        Rectangle2D.prototype._getActualSizeFromContentToRef = function (primSize, newPrimSize) {
-            // Fall back to default implementation if there's no round Radius
-            if (this._notRounded) {
-                _super.prototype._getActualSizeFromContentToRef.call(this, primSize, newPrimSize);
-            }
-            else {
-                var rr = Math.round((this.roundRadius - (this.roundRadius / Math.sqrt(2))) * 1.3);
-                newPrimSize.copyFrom(primSize);
-                newPrimSize.width += rr * 2;
-                newPrimSize.height += rr * 2;
-            }
-        };
-        Rectangle2D.prototype.createInstanceDataParts = function () {
-            var res = new Array();
-            if (this.border) {
-                res.push(new Rectangle2DInstanceData(BABYLON.Shape2D.SHAPE2D_BORDERPARTID));
-            }
-            if (this.fill) {
-                res.push(new Rectangle2DInstanceData(BABYLON.Shape2D.SHAPE2D_FILLPARTID));
-            }
-            return res;
-        };
-        Rectangle2D.prototype.refreshInstanceDataPart = function (part) {
-            if (!_super.prototype.refreshInstanceDataPart.call(this, part)) {
-                return false;
-            }
-            if (part.id === BABYLON.Shape2D.SHAPE2D_BORDERPARTID) {
-                var d = part;
-                var size = this.actualSize;
-                var s = this.actualScale;
-                d.properties = new BABYLON.Vector3(size.width * s.x, size.height * s.y, this.roundRadius || 0);
-            }
-            else if (part.id === BABYLON.Shape2D.SHAPE2D_FILLPARTID) {
-                var d = part;
-                var size = this.actualSize;
-                var s = this.actualScale;
-                d.properties = new BABYLON.Vector3(size.width * s.x, size.height * s.y, this.roundRadius || 0);
-            }
-            return true;
-        };
-        Rectangle2D._i0 = BABYLON.Vector2.Zero();
-        Rectangle2D._i1 = BABYLON.Vector2.Zero();
-        Rectangle2D._i2 = BABYLON.Vector2.Zero();
-        Rectangle2D.roundSubdivisions = 16;
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.Shape2D.SHAPE2D_PROPCOUNT + 1, function (pi) { return Rectangle2D.actualSizeProperty = pi; }, false, true)
-        ], Rectangle2D.prototype, "actualSize", null);
-        __decorate([
-            BABYLON.modelLevelProperty(BABYLON.Shape2D.SHAPE2D_PROPCOUNT + 2, function (pi) { return Rectangle2D.notRoundedProperty = pi; })
-        ], Rectangle2D.prototype, "notRounded", null);
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.Shape2D.SHAPE2D_PROPCOUNT + 3, function (pi) { return Rectangle2D.roundRadiusProperty = pi; })
-        ], Rectangle2D.prototype, "roundRadius", null);
-        Rectangle2D = __decorate([
-            BABYLON.className("Rectangle2D", "BABYLON")
-        ], Rectangle2D);
-        return Rectangle2D;
-    }(BABYLON.Shape2D));
-    BABYLON.Rectangle2D = Rectangle2D;
-})(BABYLON || (BABYLON = {}));

+ 0 - 893
canvas2D/src/Engine/babylon.renderablePrim2d.js

@@ -1,893 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var InstanceClassInfo = (function () {
-        function InstanceClassInfo(base) {
-            this._baseInfo = base;
-            this._nextOffset = new BABYLON.StringDictionary();
-            this._attributes = new Array();
-        }
-        InstanceClassInfo.prototype.mapProperty = function (propInfo, push) {
-            var curOff = this._nextOffset.getOrAdd(InstanceClassInfo._CurCategories, 0);
-            propInfo.instanceOffset.add(InstanceClassInfo._CurCategories, this._getBaseOffset(InstanceClassInfo._CurCategories) + curOff);
-            //console.log(`[${InstanceClassInfo._CurCategories}] New PropInfo. Category: ${propInfo.category}, Name: ${propInfo.attributeName}, Offset: ${propInfo.instanceOffset.get(InstanceClassInfo._CurCategories)}, Size: ${propInfo.size / 4}`);
-            this._nextOffset.set(InstanceClassInfo._CurCategories, curOff + (propInfo.size / 4));
-            if (push) {
-                this._attributes.push(propInfo);
-            }
-        };
-        InstanceClassInfo.prototype.getInstancingAttributeInfos = function (effect, categories) {
-            var catInline = ";" + categories.join(";") + ";";
-            var res = new Array();
-            var curInfo = this;
-            while (curInfo) {
-                for (var _i = 0, _a = curInfo._attributes; _i < _a.length; _i++) {
-                    var attrib = _a[_i];
-                    // Only map if there's no category assigned to the instance data or if there's a category and it's in the given list
-                    if (!attrib.category || categories.indexOf(attrib.category) !== -1) {
-                        var index = effect.getAttributeLocationByName(attrib.attributeName);
-                        var iai = new BABYLON.InstancingAttributeInfo();
-                        iai.index = index;
-                        iai.attributeSize = attrib.size / 4; // attrib.size is in byte and we need to store in "component" (i.e float is 1, vec3 is 3)
-                        iai.offset = attrib.instanceOffset.get(catInline) * 4; // attrib.instanceOffset is in float, iai.offset must be in bytes
-                        iai.attributeName = attrib.attributeName;
-                        res.push(iai);
-                    }
-                }
-                curInfo = curInfo._baseInfo;
-            }
-            return res;
-        };
-        InstanceClassInfo.prototype.getShaderAttributes = function (categories) {
-            var res = new Array();
-            var curInfo = this;
-            while (curInfo) {
-                for (var _i = 0, _a = curInfo._attributes; _i < _a.length; _i++) {
-                    var attrib = _a[_i];
-                    // Only map if there's no category assigned to the instance data or if there's a category and it's in the given list
-                    if (!attrib.category || categories.indexOf(attrib.category) !== -1) {
-                        res.push(attrib.attributeName);
-                    }
-                }
-                curInfo = curInfo._baseInfo;
-            }
-            return res;
-        };
-        InstanceClassInfo.prototype._getBaseOffset = function (categories) {
-            var curOffset = 0;
-            var curBase = this._baseInfo;
-            while (curBase) {
-                curOffset += curBase._nextOffset.getOrAdd(categories, 0);
-                curBase = curBase._baseInfo;
-            }
-            return curOffset;
-        };
-        return InstanceClassInfo;
-    }());
-    BABYLON.InstanceClassInfo = InstanceClassInfo;
-    var InstancePropInfo = (function () {
-        function InstancePropInfo() {
-            this.instanceOffset = new BABYLON.StringDictionary();
-        }
-        InstancePropInfo.prototype.setSize = function (val) {
-            if (val instanceof BABYLON.Vector2) {
-                this.size = 8;
-                this.dataType = 0 /* Vector2 */;
-                return;
-            }
-            if (val instanceof BABYLON.Vector3) {
-                this.size = 12;
-                this.dataType = 1 /* Vector3 */;
-                return;
-            }
-            if (val instanceof BABYLON.Vector4) {
-                this.size = 16;
-                this.dataType = 2 /* Vector4 */;
-                return;
-            }
-            if (val instanceof BABYLON.Matrix) {
-                throw new Error("Matrix type is not supported by WebGL Instance Buffer, you have to use four Vector4 properties instead");
-            }
-            if (typeof (val) === "number") {
-                this.size = 4;
-                this.dataType = 4 /* float */;
-                return;
-            }
-            if (val instanceof BABYLON.Color3) {
-                this.size = 12;
-                this.dataType = 5 /* Color3 */;
-                return;
-            }
-            if (val instanceof BABYLON.Color4) {
-                this.size = 16;
-                this.dataType = 6 /* Color4 */;
-                return;
-            }
-            if (val instanceof BABYLON.Size) {
-                this.size = 8;
-                this.dataType = 7 /* Size */;
-                return;
-            }
-            return;
-        };
-        InstancePropInfo.prototype.writeData = function (array, offset, val) {
-            switch (this.dataType) {
-                case 0 /* Vector2 */:
-                    {
-                        var v = val;
-                        array[offset + 0] = v.x;
-                        array[offset + 1] = v.y;
-                        break;
-                    }
-                case 1 /* Vector3 */:
-                    {
-                        var v = val;
-                        array[offset + 0] = v.x;
-                        array[offset + 1] = v.y;
-                        array[offset + 2] = v.z;
-                        break;
-                    }
-                case 2 /* Vector4 */:
-                    {
-                        var v = val;
-                        array[offset + 0] = v.x;
-                        array[offset + 1] = v.y;
-                        array[offset + 2] = v.z;
-                        array[offset + 3] = v.w;
-                        break;
-                    }
-                case 5 /* Color3 */:
-                    {
-                        var v = val;
-                        array[offset + 0] = v.r;
-                        array[offset + 1] = v.g;
-                        array[offset + 2] = v.b;
-                        break;
-                    }
-                case 6 /* Color4 */:
-                    {
-                        var v = val;
-                        array[offset + 0] = v.r;
-                        array[offset + 1] = v.g;
-                        array[offset + 2] = v.b;
-                        array[offset + 3] = v.a;
-                        break;
-                    }
-                case 4 /* float */:
-                    {
-                        var v = val;
-                        array[offset] = v;
-                        break;
-                    }
-                case 3 /* Matrix */:
-                    {
-                        var v = val;
-                        for (var i = 0; i < 16; i++) {
-                            array[offset + i] = v.m[i];
-                        }
-                        break;
-                    }
-                case 7 /* Size */:
-                    {
-                        var s = val;
-                        array[offset + 0] = s.width;
-                        array[offset + 1] = s.height;
-                        break;
-                    }
-            }
-        };
-        return InstancePropInfo;
-    }());
-    BABYLON.InstancePropInfo = InstancePropInfo;
-    function instanceData(category, shaderAttributeName) {
-        return function (target, propName, descriptor) {
-            var dic = BABYLON.ClassTreeInfo.getOrRegister(target, function (base) { return new InstanceClassInfo(base); });
-            var node = dic.getLevelOf(target);
-            var instanceDataName = propName;
-            shaderAttributeName = shaderAttributeName || instanceDataName;
-            var info = node.levelContent.get(instanceDataName);
-            if (info) {
-                throw new Error("The ID " + instanceDataName + " is already taken by another instance data");
-            }
-            info = new InstancePropInfo();
-            info.attributeName = shaderAttributeName;
-            info.category = category || null;
-            if (info.category) {
-                info.delimitedCategory = ";" + info.category + ";";
-            }
-            node.levelContent.add(instanceDataName, info);
-            descriptor.get = function () {
-                return null;
-            };
-            descriptor.set = function (val) {
-                // Check that we're not trying to set a property that belongs to a category that is not allowed (current)
-                // Quit if it's the case, otherwise we could overwrite data somewhere...
-                if (info.category && InstanceClassInfo._CurCategories.indexOf(info.delimitedCategory) === -1) {
-                    return;
-                }
-                if (!info.size) {
-                    info.setSize(val);
-                    node.classContent.mapProperty(info, true);
-                }
-                else if (!info.instanceOffset.contains(InstanceClassInfo._CurCategories)) {
-                    node.classContent.mapProperty(info, false);
-                }
-                var obj = this;
-                if (obj.dataBuffer && obj.dataElements) {
-                    var offset = obj.dataElements[obj.curElement].offset + info.instanceOffset.get(InstanceClassInfo._CurCategories);
-                    info.writeData(obj.dataBuffer.buffer, offset, val);
-                }
-            };
-        };
-    }
-    BABYLON.instanceData = instanceData;
-    var InstanceDataBase = (function () {
-        function InstanceDataBase(partId, dataElementCount) {
-            this.id = partId;
-            this.curElement = 0;
-            this._dataElementCount = dataElementCount;
-            this.renderMode = 0;
-            this.arrayLengthChanged = false;
-        }
-        Object.defineProperty(InstanceDataBase.prototype, "zBias", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(InstanceDataBase.prototype, "transformX", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(InstanceDataBase.prototype, "transformY", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(InstanceDataBase.prototype, "opacity", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        InstanceDataBase.prototype.getClassTreeInfo = function () {
-            if (!this.typeInfo) {
-                this.typeInfo = BABYLON.ClassTreeInfo.get(Object.getPrototypeOf(this));
-            }
-            return this.typeInfo;
-        };
-        InstanceDataBase.prototype.allocElements = function () {
-            if (!this.dataBuffer || this.dataElements) {
-                return;
-            }
-            var res = new Array(this.dataElementCount);
-            for (var i = 0; i < this.dataElementCount; i++) {
-                res[i] = this.dataBuffer.allocElement();
-            }
-            this.dataElements = res;
-        };
-        InstanceDataBase.prototype.freeElements = function () {
-            if (!this.dataElements) {
-                return;
-            }
-            for (var _i = 0, _a = this.dataElements; _i < _a.length; _i++) {
-                var ei = _a[_i];
-                this.dataBuffer.freeElement(ei);
-            }
-            this.dataElements = null;
-        };
-        Object.defineProperty(InstanceDataBase.prototype, "dataElementCount", {
-            get: function () {
-                return this._dataElementCount;
-            },
-            set: function (value) {
-                if (value === this._dataElementCount) {
-                    return;
-                }
-                this.arrayLengthChanged = true;
-                this.freeElements();
-                this._dataElementCount = value;
-                this.allocElements();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        __decorate([
-            instanceData()
-        ], InstanceDataBase.prototype, "zBias", null);
-        __decorate([
-            instanceData()
-        ], InstanceDataBase.prototype, "transformX", null);
-        __decorate([
-            instanceData()
-        ], InstanceDataBase.prototype, "transformY", null);
-        __decorate([
-            instanceData()
-        ], InstanceDataBase.prototype, "opacity", null);
-        return InstanceDataBase;
-    }());
-    BABYLON.InstanceDataBase = InstanceDataBase;
-    var RenderablePrim2D = (function (_super) {
-        __extends(RenderablePrim2D, _super);
-        function RenderablePrim2D(settings) {
-            _super.call(this, settings);
-            this._transparentPrimitiveInfo = null;
-        }
-        Object.defineProperty(RenderablePrim2D.prototype, "isAlphaTest", {
-            get: function () {
-                return this._useTextureAlpha() || this._isPrimAlphaTest();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(RenderablePrim2D.prototype, "isTransparent", {
-            get: function () {
-                return (this.actualOpacity < 1) || this._shouldUseAlphaFromTexture() || this._isPrimTransparent();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(RenderablePrim2D.prototype, "renderMode", {
-            get: function () {
-                return this._renderMode;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * Dispose the primitive and its resources, remove it from its parent
-         */
-        RenderablePrim2D.prototype.dispose = function () {
-            if (!_super.prototype.dispose.call(this)) {
-                return false;
-            }
-            if (this.renderGroup) {
-                this.renderGroup._setCacheGroupDirty();
-            }
-            if (this._transparentPrimitiveInfo) {
-                this.renderGroup._renderableData.removeTransparentPrimitiveInfo(this._transparentPrimitiveInfo);
-                this._transparentPrimitiveInfo = null;
-            }
-            if (this._instanceDataParts) {
-                this._cleanupInstanceDataParts();
-            }
-            if (this._modelRenderCache) {
-                this._modelRenderCache.dispose();
-                this._modelRenderCache = null;
-            }
-            if (this._instanceDataParts) {
-                this._instanceDataParts.forEach(function (p) {
-                    p.freeElements();
-                });
-                this._instanceDataParts = null;
-            }
-            return true;
-        };
-        RenderablePrim2D.prototype._cleanupInstanceDataParts = function () {
-            var gii = null;
-            for (var _i = 0, _a = this._instanceDataParts; _i < _a.length; _i++) {
-                var part = _a[_i];
-                part.freeElements();
-                gii = part.groupInstanceInfo;
-            }
-            if (gii) {
-                var usedCount = 0;
-                if (gii.hasOpaqueData) {
-                    var od = gii.opaqueData[0];
-                    usedCount += od._partData.usedElementCount;
-                    gii.opaqueDirty = true;
-                }
-                if (gii.hasAlphaTestData) {
-                    var atd = gii.alphaTestData[0];
-                    usedCount += atd._partData.usedElementCount;
-                    gii.alphaTestDirty = true;
-                }
-                if (gii.hasTransparentData) {
-                    var td = gii.transparentData[0];
-                    usedCount += td._partData.usedElementCount;
-                    gii.transparentDirty = true;
-                }
-                if (usedCount === 0 && gii.modelRenderCache != null) {
-                    this.renderGroup._renderableData._renderGroupInstancesInfo.remove(gii.modelRenderCache.modelKey);
-                    gii.dispose();
-                }
-                if (this._modelRenderCache) {
-                    this._modelRenderCache.dispose();
-                    this._modelRenderCache = null;
-                }
-            }
-            this._instanceDataParts = null;
-        };
-        RenderablePrim2D.prototype._prepareRenderPre = function (context) {
-            _super.prototype._prepareRenderPre.call(this, context);
-            // If the model changed and we have already an instance, we must remove this instance from the obsolete model
-            if (this._isFlagSet(BABYLON.SmartPropertyPrim.flagModelDirty) && this._instanceDataParts) {
-                this._cleanupInstanceDataParts();
-            }
-            // Need to create the model?
-            var setupModelRenderCache = false;
-            if (!this._modelRenderCache || this._isFlagSet(BABYLON.SmartPropertyPrim.flagModelDirty)) {
-                setupModelRenderCache = this._createModelRenderCache();
-            }
-            var gii = null;
-            var newInstance = false;
-            // Need to create the instance data parts?
-            if (!this._instanceDataParts) {
-                // Yes, flag it for later, more processing will have to be done
-                newInstance = true;
-                gii = this._createModelDataParts();
-            }
-            // If the ModelRenderCache is brand new, now is the time to call the implementation's specific setup method to create the rendering resources
-            if (setupModelRenderCache) {
-                this.setupModelRenderCache(this._modelRenderCache);
-            }
-            // At this stage we have everything correctly initialized, ModelRenderCache is setup, Model Instance data are good too, they have allocated elements in the Instanced DynamicFloatArray.
-            // The last thing to do is check if the instanced related data must be updated because a InstanceLevel property had changed or the primitive visibility changed.
-            if (this._areSomeFlagsSet(BABYLON.SmartPropertyPrim.flagVisibilityChanged | BABYLON.SmartPropertyPrim.flagNeedRefresh) || context.forceRefreshPrimitive || newInstance || (this._instanceDirtyFlags !== 0) || (this._globalTransformProcessStep !== this._globalTransformStep) || this._mustUpdateInstance()) {
-                this._updateInstanceDataParts(gii);
-            }
-        };
-        RenderablePrim2D.prototype._createModelRenderCache = function () {
-            var _this = this;
-            var setupModelRenderCache = false;
-            if (this._modelRenderCache) {
-                this._modelRenderCache.dispose();
-            }
-            this._modelRenderCache = this.owner._engineData.GetOrAddModelCache(this.modelKey, function (key) {
-                var mrc = _this.createModelRenderCache(key);
-                setupModelRenderCache = true;
-                return mrc;
-            });
-            this._clearFlags(BABYLON.SmartPropertyPrim.flagModelDirty);
-            // if this is still false it means the MRC already exists, so we add a reference to it
-            if (!setupModelRenderCache) {
-                this._modelRenderCache.addRef();
-            }
-            return setupModelRenderCache;
-        };
-        RenderablePrim2D.prototype._createModelDataParts = function () {
-            var _this = this;
-            // Create the instance data parts of the primitive and store them
-            var parts = this.createInstanceDataParts();
-            this._instanceDataParts = parts;
-            // Check if the ModelRenderCache for this particular instance is also brand new, initialize it if it's the case
-            if (!this._modelRenderCache._partData) {
-                this._setupModelRenderCache(parts);
-            }
-            // The Rendering resources (Effect, VB, IB, Textures) are stored in the ModelRenderCache
-            // But it's the RenderGroup that will store all the Instanced related data to render all the primitive it owns.
-            // So for a given ModelKey we getOrAdd a GroupInstanceInfo that will store all these data
-            var gii = this.renderGroup._renderableData._renderGroupInstancesInfo.getOrAddWithFactory(this.modelKey, function (k) {
-                var res = new BABYLON.GroupInstanceInfo(_this.renderGroup, _this._modelRenderCache, _this._modelRenderCache._partData.length);
-                for (var j = 0; j < _this._modelRenderCache._partData.length; j++) {
-                    var part = _this._instanceDataParts[j];
-                    res.partIndexFromId.add(part.id.toString(), j);
-                    res.usedShaderCategories[j] = ";" + _this.getUsedShaderCategories(part).join(";") + ";";
-                    res.strides[j] = _this._modelRenderCache._partData[j]._partDataStride;
-                }
-                return res;
-            });
-            // Get the GroupInfoDataPart corresponding to the render category of the part
-            var rm = 0;
-            var gipd = null;
-            if (this.isTransparent) {
-                gipd = gii.transparentData;
-                rm = BABYLON.Render2DContext.RenderModeTransparent;
-            }
-            else if (this.isAlphaTest) {
-                gipd = gii.alphaTestData;
-                rm = BABYLON.Render2DContext.RenderModeAlphaTest;
-            }
-            else {
-                gipd = gii.opaqueData;
-                rm = BABYLON.Render2DContext.RenderModeOpaque;
-            }
-            // For each instance data part of the primitive, allocate the instanced element it needs for render
-            for (var i = 0; i < parts.length; i++) {
-                var part = parts[i];
-                part.dataBuffer = gipd[i]._partData;
-                part.allocElements();
-                part.renderMode = rm;
-                part.groupInstanceInfo = gii;
-            }
-            return gii;
-        };
-        RenderablePrim2D.prototype._setupModelRenderCache = function (parts) {
-            var ctiArray = new Array();
-            this._modelRenderCache._partData = new Array();
-            for (var _i = 0, parts_1 = parts; _i < parts_1.length; _i++) {
-                var dataPart = parts_1[_i];
-                var pd = new BABYLON.ModelRenderCachePartData();
-                this._modelRenderCache._partData.push(pd);
-                var cat = this.getUsedShaderCategories(dataPart);
-                var cti = dataPart.getClassTreeInfo();
-                // Make sure the instance is visible other the properties won't be set and their size/offset wont be computed
-                var curVisible = this.isVisible;
-                this.isVisible = true;
-                // We manually trigger refreshInstanceData for the only sake of evaluating each instance property size and offset in the instance data, this can only be made at runtime. Once it's done we have all the information to create the instance data buffer.
-                //console.log("Build Prop Layout for " + Tools.getClassName(this._instanceDataParts[0]));
-                var joinCat = ";" + cat.join(";") + ";";
-                pd._partJoinedUsedCategories = joinCat;
-                InstanceClassInfo._CurCategories = joinCat;
-                var obj = this.beforeRefreshForLayoutConstruction(dataPart);
-                if (!this.refreshInstanceDataPart(dataPart)) {
-                    console.log("Layout construction for " + BABYLON.Tools.getClassName(this._instanceDataParts[0]) + " failed because refresh returned false");
-                }
-                this.afterRefreshForLayoutConstruction(dataPart, obj);
-                this.isVisible = curVisible;
-                var size = 0;
-                cti.fullContent.forEach(function (k, v) {
-                    if (!v.category || cat.indexOf(v.category) !== -1) {
-                        if (v.attributeName === "zBias") {
-                            pd._zBiasOffset = v.instanceOffset.get(joinCat);
-                        }
-                        if (!v.size) {
-                            console.log("ERROR: Couldn't detect the size of the Property " + v.attributeName + " from type " + BABYLON.Tools.getClassName(cti.type) + ". Property is ignored.");
-                        }
-                        else {
-                            size += v.size;
-                        }
-                    }
-                });
-                pd._partDataStride = size;
-                pd._partUsedCategories = cat;
-                pd._partId = dataPart.id;
-                ctiArray.push(cti);
-            }
-            this._modelRenderCache._partsClassInfo = ctiArray;
-        };
-        RenderablePrim2D.prototype.onZOrderChanged = function () {
-            if (this.isTransparent && this._transparentPrimitiveInfo) {
-                this.renderGroup._renderableData.transparentPrimitiveZChanged(this._transparentPrimitiveInfo);
-                var gii = this.renderGroup._renderableData._renderGroupInstancesInfo.get(this.modelKey);
-                // Flag the transparentData dirty has will have to sort it again
-                gii.transparentOrderDirty = true;
-            }
-        };
-        RenderablePrim2D.prototype._mustUpdateInstance = function () {
-            return false;
-        };
-        RenderablePrim2D.prototype._useTextureAlpha = function () {
-            return false;
-        };
-        RenderablePrim2D.prototype._shouldUseAlphaFromTexture = function () {
-            return false;
-        };
-        RenderablePrim2D.prototype._isPrimAlphaTest = function () {
-            return false;
-        };
-        RenderablePrim2D.prototype._isPrimTransparent = function () {
-            return false;
-        };
-        RenderablePrim2D.prototype._updateInstanceDataParts = function (gii) {
-            // Fetch the GroupInstanceInfo if we don't already have it
-            var rd = this.renderGroup._renderableData;
-            if (!gii) {
-                gii = rd._renderGroupInstancesInfo.get(this.modelKey);
-            }
-            var isTransparent = this.isTransparent;
-            var isAlphaTest = this.isAlphaTest;
-            var wereTransparent = false;
-            // Check a render mode change
-            var rmChanged = false;
-            if (this._instanceDataParts.length > 0) {
-                var firstPart = this._instanceDataParts[0];
-                var partRM = firstPart.renderMode;
-                var curRM = this.renderMode;
-                if (partRM !== curRM) {
-                    wereTransparent = partRM === BABYLON.Render2DContext.RenderModeTransparent;
-                    rmChanged = true;
-                    var gipd = void 0;
-                    switch (curRM) {
-                        case BABYLON.Render2DContext.RenderModeTransparent:
-                            gipd = gii.transparentData;
-                            break;
-                        case BABYLON.Render2DContext.RenderModeAlphaTest:
-                            gipd = gii.alphaTestData;
-                            break;
-                        default:
-                            gipd = gii.opaqueData;
-                    }
-                    for (var i = 0; i < this._instanceDataParts.length; i++) {
-                        var part = this._instanceDataParts[i];
-                        part.freeElements();
-                        part.dataBuffer = gipd[i]._partData;
-                        part.renderMode = curRM;
-                    }
-                }
-            }
-            // Handle changes related to ZOffset
-            var visChanged = this._isFlagSet(BABYLON.SmartPropertyPrim.flagVisibilityChanged);
-            if (isTransparent || wereTransparent) {
-                // Handle visibility change, which is also triggered when the primitive just got created
-                if (visChanged || rmChanged) {
-                    if (this.isVisible && !wereTransparent) {
-                        if (!this._transparentPrimitiveInfo) {
-                            // Add the primitive to the list of transparent ones in the group that render is
-                            this._transparentPrimitiveInfo = rd.addNewTransparentPrimitiveInfo(this, gii);
-                        }
-                    }
-                    else {
-                        if (this._transparentPrimitiveInfo) {
-                            rd.removeTransparentPrimitiveInfo(this._transparentPrimitiveInfo);
-                            this._transparentPrimitiveInfo = null;
-                        }
-                    }
-                    gii.transparentOrderDirty = true;
-                }
-            }
-            var rebuildTrans = false;
-            // For each Instance Data part, refresh it to update the data in the DynamicFloatArray
-            for (var _i = 0, _a = this._instanceDataParts; _i < _a.length; _i++) {
-                var part = _a[_i];
-                var justAllocated = false;
-                // Check if we need to allocate data elements (hidden prim which becomes visible again)
-                if (!part.dataElements && (visChanged || rmChanged || this.isVisible)) {
-                    part.allocElements();
-                    justAllocated = true;
-                }
-                InstanceClassInfo._CurCategories = gii.usedShaderCategories[gii.partIndexFromId.get(part.id.toString())];
-                // Will return false if the instance should not be rendered (not visible or other any reasons)
-                part.arrayLengthChanged = false;
-                if (!this.refreshInstanceDataPart(part)) {
-                    // Free the data element
-                    if (part.dataElements) {
-                        part.freeElements();
-                    }
-                    // The refresh couldn't succeed, push the primitive to be dirty again for the next render
-                    if (this.isVisible) {
-                        rd._primNewDirtyList.push(this);
-                    }
-                }
-                rebuildTrans = rebuildTrans || part.arrayLengthChanged || justAllocated;
-            }
-            this._instanceDirtyFlags = 0;
-            // Make the appropriate data dirty
-            if (isTransparent) {
-                gii.transparentDirty = true;
-                if (rebuildTrans) {
-                    rd._transparentListChanged = true;
-                }
-            }
-            else if (isAlphaTest) {
-                gii.alphaTestDirty = true;
-            }
-            else {
-                gii.opaqueDirty = true;
-            }
-            this._clearFlags(BABYLON.SmartPropertyPrim.flagVisibilityChanged); // Reset the flag as we've handled the case            
-        };
-        RenderablePrim2D.prototype._updateTransparentSegmentIndices = function (ts) {
-            var minOff = BABYLON.Prim2DBase._bigInt;
-            var maxOff = 0;
-            for (var _i = 0, _a = this._instanceDataParts; _i < _a.length; _i++) {
-                var part = _a[_i];
-                if (part && part.dataElements) {
-                    part.dataBuffer.pack();
-                    for (var _b = 0, _c = part.dataElements; _b < _c.length; _b++) {
-                        var el = _c[_b];
-                        minOff = Math.min(minOff, el.offset);
-                        maxOff = Math.max(maxOff, el.offset);
-                    }
-                    ts.startDataIndex = Math.min(ts.startDataIndex, minOff / part.dataBuffer.stride);
-                    ts.endDataIndex = Math.max(ts.endDataIndex, (maxOff / part.dataBuffer.stride) + 1); // +1 for exclusive
-                }
-            }
-        };
-        // This internal method is mainly used for transparency processing
-        RenderablePrim2D.prototype._getNextPrimZOrder = function () {
-            var length = this._instanceDataParts.length;
-            for (var i = 0; i < length; i++) {
-                var part = this._instanceDataParts[i];
-                if (part) {
-                    var stride = part.dataBuffer.stride;
-                    var lastElementOffset = part.dataElements[part.dataElements.length - 1].offset;
-                    // check if it's the last in the DFA
-                    if (part.dataBuffer.totalElementCount * stride <= lastElementOffset) {
-                        return null;
-                    }
-                    // Return the Z of the next primitive that lies in the DFA
-                    return part.dataBuffer[lastElementOffset + stride + this.modelRenderCache._partData[i]._zBiasOffset];
-                }
-            }
-            return null;
-        };
-        // This internal method is mainly used for transparency processing
-        RenderablePrim2D.prototype._getPrevPrimZOrder = function () {
-            var length = this._instanceDataParts.length;
-            for (var i = 0; i < length; i++) {
-                var part = this._instanceDataParts[i];
-                if (part) {
-                    var stride = part.dataBuffer.stride;
-                    var firstElementOffset = part.dataElements[0].offset;
-                    // check if it's the first in the DFA
-                    if (firstElementOffset === 0) {
-                        return null;
-                    }
-                    // Return the Z of the previous primitive that lies in the DFA
-                    return part.dataBuffer[firstElementOffset - stride + this.modelRenderCache._partData[i]._zBiasOffset];
-                }
-            }
-            return null;
-        };
-        /**
-         * Transform a given point using the Primitive's origin setting.
-         * This method requires the Primitive's actualSize to be accurate
-         * @param p the point to transform
-         * @param originOffset an offset applied on the current origin before performing the transformation. Depending on which frame of reference your data is expressed you may have to apply a offset. (if you data is expressed from the bottom/left, no offset is required. If it's expressed from the center the a [-0.5;-0.5] offset has to be applied.
-         * @param res an allocated Vector2 that will receive the transformed content
-         */
-        RenderablePrim2D.prototype.transformPointWithOriginByRef = function (p, originOffset, res) {
-            var actualSize = this.actualSize;
-            res.x = p.x - ((this.origin.x + (originOffset ? originOffset.x : 0)) * actualSize.width);
-            res.y = p.y - ((this.origin.y + (originOffset ? originOffset.y : 0)) * actualSize.height);
-        };
-        RenderablePrim2D.prototype.transformPointWithOriginToRef = function (p, originOffset, res) {
-            this.transformPointWithOriginByRef(p, originOffset, res);
-            return res;
-        };
-        /**
-         * Get the info for a given effect based on the dataPart metadata
-         * @param dataPartId partId in part list to get the info
-         * @param vertexBufferAttributes vertex buffer attributes to manually add
-         * @param uniforms uniforms to manually add
-         * @param useInstanced specified if Instanced Array should be used, if null the engine caps will be used (so true if WebGL supports it, false otherwise), but you have the possibility to override the engine capability. However, if you manually set true but the engine does not support Instanced Array, this method will return null
-         */
-        RenderablePrim2D.prototype.getDataPartEffectInfo = function (dataPartId, vertexBufferAttributes, uniforms, useInstanced) {
-            if (uniforms === void 0) { uniforms = null; }
-            if (useInstanced === void 0) { useInstanced = null; }
-            var dataPart = BABYLON.Tools.first(this._instanceDataParts, function (i) { return i.id === dataPartId; });
-            if (!dataPart) {
-                return null;
-            }
-            var instancedArray = this.owner.supportInstancedArray;
-            if (useInstanced != null) {
-                // Check if the caller ask for Instanced Array and the engine does not support it, return null if it's the case
-                if (useInstanced && instancedArray === false) {
-                    return null;
-                }
-                // Use the caller's setting
-                instancedArray = useInstanced;
-            }
-            var cti = dataPart.getClassTreeInfo();
-            var categories = this.getUsedShaderCategories(dataPart);
-            var att = cti.classContent.getShaderAttributes(categories);
-            var defines = "";
-            categories.forEach(function (c) { defines += "#define " + c + "\n"; });
-            if (instancedArray) {
-                defines += "#define Instanced\n";
-            }
-            return {
-                attributes: instancedArray ? vertexBufferAttributes.concat(att) : vertexBufferAttributes,
-                uniforms: instancedArray ? (uniforms != null ? uniforms : []) : ((uniforms != null) ? att.concat(uniforms) : (att != null ? att : [])),
-                defines: defines
-            };
-        };
-        Object.defineProperty(RenderablePrim2D.prototype, "modelRenderCache", {
-            get: function () {
-                return this._modelRenderCache;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        RenderablePrim2D.prototype.createModelRenderCache = function (modelKey) {
-            return null;
-        };
-        RenderablePrim2D.prototype.setupModelRenderCache = function (modelRenderCache) {
-        };
-        RenderablePrim2D.prototype.createInstanceDataParts = function () {
-            return null;
-        };
-        RenderablePrim2D.prototype.getUsedShaderCategories = function (dataPart) {
-            return [];
-        };
-        RenderablePrim2D.prototype.beforeRefreshForLayoutConstruction = function (part) {
-        };
-        RenderablePrim2D.prototype.afterRefreshForLayoutConstruction = function (part, obj) {
-        };
-        RenderablePrim2D.prototype.applyActualScaleOnTransform = function () {
-            return true;
-        };
-        RenderablePrim2D.prototype.refreshInstanceDataPart = function (part) {
-            if (!this.isVisible) {
-                return false;
-            }
-            part.isVisible = this.isVisible;
-            // Which means, if there's only one data element, we're update it from this method, otherwise it is the responsibility of the derived class to call updateInstanceDataPart as many times as needed, properly (look at Text2D's implementation for more information)
-            if (part.dataElementCount === 1) {
-                part.curElement = 0;
-                this.updateInstanceDataPart(part);
-            }
-            return true;
-        };
-        /**
-         * Update the instanceDataBase level properties of a part
-         * @param part the part to update
-         * @param positionOffset to use in multi part per primitive (e.g. the Text2D has N parts for N letter to display), this give the offset to apply (e.g. the position of the letter from the bottom/left corner of the text).
-         */
-        RenderablePrim2D.prototype.updateInstanceDataPart = function (part, positionOffset) {
-            if (positionOffset === void 0) { positionOffset = null; }
-            var t = this._globalTransform.multiply(this.renderGroup.invGlobalTransform); // Compute the transformation into the renderGroup's space
-            var rgScale = this._areSomeFlagsSet(BABYLON.SmartPropertyPrim.flagDontInheritParentScale) ? RenderablePrim2D._uV : this.renderGroup.actualScale; // We still need to apply the scale of the renderGroup to our rendering, so get it.
-            var size = this.renderGroup.viewportSize;
-            var zBias = this.actualZOffset;
-            var offX = 0;
-            var offY = 0;
-            // If there's an offset, apply the global transformation matrix on it to get a global offset
-            if (positionOffset) {
-                offX = positionOffset.x * t.m[0] + positionOffset.y * t.m[4];
-                offY = positionOffset.x * t.m[1] + positionOffset.y * t.m[5];
-            }
-            // Have to convert the coordinates to clip space which is ranged between [-1;1] on X and Y axis, with 0,0 being the left/bottom corner
-            // Current coordinates are expressed in renderGroup coordinates ([0, renderGroup.actualSize.width|height]) with 0,0 being at the left/top corner
-            // So for X: 
-            //  - tx.x = value * 2 / width: is to switch from [0, renderGroup.width] to [0, 2]
-            //  - tx.w = (value * 2 / width) - 1: w stores the translation in renderGroup coordinates so (value * 2 / width) to switch to a clip space translation value. - 1 is to offset the overall [0;2] to [-1;1].
-            // At last we don't forget to apply the actualScale of the Render Group to tx[0] and ty[1] to propagate scaling correctly
-            var w = size.width;
-            var h = size.height;
-            var invZBias = 1 / zBias;
-            var tx = new BABYLON.Vector4(t.m[0] * rgScale.x * 2 / w, t.m[4] * 2 / w, 0 /*t.m[8]*/, ((t.m[12] + offX) * rgScale.x * 2 / w) - 1);
-            var ty = new BABYLON.Vector4(t.m[1] * 2 / h, t.m[5] * rgScale.y * 2 / h, 0 /*t.m[9]*/, ((t.m[13] + offY) * rgScale.y * 2 / h) - 1);
-            if (!this.applyActualScaleOnTransform()) {
-                var las = this.actualScale;
-                tx.x /= las.x;
-                ty.y /= las.y;
-            }
-            part.transformX = tx;
-            part.transformY = ty;
-            part.opacity = this.actualOpacity;
-            // Stores zBias and it's inverse value because that's needed to compute the clip space W coordinate (which is 1/Z, so 1/zBias)
-            part.zBias = new BABYLON.Vector2(zBias, invZBias);
-        };
-        RenderablePrim2D.prototype._updateRenderMode = function () {
-            if (this.isTransparent) {
-                this._renderMode = BABYLON.Render2DContext.RenderModeTransparent;
-            }
-            else if (this.isAlphaTest) {
-                this._renderMode = BABYLON.Render2DContext.RenderModeAlphaTest;
-            }
-            else {
-                this._renderMode = BABYLON.Render2DContext.RenderModeOpaque;
-            }
-        };
-        RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT = BABYLON.Prim2DBase.PRIM2DBASE_PROPCOUNT + 5;
-        RenderablePrim2D._uV = new BABYLON.Vector2(1, 1);
-        __decorate([
-            BABYLON.dynamicLevelProperty(BABYLON.Prim2DBase.PRIM2DBASE_PROPCOUNT + 0, function (pi) { return RenderablePrim2D.isAlphaTestProperty = pi; })
-        ], RenderablePrim2D.prototype, "isAlphaTest", null);
-        __decorate([
-            BABYLON.dynamicLevelProperty(BABYLON.Prim2DBase.PRIM2DBASE_PROPCOUNT + 1, function (pi) { return RenderablePrim2D.isTransparentProperty = pi; })
-        ], RenderablePrim2D.prototype, "isTransparent", null);
-        RenderablePrim2D = __decorate([
-            BABYLON.className("RenderablePrim2D", "BABYLON")
-        ], RenderablePrim2D);
-        return RenderablePrim2D;
-    }(BABYLON.Prim2DBase));
-    BABYLON.RenderablePrim2D = RenderablePrim2D;
-})(BABYLON || (BABYLON = {}));

+ 0 - 308
canvas2D/src/Engine/babylon.shape2d.js

@@ -1,308 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var Shape2D = (function (_super) {
-        __extends(Shape2D, _super);
-        function Shape2D(settings) {
-            _super.call(this, settings);
-            if (!settings) {
-                settings = {};
-            }
-            var borderBrush = null;
-            if (settings.border) {
-                if (typeof (settings.border) === "string") {
-                    borderBrush = BABYLON.Canvas2D.GetBrushFromString(settings.border);
-                }
-                else {
-                    borderBrush = settings.border;
-                }
-            }
-            var fillBrush = null;
-            if (settings.fill) {
-                if (typeof (settings.fill) === "string") {
-                    fillBrush = BABYLON.Canvas2D.GetBrushFromString(settings.fill);
-                }
-                else {
-                    fillBrush = settings.fill;
-                }
-            }
-            this._isTransparent = false;
-            this._oldTransparent = false;
-            this.border = borderBrush;
-            this.fill = fillBrush;
-            this._updateTransparencyStatus();
-            this.borderThickness = settings.borderThickness;
-        }
-        Object.defineProperty(Shape2D.prototype, "border", {
-            get: function () {
-                return this._border;
-            },
-            set: function (value) {
-                this._border = value;
-                this._updateTransparencyStatus();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Shape2D.prototype, "fill", {
-            /**
-             * Get/set the brush to render the Fill part of the Primitive
-             */
-            get: function () {
-                return this._fill;
-            },
-            set: function (value) {
-                this._fill = value;
-                this._updateTransparencyStatus();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Shape2D.prototype, "borderThickness", {
-            get: function () {
-                return this._borderThickness;
-            },
-            set: function (value) {
-                this._borderThickness = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Shape2D.prototype.getUsedShaderCategories = function (dataPart) {
-            var cat = _super.prototype.getUsedShaderCategories.call(this, dataPart);
-            // Fill Part
-            if (dataPart.id === Shape2D.SHAPE2D_FILLPARTID) {
-                var fill = this.fill;
-                if (fill instanceof BABYLON.SolidColorBrush2D) {
-                    cat.push(Shape2D.SHAPE2D_CATEGORY_FILLSOLID);
-                }
-                if (fill instanceof BABYLON.GradientColorBrush2D) {
-                    cat.push(Shape2D.SHAPE2D_CATEGORY_FILLGRADIENT);
-                }
-            }
-            // Border Part
-            if (dataPart.id === Shape2D.SHAPE2D_BORDERPARTID) {
-                cat.push(Shape2D.SHAPE2D_CATEGORY_BORDER);
-                var border = this.border;
-                if (border instanceof BABYLON.SolidColorBrush2D) {
-                    cat.push(Shape2D.SHAPE2D_CATEGORY_BORDERSOLID);
-                }
-                if (border instanceof BABYLON.GradientColorBrush2D) {
-                    cat.push(Shape2D.SHAPE2D_CATEGORY_BORDERGRADIENT);
-                }
-            }
-            return cat;
-        };
-        Shape2D.prototype.applyActualScaleOnTransform = function () {
-            return false;
-        };
-        Shape2D.prototype.refreshInstanceDataPart = function (part) {
-            if (!_super.prototype.refreshInstanceDataPart.call(this, part)) {
-                return false;
-            }
-            // Fill Part
-            if (part.id === Shape2D.SHAPE2D_FILLPARTID) {
-                var d = part;
-                if (this.fill) {
-                    var fill = this.fill;
-                    if (fill instanceof BABYLON.SolidColorBrush2D) {
-                        d.fillSolidColor = fill.color;
-                    }
-                    else if (fill instanceof BABYLON.GradientColorBrush2D) {
-                        d.fillGradientColor1 = fill.color1;
-                        d.fillGradientColor2 = fill.color2;
-                        var t = BABYLON.Matrix.Compose(new BABYLON.Vector3(fill.scale, fill.scale, fill.scale), BABYLON.Quaternion.RotationAxis(new BABYLON.Vector3(0, 0, 1), fill.rotation), new BABYLON.Vector3(fill.translation.x, fill.translation.y, 0));
-                        var ty = new BABYLON.Vector4(t.m[1], t.m[5], t.m[9], t.m[13]);
-                        d.fillGradientTY = ty;
-                    }
-                }
-            }
-            else if (part.id === Shape2D.SHAPE2D_BORDERPARTID) {
-                var d = part;
-                if (this.border) {
-                    d.borderThickness = this.borderThickness;
-                    var border = this.border;
-                    if (border instanceof BABYLON.SolidColorBrush2D) {
-                        d.borderSolidColor = border.color;
-                    }
-                    else if (border instanceof BABYLON.GradientColorBrush2D) {
-                        d.borderGradientColor1 = border.color1;
-                        d.borderGradientColor2 = border.color2;
-                        var t = BABYLON.Matrix.Compose(new BABYLON.Vector3(border.scale, border.scale, border.scale), BABYLON.Quaternion.RotationAxis(new BABYLON.Vector3(0, 0, 1), border.rotation), new BABYLON.Vector3(border.translation.x, border.translation.y, 0));
-                        var ty = new BABYLON.Vector4(t.m[1], t.m[5], t.m[9], t.m[13]);
-                        d.borderGradientTY = ty;
-                    }
-                }
-            }
-            return true;
-        };
-        Shape2D.prototype._updateTransparencyStatus = function () {
-            this._isTransparent = (this._border && this._border.isTransparent()) || (this._fill && this._fill.isTransparent()) || (this.actualOpacity < 1);
-            if (this._isTransparent !== this._oldTransparent) {
-                this._oldTransparent = this._isTransparent;
-                this._updateRenderMode();
-            }
-        };
-        Shape2D.prototype._mustUpdateInstance = function () {
-            var res = this._oldTransparent !== this._isTransparent;
-            if (res) {
-                this._updateRenderMode();
-                this._oldTransparent = this._isTransparent;
-            }
-            return res;
-        };
-        Shape2D.prototype._isPrimTransparent = function () {
-            return this._isTransparent;
-        };
-        Shape2D.SHAPE2D_BORDERPARTID = 1;
-        Shape2D.SHAPE2D_FILLPARTID = 2;
-        Shape2D.SHAPE2D_CATEGORY_BORDER = "Border";
-        Shape2D.SHAPE2D_CATEGORY_BORDERSOLID = "BorderSolid";
-        Shape2D.SHAPE2D_CATEGORY_BORDERGRADIENT = "BorderGradient";
-        Shape2D.SHAPE2D_CATEGORY_FILLSOLID = "FillSolid";
-        Shape2D.SHAPE2D_CATEGORY_FILLGRADIENT = "FillGradient";
-        Shape2D.SHAPE2D_PROPCOUNT = BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 5;
-        __decorate([
-            BABYLON.modelLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 1, function (pi) { return Shape2D.borderProperty = pi; }, true)
-        ], Shape2D.prototype, "border", null);
-        __decorate([
-            BABYLON.modelLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 2, function (pi) { return Shape2D.fillProperty = pi; }, true)
-        ], Shape2D.prototype, "fill", null);
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 3, function (pi) { return Shape2D.borderThicknessProperty = pi; })
-        ], Shape2D.prototype, "borderThickness", null);
-        Shape2D = __decorate([
-            BABYLON.className("Shape2D", "BABYLON")
-        ], Shape2D);
-        return Shape2D;
-    }(BABYLON.RenderablePrim2D));
-    BABYLON.Shape2D = Shape2D;
-    var Shape2DInstanceData = (function (_super) {
-        __extends(Shape2DInstanceData, _super);
-        function Shape2DInstanceData() {
-            _super.apply(this, arguments);
-        }
-        Object.defineProperty(Shape2DInstanceData.prototype, "fillSolidColor", {
-            // FILL ATTRIBUTES
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Shape2DInstanceData.prototype, "fillGradientColor1", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Shape2DInstanceData.prototype, "fillGradientColor2", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Shape2DInstanceData.prototype, "fillGradientTY", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Shape2DInstanceData.prototype, "borderThickness", {
-            // BORDER ATTRIBUTES
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Shape2DInstanceData.prototype, "borderSolidColor", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Shape2DInstanceData.prototype, "borderGradientColor1", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Shape2DInstanceData.prototype, "borderGradientColor2", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Shape2DInstanceData.prototype, "borderGradientTY", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        __decorate([
-            BABYLON.instanceData(Shape2D.SHAPE2D_CATEGORY_FILLSOLID)
-        ], Shape2DInstanceData.prototype, "fillSolidColor", null);
-        __decorate([
-            BABYLON.instanceData(Shape2D.SHAPE2D_CATEGORY_FILLGRADIENT)
-        ], Shape2DInstanceData.prototype, "fillGradientColor1", null);
-        __decorate([
-            BABYLON.instanceData(Shape2D.SHAPE2D_CATEGORY_FILLGRADIENT)
-        ], Shape2DInstanceData.prototype, "fillGradientColor2", null);
-        __decorate([
-            BABYLON.instanceData(Shape2D.SHAPE2D_CATEGORY_FILLGRADIENT)
-        ], Shape2DInstanceData.prototype, "fillGradientTY", null);
-        __decorate([
-            BABYLON.instanceData(Shape2D.SHAPE2D_CATEGORY_BORDER)
-        ], Shape2DInstanceData.prototype, "borderThickness", null);
-        __decorate([
-            BABYLON.instanceData(Shape2D.SHAPE2D_CATEGORY_BORDERSOLID)
-        ], Shape2DInstanceData.prototype, "borderSolidColor", null);
-        __decorate([
-            BABYLON.instanceData(Shape2D.SHAPE2D_CATEGORY_BORDERGRADIENT)
-        ], Shape2DInstanceData.prototype, "borderGradientColor1", null);
-        __decorate([
-            BABYLON.instanceData(Shape2D.SHAPE2D_CATEGORY_BORDERGRADIENT)
-        ], Shape2DInstanceData.prototype, "borderGradientColor2", null);
-        __decorate([
-            BABYLON.instanceData(Shape2D.SHAPE2D_CATEGORY_BORDERGRADIENT)
-        ], Shape2DInstanceData.prototype, "borderGradientTY", null);
-        return Shape2DInstanceData;
-    }(BABYLON.InstanceDataBase));
-    BABYLON.Shape2DInstanceData = Shape2DInstanceData;
-})(BABYLON || (BABYLON = {}));

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 0 - 1146
canvas2D/src/Engine/babylon.smartPropertyPrim.js


+ 0 - 486
canvas2D/src/Engine/babylon.sprite2d.js

@@ -1,486 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var Sprite2DRenderCache = (function (_super) {
-        __extends(Sprite2DRenderCache, _super);
-        function Sprite2DRenderCache() {
-            _super.apply(this, arguments);
-            this.effectsReady = false;
-            this.vb = null;
-            this.ib = null;
-            this.instancingAttributes = null;
-            this.texture = null;
-            this.effect = null;
-            this.effectInstanced = null;
-        }
-        Sprite2DRenderCache.prototype.render = function (instanceInfo, context) {
-            // Do nothing if the shader is still loading/preparing 
-            if (!this.effectsReady) {
-                if ((this.effect && (!this.effect.isReady() || (this.effectInstanced && !this.effectInstanced.isReady())))) {
-                    return false;
-                }
-                this.effectsReady = true;
-            }
-            // Compute the offset locations of the attributes in the vertex shader that will be mapped to the instance buffer data
-            var canvas = instanceInfo.owner.owner;
-            var engine = canvas.engine;
-            var cur = engine.getAlphaMode();
-            var effect = context.useInstancing ? this.effectInstanced : this.effect;
-            engine.enableEffect(effect);
-            effect.setTexture("diffuseSampler", this.texture);
-            engine.bindBuffersDirectly(this.vb, this.ib, [1], 4, effect);
-            if (context.renderMode !== BABYLON.Render2DContext.RenderModeOpaque) {
-                engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE, true);
-            }
-            effect.setBool("alphaTest", context.renderMode === BABYLON.Render2DContext.RenderModeAlphaTest);
-            var pid = context.groupInfoPartData[0];
-            if (context.useInstancing) {
-                if (!this.instancingAttributes) {
-                    this.instancingAttributes = this.loadInstancingAttributes(Sprite2D.SPRITE2D_MAINPARTID, effect);
-                }
-                var glBuffer = context.instancedBuffers ? context.instancedBuffers[0] : pid._partBuffer;
-                var count = context.instancedBuffers ? context.instancesCount : pid._partData.usedElementCount;
-                canvas._addDrawCallCount(1, context.renderMode);
-                engine.updateAndBindInstancesBuffer(glBuffer, null, this.instancingAttributes);
-                engine.draw(true, 0, 6, count);
-                engine.unbindInstanceAttributes();
-            }
-            else {
-                canvas._addDrawCallCount(context.partDataEndIndex - context.partDataStartIndex, context.renderMode);
-                for (var i = context.partDataStartIndex; i < context.partDataEndIndex; i++) {
-                    this.setupUniforms(effect, 0, pid._partData, i);
-                    engine.draw(true, 0, 6);
-                }
-            }
-            engine.setAlphaMode(cur, true);
-            return true;
-        };
-        Sprite2DRenderCache.prototype.dispose = function () {
-            if (!_super.prototype.dispose.call(this)) {
-                return false;
-            }
-            if (this.vb) {
-                this._engine._releaseBuffer(this.vb);
-                this.vb = null;
-            }
-            if (this.ib) {
-                this._engine._releaseBuffer(this.ib);
-                this.ib = null;
-            }
-            //if (this.texture) {
-            //    this.texture.dispose();
-            //    this.texture = null;
-            //}
-            this.effect = null;
-            this.effectInstanced = null;
-            return true;
-        };
-        return Sprite2DRenderCache;
-    }(BABYLON.ModelRenderCache));
-    BABYLON.Sprite2DRenderCache = Sprite2DRenderCache;
-    var Sprite2DInstanceData = (function (_super) {
-        __extends(Sprite2DInstanceData, _super);
-        function Sprite2DInstanceData(partId) {
-            _super.call(this, partId, 1);
-        }
-        Object.defineProperty(Sprite2DInstanceData.prototype, "topLeftUV", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Sprite2DInstanceData.prototype, "sizeUV", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Sprite2DInstanceData.prototype, "scaleFactor", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Sprite2DInstanceData.prototype, "textureSize", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Sprite2DInstanceData.prototype, "properties", {
-            // 3 floats being:
-            // - x: frame number to display
-            // - y: invertY setting
-            // - z: alignToPixel setting
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        __decorate([
-            BABYLON.instanceData()
-        ], Sprite2DInstanceData.prototype, "topLeftUV", null);
-        __decorate([
-            BABYLON.instanceData()
-        ], Sprite2DInstanceData.prototype, "sizeUV", null);
-        __decorate([
-            BABYLON.instanceData()
-        ], Sprite2DInstanceData.prototype, "scaleFactor", null);
-        __decorate([
-            BABYLON.instanceData()
-        ], Sprite2DInstanceData.prototype, "textureSize", null);
-        __decorate([
-            BABYLON.instanceData()
-        ], Sprite2DInstanceData.prototype, "properties", null);
-        return Sprite2DInstanceData;
-    }(BABYLON.InstanceDataBase));
-    BABYLON.Sprite2DInstanceData = Sprite2DInstanceData;
-    var Sprite2D = (function (_super) {
-        __extends(Sprite2D, _super);
-        /**
-         * Create an 2D Sprite primitive
-         * @param texture the texture that stores the sprite to render
-         * @param settings a combination of settings, possible ones are
-         * - parent: the parent primitive/canvas, must be specified if the primitive is not constructed as a child of another one (i.e. as part of the children array setting)
-         * - children: an array of direct children
-         * - id a text identifier, for information purpose
-         * - position: the X & Y positions relative to its parent. Alternatively the x and y properties can be set. Default is [0;0]
-         * - rotation: the initial rotation (in radian) of the primitive. default is 0
-         * - scale: the initial scale of the primitive. default is 1. You can alternatively use scaleX &| scaleY to apply non uniform scale
-         * - dontInheritParentScale: if set the parent's scale won't be taken into consideration to compute the actualScale property
-         * - opacity: set the overall opacity of the primitive, 1 to be opaque (default), less than 1 to be transparent.
-         * - zOrder: override the zOrder with the specified value
-         * - origin: define the normalized origin point location, default [0.5;0.5]
-         * - spriteSize: the size of the sprite (in pixels), if null the size of the given texture will be used, default is null.
-         * - spriteLocation: the location (in pixels) in the texture of the top/left corner of the Sprite to display, default is null (0,0)
-         * - spriteScaleFactor: say you want to display a sprite twice as big as its bitmap which is 64,64, you set the spriteSize to 128,128 and have to set the spriteScaleFactory to 0.5,0.5 in order to address only the 64,64 pixels of the bitmaps. Default is 1,1.
-         * - invertY: if true the texture Y will be inverted, default is false.
-         * - alignToPixel: if true the sprite's texels will be aligned to the rendering viewport pixels, ensuring the best rendering quality but slow animations won't be done as smooth as if you set false. If false a texel could lies between two pixels, being blended by the texture sampling mode you choose, the rendering result won't be as good, but very slow animation will be overall better looking. Default is true: content will be aligned.
-         * - isVisible: true if the sprite must be visible, false for hidden. Default is true.
-         * - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
-         * - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
-         * - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
-         * - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginBottom: bottom margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - margin: top, left, right and bottom margin formatted as a single string (see PrimitiveThickness.fromString)
-         * - marginHAlignment: one value of the PrimitiveAlignment type's static properties
-         * - marginVAlignment: one value of the PrimitiveAlignment type's static properties
-         * - marginAlignment: a string defining the alignment, see PrimitiveAlignment.fromString
-         * - paddingTop: top padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingLeft: left padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingRight: right padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingBottom: bottom padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - padding: top, left, right and bottom padding formatted as a single string (see PrimitiveThickness.fromString)
-         */
-        function Sprite2D(texture, settings) {
-            var _this = this;
-            if (!settings) {
-                settings = {};
-            }
-            _super.call(this, settings);
-            this.texture = texture;
-            this.texture.wrapU = BABYLON.Texture.CLAMP_ADDRESSMODE;
-            this.texture.wrapV = BABYLON.Texture.CLAMP_ADDRESSMODE;
-            this.size = settings.spriteSize;
-            this.spriteLocation = settings.spriteLocation || new BABYLON.Vector2(0, 0);
-            this.spriteScaleFactor = settings.spriteScaleFactor || new BABYLON.Vector2(1, 1);
-            this.spriteFrame = 0;
-            this.invertY = (settings.invertY == null) ? false : settings.invertY;
-            this.alignToPixel = (settings.alignToPixel == null) ? true : settings.alignToPixel;
-            this.useAlphaFromTexture = true;
-            if (settings.spriteSize == null || !texture.isReady()) {
-                if (texture.isReady()) {
-                    this.size = texture.getBaseSize();
-                }
-                else {
-                    texture.onLoadObservable.add(function () {
-                        if (settings.spriteSize == null) {
-                            _this.size = texture.getBaseSize();
-                        }
-                        _this._positioningDirty();
-                        _this._instanceDirtyFlags |= BABYLON.Prim2DBase.originProperty.flagId | Sprite2D.textureProperty.flagId; // To make sure the sprite is issued again for render
-                    });
-                }
-            }
-        }
-        Object.defineProperty(Sprite2D.prototype, "texture", {
-            get: function () {
-                return this._texture;
-            },
-            set: function (value) {
-                this._texture = value;
-                this._oldTextureHasAlpha = this._texture && this.texture.hasAlpha;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Sprite2D.prototype, "useAlphaFromTexture", {
-            get: function () {
-                return this._useAlphaFromTexture;
-            },
-            set: function (value) {
-                if (this._useAlphaFromTexture === value) {
-                    return;
-                }
-                this._useAlphaFromTexture = value;
-                this._updateRenderMode();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Sprite2D.prototype, "actualSize", {
-            get: function () {
-                if (this._actualSize) {
-                    return this._actualSize;
-                }
-                return this.size;
-            },
-            set: function (value) {
-                this._actualSize = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Sprite2D.prototype, "spriteLocation", {
-            get: function () {
-                return this._location;
-            },
-            set: function (value) {
-                this._location = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Sprite2D.prototype, "spriteFrame", {
-            get: function () {
-                return this._spriteFrame;
-            },
-            set: function (value) {
-                this._spriteFrame = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Sprite2D.prototype, "invertY", {
-            get: function () {
-                return this._invertY;
-            },
-            set: function (value) {
-                this._invertY = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Sprite2D.prototype, "spriteScaleFactor", {
-            get: function () {
-                return this._spriteScaleFactor;
-            },
-            set: function (value) {
-                this._spriteScaleFactor = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * Sets the scale of the sprite using a BABYLON.Size(w,h).
-         * Keeps proportion by taking the maximum of the two scale for x and y.
-         * @param {Size} size Size(width,height)
-         */
-        Sprite2D.prototype.scaleToSize = function (size) {
-            var baseSize = this.size;
-            if (baseSize == null || !this.texture.isReady()) {
-                // we're probably at initiation of the scene, size is not set
-                if (this.texture.isReady()) {
-                    baseSize = this.texture.getBaseSize();
-                }
-                else {
-                    // the texture is not ready, wait for it to load before calling scaleToSize again
-                    var thisObject = this;
-                    this.texture.onLoadObservable.add(function () {
-                        thisObject.scaleToSize(size);
-                    });
-                    return;
-                }
-            }
-            this.scale = Math.max(size.height / baseSize.height, size.width / baseSize.width);
-        };
-        Object.defineProperty(Sprite2D.prototype, "alignToPixel", {
-            /**
-             * Get/set if the sprite rendering should be aligned to the target rendering device pixel or not
-             */
-            get: function () {
-                return this._alignToPixel;
-            },
-            set: function (value) {
-                this._alignToPixel = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Sprite2D.prototype.updateLevelBoundingInfo = function () {
-            BABYLON.BoundingInfo2D.CreateFromSizeToRef(this.size, this._levelBoundingInfo);
-        };
-        /**
-         * Get the animatable array (see http://doc.babylonjs.com/tutorials/Animations)
-         */
-        Sprite2D.prototype.getAnimatables = function () {
-            var res = new Array();
-            if (this.texture && this.texture.animations && this.texture.animations.length > 0) {
-                res.push(this.texture);
-            }
-            return res;
-        };
-        Sprite2D.prototype.levelIntersect = function (intersectInfo) {
-            // If we've made it so far it means the boundingInfo intersection test succeed, the Sprite2D is shaped the same, so we always return true
-            return true;
-        };
-        Sprite2D._createCachedCanvasSprite = function (owner, texture, size, pos) {
-            var sprite = new Sprite2D(texture, { parent: owner, id: "__cachedCanvasSprite__", position: BABYLON.Vector2.Zero(), origin: BABYLON.Vector2.Zero(), spriteSize: size, spriteLocation: pos, alignToPixel: true });
-            return sprite;
-        };
-        Sprite2D.prototype.createModelRenderCache = function (modelKey) {
-            var renderCache = new Sprite2DRenderCache(this.owner.engine, modelKey);
-            return renderCache;
-        };
-        Sprite2D.prototype.setupModelRenderCache = function (modelRenderCache) {
-            var renderCache = modelRenderCache;
-            var engine = this.owner.engine;
-            var vb = new Float32Array(4);
-            for (var i = 0; i < 4; i++) {
-                vb[i] = i;
-            }
-            renderCache.vb = engine.createVertexBuffer(vb);
-            var ib = new Float32Array(6);
-            ib[0] = 0;
-            ib[1] = 2;
-            ib[2] = 1;
-            ib[3] = 0;
-            ib[4] = 3;
-            ib[5] = 2;
-            renderCache.ib = engine.createIndexBuffer(ib);
-            renderCache.texture = this.texture;
-            // Get the instanced version of the effect, if the engine does not support it, null is return and we'll only draw on by one
-            var ei = this.getDataPartEffectInfo(Sprite2D.SPRITE2D_MAINPARTID, ["index"], ["alphaTest"], true);
-            if (ei) {
-                renderCache.effectInstanced = engine.createEffect("sprite2d", ei.attributes, ei.uniforms, ["diffuseSampler"], ei.defines, null);
-            }
-            ei = this.getDataPartEffectInfo(Sprite2D.SPRITE2D_MAINPARTID, ["index"], ["alphaTest"], false);
-            renderCache.effect = engine.createEffect("sprite2d", ei.attributes, ei.uniforms, ["diffuseSampler"], ei.defines, null);
-            return renderCache;
-        };
-        Sprite2D.prototype.createInstanceDataParts = function () {
-            return [new Sprite2DInstanceData(Sprite2D.SPRITE2D_MAINPARTID)];
-        };
-        Sprite2D.prototype.beforeRefreshForLayoutConstruction = function (part) {
-            Sprite2D.layoutConstructMode = true;
-        };
-        // if obj contains something, we restore the _text property
-        Sprite2D.prototype.afterRefreshForLayoutConstruction = function (part, obj) {
-            Sprite2D.layoutConstructMode = false;
-        };
-        Sprite2D.prototype.refreshInstanceDataPart = function (part) {
-            if (!_super.prototype.refreshInstanceDataPart.call(this, part)) {
-                return false;
-            }
-            if (!this.texture.isReady() && !Sprite2D.layoutConstructMode) {
-                return false;
-            }
-            if (part.id === Sprite2D.SPRITE2D_MAINPARTID) {
-                var d = this._instanceDataParts[0];
-                if (Sprite2D.layoutConstructMode) {
-                    d.topLeftUV = BABYLON.Vector2.Zero();
-                    d.sizeUV = BABYLON.Vector2.Zero();
-                    d.properties = BABYLON.Vector3.Zero();
-                    d.textureSize = BABYLON.Vector2.Zero();
-                    d.scaleFactor = BABYLON.Vector2.Zero();
-                }
-                else {
-                    var ts = this.texture.getBaseSize();
-                    var sl = this.spriteLocation;
-                    var ss = this.actualSize;
-                    var ssf = this.spriteScaleFactor;
-                    d.topLeftUV = new BABYLON.Vector2(sl.x / ts.width, sl.y / ts.height);
-                    var suv = new BABYLON.Vector2(ss.width / ts.width, ss.height / ts.height);
-                    d.sizeUV = suv;
-                    d.scaleFactor = ssf;
-                    Sprite2D._prop.x = this.spriteFrame;
-                    Sprite2D._prop.y = this.invertY ? 1 : 0;
-                    Sprite2D._prop.z = this.alignToPixel ? 1 : 0;
-                    d.properties = Sprite2D._prop;
-                    d.textureSize = new BABYLON.Vector2(ts.width, ts.height);
-                }
-            }
-            return true;
-        };
-        Sprite2D.prototype._mustUpdateInstance = function () {
-            var res = this._oldTextureHasAlpha !== (this.texture != null && this.texture.hasAlpha);
-            this._oldTextureHasAlpha = this.texture != null && this.texture.hasAlpha;
-            if (res) {
-                this._updateRenderMode();
-            }
-            return res;
-        };
-        Sprite2D.prototype._useTextureAlpha = function () {
-            return this.texture != null && this.texture.hasAlpha;
-        };
-        Sprite2D.prototype._shouldUseAlphaFromTexture = function () {
-            return this.texture != null && this.texture.hasAlpha && this.useAlphaFromTexture;
-        };
-        Sprite2D.SPRITE2D_MAINPARTID = 1;
-        Sprite2D._prop = BABYLON.Vector3.Zero();
-        Sprite2D.layoutConstructMode = false;
-        __decorate([
-            BABYLON.modelLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 1, function (pi) { return Sprite2D.textureProperty = pi; })
-        ], Sprite2D.prototype, "texture", null);
-        __decorate([
-            BABYLON.dynamicLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 2, function (pi) { return Sprite2D.useAlphaFromTextureProperty = pi; })
-        ], Sprite2D.prototype, "useAlphaFromTexture", null);
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 3, function (pi) { return Sprite2D.actualSizeProperty = pi; }, false, true)
-        ], Sprite2D.prototype, "actualSize", null);
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 4, function (pi) { return Sprite2D.spriteLocationProperty = pi; })
-        ], Sprite2D.prototype, "spriteLocation", null);
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 5, function (pi) { return Sprite2D.spriteFrameProperty = pi; })
-        ], Sprite2D.prototype, "spriteFrame", null);
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 6, function (pi) { return Sprite2D.invertYProperty = pi; })
-        ], Sprite2D.prototype, "invertY", null);
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 7, function (pi) { return Sprite2D.spriteScaleFactorProperty = pi; })
-        ], Sprite2D.prototype, "spriteScaleFactor", null);
-        Sprite2D = __decorate([
-            BABYLON.className("Sprite2D", "BABYLON")
-        ], Sprite2D);
-        return Sprite2D;
-    }(BABYLON.RenderablePrim2D));
-    BABYLON.Sprite2D = Sprite2D;
-})(BABYLON || (BABYLON = {}));

+ 0 - 473
canvas2D/src/Engine/babylon.text2d.js

@@ -1,473 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var Text2DRenderCache = (function (_super) {
-        __extends(Text2DRenderCache, _super);
-        function Text2DRenderCache() {
-            _super.apply(this, arguments);
-            this.effectsReady = false;
-            this.vb = null;
-            this.ib = null;
-            this.instancingAttributes = null;
-            this.fontTexture = null;
-            this.effect = null;
-            this.effectInstanced = null;
-        }
-        Text2DRenderCache.prototype.render = function (instanceInfo, context) {
-            // Do nothing if the shader is still loading/preparing 
-            if (!this.effectsReady) {
-                if ((this.effect && (!this.effect.isReady() || (this.effectInstanced && !this.effectInstanced.isReady())))) {
-                    return false;
-                }
-                this.effectsReady = true;
-            }
-            var canvas = instanceInfo.owner.owner;
-            var engine = canvas.engine;
-            this.fontTexture.update();
-            var effect = context.useInstancing ? this.effectInstanced : this.effect;
-            engine.enableEffect(effect);
-            effect.setTexture("diffuseSampler", this.fontTexture);
-            engine.bindBuffersDirectly(this.vb, this.ib, [1], 4, effect);
-            var curAlphaMode = engine.getAlphaMode();
-            engine.setAlphaMode(BABYLON.Engine.ALPHA_COMBINE, true);
-            var pid = context.groupInfoPartData[0];
-            if (context.useInstancing) {
-                if (!this.instancingAttributes) {
-                    this.instancingAttributes = this.loadInstancingAttributes(Text2D.TEXT2D_MAINPARTID, effect);
-                }
-                var glBuffer = context.instancedBuffers ? context.instancedBuffers[0] : pid._partBuffer;
-                var count = context.instancedBuffers ? context.instancesCount : pid._partData.usedElementCount;
-                canvas._addDrawCallCount(1, context.renderMode);
-                engine.updateAndBindInstancesBuffer(glBuffer, null, this.instancingAttributes);
-                engine.draw(true, 0, 6, count);
-                engine.unbindInstanceAttributes();
-            }
-            else {
-                canvas._addDrawCallCount(context.partDataEndIndex - context.partDataStartIndex, context.renderMode);
-                for (var i = context.partDataStartIndex; i < context.partDataEndIndex; i++) {
-                    this.setupUniforms(effect, 0, pid._partData, i);
-                    engine.draw(true, 0, 6);
-                }
-            }
-            engine.setAlphaMode(curAlphaMode, true);
-            return true;
-        };
-        Text2DRenderCache.prototype.dispose = function () {
-            if (!_super.prototype.dispose.call(this)) {
-                return false;
-            }
-            if (this.vb) {
-                this._engine._releaseBuffer(this.vb);
-                this.vb = null;
-            }
-            if (this.ib) {
-                this._engine._releaseBuffer(this.ib);
-                this.ib = null;
-            }
-            if (this.fontTexture) {
-                this.fontTexture.decCachedFontTextureCounter();
-                this.fontTexture = null;
-            }
-            this.effect = null;
-            this.effectInstanced = null;
-            return true;
-        };
-        return Text2DRenderCache;
-    }(BABYLON.ModelRenderCache));
-    BABYLON.Text2DRenderCache = Text2DRenderCache;
-    var Text2DInstanceData = (function (_super) {
-        __extends(Text2DInstanceData, _super);
-        function Text2DInstanceData(partId, dataElementCount) {
-            _super.call(this, partId, dataElementCount);
-        }
-        Object.defineProperty(Text2DInstanceData.prototype, "topLeftUV", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2DInstanceData.prototype, "sizeUV", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2DInstanceData.prototype, "textureSize", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2DInstanceData.prototype, "color", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2DInstanceData.prototype, "superSampleFactor", {
-            get: function () {
-                return null;
-            },
-            set: function (value) {
-            },
-            enumerable: true,
-            configurable: true
-        });
-        __decorate([
-            BABYLON.instanceData()
-        ], Text2DInstanceData.prototype, "topLeftUV", null);
-        __decorate([
-            BABYLON.instanceData()
-        ], Text2DInstanceData.prototype, "sizeUV", null);
-        __decorate([
-            BABYLON.instanceData()
-        ], Text2DInstanceData.prototype, "textureSize", null);
-        __decorate([
-            BABYLON.instanceData()
-        ], Text2DInstanceData.prototype, "color", null);
-        __decorate([
-            BABYLON.instanceData()
-        ], Text2DInstanceData.prototype, "superSampleFactor", null);
-        return Text2DInstanceData;
-    }(BABYLON.InstanceDataBase));
-    BABYLON.Text2DInstanceData = Text2DInstanceData;
-    var Text2D = (function (_super) {
-        __extends(Text2D, _super);
-        /**
-         * Create a Text primitive
-         * @param text the text to display
-         * @param settings a combination of settings, possible ones are
-         * - parent: the parent primitive/canvas, must be specified if the primitive is not constructed as a child of another one (i.e. as part of the children array setting)
-         * - children: an array of direct children
-         * - id a text identifier, for information purpose
-         * - position: the X & Y positions relative to its parent. Alternatively the x and y properties can be set. Default is [0;0]
-         * - rotation: the initial rotation (in radian) of the primitive. default is 0
-         * - scale: the initial scale of the primitive. default is 1. You can alternatively use scaleX &| scaleY to apply non uniform scale
-         * - dontInheritParentScale: if set the parent's scale won't be taken into consideration to compute the actualScale property
-         * - opacity: set the overall opacity of the primitive, 1 to be opaque (default), less than 1 to be transparent.
-         * - zOrder: override the zOrder with the specified value
-         * - origin: define the normalized origin point location, default [0.5;0.5]
-         * - fontName: the name/size/style of the font to use, following the CSS notation. Default is "12pt Arial".
-         * - fontSuperSample: if true the text will be rendered with a superSampled font (the font is twice the given size). Use this settings if the text lies in world space or if it's scaled in.
-         * - defaultFontColor: the color by default to apply on each letter of the text to display, default is plain white.
-         * - areaSize: the size of the area in which to display the text, default is auto-fit from text content.
-         * - tabulationSize: number of space character to insert when a tabulation is encountered, default is 4
-         * - isVisible: true if the text must be visible, false for hidden. Default is true.
-         * - isPickable: if true the Primitive can be used with interaction mode and will issue Pointer Event. If false it will be ignored for interaction/intersection test. Default value is true.
-         * - isContainer: if true the Primitive acts as a container for interaction, if the primitive is not pickable or doesn't intersection, no further test will be perform on its children. If set to false, children will always be considered for intersection/interaction. Default value is true.
-         * - childrenFlatZOrder: if true all the children (direct and indirect) will share the same Z-Order. Use this when there's a lot of children which don't overlap. The drawing order IS NOT GUARANTED!
-         * - marginTop: top margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginLeft: left margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginRight: right margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - marginBottom: bottom margin, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - margin: top, left, right and bottom margin formatted as a single string (see PrimitiveThickness.fromString)
-         * - marginHAlignment: one value of the PrimitiveAlignment type's static properties
-         * - marginVAlignment: one value of the PrimitiveAlignment type's static properties
-         * - marginAlignment: a string defining the alignment, see PrimitiveAlignment.fromString
-         * - paddingTop: top padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingLeft: left padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingRight: right padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - paddingBottom: bottom padding, can be a number (will be pixels) or a string (see PrimitiveThickness.fromString)
-         * - padding: top, left, right and bottom padding formatted as a single string (see PrimitiveThickness.fromString)
-         */
-        function Text2D(text, settings) {
-            if (!settings) {
-                settings = {};
-            }
-            _super.call(this, settings);
-            this.fontName = (settings.fontName == null) ? "12pt Arial" : settings.fontName;
-            this._fontSuperSample = (settings.fontSuperSample != null && settings.fontSuperSample);
-            this.defaultFontColor = (settings.defaultFontColor == null) ? new BABYLON.Color4(1, 1, 1, 1) : settings.defaultFontColor;
-            this._tabulationSize = (settings.tabulationSize == null) ? 4 : settings.tabulationSize;
-            this._textSize = null;
-            this.text = text;
-            this.size = (settings.size == null) ? null : settings.size;
-            this._updateRenderMode();
-        }
-        Object.defineProperty(Text2D.prototype, "fontName", {
-            get: function () {
-                return this._fontName;
-            },
-            set: function (value) {
-                if (this._fontName) {
-                    throw new Error("Font Name change is not supported right now.");
-                }
-                this._fontName = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2D.prototype, "defaultFontColor", {
-            get: function () {
-                return this._defaultFontColor;
-            },
-            set: function (value) {
-                this._defaultFontColor = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2D.prototype, "text", {
-            get: function () {
-                return this._text;
-            },
-            set: function (value) {
-                if (!value) {
-                    value = "";
-                }
-                this._text = value;
-                this._textSize = null; // A change of text will reset the TextSize which will be recomputed next time it's used
-                this._size = null;
-                this._updateCharCount();
-                // Trigger a textSize to for a sizeChange if necessary, which is needed for layout to recompute
-                var s = this.textSize;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2D.prototype, "size", {
-            get: function () {
-                if (this._size != null) {
-                    return this._size;
-                }
-                return this.textSize;
-            },
-            set: function (value) {
-                this._size = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2D.prototype, "isSizeAuto", {
-            get: function () {
-                return false;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2D.prototype, "actualSize", {
-            /**
-             * Get the actual size of the Text2D primitive
-             */
-            get: function () {
-                if (this._actualSize) {
-                    return this._actualSize;
-                }
-                return this.size;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2D.prototype, "textSize", {
-            /**
-             * Get the area that bounds the text associated to the primitive
-             */
-            get: function () {
-                if (!this._textSize) {
-                    if (this.owner && this._text) {
-                        var newSize = this.fontTexture.measureText(this._text, this._tabulationSize);
-                        if (!newSize.equals(this._textSize)) {
-                            this.onPrimitivePropertyDirty(BABYLON.Prim2DBase.sizeProperty.flagId);
-                            this._positioningDirty();
-                        }
-                        this._textSize = newSize;
-                    }
-                    else {
-                        return Text2D.nullSize;
-                    }
-                }
-                return this._textSize;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Text2D.prototype, "fontTexture", {
-            get: function () {
-                if (this._fontTexture) {
-                    return this._fontTexture;
-                }
-                if (this.fontName == null || this.owner == null || this.owner.scene == null) {
-                    return null;
-                }
-                this._fontTexture = BABYLON.FontTexture.GetCachedFontTexture(this.owner.scene, this.fontName, this._fontSuperSample);
-                return this._fontTexture;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * Dispose the primitive, remove it from its parent
-         */
-        Text2D.prototype.dispose = function () {
-            if (!_super.prototype.dispose.call(this)) {
-                return false;
-            }
-            if (this._fontTexture) {
-                BABYLON.FontTexture.ReleaseCachedFontTexture(this.owner.scene, this.fontName, this._fontSuperSample);
-                this._fontTexture = null;
-            }
-            return true;
-        };
-        Text2D.prototype.updateLevelBoundingInfo = function () {
-            BABYLON.BoundingInfo2D.CreateFromSizeToRef(this.actualSize, this._levelBoundingInfo);
-        };
-        Text2D.prototype.levelIntersect = function (intersectInfo) {
-            // For now I can't do something better that boundingInfo is a hit, detecting an intersection on a particular letter would be possible, but do we really need it? Not for now...
-            return true;
-        };
-        Text2D.prototype.createModelRenderCache = function (modelKey) {
-            var renderCache = new Text2DRenderCache(this.owner.engine, modelKey);
-            return renderCache;
-        };
-        Text2D.prototype.setupModelRenderCache = function (modelRenderCache) {
-            var renderCache = modelRenderCache;
-            var engine = this.owner.engine;
-            renderCache.fontTexture = this.fontTexture;
-            renderCache.fontTexture.incCachedFontTextureCounter();
-            var vb = new Float32Array(4);
-            for (var i = 0; i < 4; i++) {
-                vb[i] = i;
-            }
-            renderCache.vb = engine.createVertexBuffer(vb);
-            var ib = new Float32Array(6);
-            ib[0] = 0;
-            ib[1] = 2;
-            ib[2] = 1;
-            ib[3] = 0;
-            ib[4] = 3;
-            ib[5] = 2;
-            renderCache.ib = engine.createIndexBuffer(ib);
-            // Get the instanced version of the effect, if the engine does not support it, null is return and we'll only draw on by one
-            var ei = this.getDataPartEffectInfo(Text2D.TEXT2D_MAINPARTID, ["index"], null, true);
-            if (ei) {
-                renderCache.effectInstanced = engine.createEffect("text2d", ei.attributes, ei.uniforms, ["diffuseSampler"], ei.defines, null);
-            }
-            ei = this.getDataPartEffectInfo(Text2D.TEXT2D_MAINPARTID, ["index"], null, false);
-            renderCache.effect = engine.createEffect("text2d", ei.attributes, ei.uniforms, ["diffuseSampler"], ei.defines, null);
-            return renderCache;
-        };
-        Text2D.prototype.createInstanceDataParts = function () {
-            return [new Text2DInstanceData(Text2D.TEXT2D_MAINPARTID, this._charCount)];
-        };
-        // Looks like a hack!? Yes! Because that's what it is!
-        // For the InstanceData layer to compute correctly we need to set all the properties involved, which won't be the case if there's no text
-        // This method is called before the layout construction for us to detect this case, set some text and return the initial one to restore it after (there can be some text without char to display, say "\t\n" for instance)
-        Text2D.prototype.beforeRefreshForLayoutConstruction = function (part) {
-            if (!this._charCount) {
-                var curText = this._text;
-                this.text = "A";
-                return curText;
-            }
-        };
-        // if obj contains something, we restore the _text property
-        Text2D.prototype.afterRefreshForLayoutConstruction = function (part, obj) {
-            if (obj !== undefined) {
-                this.text = obj;
-            }
-        };
-        Text2D.prototype.refreshInstanceDataPart = function (part) {
-            if (!_super.prototype.refreshInstanceDataPart.call(this, part)) {
-                return false;
-            }
-            if (part.id === Text2D.TEXT2D_MAINPARTID) {
-                var d = part;
-                var texture = this.fontTexture;
-                var superSampleFactor = texture.isSuperSampled ? 0.5 : 1;
-                var ts = texture.getSize();
-                var offset = BABYLON.Vector2.Zero();
-                var lh = this.fontTexture.lineHeight;
-                offset.y = ((this.textSize.height / lh) - 1) * lh; // Origin is bottom, not top, so the offset is starting with a y that is the top location of the text
-                var charxpos = 0;
-                d.dataElementCount = this._charCount;
-                d.curElement = 0;
-                for (var _i = 0, _a = this.text; _i < _a.length; _i++) {
-                    var char = _a[_i];
-                    // Line feed
-                    if (char === "\n") {
-                        offset.x = 0;
-                        offset.y -= texture.lineHeight;
-                    }
-                    // Tabulation ?
-                    if (char === "\t") {
-                        var nextPos = charxpos + this._tabulationSize;
-                        nextPos = nextPos - (nextPos % this._tabulationSize);
-                        offset.x += (nextPos - charxpos) * texture.spaceWidth;
-                        charxpos = nextPos;
-                        continue;
-                    }
-                    if (char < " ") {
-                        continue;
-                    }
-                    this.updateInstanceDataPart(d, offset);
-                    var ci = texture.getChar(char);
-                    offset.x += ci.charWidth;
-                    d.topLeftUV = ci.topLeftUV;
-                    var suv = ci.bottomRightUV.subtract(ci.topLeftUV);
-                    d.sizeUV = suv;
-                    d.textureSize = new BABYLON.Vector2(ts.width, ts.height);
-                    d.color = this.defaultFontColor;
-                    d.superSampleFactor = superSampleFactor;
-                    ++d.curElement;
-                }
-            }
-            return true;
-        };
-        Text2D.prototype._updateCharCount = function () {
-            var count = 0;
-            for (var _i = 0, _a = this._text; _i < _a.length; _i++) {
-                var char = _a[_i];
-                if (char === "\r" || char === "\n" || char === "\t" || char < " ") {
-                    continue;
-                }
-                ++count;
-            }
-            this._charCount = count;
-        };
-        Text2D.prototype._useTextureAlpha = function () {
-            return this.fontTexture != null && this.fontTexture.hasAlpha;
-        };
-        Text2D.prototype._shouldUseAlphaFromTexture = function () {
-            return true;
-        };
-        Text2D.TEXT2D_MAINPARTID = 1;
-        __decorate([
-            BABYLON.modelLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 1, function (pi) { return Text2D.fontProperty = pi; }, false, true)
-        ], Text2D.prototype, "fontName", null);
-        __decorate([
-            BABYLON.dynamicLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 2, function (pi) { return Text2D.defaultFontColorProperty = pi; })
-        ], Text2D.prototype, "defaultFontColor", null);
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 3, function (pi) { return Text2D.textProperty = pi; }, false, true)
-        ], Text2D.prototype, "text", null);
-        __decorate([
-            BABYLON.instanceLevelProperty(BABYLON.RenderablePrim2D.RENDERABLEPRIM2D_PROPCOUNT + 4, function (pi) { return Text2D.sizeProperty = pi; })
-        ], Text2D.prototype, "size", null);
-        Text2D = __decorate([
-            BABYLON.className("Text2D", "BABYLON")
-        ], Text2D);
-        return Text2D;
-    }(BABYLON.RenderablePrim2D));
-    BABYLON.Text2D = Text2D;
-})(BABYLON || (BABYLON = {}));

+ 0 - 27
canvas2D/src/Engine/babylon.worldSpaceCanvas2dNode.js

@@ -1,27 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var BABYLON;
-(function (BABYLON) {
-    /**
-     * This is the class that is used to display a World Space Canvas into a 3D scene
-     */
-    var WorldSpaceCanvas2DNode = (function (_super) {
-        __extends(WorldSpaceCanvas2DNode, _super);
-        function WorldSpaceCanvas2DNode(name, scene, canvas) {
-            _super.call(this, name, scene);
-            this._canvas = canvas;
-        }
-        WorldSpaceCanvas2DNode.prototype.dispose = function () {
-            _super.prototype.dispose.call(this);
-            if (this._canvas) {
-                this._canvas.dispose();
-                this._canvas = null;
-            }
-        };
-        return WorldSpaceCanvas2DNode;
-    }(BABYLON.Mesh));
-    BABYLON.WorldSpaceCanvas2DNode = WorldSpaceCanvas2DNode;
-})(BABYLON || (BABYLON = {}));

+ 0 - 779
canvas2D/src/GUI/babylon.gui.UIElement.js

@@ -1,779 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var Command = (function () {
-        function Command(execute, canExecute) {
-            if (!execute) {
-                throw Error("At least an execute lambda must be given at Command creation time");
-            }
-            this._canExecuteChanged = null;
-            this._lastCanExecuteResult = null;
-            this.execute = execute;
-            this.canExecute = canExecute;
-        }
-        Command.prototype.canExecute = function (parameter) {
-            var res = true;
-            if (this._canExecute) {
-                res = this._canExecute(parameter);
-            }
-            if (res !== this._lastCanExecuteResult) {
-                if (this._canExecuteChanged && this._canExecuteChanged.hasObservers()) {
-                    this._canExecuteChanged.notifyObservers(null);
-                }
-                this._lastCanExecuteResult = res;
-            }
-            return res;
-        };
-        Command.prototype.execute = function (parameter) {
-            this._execute(parameter);
-        };
-        Object.defineProperty(Command.prototype, "canExecuteChanged", {
-            get: function () {
-                if (!this._canExecuteChanged) {
-                    this._canExecuteChanged = new BABYLON.Observable();
-                }
-                return this._canExecuteChanged;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return Command;
-    }());
-    BABYLON.Command = Command;
-    var UIElement = (function (_super) {
-        __extends(UIElement, _super);
-        function UIElement(settings) {
-            _super.call(this);
-            if (!settings) {
-                throw Error("A settings object must be passed with at least either a parent or owner parameter");
-            }
-            var type = BABYLON.Tools.getFullClassName(this);
-            this._ownerWindow = null;
-            this._parent = null;
-            this._visualPlaceholder = null;
-            this._visualTemplateRoot = null;
-            this._visualChildrenPlaceholder = null;
-            this._hierarchyDepth = 0;
-            this._style = (settings.styleName != null) ? UIElementStyleManager.getStyle(type, settings.styleName) : null;
-            this._flags = 0;
-            this._id = (settings.id != null) ? settings.id : null;
-            this._uid = null;
-            this._width = (settings.width != null) ? settings.width : null;
-            this._height = (settings.height != null) ? settings.height : null;
-            this._minWidth = (settings.minWidth != null) ? settings.minWidth : 0;
-            this._minHeight = (settings.minHeight != null) ? settings.minHeight : 0;
-            this._maxWidth = (settings.maxWidth != null) ? settings.maxWidth : Number.MAX_VALUE;
-            this._maxHeight = (settings.maxHeight != null) ? settings.maxHeight : Number.MAX_VALUE;
-            this._margin = null;
-            this._padding = null;
-            this._marginAlignment = null;
-            this._isEnabled = true;
-            this._isFocused = false;
-            this._isMouseOver = false;
-            // Default Margin Alignment for UIElement is stretch for horizontal/vertical and not left/bottom (which is the default for Canvas2D Primitives)
-            //this.marginAlignment.horizontal = PrimitiveAlignment.AlignStretch;
-            //this.marginAlignment.vertical   = PrimitiveAlignment.AlignStretch;
-            // Set the layout/margin stuffs
-            if (settings.marginTop) {
-                this.margin.setTop(settings.marginTop);
-            }
-            if (settings.marginLeft) {
-                this.margin.setLeft(settings.marginLeft);
-            }
-            if (settings.marginRight) {
-                this.margin.setRight(settings.marginRight);
-            }
-            if (settings.marginBottom) {
-                this.margin.setBottom(settings.marginBottom);
-            }
-            if (settings.margin) {
-                if (typeof settings.margin === "string") {
-                    this.margin.fromString(settings.margin);
-                }
-                else {
-                    this.margin.fromUniformPixels(settings.margin);
-                }
-            }
-            if (settings.marginHAlignment) {
-                this.marginAlignment.horizontal = settings.marginHAlignment;
-            }
-            if (settings.marginVAlignment) {
-                this.marginAlignment.vertical = settings.marginVAlignment;
-            }
-            if (settings.marginAlignment) {
-                this.marginAlignment.fromString(settings.marginAlignment);
-            }
-            if (settings.paddingTop) {
-                this.padding.setTop(settings.paddingTop);
-            }
-            if (settings.paddingLeft) {
-                this.padding.setLeft(settings.paddingLeft);
-            }
-            if (settings.paddingRight) {
-                this.padding.setRight(settings.paddingRight);
-            }
-            if (settings.paddingBottom) {
-                this.padding.setBottom(settings.paddingBottom);
-            }
-            if (settings.padding) {
-                this.padding.fromString(settings.padding);
-            }
-            this._assignTemplate(settings.templateName);
-            if (settings.parent != null) {
-                this._parent = settings.parent;
-                this._hierarchyDepth = this._parent._hierarchyDepth + 1;
-            }
-        }
-        UIElement.prototype.dispose = function () {
-            if (this.isDisposed) {
-                return false;
-            }
-            if (this._renderingTemplate) {
-                this._renderingTemplate.detach();
-                this._renderingTemplate = null;
-            }
-            _super.prototype.dispose.call(this);
-            // Don't set to null, it may upset somebody...
-            this.animations.splice(0);
-            return true;
-        };
-        /**
-         * Returns as a new array populated with the Animatable used by the primitive. Must be overloaded by derived primitives.
-         * Look at Sprite2D for more information
-         */
-        UIElement.prototype.getAnimatables = function () {
-            return new Array();
-        };
-        Object.defineProperty(UIElement.prototype, "ownerWindows", {
-            // TODO
-            // PROPERTIES
-            // Style
-            // Id
-            // Parent/Children
-            // ActualWidth/Height, MinWidth/Height, MaxWidth/Height,
-            // Alignment/Margin
-            // Visibility, IsVisible
-            // IsEnabled (is false, control is disabled, no interaction and a specific render state)
-            // CacheMode of Visual Elements
-            // Focusable/IsFocused
-            // IsPointerCaptured, CapturePointer, IsPointerDirectlyOver, IsPointerOver. De-correlate mouse, stylus, touch?
-            // ContextMenu
-            // Cursor
-            // DesiredSize
-            // IsInputEnable ?
-            // Opacity, OpacityMask ?
-            // SnapToDevicePixels
-            // Tag
-            // ToolTip
-            // METHODS
-            // BringIntoView (for scrollable content, to move the scroll to bring the given element visible in the parent's area)
-            // Capture/ReleaseCapture (mouse, touch, stylus)
-            // Focus
-            // PointFrom/ToScreen to translate coordinates
-            // EVENTS
-            // ContextMenuOpening/Closing/Changed
-            // DragEnter/LeaveOver, Drop
-            // Got/LostFocus
-            // IsEnabledChanged
-            // IsPointerOver/DirectlyOverChanged
-            // IsVisibleChanged
-            // KeyDown/Up
-            // LayoutUpdated ?
-            // Pointer related events
-            // SizeChanged
-            // ToolTipOpening/Closing
-            get: function () {
-                return this._ownerWindow;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "style", {
-            get: function () {
-                if (!this.style) {
-                    return UIElementStyleManager.DefaultStyleName;
-                }
-                return this._style.name;
-            },
-            set: function (value) {
-                if (this._style && (this._style.name === value)) {
-                    return;
-                }
-                var newStyle = null;
-                if (value) {
-                    newStyle = UIElementStyleManager.getStyle(BABYLON.Tools.getFullClassName(this), value);
-                    if (!newStyle) {
-                        throw Error("Couldn't find Style " + value + " for UIElement " + BABYLON.Tools.getFullClassName(this));
-                    }
-                }
-                if (this._style) {
-                    this._style.removeStyle(this);
-                }
-                if (newStyle) {
-                    newStyle.applyStyle(this);
-                }
-                this._style = newStyle;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "id", {
-            /**
-             * A string that identifies the UIElement.
-             * The id is optional and there's possible collision with other UIElement's id as the uniqueness is not supported.
-             */
-            get: function () {
-                return this._id;
-            },
-            set: function (value) {
-                if (this._id === value) {
-                    return;
-                }
-                this._id = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "uid", {
-            /**
-             * Return a unique id automatically generated.
-             * This property is mainly used for serialization to ensure a perfect way of identifying a UIElement
-             */
-            get: function () {
-                if (!this._uid) {
-                    this._uid = BABYLON.Tools.RandomId();
-                }
-                return this._uid;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "hierarchyDepth", {
-            get: function () {
-                return this._hierarchyDepth;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "parent", {
-            get: function () {
-                return this._parent;
-            },
-            set: function (value) {
-                this._parent = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "width", {
-            get: function () {
-                return this._width;
-            },
-            set: function (value) {
-                this._width = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "height", {
-            get: function () {
-                return this._height;
-            },
-            set: function (value) {
-                this._height = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "minWidth", {
-            get: function () {
-                return this._minWidth;
-            },
-            set: function (value) {
-                this._minWidth = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "minHheight", {
-            get: function () {
-                return this._minHeight;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "minHeight", {
-            set: function (value) {
-                this._minHeight = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "maxWidth", {
-            get: function () {
-                return this._maxWidth;
-            },
-            set: function (value) {
-                this._maxWidth = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "maxHeight", {
-            get: function () {
-                return this._maxHeight;
-            },
-            set: function (value) {
-                this._maxHeight = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "actualWidth", {
-            get: function () {
-                return this._actualWidth;
-            },
-            set: function (value) {
-                this._actualWidth = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "actualHeight", {
-            get: function () {
-                return this._actualHeight;
-            },
-            set: function (value) {
-                this._actualHeight = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "margin", {
-            get: function () {
-                var _this = this;
-                if (!this._margin) {
-                    this._margin = new BABYLON.PrimitiveThickness(function () {
-                        if (!_this.parent) {
-                            return null;
-                        }
-                        return _this.parent.margin;
-                    });
-                }
-                return this._margin;
-            },
-            set: function (value) {
-                this.margin.copyFrom(value);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "_hasMargin", {
-            get: function () {
-                return (this._margin !== null && !this._margin.isDefault) || (this._marginAlignment !== null && !this._marginAlignment.isDefault);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "padding", {
-            get: function () {
-                var _this = this;
-                if (!this._padding) {
-                    this._padding = new BABYLON.PrimitiveThickness(function () {
-                        if (!_this.parent) {
-                            return null;
-                        }
-                        return _this.parent.padding;
-                    });
-                }
-                return this._padding;
-            },
-            set: function (value) {
-                this.padding.copyFrom(value);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "_hasPadding", {
-            get: function () {
-                return this._padding !== null && !this._padding.isDefault;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "marginAlignment", {
-            get: function () {
-                if (!this._marginAlignment) {
-                    this._marginAlignment = new BABYLON.PrimitiveAlignment();
-                }
-                return this._marginAlignment;
-            },
-            set: function (value) {
-                this.marginAlignment.copyFrom(value);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "_hasMarginAlignment", {
-            /**
-             * Check if there a marginAlignment specified (non null and not default)
-             */
-            get: function () {
-                return (this._marginAlignment !== null && !this._marginAlignment.isDefault);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "isEnabled", {
-            get: function () {
-                return this._isEnabled;
-            },
-            set: function (value) {
-                this._isEnabled = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "isFocused", {
-            get: function () {
-                return this._isFocused;
-            },
-            set: function (value) {
-                this._isFocused = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "isMouseOver", {
-            get: function () {
-                return this._isMouseOver;
-            },
-            set: function (value) {
-                this._isMouseOver = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        /**
-         * Check if a given flag is set
-         * @param flag the flag value
-         * @return true if set, false otherwise
-         */
-        UIElement.prototype._isFlagSet = function (flag) {
-            return (this._flags & flag) !== 0;
-        };
-        /**
-         * Check if all given flags are set
-         * @param flags the flags ORed
-         * @return true if all the flags are set, false otherwise
-         */
-        UIElement.prototype._areAllFlagsSet = function (flags) {
-            return (this._flags & flags) === flags;
-        };
-        /**
-         * Check if at least one flag of the given flags is set
-         * @param flags the flags ORed
-         * @return true if at least one flag is set, false otherwise
-         */
-        UIElement.prototype._areSomeFlagsSet = function (flags) {
-            return (this._flags & flags) !== 0;
-        };
-        /**
-         * Clear the given flags
-         * @param flags the flags to clear
-         */
-        UIElement.prototype._clearFlags = function (flags) {
-            this._flags &= ~flags;
-        };
-        /**
-         * Set the given flags to true state
-         * @param flags the flags ORed to set
-         * @return the flags state before this call
-         */
-        UIElement.prototype._setFlags = function (flags) {
-            var cur = this._flags;
-            this._flags |= flags;
-            return cur;
-        };
-        /**
-         * Change the state of the given flags
-         * @param flags the flags ORed to change
-         * @param state true to set them, false to clear them
-         */
-        UIElement.prototype._changeFlags = function (flags, state) {
-            if (state) {
-                this._flags |= flags;
-            }
-            else {
-                this._flags &= ~flags;
-            }
-        };
-        UIElement.prototype._assignTemplate = function (templateName) {
-            if (!templateName) {
-                templateName = UIElementRenderingTemplateManager.DefaultTemplateName;
-            }
-            var className = BABYLON.Tools.getFullClassName(this);
-            if (!className) {
-                throw Error("Couldn't access class name of this UIElement, you have to decorate the type with the className decorator");
-            }
-            var factory = UIElementRenderingTemplateManager.getRenderingTemplate(className, templateName);
-            if (!factory) {
-                throw Error("Couldn't get the renderingTemplate " + templateName + " of class " + className);
-            }
-            this._renderingTemplate = factory();
-            this._renderingTemplate.attach(this);
-        };
-        UIElement.prototype._createVisualTree = function () {
-            var parentPrim = this.ownerWindows.canvas;
-            if (this.parent) {
-                parentPrim = this.parent.visualChildrenPlaceholder;
-            }
-            this._visualPlaceholder = new BABYLON.Group2D({ parent: parentPrim, id: "GUI Visual Placeholder of " + this.id });
-            var p = this._visualPlaceholder;
-            p.addExternalData("_GUIOwnerElement_", this);
-            p.dataSource = this;
-            p.createSimpleDataBinding(BABYLON.Prim2DBase.widthProperty, "width", BABYLON.DataBinding.MODE_ONEWAY);
-            p.createSimpleDataBinding(BABYLON.Prim2DBase.heightProperty, "height", BABYLON.DataBinding.MODE_ONEWAY);
-            p.createSimpleDataBinding(BABYLON.Prim2DBase.actualWidthProperty, "actualWidth", BABYLON.DataBinding.MODE_ONEWAYTOSOURCE);
-            p.createSimpleDataBinding(BABYLON.Prim2DBase.actualHeightProperty, "actualHeight", BABYLON.DataBinding.MODE_ONEWAYTOSOURCE);
-            p.createSimpleDataBinding(BABYLON.Prim2DBase.marginProperty, "margin", BABYLON.DataBinding.MODE_ONEWAY);
-            p.createSimpleDataBinding(BABYLON.Prim2DBase.paddingProperty, "padding", BABYLON.DataBinding.MODE_ONEWAY);
-            p.createSimpleDataBinding(BABYLON.Prim2DBase.marginAlignmentProperty, "marginAlignment", BABYLON.DataBinding.MODE_ONEWAY);
-            this.createVisualTree();
-        };
-        UIElement.prototype._patchUIElement = function (ownerWindow, parent) {
-            if (ownerWindow) {
-                if (!this._ownerWindow) {
-                    ownerWindow._registerVisualToBuild(this);
-                }
-                this._ownerWindow = ownerWindow;
-            }
-            this._parent = parent;
-            if (parent) {
-                this._hierarchyDepth = parent.hierarchyDepth + 1;
-            }
-            var children = this._getChildren();
-            if (children) {
-                for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {
-                    var curChild = children_1[_i];
-                    curChild._patchUIElement(ownerWindow, this);
-                }
-            }
-        };
-        // Overload the SmartPropertyBase's method to provide the additional logic of returning the parent's dataSource if there's no dataSource specified at this level.
-        UIElement.prototype._getDataSource = function () {
-            var levelDS = _super.prototype._getDataSource.call(this);
-            if (levelDS != null) {
-                return levelDS;
-            }
-            var p = this.parent;
-            if (p != null) {
-                return p.dataSource;
-            }
-            return null;
-        };
-        UIElement.prototype.createVisualTree = function () {
-            var res = this._renderingTemplate.createVisualTree(this, this._visualPlaceholder);
-            this._visualTemplateRoot = res.root;
-            this._visualChildrenPlaceholder = res.contentPlaceholder;
-        };
-        Object.defineProperty(UIElement.prototype, "visualPlaceholder", {
-            get: function () {
-                return this._visualPlaceholder;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "visualTemplateRoot", {
-            get: function () {
-                return this._visualTemplateRoot;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "visualChildrenPlaceholder", {
-            get: function () {
-                return this._visualChildrenPlaceholder;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(UIElement.prototype, "_position", {
-            get: function () { return null; } // TODO use abstract keyword when TS 2.0 will be approved
-            ,
-            enumerable: true,
-            configurable: true
-        });
-        UIElement.UIELEMENT_PROPCOUNT = 15;
-        UIElement.flagVisualToBuild = 0x0000001; // set if the UIElement visual must be updated
-        __decorate([
-            BABYLON.dependencyProperty(0, function (pi) { return UIElement.parentProperty = pi; })
-        ], UIElement.prototype, "parent", null);
-        __decorate([
-            BABYLON.dependencyProperty(1, function (pi) { return UIElement.widthProperty = pi; })
-        ], UIElement.prototype, "width", null);
-        __decorate([
-            BABYLON.dependencyProperty(2, function (pi) { return UIElement.heightProperty = pi; })
-        ], UIElement.prototype, "height", null);
-        __decorate([
-            BABYLON.dependencyProperty(3, function (pi) { return UIElement.minWidthProperty = pi; })
-        ], UIElement.prototype, "minWidth", null);
-        __decorate([
-            BABYLON.dependencyProperty(4, function (pi) { return UIElement.minHeightProperty = pi; })
-        ], UIElement.prototype, "minHheight", null);
-        __decorate([
-            BABYLON.dependencyProperty(5, function (pi) { return UIElement.maxWidthProperty = pi; })
-        ], UIElement.prototype, "maxWidth", null);
-        __decorate([
-            BABYLON.dependencyProperty(6, function (pi) { return UIElement.maxHeightProperty = pi; })
-        ], UIElement.prototype, "maxHeight", null);
-        __decorate([
-            BABYLON.dependencyProperty(7, function (pi) { return UIElement.actualWidthProperty = pi; })
-        ], UIElement.prototype, "actualWidth", null);
-        __decorate([
-            BABYLON.dependencyProperty(8, function (pi) { return UIElement.actualHeightProperty = pi; })
-        ], UIElement.prototype, "actualHeight", null);
-        __decorate([
-            BABYLON.dynamicLevelProperty(9, function (pi) { return UIElement.marginProperty = pi; })
-        ], UIElement.prototype, "margin", null);
-        __decorate([
-            BABYLON.dynamicLevelProperty(10, function (pi) { return UIElement.paddingProperty = pi; })
-        ], UIElement.prototype, "padding", null);
-        __decorate([
-            BABYLON.dynamicLevelProperty(11, function (pi) { return UIElement.marginAlignmentProperty = pi; })
-        ], UIElement.prototype, "marginAlignment", null);
-        __decorate([
-            BABYLON.dynamicLevelProperty(12, function (pi) { return UIElement.isEnabledProperty = pi; })
-        ], UIElement.prototype, "isEnabled", null);
-        __decorate([
-            BABYLON.dynamicLevelProperty(13, function (pi) { return UIElement.isFocusedProperty = pi; })
-        ], UIElement.prototype, "isFocused", null);
-        __decorate([
-            BABYLON.dynamicLevelProperty(14, function (pi) { return UIElement.isMouseOverProperty = pi; })
-        ], UIElement.prototype, "isMouseOver", null);
-        return UIElement;
-    }(BABYLON.SmartPropertyBase));
-    BABYLON.UIElement = UIElement;
-    var UIElementStyle = (function () {
-        function UIElementStyle() {
-        }
-        Object.defineProperty(UIElementStyle.prototype, "name", {
-            get: function () { return null; } // TODO use abstract keyword when TS 2.0 will be approved
-            ,
-            enumerable: true,
-            configurable: true
-        });
-        return UIElementStyle;
-    }());
-    BABYLON.UIElementStyle = UIElementStyle;
-    var UIElementStyleManager = (function () {
-        function UIElementStyleManager() {
-        }
-        UIElementStyleManager.getStyle = function (uiElType, styleName) {
-            var styles = UIElementStyleManager.stylesByUIElement.get(uiElType);
-            if (!styles) {
-                throw Error("The type " + uiElType + " is unknown, no style were registered for it.");
-            }
-            var style = styles.get(styleName);
-            if (!style) {
-                throw Error("Couldn't find Template " + styleName + " of UIElement type " + uiElType);
-            }
-            return style;
-        };
-        UIElementStyleManager.registerStyle = function (uiElType, templateName, style) {
-            var templates = UIElementStyleManager.stylesByUIElement.getOrAddWithFactory(uiElType, function () { return new BABYLON.StringDictionary(); });
-            if (templates.contains(templateName)) {
-                templates[templateName] = style;
-            }
-            else {
-                templates.add(templateName, style);
-            }
-        };
-        Object.defineProperty(UIElementStyleManager, "DefaultStyleName", {
-            get: function () {
-                return UIElementStyleManager._defaultStyleName;
-            },
-            set: function (value) {
-                UIElementStyleManager._defaultStyleName = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        UIElementStyleManager.stylesByUIElement = new BABYLON.StringDictionary();
-        UIElementStyleManager._defaultStyleName = "Default";
-        return UIElementStyleManager;
-    }());
-    BABYLON.UIElementStyleManager = UIElementStyleManager;
-    var UIElementRenderingTemplateManager = (function () {
-        function UIElementRenderingTemplateManager() {
-        }
-        UIElementRenderingTemplateManager.getRenderingTemplate = function (uiElType, templateName) {
-            var templates = UIElementRenderingTemplateManager.renderingTemplatesByUIElement.get(uiElType);
-            if (!templates) {
-                throw Error("The type " + uiElType + " is unknown, no Rendering Template were registered for it.");
-            }
-            var templateFactory = templates.get(templateName);
-            if (!templateFactory) {
-                throw Error("Couldn't find Template " + templateName + " of UI Element type " + uiElType);
-            }
-            return templateFactory;
-        };
-        UIElementRenderingTemplateManager.registerRenderingTemplate = function (uiElType, templateName, factory) {
-            var templates = UIElementRenderingTemplateManager.renderingTemplatesByUIElement.getOrAddWithFactory(uiElType, function () { return new BABYLON.StringDictionary(); });
-            if (templates.contains(templateName)) {
-                templates[templateName] = factory;
-            }
-            else {
-                templates.add(templateName, factory);
-            }
-        };
-        Object.defineProperty(UIElementRenderingTemplateManager, "DefaultTemplateName", {
-            get: function () {
-                return UIElementRenderingTemplateManager._defaultTemplateName;
-            },
-            set: function (value) {
-                UIElementRenderingTemplateManager._defaultTemplateName = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        UIElementRenderingTemplateManager.renderingTemplatesByUIElement = new BABYLON.StringDictionary();
-        UIElementRenderingTemplateManager._defaultTemplateName = "Default";
-        return UIElementRenderingTemplateManager;
-    }());
-    BABYLON.UIElementRenderingTemplateManager = UIElementRenderingTemplateManager;
-    var UIElementRenderingTemplateBase = (function () {
-        function UIElementRenderingTemplateBase() {
-        }
-        UIElementRenderingTemplateBase.prototype.attach = function (owner) {
-            this._owner = owner;
-        };
-        UIElementRenderingTemplateBase.prototype.detach = function () {
-        };
-        Object.defineProperty(UIElementRenderingTemplateBase.prototype, "owner", {
-            get: function () {
-                return this._owner;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        return UIElementRenderingTemplateBase;
-    }());
-    BABYLON.UIElementRenderingTemplateBase = UIElementRenderingTemplateBase;
-    function registerWindowRenderingTemplate(uiElType, templateName, factory) {
-        return function () {
-            UIElementRenderingTemplateManager.registerRenderingTemplate(uiElType, templateName, factory);
-        };
-    }
-    BABYLON.registerWindowRenderingTemplate = registerWindowRenderingTemplate;
-})(BABYLON || (BABYLON = {}));

+ 0 - 191
canvas2D/src/GUI/babylon.gui.button.js

@@ -1,191 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var Button = (function (_super) {
-        __extends(Button, _super);
-        function Button(settings) {
-            if (!settings) {
-                settings = {};
-            }
-            _super.call(this, settings);
-            // For a button the default contentAlignemnt is center/center
-            if (settings.contentAlignment == null) {
-                this.contentAlignment.horizontal = BABYLON.PrimitiveAlignment.AlignCenter;
-                this.contentAlignment.vertical = BABYLON.PrimitiveAlignment.AlignCenter;
-            }
-            this.normalEnabledBackground = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#337AB7FF");
-            this.normalDisabledBackground = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#7BA9D0FF");
-            this.normalMouseOverBackground = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#286090FF");
-            this.normalPushedBackground = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#1E496EFF");
-            this.normalEnabledBorder = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#2E6DA4FF");
-            this.normalDisabledBorder = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#77A0C4FF");
-            this.normalMouseOverBorder = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#204D74FF");
-            this.normalPushedBorder = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#2E5D9EFF");
-            this.defaultEnabledBackground = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#FFFFFFFF");
-            this.defaultDisabledBackground = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#FFFFFFFF");
-            this.defaultMouseOverBackground = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#E6E6E6FF");
-            this.defaultPushedBackground = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#D4D4D4FF");
-            this.defaultEnabledBorder = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#CCCCCCFF");
-            this.defaultDisabledBorder = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#DEDEDEFF");
-            this.defaultMouseOverBorder = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#ADADADFF");
-            this.defaultPushedBorder = BABYLON.Canvas2D.GetSolidColorBrushFromHex("#6C8EC5FF");
-        }
-        Object.defineProperty(Button.prototype, "isPushed", {
-            get: function () {
-                return this._isPushed;
-            },
-            set: function (value) {
-                this._isPushed = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Button.prototype, "isDefault", {
-            get: function () {
-                return this._isDefault;
-            },
-            set: function (value) {
-                this._isDefault = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Button.prototype, "isOutline", {
-            get: function () {
-                return this._isOutline;
-            },
-            set: function (value) {
-                this._isOutline = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Button.prototype, "clickObservable", {
-            get: function () {
-                if (!this._clickObservable) {
-                    this._clickObservable = new BABYLON.Observable();
-                }
-                return this._clickObservable;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Button.prototype._raiseClick = function () {
-            console.log("click");
-        };
-        Button.prototype.createVisualTree = function () {
-            var _this = this;
-            _super.prototype.createVisualTree.call(this);
-            var p = this._visualPlaceholder;
-            p.pointerEventObservable.add(function (e, s) {
-                // We reject an event coming from the placeholder because it means it's on an empty spot, so it's not valid.
-                if (e.relatedTarget === _this._visualPlaceholder) {
-                    return;
-                }
-                if (s.mask === BABYLON.PrimitivePointerInfo.PointerUp) {
-                    _this._raiseClick();
-                    _this.isPushed = false;
-                }
-                else if (s.mask === BABYLON.PrimitivePointerInfo.PointerDown) {
-                    _this.isPushed = true;
-                }
-            }, BABYLON.PrimitivePointerInfo.PointerUp | BABYLON.PrimitivePointerInfo.PointerDown);
-        };
-        Object.defineProperty(Button.prototype, "_position", {
-            get: function () {
-                return BABYLON.Vector2.Zero();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Button.BUTTON_PROPCOUNT = BABYLON.ContentControl.CONTENTCONTROL_PROPCOUNT + 3;
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.ContentControl.CONTROL_PROPCOUNT + 0, function (pi) { return Button.isPushedProperty = pi; })
-        ], Button.prototype, "isPushed", null);
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.ContentControl.CONTROL_PROPCOUNT + 1, function (pi) { return Button.isDefaultProperty = pi; })
-        ], Button.prototype, "isDefault", null);
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.ContentControl.CONTROL_PROPCOUNT + 2, function (pi) { return Button.isOutlineProperty = pi; })
-        ], Button.prototype, "isOutline", null);
-        Button = __decorate([
-            BABYLON.className("Button", "BABYLON")
-        ], Button);
-        return Button;
-    }(BABYLON.ContentControl));
-    BABYLON.Button = Button;
-    var DefaultButtonRenderingTemplate = (function (_super) {
-        __extends(DefaultButtonRenderingTemplate, _super);
-        function DefaultButtonRenderingTemplate() {
-            _super.apply(this, arguments);
-        }
-        DefaultButtonRenderingTemplate.prototype.createVisualTree = function (owner, visualPlaceholder) {
-            this._rect = new BABYLON.Rectangle2D({ parent: visualPlaceholder, fill: "#FF8080FF", border: "#FF8080FF", roundRadius: 10, borderThickness: 2 });
-            this.stateChange();
-            return { root: this._rect, contentPlaceholder: this._rect };
-        };
-        DefaultButtonRenderingTemplate.prototype.attach = function (owner) {
-            var _this = this;
-            _super.prototype.attach.call(this, owner);
-            this.owner.propertyChanged.add(function (e, s) { return _this.stateChange(); }, BABYLON.UIElement.isEnabledProperty.flagId |
-                BABYLON.UIElement.isFocusedProperty.flagId |
-                BABYLON.UIElement.isMouseOverProperty.flagId |
-                Button.isDefaultProperty.flagId |
-                Button.isOutlineProperty.flagId |
-                Button.isPushedProperty.flagId);
-        };
-        DefaultButtonRenderingTemplate.prototype.stateChange = function () {
-            var b = this.owner;
-            var bg = b.isDefault ? b.defaultEnabledBackground : b.normalEnabledBackground;
-            var bd = b.isDefault ? b.defaultEnabledBorder : b.normalEnabledBorder;
-            if (b.isPushed) {
-                if (b.isDefault) {
-                    bg = b.defaultPushedBackground;
-                    bd = b.defaultPushedBorder;
-                }
-                else {
-                    bg = b.normalPushedBackground;
-                    bd = b.normalPushedBorder;
-                }
-            }
-            else if (b.isMouseOver) {
-                console.log("MouseOver Style");
-                if (b.isDefault) {
-                    bg = b.defaultMouseOverBackground;
-                    bd = b.defaultMouseOverBorder;
-                }
-                else {
-                    bg = b.normalMouseOverBackground;
-                    bd = b.normalMouseOverBorder;
-                }
-            }
-            else if (!b.isEnabled) {
-                if (b.isDefault) {
-                    bg = b.defaultDisabledBackground;
-                    bd = b.defaultDisabledBorder;
-                }
-                else {
-                    bg = b.normalDisabledBackground;
-                    bd = b.normalDisabledBorder;
-                }
-            }
-            this._rect.fill = bg;
-            this._rect.border = bd;
-        };
-        DefaultButtonRenderingTemplate = __decorate([
-            BABYLON.registerWindowRenderingTemplate("BABYLON.Button", "Default", function () { return new DefaultButtonRenderingTemplate(); })
-        ], DefaultButtonRenderingTemplate);
-        return DefaultButtonRenderingTemplate;
-    }(BABYLON.UIElementRenderingTemplateBase));
-    BABYLON.DefaultButtonRenderingTemplate = DefaultButtonRenderingTemplate;
-})(BABYLON || (BABYLON = {}));

+ 0 - 212
canvas2D/src/GUI/babylon.gui.control.js

@@ -1,212 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var Control = (function (_super) {
-        __extends(Control, _super);
-        function Control(settings) {
-            _super.call(this, settings);
-        }
-        Object.defineProperty(Control.prototype, "background", {
-            get: function () {
-                if (!this._background) {
-                    this._background = new BABYLON.ObservableStringDictionary(false);
-                }
-                return this._background;
-            },
-            set: function (value) {
-                this.background.copyFrom(value);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Control.prototype, "border", {
-            get: function () {
-                return this._border;
-            },
-            set: function (value) {
-                this._border = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Control.prototype, "borderThickness", {
-            get: function () {
-                return this._borderThickness;
-            },
-            set: function (value) {
-                this._borderThickness = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Control.prototype, "fontName", {
-            get: function () {
-                return this._fontName;
-            },
-            set: function (value) {
-                this._fontName = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Control.prototype, "foreground", {
-            get: function () {
-                return this._foreground;
-            },
-            set: function (value) {
-                this._foreground = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Control.CONTROL_PROPCOUNT = BABYLON.UIElement.UIELEMENT_PROPCOUNT + 5;
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.UIElement.UIELEMENT_PROPCOUNT + 0, function (pi) { return Control.backgroundProperty = pi; })
-        ], Control.prototype, "background", null);
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.UIElement.UIELEMENT_PROPCOUNT + 1, function (pi) { return Control.borderProperty = pi; })
-        ], Control.prototype, "border", null);
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.UIElement.UIELEMENT_PROPCOUNT + 2, function (pi) { return Control.borderThicknessProperty = pi; })
-        ], Control.prototype, "borderThickness", null);
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.UIElement.UIELEMENT_PROPCOUNT + 3, function (pi) { return Control.fontNameProperty = pi; })
-        ], Control.prototype, "fontName", null);
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.UIElement.UIELEMENT_PROPCOUNT + 4, function (pi) { return Control.foregroundProperty = pi; })
-        ], Control.prototype, "foreground", null);
-        Control = __decorate([
-            BABYLON.className("Control", "BABYLON")
-        ], Control);
-        return Control;
-    }(BABYLON.UIElement));
-    BABYLON.Control = Control;
-    var ContentControl = (function (_super) {
-        __extends(ContentControl, _super);
-        function ContentControl(settings) {
-            if (!settings) {
-                settings = {};
-            }
-            _super.call(this, settings);
-            if (settings.content != null) {
-                this._content = settings.content;
-            }
-            if (settings.contentAlignment != null) {
-                this.contentAlignment.fromString(settings.contentAlignment);
-            }
-        }
-        ContentControl.prototype.dispose = function () {
-            if (this.isDisposed) {
-                return false;
-            }
-            if (this.content && this.content.dispose) {
-                this.content.dispose();
-                this.content = null;
-            }
-            if (this.__contentUIElement) {
-                this.__contentUIElement.dispose();
-                this.__contentUIElement = null;
-            }
-            _super.prototype.dispose.call(this);
-            return true;
-        };
-        Object.defineProperty(ContentControl.prototype, "content", {
-            get: function () {
-                return this._content;
-            },
-            set: function (value) {
-                this._content = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ContentControl.prototype, "contentAlignment", {
-            get: function () {
-                if (!this._contentAlignment) {
-                    this._contentAlignment = new BABYLON.PrimitiveAlignment();
-                }
-                return this._contentAlignment;
-            },
-            set: function (value) {
-                this.contentAlignment.copyFrom(value);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ContentControl.prototype, "_hasContentAlignment", {
-            /**
-             * Check if there a contentAlignment specified (non null and not default)
-             */
-            get: function () {
-                return (this._contentAlignment !== null && !this._contentAlignment.isDefault);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ContentControl.prototype, "_contentUIElement", {
-            get: function () {
-                if (!this.__contentUIElement) {
-                    this._buildContentUIElement();
-                }
-                return this.__contentUIElement;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        ContentControl.prototype._buildContentUIElement = function () {
-            var c = this._content;
-            this.__contentUIElement = null;
-            // Already a UIElement
-            if (c instanceof BABYLON.UIElement) {
-                this.__contentUIElement = c;
-            }
-            else if ((typeof c === "string") || (typeof c === "boolean") || (typeof c === "number")) {
-                var l = new BABYLON.Label({ parent: this, id: "Content of " + this.id });
-                var binding = new BABYLON.DataBinding();
-                binding.propertyPathName = "content";
-                binding.stringFormat = function (v) { return ("" + v); };
-                binding.dataSource = this;
-                l.createDataBinding(BABYLON.Label.textProperty, binding);
-                binding = new BABYLON.DataBinding();
-                binding.propertyPathName = "contentAlignment";
-                binding.dataSource = this;
-                l.createDataBinding(BABYLON.Label.marginAlignmentProperty, binding);
-                this.__contentUIElement = l;
-            }
-            else {
-            }
-            if (this.__contentUIElement) {
-                this.__contentUIElement._patchUIElement(this.ownerWindows, this);
-            }
-        };
-        ContentControl.prototype._getChildren = function () {
-            var children = new Array();
-            if (this.content) {
-                children.push(this._contentUIElement);
-            }
-            return children;
-        };
-        ContentControl.CONTENTCONTROL_PROPCOUNT = Control.CONTROL_PROPCOUNT + 2;
-        __decorate([
-            BABYLON.dependencyProperty(Control.CONTROL_PROPCOUNT + 0, function (pi) { return ContentControl.contentProperty = pi; })
-        ], ContentControl.prototype, "content", null);
-        __decorate([
-            BABYLON.dependencyProperty(Control.CONTROL_PROPCOUNT + 1, function (pi) { return ContentControl.contentAlignmentProperty = pi; })
-        ], ContentControl.prototype, "contentAlignment", null);
-        ContentControl = __decorate([
-            BABYLON.className("ContentControl", "BABYLON")
-        ], ContentControl);
-        return ContentControl;
-    }(Control));
-    BABYLON.ContentControl = ContentControl;
-})(BABYLON || (BABYLON = {}));

+ 0 - 76
canvas2D/src/GUI/babylon.gui.label.js

@@ -1,76 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var Label = (function (_super) {
-        __extends(Label, _super);
-        function Label(settings) {
-            if (!settings) {
-                settings = {};
-            }
-            _super.call(this, settings);
-            if (settings.text != null) {
-                this.text = settings.text;
-            }
-        }
-        Object.defineProperty(Label.prototype, "_position", {
-            get: function () {
-                return BABYLON.Vector2.Zero();
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Label.prototype._getChildren = function () {
-            return Label._emptyArray;
-        };
-        Label.prototype.createVisualTree = function () {
-            _super.prototype.createVisualTree.call(this);
-            var p = this._visualChildrenPlaceholder;
-        };
-        Object.defineProperty(Label.prototype, "text", {
-            get: function () {
-                return this._text;
-            },
-            set: function (value) {
-                this._text = value;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Label._emptyArray = new Array();
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.Control.CONTROL_PROPCOUNT + 0, function (pi) { return Label.textProperty = pi; })
-        ], Label.prototype, "text", null);
-        Label = __decorate([
-            BABYLON.className("Label", "BABYLON")
-        ], Label);
-        return Label;
-    }(BABYLON.Control));
-    BABYLON.Label = Label;
-    var DefaultLabelRenderingTemplate = (function (_super) {
-        __extends(DefaultLabelRenderingTemplate, _super);
-        function DefaultLabelRenderingTemplate() {
-            _super.apply(this, arguments);
-        }
-        DefaultLabelRenderingTemplate.prototype.createVisualTree = function (owner, visualPlaceholder) {
-            var r = new BABYLON.Text2D("", { parent: visualPlaceholder });
-            r.createSimpleDataBinding(BABYLON.Text2D.textProperty, "text");
-            r.dataSource = owner;
-            return { root: r, contentPlaceholder: r };
-        };
-        DefaultLabelRenderingTemplate = __decorate([
-            BABYLON.registerWindowRenderingTemplate("BABYLON.Label", "Default", function () { return new DefaultLabelRenderingTemplate(); })
-        ], DefaultLabelRenderingTemplate);
-        return DefaultLabelRenderingTemplate;
-    }(BABYLON.UIElementRenderingTemplateBase));
-    BABYLON.DefaultLabelRenderingTemplate = DefaultLabelRenderingTemplate;
-})(BABYLON || (BABYLON = {}));

+ 0 - 195
canvas2D/src/GUI/babylon.gui.window.js

@@ -1,195 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
-    var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
-    if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
-    else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
-    return c > 3 && r && Object.defineProperty(target, key, r), r;
-};
-var BABYLON;
-(function (BABYLON) {
-    var Window = (function (_super) {
-        __extends(Window, _super);
-        function Window(scene, settings) {
-            var _this = this;
-            if (!settings) {
-                settings = {};
-            }
-            _super.call(this, settings);
-            if (!this._UIElementVisualToBuildList) {
-                this._UIElementVisualToBuildList = new Array();
-            }
-            // Patch the owner and also the parent property through the whole tree
-            this._patchUIElement(this, null);
-            // Screen Space UI
-            if (!settings.worldPosition && !settings.worldRotation) {
-                this._canvas = Window.getScreenCanvas(scene);
-                this._isWorldSpaceCanvas = false;
-                this._left = (settings.left != null) ? settings.left : 0;
-                this._bottom = (settings.bottom != null) ? settings.bottom : 0;
-            }
-            else {
-                var w = (settings.width == null) ? 100 : settings.width;
-                var h = (settings.height == null) ? 100 : settings.height;
-                var wpos = (settings.worldPosition == null) ? BABYLON.Vector3.Zero() : settings.worldPosition;
-                var wrot = (settings.worldRotation == null) ? BABYLON.Quaternion.Identity() : settings.worldRotation;
-                this._canvas = new BABYLON.WorldSpaceCanvas2D(scene, new BABYLON.Size(w, h), { id: "GUI Canvas", cachingStrategy: BABYLON.Canvas2D.CACHESTRATEGY_DONTCACHE, worldPosition: wpos, worldRotation: wrot });
-                this._isWorldSpaceCanvas = true;
-            }
-            this._renderObserver = this._canvas.renderObservable.add(function (e, s) { return _this._canvasPreRender(); }, BABYLON.Canvas2D.RENDEROBSERVABLE_PRE);
-            this._disposeObserver = this._canvas.disposeObservable.add(function (e, s) { return _this._canvasDisposed(); });
-            this._canvas.propertyChanged.add(function (e, s) {
-                if (e.propertyName === "overPrim") {
-                    _this._overPrimChanged(e.oldValue, e.newValue);
-                }
-            });
-            this._mouseOverUIElement = null;
-        }
-        Object.defineProperty(Window.prototype, "canvas", {
-            get: function () {
-                return this._canvas;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Window.prototype, "left", {
-            get: function () {
-                return this._left;
-            },
-            set: function (value) {
-                var old = new BABYLON.Vector2(this._left, this._bottom);
-                this._left = value;
-                this.onPropertyChanged("_position", old, this._position);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Window.prototype, "bottom", {
-            get: function () {
-                return this._bottom;
-            },
-            set: function (value) {
-                var old = new BABYLON.Vector2(this._left, this._bottom);
-                this._bottom = value;
-                this.onPropertyChanged("_position", old, this._position);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Window.prototype, "position", {
-            get: function () {
-                return this._position;
-            },
-            set: function (value) {
-                this._left = value.x;
-                this._bottom = value.y;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(Window.prototype, "_position", {
-            get: function () {
-                return new BABYLON.Vector2(this.left, this.bottom);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Window.prototype.createVisualTree = function () {
-            _super.prototype.createVisualTree.call(this);
-            var p = this._visualPlaceholder;
-            p.createSimpleDataBinding(BABYLON.Group2D.positionProperty, "position");
-        };
-        Window.prototype._registerVisualToBuild = function (uiel) {
-            if (uiel._isFlagSet(BABYLON.UIElement.flagVisualToBuild)) {
-                return;
-            }
-            if (!this._UIElementVisualToBuildList) {
-                this._UIElementVisualToBuildList = new Array();
-            }
-            this._UIElementVisualToBuildList.push(uiel);
-            uiel._setFlags(BABYLON.UIElement.flagVisualToBuild);
-        };
-        Window.prototype._overPrimChanged = function (oldPrim, newPrim) {
-            var curOverEl = this._mouseOverUIElement;
-            var newOverEl = null;
-            var curGroup = newPrim ? newPrim.traverseUp(function (p) { return p instanceof BABYLON.Group2D; }) : null;
-            while (curGroup) {
-                var uiel = curGroup.getExternalData("_GUIOwnerElement_");
-                if (uiel) {
-                    newOverEl = uiel;
-                    break;
-                }
-                curGroup = curGroup.parent ? curGroup.parent.traverseUp(function (p) { return p instanceof BABYLON.Group2D; }) : null;
-            }
-            if (curOverEl === newOverEl) {
-                return;
-            }
-            if (curOverEl) {
-                curOverEl.isMouseOver = false;
-            }
-            if (newOverEl) {
-                newOverEl.isMouseOver = true;
-            }
-            this._mouseOverUIElement = newOverEl;
-        };
-        Window.prototype._canvasPreRender = function () {
-            // Check if we have visual to create
-            if (this._UIElementVisualToBuildList.length > 0) {
-                // Sort the UI Element to get the highest (so lowest hierarchy depth) in the hierarchy tree first
-                var sortedElementList = this._UIElementVisualToBuildList.sort(function (a, b) { return a.hierarchyDepth - b.hierarchyDepth; });
-                for (var _i = 0, sortedElementList_1 = sortedElementList; _i < sortedElementList_1.length; _i++) {
-                    var el = sortedElementList_1[_i];
-                    el._createVisualTree();
-                }
-                this._UIElementVisualToBuildList.splice(0);
-            }
-        };
-        Window.prototype._canvasDisposed = function () {
-            this._canvas.disposeObservable.remove(this._disposeObserver);
-            this._canvas.renderObservable.remove(this._renderObserver);
-        };
-        Window.getScreenCanvas = function (scene) {
-            var canvas = BABYLON.Tools.first(Window._screenCanvasList, function (c) { return c.scene === scene; });
-            if (canvas) {
-                return canvas;
-            }
-            canvas = new BABYLON.ScreenSpaceCanvas2D(scene, { id: "GUI Canvas", cachingStrategy: BABYLON.Canvas2D.CACHESTRATEGY_DONTCACHE });
-            Window._screenCanvasList.push(canvas);
-            return canvas;
-        };
-        Window.WINDOW_PROPCOUNT = BABYLON.ContentControl.CONTENTCONTROL_PROPCOUNT + 2;
-        Window._screenCanvasList = new Array();
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.ContentControl.CONTENTCONTROL_PROPCOUNT + 0, function (pi) { return Window.leftProperty = pi; })
-        ], Window.prototype, "left", null);
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.ContentControl.CONTENTCONTROL_PROPCOUNT + 1, function (pi) { return Window.bottomProperty = pi; })
-        ], Window.prototype, "bottom", null);
-        __decorate([
-            BABYLON.dependencyProperty(BABYLON.ContentControl.CONTENTCONTROL_PROPCOUNT + 2, function (pi) { return Window.positionProperty = pi; })
-        ], Window.prototype, "position", null);
-        Window = __decorate([
-            BABYLON.className("Window", "BABYLON")
-        ], Window);
-        return Window;
-    }(BABYLON.ContentControl));
-    BABYLON.Window = Window;
-    var DefaultWindowRenderingTemplate = (function (_super) {
-        __extends(DefaultWindowRenderingTemplate, _super);
-        function DefaultWindowRenderingTemplate() {
-            _super.apply(this, arguments);
-        }
-        DefaultWindowRenderingTemplate.prototype.createVisualTree = function (owner, visualPlaceholder) {
-            var r = new BABYLON.Rectangle2D({ parent: visualPlaceholder, fill: "#808080FF" });
-            return { root: r, contentPlaceholder: r };
-        };
-        DefaultWindowRenderingTemplate = __decorate([
-            BABYLON.registerWindowRenderingTemplate("BABYLON.Window", "Default", function () { return new DefaultWindowRenderingTemplate(); })
-        ], DefaultWindowRenderingTemplate);
-        return DefaultWindowRenderingTemplate;
-    }(BABYLON.UIElementRenderingTemplateBase));
-    BABYLON.DefaultWindowRenderingTemplate = DefaultWindowRenderingTemplate;
-})(BABYLON || (BABYLON = {}));

+ 0 - 617
canvas2D/src/Tools/babylon.observable.js

@@ -1,617 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var BABYLON;
-(function (BABYLON) {
-    /**
-     * Custom type of the propertyChanged observable
-     */
-    var PropertyChangedInfo = (function () {
-        function PropertyChangedInfo() {
-        }
-        return PropertyChangedInfo;
-    }());
-    BABYLON.PropertyChangedInfo = PropertyChangedInfo;
-    /**
-     * The purpose of this class is to provide a base implementation of the IPropertyChanged interface for the user to avoid rewriting a code needlessly.
-     * Typical use of this class is to check for equality in a property set(), then call the onPropertyChanged method if values are different after the new value is set. The protected method will notify observers of the change.
-     * Remark: onPropertyChanged detects reentrant code and acts in a way to make sure everything is fine, fast and allocation friendly (when there no reentrant code which should be 99% of the time)
-     */
-    var PropertyChangedBase = (function () {
-        function PropertyChangedBase() {
-            this._propertyChanged = null;
-        }
-        /**
-         * Protected method to call when there's a change of value in a property set
-         * @param propName the name of the concerned property
-         * @param oldValue its old value
-         * @param newValue its new value
-         * @param mask an optional observable mask
-         */
-        PropertyChangedBase.prototype.onPropertyChanged = function (propName, oldValue, newValue, mask) {
-            if (this.propertyChanged.hasObservers()) {
-                var pci = PropertyChangedBase.calling ? new PropertyChangedInfo() : PropertyChangedBase.pci;
-                pci.oldValue = oldValue;
-                pci.newValue = newValue;
-                pci.propertyName = propName;
-                try {
-                    PropertyChangedBase.calling = true;
-                    this.propertyChanged.notifyObservers(pci, mask);
-                }
-                finally {
-                    PropertyChangedBase.calling = false;
-                }
-            }
-        };
-        Object.defineProperty(PropertyChangedBase.prototype, "propertyChanged", {
-            /**
-             * An observable that is triggered when a property (using of the XXXXLevelProperty decorator) has its value changing.
-             * You can add an observer that will be triggered only for a given set of Properties using the Mask feature of the Observable and the corresponding Prim2DPropInfo.flagid value (e.g. Prim2DBase.positionProperty.flagid|Prim2DBase.rotationProperty.flagid to be notified only about position or rotation change)
-             */
-            get: function () {
-                if (!this._propertyChanged) {
-                    this._propertyChanged = new BABYLON.Observable();
-                }
-                return this._propertyChanged;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        PropertyChangedBase.pci = new PropertyChangedInfo();
-        PropertyChangedBase.calling = false;
-        return PropertyChangedBase;
-    }());
-    BABYLON.PropertyChangedBase = PropertyChangedBase;
-    /**
-     * Class for the ObservableArray.onArrayChanged observable
-     */
-    var ArrayChanged = (function () {
-        function ArrayChanged() {
-            this.action = 0;
-            this.newItems = new Array();
-            this.removedItems = new Array();
-            this.changedItems = new Array();
-            this.newStartingIndex = -1;
-            this.removedStartingIndex = -1;
-        }
-        Object.defineProperty(ArrayChanged, "clearAction", {
-            /**
-             * The content of the array was totally cleared
-             */
-            get: function () {
-                return ArrayChanged._clearAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ArrayChanged, "newItemsAction", {
-            /**
-             * A new item was added, the newItems field contains the key/value pairs
-             */
-            get: function () {
-                return ArrayChanged._newItemsAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ArrayChanged, "removedItemsAction", {
-            /**
-             * An existing item was removed, the removedKey field contains its key
-             */
-            get: function () {
-                return ArrayChanged._removedItemsAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ArrayChanged, "changedItemAction", {
-            /**
-             * One or many items in the array were changed, the
-             */
-            get: function () {
-                return ArrayChanged._changedItemAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ArrayChanged, "replacedArrayAction", {
-            /**
-             * The array's content was totally changed
-             * Depending on the method that used this mode the ChangedArray object may contains more information
-             */
-            get: function () {
-                return ArrayChanged._replacedArrayAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(ArrayChanged, "lengthChangedAction", {
-            /**
-             * The length of the array changed
-             */
-            get: function () {
-                return ArrayChanged._lengthChangedAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        ArrayChanged.prototype.clear = function () {
-            this.action = 0;
-            this.newItems.splice(0);
-            this.removedItems.splice(0);
-            this.changedItems.splice(0);
-            this.removedStartingIndex = this.removedStartingIndex = this.changedStartingIndex = 0;
-        };
-        ArrayChanged._clearAction = 0x1;
-        ArrayChanged._newItemsAction = 0x2;
-        ArrayChanged._removedItemsAction = 0x4;
-        ArrayChanged._replacedArrayAction = 0x8;
-        ArrayChanged._lengthChangedAction = 0x10;
-        ArrayChanged._changedItemAction = 0x20;
-        return ArrayChanged;
-    }());
-    BABYLON.ArrayChanged = ArrayChanged;
-    var OAWatchedObjectChangedInfo = (function () {
-        function OAWatchedObjectChangedInfo() {
-        }
-        return OAWatchedObjectChangedInfo;
-    }());
-    BABYLON.OAWatchedObjectChangedInfo = OAWatchedObjectChangedInfo;
-    /**
-     * This class mimics the Javascript Array and TypeScript Array<T> classes, adding new features concerning the Observable pattern.
-     *
-     */
-    var ObservableArray = (function (_super) {
-        __extends(ObservableArray, _super);
-        /**
-         * Create an Observable Array.
-         * @param watchObjectsPropertyChange
-         * @param array and optional array that will be encapsulated by this ObservableArray instance. That's right, it's NOT a copy!
-         */
-        function ObservableArray(watchObjectsPropertyChange, array) {
-            _super.call(this);
-            this.dci = new ArrayChanged();
-            this._callingArrayChanged = false;
-            this._array = (array != null) ? array : new Array();
-            this.dci = new ArrayChanged();
-            this._callingArrayChanged = false;
-            this._arrayChanged = null;
-            this._callingWatchedObjectChanged = false;
-            this._watchObjectsPropertyChange = watchObjectsPropertyChange;
-            this._watchedObjectList = this._watchObjectsPropertyChange ? new BABYLON.StringDictionary() : null;
-            this._woci = new OAWatchedObjectChangedInfo();
-        }
-        Object.defineProperty(ObservableArray.prototype, "length", {
-            /**
-              * Gets or sets the length of the array. This is a number one higher than the highest element defined in an array.
-              */
-            get: function () {
-                return this._array.length;
-            },
-            set: function (value) {
-                if (value === this._array.length) {
-                    return;
-                }
-                var oldLength = this._array.length;
-                this._array.length = value;
-                this.onPropertyChanged("length", oldLength, this._array.length);
-            },
-            enumerable: true,
-            configurable: true
-        });
-        ObservableArray.prototype.getAt = function (index) {
-            return this._array[index];
-        };
-        ObservableArray.prototype.setAt = function (index, value) {
-            if (index < 0) {
-                return false;
-            }
-            var insertion = (index >= this._array.length) || this._array[index] === undefined;
-            var oldLength = 0;
-            if (insertion) {
-                oldLength = this._array.length;
-            }
-            else if (this._watchObjectsPropertyChange) {
-                this._removeWatchedElement(this._array[index]);
-            }
-            this._array[index] = value;
-            if (this._watchObjectsPropertyChange) {
-                this._addWatchedElement(value);
-            }
-            if (insertion) {
-                this.onPropertyChanged("length", oldLength, this._array.length);
-            }
-            var ac = this.getArrayChangedObject();
-            if (ac) {
-                ac.action = insertion ? ArrayChanged.newItemsAction : ArrayChanged.changedItemAction;
-                if (insertion) {
-                    ac.newItems.splice(0, ac.newItems.length, { index: index, value: value });
-                    ac.newStartingIndex = index;
-                    ac.changedItems.splice(0);
-                }
-                else {
-                    ac.newItems.splice(0);
-                    ac.changedStartingIndex = index;
-                    ac.changedItems.splice(0, ac.changedItems.length, { index: index, value: value });
-                }
-                ac.removedItems.splice(0);
-                ac.removedStartingIndex = -1;
-                this.callArrayChanged(ac);
-            }
-        };
-        /**
-          * Returns a string representation of an array.
-          */
-        ObservableArray.prototype.toString = function () {
-            return this._array.toString();
-        };
-        ObservableArray.prototype.toLocaleString = function () {
-            return this._array.toLocaleString();
-        };
-        /**
-          * Appends new elements to an array, and returns the new length of the array.
-          * @param items New elements of the Array.
-          */
-        ObservableArray.prototype.push = function () {
-            var items = [];
-            for (var _i = 0; _i < arguments.length; _i++) {
-                items[_i - 0] = arguments[_i];
-            }
-            var oldLength = this._array.length;
-            var n = (_a = this._array).push.apply(_a, items);
-            if (this._watchObjectsPropertyChange) {
-                this._addWatchedElement.apply(this, items);
-            }
-            this.onPropertyChanged("length", oldLength, this._array.length);
-            var ac = this.getArrayChangedObject();
-            if (ac) {
-                ac.action = ArrayChanged.newItemsAction;
-                ac.newStartingIndex = oldLength;
-                this.feedNotifArray.apply(this, [ac.newItems, oldLength].concat(items));
-                this.callArrayChanged(ac);
-            }
-            return n;
-            var _a;
-        };
-        /**
-          * Removes the last element from an array and returns it.
-          */
-        ObservableArray.prototype.pop = function () {
-            var firstRemove = this._array.length - 1;
-            var res = this._array.pop();
-            if (res && this._watchObjectsPropertyChange) {
-                this._removeWatchedElement(res);
-            }
-            if (firstRemove !== -1) {
-                this.onPropertyChanged("length", this._array.length + 1, this._array.length);
-                var ac = this.getArrayChangedObject();
-                if (ac) {
-                    ac.action = ArrayChanged.removedItemsAction;
-                    ac.removedStartingIndex = firstRemove;
-                    this.feedNotifArray(ac.removedItems, firstRemove, res);
-                }
-            }
-            return res;
-        };
-        /**
-          * Combines two or more arrays.
-          * @param items Additional items to add to the end of array1.
-          */
-        ObservableArray.prototype.concat = function () {
-            var items = [];
-            for (var _i = 0; _i < arguments.length; _i++) {
-                items[_i - 0] = arguments[_i];
-            }
-            return new ObservableArray(this._watchObjectsPropertyChange, (_a = this._array).concat.apply(_a, items));
-            var _a;
-        };
-        /**
-          * Adds all the elements of an array separated by the specified separator string.
-          * @param separator A string used to separate one element of an array from the next in the resulting String. If omitted, the array elements are separated with a comma.
-          */
-        ObservableArray.prototype.join = function (separator) {
-            return this._array.join(separator);
-        };
-        /**
-          * Reverses the elements in an Array.
-         * The arrayChanged action is
-          */
-        ObservableArray.prototype.reverse = function () {
-            var res = this._array.reverse();
-            var ac = this.getArrayChangedObject();
-            ac.action = ArrayChanged.replacedArrayAction;
-            return res;
-        };
-        /**
-          * Removes the first element from an array and returns it, shift all subsequents element one element before.
-         * The ArrayChange action is replacedArrayAction, the whole array changes and must be reevaluate as such, the removed element is in removedItems.
-         *
-          */
-        ObservableArray.prototype.shift = function () {
-            var oldLength = this._array.length;
-            var res = this._array.shift();
-            if (this._watchedObjectChanged && res != null) {
-                this._removeWatchedElement(res);
-            }
-            if (oldLength !== 0) {
-                this.onPropertyChanged("length", oldLength, this._array.length);
-                var ac = this.getArrayChangedObject();
-                if (ac) {
-                    ac.action = ArrayChanged.replacedArrayAction;
-                    ac.removedItems.splice(0, ac.removedItems.length, { index: 0, value: res });
-                    ac.newItems.splice(0);
-                    ac.changedItems.splice(0);
-                    ac.removedStartingIndex = 0;
-                    this.callArrayChanged(ac);
-                }
-            }
-            return res;
-        };
-        /**
-          * Returns a section of an array.
-          * @param start The beginning of the specified portion of the array.
-          * @param end The end of the specified portion of the array.
-          */
-        ObservableArray.prototype.slice = function (start, end) {
-            return new ObservableArray(this._watchObjectsPropertyChange, this._array.slice(start, end));
-        };
-        /**
-          * Sorts an array.
-          * @param compareFn The name of the function used to determine the order of the elements. If omitted, the elements are sorted in ascending, ASCII character order.
-         * On the contrary of the Javascript Array's implementation, this method returns nothing
-          */
-        ObservableArray.prototype.sort = function (compareFn) {
-            var oldLength = this._array.length;
-            this._array.sort(compareFn);
-            if (oldLength !== 0) {
-                var ac = this.getArrayChangedObject();
-                if (ac) {
-                    ac.clear();
-                    ac.action = ArrayChanged.replacedArrayAction;
-                    this.callArrayChanged(ac);
-                }
-            }
-        };
-        /**
-          * Removes elements from an array and, if necessary, inserts new elements in their place, returning the deleted elements.
-          * @param start The zero-based location in the array from which to start removing elements.
-          * @param deleteCount The number of elements to remove.
-          * @param items Elements to insert into the array in place of the deleted elements.
-          */
-        ObservableArray.prototype.splice = function (start, deleteCount) {
-            var items = [];
-            for (var _i = 2; _i < arguments.length; _i++) {
-                items[_i - 2] = arguments[_i];
-            }
-            var oldLength = this._array.length;
-            if (this._watchObjectsPropertyChange) {
-                for (var i = start; i < start + deleteCount; i++) {
-                    var val = this._array[i];
-                    if (this._watchObjectsPropertyChange && val != null) {
-                        this._removeWatchedElement(val);
-                    }
-                }
-            }
-            var res = (_a = this._array).splice.apply(_a, [start, deleteCount].concat(items));
-            if (this._watchObjectsPropertyChange) {
-                this._addWatchedElement.apply(this, items);
-            }
-            if (oldLength !== this._array.length) {
-                this.onPropertyChanged("length", oldLength, this._array.length);
-            }
-            var ac = this.getArrayChangedObject();
-            if (ac) {
-                ac.clear();
-                ac.action = ArrayChanged.replacedArrayAction;
-                this.callArrayChanged(ac);
-            }
-            return res;
-            var _a;
-        };
-        /**
-          * Inserts new elements at the start of an array.
-          * @param items  Elements to insert at the start of the Array.
-          * The ChangedArray action is replacedArrayAction, newItems contains the list of the added items
-          */
-        ObservableArray.prototype.unshift = function () {
-            var items = [];
-            for (var _i = 0; _i < arguments.length; _i++) {
-                items[_i - 0] = arguments[_i];
-            }
-            var oldLength = this._array.length;
-            var res = (_a = this._array).unshift.apply(_a, items);
-            if (this._watchObjectsPropertyChange) {
-                this._addWatchedElement.apply(this, items);
-            }
-            this.onPropertyChanged("length", oldLength, this._array.length);
-            var ac = this.getArrayChangedObject();
-            if (ac) {
-                ac.clear();
-                ac.action = ArrayChanged.replacedArrayAction;
-                ac.newStartingIndex = 0,
-                    this.feedNotifArray.apply(this, [ac.newItems, 0].concat(items));
-                this.callArrayChanged(ac);
-            }
-            return res;
-            var _a;
-        };
-        /**
-          * Returns the index of the first occurrence of a value in an array.
-          * @param searchElement The value to locate in the array.
-          * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at index 0.
-          */
-        ObservableArray.prototype.indexOf = function (searchElement, fromIndex) {
-            return this._array.indexOf(searchElement, fromIndex);
-        };
-        /**
-          * Returns the index of the last occurrence of a specified value in an array.
-          * @param searchElement The value to locate in the array.
-          * @param fromIndex The array index at which to begin the search. If fromIndex is omitted, the search starts at the last index in the array.
-          */
-        ObservableArray.prototype.lastIndexOf = function (searchElement, fromIndex) {
-            return this._array.lastIndexOf(searchElement, fromIndex);
-        };
-        /**
-          * Determines whether all the members of an array satisfy the specified test.
-          * @param callbackfn A function that accepts up to three arguments. The every method calls the callbackfn function for each element in array1 until the callbackfn returns false, or until the end of the array.
-          * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
-          */
-        ObservableArray.prototype.every = function (callbackfn, thisArg) {
-            return this._array.every(callbackfn, thisArg);
-        };
-        /**
-          * Determines whether the specified callback function returns true for any element of an array.
-          * @param callbackfn A function that accepts up to three arguments. The some method calls the callbackfn function for each element in array1 until the callbackfn returns true, or until the end of the array.
-          * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
-          */
-        ObservableArray.prototype.some = function (callbackfn, thisArg) {
-            return this._array.some(callbackfn, thisArg);
-        };
-        /**
-          * Performs the specified action for each element in an array.
-          * @param callbackfn  A function that accepts up to three arguments. forEach calls the callbackfn function one time for each element in the array.
-          * @param thisArg  An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
-          */
-        ObservableArray.prototype.forEach = function (callbackfn, thisArg) {
-            return this._array.forEach(callbackfn, thisArg);
-        };
-        /**
-          * Calls a defined callback function on each element of an array, and returns an array that contains the results.
-          * @param callbackfn A function that accepts up to three arguments. The map method calls the callbackfn function one time for each element in the array.
-          * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
-          */
-        ObservableArray.prototype.map = function (callbackfn, thisArg) {
-            return this._array.map(callbackfn, thisArg);
-        };
-        /**
-          * Returns the elements of an array that meet the condition specified in a callback function.
-          * @param callbackfn A function that accepts up to three arguments. The filter method calls the callbackfn function one time for each element in the array.
-          * @param thisArg An object to which the this keyword can refer in the callbackfn function. If thisArg is omitted, undefined is used as the this value.
-          */
-        ObservableArray.prototype.filter = function (callbackfn, thisArg) {
-            return this._array.filter(callbackfn, thisArg);
-        };
-        /**
-          * Calls the specified callback function for all the elements in an array. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
-          * @param callbackfn A function that accepts up to four arguments. The reduce method calls the callbackfn function one time for each element in the array.
-          * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
-          */
-        ObservableArray.prototype.reduce = function (callbackfn, initialValue) {
-            return this._array.reduce(callbackfn);
-        };
-        /**
-          * Calls the specified callback function for all the elements in an array, in descending order. The return value of the callback function is the accumulated result, and is provided as an argument in the next call to the callback function.
-          * @param callbackfn A function that accepts up to four arguments. The reduceRight method calls the callbackfn function one time for each element in the array.
-          * @param initialValue If initialValue is specified, it is used as the initial value to start the accumulation. The first call to the callbackfn function provides this value as an argument instead of an array value.
-          */
-        ObservableArray.prototype.reduceRight = function (callbackfn, initialValue) {
-            return this._array.reduceRight(callbackfn);
-        };
-        Object.defineProperty(ObservableArray.prototype, "arrayChanged", {
-            get: function () {
-                if (!this._arrayChanged) {
-                    this._arrayChanged = new BABYLON.Observable();
-                }
-                return this._arrayChanged;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        ObservableArray.prototype.getArrayChangedObject = function () {
-            if (this._arrayChanged && this._arrayChanged.hasObservers()) {
-                var ac = this._callingArrayChanged ? new ArrayChanged() : this.dci;
-                return ac;
-            }
-            return null;
-        };
-        ObservableArray.prototype.feedNotifArray = function (array, startindIndex) {
-            var items = [];
-            for (var _i = 2; _i < arguments.length; _i++) {
-                items[_i - 2] = arguments[_i];
-            }
-            array.splice(0);
-            for (var i = 0; i < items.length; i++) {
-                var value = this._array[i + startindIndex];
-                if (value !== undefined) {
-                    array.push({ index: i + startindIndex, value: value });
-                }
-            }
-        };
-        ObservableArray.prototype.callArrayChanged = function (ac) {
-            try {
-                this._callingArrayChanged = true;
-                this.arrayChanged.notifyObservers(ac, ac.action);
-            }
-            finally {
-                this._callingArrayChanged = false;
-            }
-        };
-        Object.defineProperty(ObservableArray.prototype, "watchedObjectChanged", {
-            get: function () {
-                if (!this._watchedObjectChanged) {
-                    this._watchedObjectChanged = new BABYLON.Observable();
-                }
-                return this._watchedObjectChanged;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        ObservableArray.prototype._addWatchedElement = function () {
-            var _this = this;
-            var items = [];
-            for (var _i = 0; _i < arguments.length; _i++) {
-                items[_i - 0] = arguments[_i];
-            }
-            var _loop_1 = function(curItem) {
-                if (curItem["propertyChanged"]) {
-                    var key_1 = curItem["__ObsArrayObjID__"];
-                    // The object may already be part of another ObsArray, so there already be a valid ID
-                    if (!key_1) {
-                        key_1 = BABYLON.Tools.RandomId();
-                        curItem["__ObsArrayObjID__"] = key_1;
-                    }
-                    this_1._watchedObjectList.add(key_1, curItem.propertyChanged.add(function (e, d) {
-                        _this.onWatchedObjectChanged(key_1, curItem, e);
-                    }));
-                }
-            };
-            var this_1 = this;
-            for (var _a = 0, items_1 = items; _a < items_1.length; _a++) {
-                var curItem = items_1[_a];
-                _loop_1(curItem);
-            }
-        };
-        ObservableArray.prototype._removeWatchedElement = function () {
-            var items = [];
-            for (var _i = 0; _i < arguments.length; _i++) {
-                items[_i - 0] = arguments[_i];
-            }
-            for (var _a = 0, items_2 = items; _a < items_2.length; _a++) {
-                var curItem = items_2[_a];
-                var key = curItem["__ObsArrayObjID__"];
-                if (key != null) {
-                    var observer = this._watchedObjectList.getAndRemove(key);
-                    curItem.propertyChanged.remove(observer);
-                }
-            }
-        };
-        ObservableArray.prototype.onWatchedObjectChanged = function (key, object, propChanged) {
-            if (this._watchedObjectChanged && this._watchedObjectChanged.hasObservers()) {
-                var woci = this._callingWatchedObjectChanged ? new OAWatchedObjectChangedInfo() : this._woci;
-                woci.object = object;
-                woci.propertyChanged = propChanged;
-                try {
-                    this._callingWatchedObjectChanged = true;
-                    this.watchedObjectChanged.notifyObservers(woci);
-                }
-                finally {
-                    this._callingWatchedObjectChanged = false;
-                }
-            }
-        };
-        return ObservableArray;
-    }(PropertyChangedBase));
-    BABYLON.ObservableArray = ObservableArray;
-})(BABYLON || (BABYLON = {}));

+ 0 - 296
canvas2D/src/Tools/babylon.stringDictionary.js

@@ -1,296 +0,0 @@
-var __extends = (this && this.__extends) || function (d, b) {
-    for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
-    function __() { this.constructor = d; }
-    d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
-};
-var BABYLON;
-(function (BABYLON) {
-    /**
-     * Class for the ObservableStringDictionary.onDictionaryChanged observable
-     */
-    var DictionaryChanged = (function () {
-        function DictionaryChanged() {
-        }
-        Object.defineProperty(DictionaryChanged, "clearAction", {
-            /**
-             * The content of the dictionary was totally cleared
-             */
-            get: function () {
-                return DictionaryChanged._clearAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(DictionaryChanged, "newItemAction", {
-            /**
-             * A new item was added, the newItem field contains the key/value pair
-             */
-            get: function () {
-                return DictionaryChanged._newItemAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(DictionaryChanged, "removedItemAction", {
-            /**
-             * An existing item was removed, the removedKey field contains its key
-             */
-            get: function () {
-                return DictionaryChanged._removedItemAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(DictionaryChanged, "itemValueChangedAction", {
-            /**
-             * An existing item had a value change, the changedItem field contains the key/value
-             */
-            get: function () {
-                return DictionaryChanged._itemValueChangedAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        Object.defineProperty(DictionaryChanged, "replacedAction", {
-            /**
-             * The dictionary's content was reset and replaced by the content of another dictionary.
-             * DictionaryChanged<T> contains no further information about this action
-             */
-            get: function () {
-                return DictionaryChanged._replacedAction;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        DictionaryChanged._clearAction = 0x1;
-        DictionaryChanged._newItemAction = 0x2;
-        DictionaryChanged._removedItemAction = 0x4;
-        DictionaryChanged._itemValueChangedAction = 0x8;
-        DictionaryChanged._replacedAction = 0x10;
-        return DictionaryChanged;
-    }());
-    BABYLON.DictionaryChanged = DictionaryChanged;
-    var OSDWatchedObjectChangedInfo = (function () {
-        function OSDWatchedObjectChangedInfo() {
-        }
-        return OSDWatchedObjectChangedInfo;
-    }());
-    BABYLON.OSDWatchedObjectChangedInfo = OSDWatchedObjectChangedInfo;
-    var ObservableStringDictionary = (function (_super) {
-        __extends(ObservableStringDictionary, _super);
-        function ObservableStringDictionary(watchObjectsPropertyChange) {
-            _super.call(this);
-            this._propertyChanged = null;
-            this._dictionaryChanged = null;
-            this.dci = new DictionaryChanged();
-            this._callingDicChanged = false;
-            this._watchedObjectChanged = null;
-            this._callingWatchedObjectChanged = false;
-            this._woci = new OSDWatchedObjectChangedInfo();
-            this._watchObjectsPropertyChange = watchObjectsPropertyChange;
-            this._watchedObjectList = this._watchObjectsPropertyChange ? new BABYLON.StringDictionary() : null;
-        }
-        /**
-         * This will clear this dictionary and copy the content from the 'source' one.
-         * If the T value is a custom object, it won't be copied/cloned, the same object will be used
-         * @param source the dictionary to take the content from and copy to this dictionary
-         */
-        ObservableStringDictionary.prototype.copyFrom = function (source) {
-            var _this = this;
-            var oldCount = this.count;
-            // Don't rely on this class' implementation for clear/add otherwise tons of notification will be thrown
-            _super.prototype.clear.call(this);
-            source.forEach(function (t, v) { return _this._add(t, v, false, _this._watchObjectsPropertyChange); });
-            this.onDictionaryChanged(DictionaryChanged.replacedAction, null, null, null);
-            this.onPropertyChanged("count", oldCount, this.count);
-        };
-        /**
-         * Get a value from its key or add it if it doesn't exist.
-         * This method will ensure you that a given key/data will be present in the dictionary.
-         * @param key the given key to get the matching value from
-         * @param factory the factory that will create the value if the key is not present in the dictionary.
-         * The factory will only be invoked if there's no data for the given key.
-         * @return the value corresponding to the key.
-         */
-        ObservableStringDictionary.prototype.getOrAddWithFactory = function (key, factory) {
-            var _this = this;
-            var val = _super.prototype.getOrAddWithFactory.call(this, key, function (k) {
-                var v = factory(key);
-                _this._add(key, v, true, _this._watchObjectsPropertyChange);
-                return v;
-            });
-            return val;
-        };
-        /**
-         * Add a new key and its corresponding value
-         * @param key the key to add
-         * @param value the value corresponding to the key
-         * @return true if the operation completed successfully, false if we couldn't insert the key/value because there was already this key in the dictionary
-         */
-        ObservableStringDictionary.prototype.add = function (key, value) {
-            return this._add(key, value, true, true);
-        };
-        ObservableStringDictionary.prototype.getAndRemove = function (key) {
-            var val = _super.prototype.get.call(this, key);
-            this._remove(key, true, val);
-            return val;
-        };
-        ObservableStringDictionary.prototype._add = function (key, value, fireNotif, registerWatcher) {
-            if (_super.prototype.add.call(this, key, value)) {
-                if (fireNotif) {
-                    this.onDictionaryChanged(DictionaryChanged.newItemAction, { key: key, value: value }, null, null);
-                    this.onPropertyChanged("count", this.count - 1, this.count);
-                }
-                if (registerWatcher) {
-                    this._addWatchedElement(key, value);
-                }
-                return true;
-            }
-            return false;
-        };
-        ObservableStringDictionary.prototype._addWatchedElement = function (key, el) {
-            var _this = this;
-            if (el["propertyChanged"]) {
-                this._watchedObjectList.add(key, el.propertyChanged.add(function (e, d) {
-                    _this.onWatchedObjectChanged(key, el, e);
-                }));
-            }
-        };
-        ObservableStringDictionary.prototype._removeWatchedElement = function (key, el) {
-            var observer = this._watchedObjectList.getAndRemove(key);
-            el.propertyChanged.remove(observer);
-        };
-        ObservableStringDictionary.prototype.set = function (key, value) {
-            var oldValue = this.get(key);
-            if (this._watchObjectsPropertyChange) {
-                this._removeWatchedElement(key, oldValue);
-            }
-            if (_super.prototype.set.call(this, key, value)) {
-                this.onDictionaryChanged(DictionaryChanged.itemValueChangedAction, null, null, { key: key, oldValue: oldValue, newValue: value });
-                this._addWatchedElement(key, value);
-                return true;
-            }
-            return false;
-        };
-        /**
-         * Remove a key/value from the dictionary.
-         * @param key the key to remove
-         * @return true if the item was successfully deleted, false if no item with such key exist in the dictionary
-         */
-        ObservableStringDictionary.prototype.remove = function (key) {
-            return this._remove(key, true);
-        };
-        ObservableStringDictionary.prototype._remove = function (key, fireNotif, element) {
-            if (!element) {
-                element = this.get(key);
-            }
-            if (!element) {
-                return false;
-            }
-            if (_super.prototype.remove.call(this, key) === undefined) {
-                return false;
-            }
-            this.onDictionaryChanged(DictionaryChanged.removedItemAction, null, key, null);
-            this.onPropertyChanged("count", this.count + 1, this.count);
-            if (this._watchObjectsPropertyChange) {
-                this._removeWatchedElement(key, element);
-            }
-            return true;
-        };
-        /**
-         * Clear the whole content of the dictionary
-         */
-        ObservableStringDictionary.prototype.clear = function () {
-            var _this = this;
-            this._watchedObjectList.forEach(function (k, v) {
-                var el = _this.get(k);
-                _this._removeWatchedElement(k, el);
-            });
-            this._watchedObjectList.clear();
-            var oldCount = this.count;
-            _super.prototype.clear.call(this);
-            this.onDictionaryChanged(DictionaryChanged.clearAction, null, null, null);
-            this.onPropertyChanged("count", oldCount, 0);
-        };
-        Object.defineProperty(ObservableStringDictionary.prototype, "propertyChanged", {
-            get: function () {
-                if (!this._propertyChanged) {
-                    this._propertyChanged = new BABYLON.Observable();
-                }
-                return this._propertyChanged;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        ObservableStringDictionary.prototype.onPropertyChanged = function (propName, oldValue, newValue, mask) {
-            if (this._propertyChanged && this._propertyChanged.hasObservers()) {
-                var pci = ObservableStringDictionary.callingPropChanged ? new BABYLON.PropertyChangedInfo() : ObservableStringDictionary.pci;
-                pci.oldValue = oldValue;
-                pci.newValue = newValue;
-                pci.propertyName = propName;
-                try {
-                    ObservableStringDictionary.callingPropChanged = true;
-                    this.propertyChanged.notifyObservers(pci, mask);
-                }
-                finally {
-                    ObservableStringDictionary.callingPropChanged = false;
-                }
-            }
-        };
-        Object.defineProperty(ObservableStringDictionary.prototype, "dictionaryChanged", {
-            get: function () {
-                if (!this._dictionaryChanged) {
-                    this._dictionaryChanged = new BABYLON.Observable();
-                }
-                return this._dictionaryChanged;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        ObservableStringDictionary.prototype.onDictionaryChanged = function (action, newItem, removedKey, changedItem) {
-            if (this._dictionaryChanged && this._dictionaryChanged.hasObservers()) {
-                var dci = this._callingDicChanged ? new DictionaryChanged() : this.dci;
-                dci.action = action;
-                dci.newItem = newItem;
-                dci.removedKey = removedKey;
-                dci.changedItem = changedItem;
-                try {
-                    this._callingDicChanged = true;
-                    this.dictionaryChanged.notifyObservers(dci, action);
-                }
-                finally {
-                    this._callingDicChanged = false;
-                }
-            }
-        };
-        Object.defineProperty(ObservableStringDictionary.prototype, "watchedObjectChanged", {
-            get: function () {
-                if (!this._watchedObjectChanged) {
-                    this._watchedObjectChanged = new BABYLON.Observable();
-                }
-                return this._watchedObjectChanged;
-            },
-            enumerable: true,
-            configurable: true
-        });
-        ObservableStringDictionary.prototype.onWatchedObjectChanged = function (key, object, propChanged) {
-            if (this._watchedObjectChanged && this._watchedObjectChanged.hasObservers()) {
-                var woci = this._callingWatchedObjectChanged ? new OSDWatchedObjectChangedInfo() : this._woci;
-                woci.key = key;
-                woci.object = object;
-                woci.propertyChanged = propChanged;
-                try {
-                    this._callingWatchedObjectChanged = true;
-                    this.watchedObjectChanged.notifyObservers(woci);
-                }
-                finally {
-                    this._callingWatchedObjectChanged = false;
-                }
-            }
-        };
-        ObservableStringDictionary.pci = new BABYLON.PropertyChangedInfo();
-        ObservableStringDictionary.callingPropChanged = false;
-        return ObservableStringDictionary;
-    }(BABYLON.StringDictionary));
-    BABYLON.ObservableStringDictionary = ObservableStringDictionary;
-})(BABYLON || (BABYLON = {}));

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 5256 - 5256
dist/preview release/babylon.d.ts


+ 1 - 1
dist/preview release/canvas2D/babylon.canvas2d.js

@@ -69,7 +69,7 @@ var BABYLON;
     BABYLON.PropertyChangedBase = PropertyChangedBase;
 })(BABYLON || (BABYLON = {}));
 
-//# sourceMappingURL=babylon.iPropertyChanged.js.map
+//# sourceMappingURL=babylon.IPropertyChanged.js.map
 
 var __extends = (this && this.__extends) || function (d, b) {
     for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];