import Cube from './Cube';
import Cylinder from './Cylinder';
import Sphere from './Sphere';
import Prism from './Prism';
import Union from './Union';
import Difference from './Difference';
import Intersection from './Intersection';
import ObjectsGroup from './ObjectsGroup';
import RepetitionObject from './RepetitionObject';
var ObjectFactory = /** @class */ (function () {
    function ObjectFactory() {
    }
    /**
     * Creates a new Primitive Object from its JSON
     * @param json object toJSON
     */
    ObjectFactory.newFromJSON = function (obj, scene) {
        switch (obj.type) {
            case Cube.typeName:
                return Cube.newFromJSON(obj);
            case Cylinder.typeName:
                return Cylinder.newFromJSON(obj);
            case Sphere.typeName:
                return Sphere.newFromJSON(obj);
            case Prism.typeName:
                return Prism.newFromJSON(obj);
            case ObjectsGroup.typeName:
                return ObjectsGroup.newFromJSON(obj, scene);
            case RepetitionObject.typeName:
                return RepetitionObject.newFromJSON(obj, scene);
            case Union.typeName:
                return Union.newFromJSON(obj, scene);
            case Difference.typeName:
                return Difference.newFromJSON(obj, scene);
            case Intersection.typeName:
                return Intersection.newFromJSON(obj, scene);
        }
        throw new Error('Unknown Primitive Object Type');
    };
    return ObjectFactory;
}());
export default ObjectFactory;
//# sourceMappingURL=ObjectFactory.js.map