build/browser/index.js
/**
     * Converts from a mode, k, or wireFrame option specification to a GeometryMode.
     * @hidden
     */
Converts from a mode, k, or wireFrame option specification to a GeometryMode.
@hidden
Converts from a mode k or wireFrame option specification to a GeometryMode . @hidden
function geometryModeFromOptions(options, fallback, suppressWarnings) {
        if (fallback === void 0) { fallback = exports.GeometryMode.MESH; }
        if (suppressWarnings === void 0) { suppressWarnings = false; }
        if (isDefined(options)) {
            if (isDefined(options.mode)) {
                switch (options.mode) {
                    case exports.GeometryMode.POINT: return options.mode;
                    case exports.GeometryMode.WIRE: return options.mode;
                    case exports.GeometryMode.MESH: return options.mode;
                    case 'mesh': return exports.GeometryMode.MESH;
                    case 'wire': return exports.GeometryMode.WIRE;
                    case 'point': return exports.GeometryMode.POINT;
                    default: {
                        throw new Error("mode must be POINT = " + exports.GeometryMode.POINT + ", WIRE = " + exports.GeometryMode.WIRE + ", or MESH = " + exports.GeometryMode.MESH);
                    }
                }
            }
            else if (isDefined(options.wireFrame)) {
                if (!suppressWarnings) {
                    console.warn("wireFrame: boolean is deprecated. Please use mode: GeometryMode instead.");
                }
                return mustBeBoolean('wireFrame', options.wireFrame) ? exports.GeometryMode.WIRE : fallback;
            }
            else if (isDefined(options.k)) {
                if (!suppressWarnings) {
                    console.warn("k: SimplexMode is deprecated. Please use mode: GeometryMode instead.");
                }
                var k = mustBeInteger('k', options.k);
                switch (k) {
                    case SimplexMode.POINT: return exports.GeometryMode.POINT;
                    case SimplexMode.LINE: return exports.GeometryMode.WIRE;
                    case SimplexMode.TRIANGLE: return exports.GeometryMode.MESH;
                    default: {
                        throw new Error("k must be POINT = " + SimplexMode.POINT + ", LINE = " + SimplexMode.LINE + ", or TRIANGLE = " + SimplexMode.TRIANGLE);
                    }
                }
            }
            else {
                return fallback;
            }
        }
        else {
            return fallback;
        }
    }
function geometryModeFromOptions ( options , fallback , suppressWarnings ) { if ( fallback === void 0 ) { fallback = exports . GeometryMode . MESH ; } if ( suppressWarnings === void 0 ) { suppressWarnings = false ; } if ( isDefined ( options ) ) { if ( isDefined ( options . mode ) ) { switch ( options . mode ) { case exports . GeometryMode . POINT : return options . mode ; case exports . GeometryMode . WIRE : return options . mode ; case exports . GeometryMode . MESH : return options . mode ; case 'mesh' : return exports . GeometryMode . MESH ; case 'wire' : return exports . GeometryMode . WIRE ; case 'point' : return exports . GeometryMode . POINT ; default : { throw new Error ( "mode must be POINT = " + exports . GeometryMode . POINT + ", WIRE = " + exports . GeometryMode . WIRE + ", or MESH = " + exports . GeometryMode . MESH ) ; } } } else if ( isDefined ( options . wireFrame ) ) { if ( ! suppressWarnings ) { console . warn ( "wireFrame: boolean is deprecated. Please use mode: GeometryMode instead." ) ; } return mustBeBoolean ( 'wireFrame' , options . wireFrame ) ? exports . GeometryMode . WIRE : fallback ; } else if ( isDefined ( options . k ) ) { if ( ! suppressWarnings ) { console . warn ( "k: SimplexMode is deprecated. Please use mode: GeometryMode instead." ) ; } var k = mustBeInteger ( 'k' , options . k ) ; switch ( k ) { case SimplexMode . POINT : return exports . GeometryMode . POINT ; case SimplexMode . LINE : return exports . GeometryMode . WIRE ; case SimplexMode . TRIANGLE : return exports . GeometryMode . MESH ; default : { throw new Error ( "k must be POINT = " + SimplexMode . POINT + ", LINE = " + SimplexMode . LINE + ", or TRIANGLE = " + SimplexMode . TRIANGLE ) ; } } } else { return fallback ; } } else { return fallback ; } }
Converts from a mode, k, or wireFrame option specification to a GeometryMode.
Converts from a mode k or wireFrame option specification to a GeometryMode .
// In the absence of any hints to the contrary we assume...