@itwin/core-common
Version:
iTwin.js components common to frontend and backend
184 lines • 9.57 kB
TypeScript
/** @packageDocumentation
* @module DisplayStyles
*/
/** Specifies how the sizes of the individual points within a point cloud are computed.
* - "pixel": Each point is an exact number of pixels in diameter, as specified by [[PointCloudDisplaySettings.pixelSize]].
* - "voxel": Each point is the size of a "voxel" in meters, as specified by the [Tile]($frontend) to which the point belongs.
* @see [[PointCloudDisplaySettings.sizeMode]].
* @beta
*/
export type PointCloudSizeMode = "voxel" | "pixel";
/** Specifies the shape drawn for each individual point within a point cloud.
* - "round": Each point is drawn as a circle.
* - "square": Each point is drawn as a square.
* @see [[PointCloudDisplaySettings.shape]].
* @beta
*/
export type PointCloudShape = "square" | "round";
/** Specifies the Eye-Dome Lighting mode used for a point cloud.
* - "off": EDL is not calculated
* - "on": EDL is calculated using a single pass.
* - "full" EDL is calculated with full algorithm including optional filtering
* @see [[PointCloudDisplaySettings.edlMode]].
* @beta
*/
export type PointCloudEDLMode = "off" | "on" | "full";
/** The JSON representation of [[PointCloudDisplaySettings]].
* @beta
*/
export interface PointCloudDisplayProps {
/** See [[PointCloudDisplaySettings.sizeMode]]. */
sizeMode?: PointCloudSizeMode;
/** See [[PointCloudDisplaySettings.voxelScale]]. */
voxelScale?: number;
/** See [[PointCloudDisplaySettings.minPixelsPerVoxel]]. */
minPixelsPerVoxel?: number;
/** See [[PointCloudDisplaySettings.maxPixelsPerVoxel]]. */
maxPixelsPerVoxel?: number;
/** See [[PointCloudDisplaySettings.pixelSize]]. */
pixelSize?: number;
/** See [[PointCloudDisplaySettings.shape]]. */
shape?: PointCloudShape;
/** See [[PointCloudDisplaySettings.edlMode]]. */
edlMode?: PointCloudEDLMode;
/** See [[PointCloudDisplaySettings.edlStrength]]. */
edlStrength?: number;
/** See [[PointCloudDisplaySettings.edlRadius]]. */
edlRadius?: number;
/** See [[PointCloudDisplaySettings.edlFilter]]. */
edlFilter?: number;
/** See [[PointCloudDisplaySettings.edlMixWts1]]. */
edlMixWts1?: number;
/** See [[PointCloudDisplaySettings.edlMixWts2]]. */
edlMixWts2?: number;
/** See [[PointCloudDisplaySettings.edlMixWts4]]. */
edlMixWts4?: number;
}
/** The JSON representation of [[RealityModelDisplaySettings]].
* @beta
*/
export interface RealityModelDisplayProps {
/** See [[RealityModelDisplaySettings.pointCloud]]. */
pointCloud?: PointCloudDisplayProps;
/** See [[RealityModelDisplaySettings.overrideColorRatio]]. */
overrideColorRatio?: number;
}
/** Settings that control how a point cloud reality model is displayed within a [Viewport]($frontend).
* @note This is an immutable type - to modify its properties, use [[clone]].
* Eye-Dome Lighting (EDL) is a non-photorealistic, image-based shading technique that was designed to improve depth
* perception in scientific visualization. It is particularly useful for visualizing monochrome point cloud data, but
* also can be useful for point clouds with color information.
* @note EDL mode is ignored (off) if the view is not perspective (camera is off)
* @see [[RealityModelDisplaySettings.pointCloud]].
* @beta
*/
export declare class PointCloudDisplaySettings {
/** The shape drawn for each point in the cloud.
* Default: "round".
*/
readonly shape: PointCloudShape;
/** The method by which the size of each individual point is computed.
* Default: "voxel".
* @see [[pixelSize]] to configure the size for "pixel" mode.
* @see [[voxelScale]], [[minPixelsPerVoxel]], and [[maxPixelsPerVoxel]] to configure the size for "voxel" mode.
*/
readonly sizeMode: PointCloudSizeMode;
/** The radius of each point in pixels, when [[sizeMode]] is "pixel".
* The size is expected to be a positive integer. The maximum size will vary based on the graphics hardware in use, but typically is limited to 32 or 64 pixels.
* Default: 1
*/
readonly pixelSize: number;
/** A scale factor applied to the size of each point, when [[sizeMode]] is "voxel".
* The scale is expected to be a positive floating point number.
* Default: 1.0
*/
readonly voxelScale: number;
/** If [[sizeMode]] is "voxel", the minimum radius of each point in pixels. It is expected to be a positive integer no greater than [[maxPixelsPerVoxel]].
* Default: 2
*/
readonly minPixelsPerVoxel: number;
/** If [[sizeMode]] is "voxel", the maximum radius of each point in pixels. It is expected to be a positive integer no less than [[minPixelsPerVoxel]].
* Default: 20.
*/
readonly maxPixelsPerVoxel: number;
/** The mode for the Eye-Dome Lighting (EDL) effect.
* Default: "off"
* @note EDL mode is ignored (off) if the view is not perspective (camera is off)
*/
readonly edlMode: PointCloudEDLMode;
/** A strength value for the Eye Dome Lighting (EDL) effect.
* The strength is expected to be a positive floating point number.
* Default: 5.0
*/
readonly edlStrength: number;
/** A radius value for the Eye Dome Lighting (EDL) effect.
* The radius is expected to be a positive floating point number
* It is used to deterimine how far away in pixels to sample for depth change
* Default: 2.0
*/
readonly edlRadius: number;
/** A flag for whether or not to apply filtering pass in the Eye Dome Lighting (EDL) effect.
* It only applies if edlMode is "full"
* Default: 1.0
*/
readonly edlFilter?: number;
/** A weighting value to apply to the full image when combining it with the half and quarter sized ones
* It only applies if edlMode is "full"
* The strength is expected to be a floating point number between 0 and 1 inclusive.
* Default: 1.0
*/
readonly edlMixWts1?: number;
/** A weighting value to apply to the half sized image when combining it with the full and quarter sized ones
* It only applies if edlMode is "full"
* The strength is expected to be a floating point number between 0 and 1 inclusive.
* Default: 0.5
*/
readonly edlMixWts2?: number;
/** A weighting value to apply to the quarter sized image when combining it with the full and half sized ones
* It only applies if edlMode is "full"
* The strength is expected to be a floating point number between 0 and 1 inclusive.
* Default: 0.25
*/
readonly edlMixWts4?: number;
/** Settings with all properties initialized to their default values. */
static defaults: PointCloudDisplaySettings;
private constructor();
/** Create display settings from their JSON representation. If `props` is `undefined`, the default settings are returned. */
static fromJSON(props?: PointCloudDisplayProps): PointCloudDisplaySettings;
/** Convert these settings to their JSON representation. */
toJSON(): PointCloudDisplayProps | undefined;
/** Create a copy of these settings, identical except for any properties explicitly specified by `changedProps`. */
clone(changedProps: PointCloudDisplayProps): PointCloudDisplaySettings;
/** Returns true if these settings are identical to `other`. */
equals(other: PointCloudDisplaySettings): boolean;
}
/** Settings that control how a reality model - whether a [[ContextRealityModel]] or a persistent reality [Model]($backend) - is displayed within a [Viewport]($frontend).
* @see [[ContextRealityModel.displaySettings]] to apply these settings to a context reality model.
* @see [[DisplayStyleSettings.setRealityModelDisplaySettings]] to apply these settings to a persistent reality model.
* @note This is an immutable type - to modify its properties, use [[clone]].
* @beta
*/
export declare class RealityModelDisplaySettings {
/** If the reality model's color is overridden with another color, a ratio in [0..1] with which to mix the two colors together.
* A ratio of 0 uses only the reality model's color, a ratio of 1 uses only the override color, and a ratio of 0.5 mixes the two colors equally.
* The color may be overridden using [[FeatureOverrides]] such as those supplied by a [FeatureOverrideProvider]($frontend), or by applying a [[SpatialClassifier]].
* Default: 0.5
*/
readonly overrideColorRatio: number;
/** Settings that apply specifically to point cloud reality models.
* Default: [[PointCloudDisplaySettings.defaults]].
*/
readonly pointCloud: PointCloudDisplaySettings;
/** Settings with all properties initialized to their default values. */
static defaults: RealityModelDisplaySettings;
private constructor();
/** Create display settings from their JSON representation. If `props` is `undefined`, the default settings are returned. */
static fromJSON(props?: RealityModelDisplayProps): RealityModelDisplaySettings;
/** Convert these settings to their JSON representation, which is `undefined` if all of their properties match the default settings. */
toJSON(): RealityModelDisplayProps | undefined;
/** Returns true if these settings are identical to `other`. */
equals(other: RealityModelDisplaySettings): boolean;
/** Create a copy of these settings, identical except for any properties explicitly specified by `changedProps`. */
clone(changedProps: RealityModelDisplayProps): RealityModelDisplaySettings;
}
//# sourceMappingURL=RealityModelDisplaySettings.d.ts.map