@itwin/core-common
Version:
iTwin.js components common to frontend and backend
51 lines • 2.8 kB
TypeScript
/** @packageDocumentation
* @module Rendering
*/
import { ColorDef } from "./ColorDef";
/** Contains types related to display of hilited elements within a [[Viewport]].
* @public
*/
export declare namespace Hilite {
/** Describes the width of the outline applied to hilited geometry. The outline is drawn around the union of all hilited geometry and is visible behind non-hilited geometry.
* @see [[Hilite.Settings]]
*/
enum Silhouette {
/** No outline. */
None = 0,
/** 1-pixel-wide outline. */
Thin = 1,
/** 2-pixel-wide outline. */
Thick = 2
}
/**
* Describes how the hilite effect is applied to elements within a [[Viewport]].
* The hilite effect is applied to elements contained in the [[IModelConnection]]'s [[SelectionSet]].
* It is designed to draw attention to those elements. The effect is produced as follows:
* 1. All hilited elements are drawn as normal, except that their element color is mixed with the hilite color.
* 2. The union of the regions of the screen corresponding to hilited elements is computed.
* 3. A silhouette is drawn using the hilite color around the boundaries of the hilited region. This silhouette is visible behind other geometry.
* 4. The hilite color is mixed with the color of each pixel within the hilited region. This enables surfaces of hilited geometry to be visible behind other geometry.
*
* The Settings allow an application to customize how this effect is applied.
* @see [[Viewport.hilite]]
*/
class Settings {
/** The color that is used to draw the outline and which is mixed with element color. */
readonly color: ColorDef;
/** The ratio of hilite color to element color used when drawing unobscured portions of hilited geometry, in the range [0, 1].
* A ratio of 0.0 uses only the element color. A ratio of 1.0 uses only the hilite color. A ratio of 0.5 mixes the hilite color and element color evenly.
*/
readonly visibleRatio: number;
/** The ratio of hilite color to screen color used when drawing the hilited region overtop of the screen contents, in the range [0, 1]. */
readonly hiddenRatio: number;
/** The type of outline to be drawn around the boundaries of the hilited region. */
silhouette: Silhouette;
private static clamp;
constructor(color?: ColorDef, visibleRatio?: number, hiddenRatio?: number, silhouette?: Silhouette);
}
/** Compare two Settings objects for equivalence. */
function equalSettings(lhs: Settings, rhs: Settings): boolean;
/** Create a copy of a Settings object. */
function cloneSettings(settings: Settings): Settings;
}
//# sourceMappingURL=Hilite.d.ts.map