@itwin/core-frontend
Version:
iTwin.js frontend components
38 lines • 1.75 kB
JavaScript
/*---------------------------------------------------------------------------------------------
* Copyright (c) Bentley Systems, Incorporated. All rights reserved.
* See LICENSE.md in the project root for license terms and full copyright notice.
*--------------------------------------------------------------------------------------------*/
/** @packageDocumentation
* @module Tiles
*/
Object.defineProperty(exports, "__esModule", { value: true });
exports.createDefaultViewFlagOverrides = createDefaultViewFlagOverrides;
const core_common_1 = require("@itwin/core-common");
/** Create ViewFlagOverrides suitable for most non-iModel tile trees (reality/map tiles).
* @param options Customize the overrides. Any properties left unspecified use the current view settings, except white-on-white reversal is always disabled.
*/
function createDefaultViewFlagOverrides(options) {
const noLights = undefined !== options.lighting ? !options.lighting : undefined;
const viewflags = core_common_1.ViewFlags.fromJSON({
renderMode: core_common_1.RenderMode.SmoothShade,
noCameraLights: noLights,
noSourceLights: noLights,
noSolarLight: noLights,
clipVol: options.clipVolume,
shadows: options.shadows,
noWhiteOnWhiteReversal: true,
thematicDisplay: false,
});
const ovrs = { ...viewflags };
if (undefined === options.clipVolume)
ovrs.clipVolume = undefined;
if (undefined === options.shadows)
ovrs.shadows = undefined;
if (undefined === options.lighting)
ovrs.lighting = undefined;
if (undefined === options.thematic)
ovrs.thematicDisplay = undefined;
return ovrs;
}
//# sourceMappingURL=ViewFlagOverrides.js.map
;