UNPKG

@itwin/core-common

Version:

iTwin.js components common to frontend and backend

126 lines 5.35 kB
/** @packageDocumentation * @module Views */ import { BeEvent, Id64String } from "@itwin/core-bentley"; import { ClipVector, ClipVectorProps, XAndY } from "@itwin/core-geometry"; import { ModelClipGroupProps, ModelClipGroups } from "./ModelClipGroup"; /** Properties of a [[ViewDefinitionProps]] stored as JSON. * @see [[ViewDefinitionProps.jsonProperties]]. * @see [[ViewDetails3dProps]] for additional properties specific to 3d views. * @public * @extensions */ export interface ViewDetailsProps { /** Id of the aux coord system. Default: invalid. */ acs?: Id64String; /** Aspect ratio skew (x/y) used to exaggerate the y axis of the view. Default: 1.0. */ aspectSkew?: number; /** Grid orientation. Default: WorldXY. */ gridOrient?: GridOrientationType; /** Default: 10. */ gridPerRef?: number; /** Default: 1.0. */ gridSpaceX?: number; /** Default: same as gridSpaceX. */ gridSpaceY?: number; /** Describes the [ClipVector]($core-geometry) applied to the view. */ clip?: ClipVectorProps; } /** Describes the orientation of the grid displayed within a [Viewport]($frontend). * @public * @extensions */ export declare enum GridOrientationType { /** Oriented with the view. */ View = 0, /** Top */ WorldXY = 1, /** Right */ WorldYZ = 2, /** Front */ WorldXZ = 3, /** Oriented by the auxiliary coordinate system. */ AuxCoord = 4 } /** Properties of a [[ViewDefinition3dProps]] stored as JSON. * @see [[ViewDefinition3dProps.jsonProperties]]. * @public * @extensions */ export interface ViewDetails3dProps extends ViewDetailsProps { /** Whether viewing tools are prohibited from operating in 3 dimensions on this view. Default: false. */ disable3dManipulations?: boolean; /** Defines how to clip groups of models. */ modelClipGroups?: ModelClipGroupProps[]; } /** Encapsulates access to optional view details stored in JSON properties. * @see [[ViewDetailsProps]] for the JSON representation. * @see [ViewDefinition.details]($backend) and [ViewState.details]($frontend). * @public */ export declare class ViewDetails { /** @internal */ protected readonly _json: ViewDetailsProps; private _clipVector?; /** Event raised just before assignment to the [[clipVector]] property. */ readonly onClipVectorChanged: BeEvent<(newClip: ClipVector | undefined) => void>; /** @internal */ constructor(jsonProperties: { viewDetails?: ViewDetailsProps; }); /** The Id of the auxiliary coordinate system for the view. */ get auxiliaryCoordinateSystemId(): Id64String; set auxiliaryCoordinateSystemId(id: Id64String); /** Maximum aspect ratio skew. Apps can override this by changing its value. */ static maxSkew: number; /** The aspect ratio skew (x/y, usually 1.0) used to exaggerate the y axis of the view. */ get aspectRatioSkew(): number; set aspectRatioSkew(skew: number); /** The orientation of the view's grid. */ get gridOrientation(): GridOrientationType; set gridOrientation(orientation: GridOrientationType); /** The number of grids per ref for the view. */ get gridsPerRef(): number; set gridsPerRef(gridsPerRef: number); /** The grid spacing for the view. */ get gridSpacing(): XAndY; set gridSpacing(spacing: XAndY); /** Clipping volume for the view. * @note Do *not* modify the returned ClipVector. If you wish to change the ClipVector, clone the returned ClipVector, modify it as desired, and pass the clone back to the setter. */ get clipVector(): ClipVector | undefined; set clipVector(clip: ClipVector | undefined); /** Returns the internal JSON representation. This is *not* a copy. * @internal */ getJSON(): Readonly<ViewDetailsProps>; } /** Encapsulates access to optional 3d view details stored in JSON properties. * @see [[ViewDetails3dProps]] for the JSON representation. * @public */ export declare class ViewDetails3d extends ViewDetails { private _modelClipGroups?; private get _json3d(); /** Event raised when just before assignment to the [[modelClipGroups]] property. */ readonly onModelClipGroupsChanged: BeEvent<(newGroups: ModelClipGroups) => void>; /** @internal */ constructor(jsonProperties: { viewDetails?: ViewDetails3dProps; }); /** Controls whether viewing tools are allowed to operate on the view in 3 dimensions. */ get allow3dManipulations(): boolean; set allow3dManipulations(allow: boolean); /** Groups of models associated with [ClipVector]($core-geometry)s by which those models should be clipped. * If the view and the model both have a clip vector defined, geometry in the model will be clipped by the intersection of the two clip vectors. * [[ViewFlags.clipVolume]] has no effect on model clips, only the view clip - model clips are always applied. * @note Do **not** modify the returned object directly. Instead, clone it, modify the clone, and pass the clone to the property setter. */ get modelClipGroups(): ModelClipGroups; set modelClipGroups(groups: ModelClipGroups); /** Returns the internal JSON representation. This is *not* a copy. * @internal */ getJSON(): Readonly<ViewDetails3dProps>; } //# sourceMappingURL=ViewDetails.d.ts.map