SpatialViewState Class
Defines a view of one or more SpatialModels. The list of viewed models is stored in the ModelSelector.
Extends
Extended by
Methods
Name | Description | |
---|---|---|
constructor(props: SpatialViewDefinitionProps, iModel: IModelConnection, arg3: CategorySelectorState, displayStyle: DisplayStyle3dState, modelSelector: ModelSelectorState): SpatialViewState | ||
addViewedModel(id: string): void | ||
attachToViewport(args: Viewport): void | See attachToViewport. | |
clearViewedModels(): void | ||
computeFitRange(options?: ComputeSpatialViewFitRangeOptions): Range3d | Compute a volume in world coordinates tightly encompassing the contents of the view. | |
detachFromViewport(): void | See detachFromViewport. | |
equals(other: this): boolean | Determine whether this ViewState exactly matches another. | |
forEachModel(func: (model: GeometricModelState) => void): void | Execute a function on each viewed model | |
getDisplayedExtents(): Range3d Protected | Get world-space viewed extents based on the iModel's project extents. | Deprecated |
getViewedExtents(): Range3d | Get the extents of this view in CoordSystem.World coordinates. | |
isSpatialView(): this is SpatialViewState | Returns true if this ViewState is-a SpatialViewState | |
removeViewedModel(id: string): void | ||
toJSON(): SpatialViewDefinitionProps | Convert to JSON representation. | |
toProps(): ViewStateProps | Serialize this ViewState as a set of properties that can be used to recreate it via createFromProps. | |
viewsModel(modelId: string): boolean | Returns true if this view displays the contents of a Model specified by Id. | |
createBlank(iModel: IModelConnection, origin: Readonly<WritableXYAndZ>, extents: Readonly<WritableXYAndZ>, rotation?: Matrix3d): SpatialViewState Static | Create a new blank SpatialViewState. | |
createFromProps(props: ViewStateProps, iModel: IModelConnection): SpatialViewState Static | Create a new ViewState object from a set of properties. |
Inherited methods
Name | Inherited from | Description |
---|---|---|
_updateMaxGlobalScopeFactor(): void Protected Inherited | ViewState3d | |
adjustAspectRatio(aspect: number): void Inherited | ViewState3d | Adjust the aspect ratio of this ViewState so it matches the supplied value. |
alignToGlobe(target: Point3d, transition?: boolean): ViewStatus Inherited | ViewState3d | For a geoLocated project, align the view with the global ellipsoid by rotating |
allow3dManipulations(): boolean Inherited | ViewState3d | Returns true if ViewTools are allowed to operate in three dimensions on this view. |
applyPose(val: ViewPose): this Inherited | ViewState3d | See applyPose. |
calcLensAngle(): Angle Inherited | ViewState3d | Calculate the lens angle formed by the current delta and focus distance |
calculateFocusCorners(): Point3d[] Inherited | ViewState3d | |
calculateFrustum(result?: Frustum): undefined | Frustum Inherited | ViewState3d | Calculate the world coordinate Frustum from the parameters of this ViewState. |
cartographicToRoot(cartographic: Cartographic, result?: Point3d): undefined | Point3d Inherited | ViewState3d | Convert a cartographic coordinate to a point in spatial coordinates. |
cartographicToRootFromGcs(cartographic: Cartographic, result?: Point3d): Promise<undefined | Point3d> Inherited | ViewState3d | Convert a cartographic coordinate to a point in spatial coordinates using the GCS reprojection. |
cartographicToRootUsingGcs(cartographic: Cartographic[]): Promise<undefined | Point3d[]> Inherited | ViewState3d | Convert cartographic coordinates to spatial coordinates using the GCS reprojection. |
centerEyePoint(backDistance?: number): void Inherited | ViewState3d | Place the eyepoint of the camera so it is aligned with the center of the view. |
centerFocusDistance(): void Inherited | ViewState3d | Center the focus distance of the camera halfway between the front plane and the back plane, keeping the eyepoint, |
clone(iModel?: IModelConnection): this Inherited | ViewState3d | Make an independent copy of this EntityState |
computeDisplayTransform(args: ComputeDisplayTransformArgs): undefined | Transform Inherited | ViewState3d | Compute the transform applied to a model or element at display time, if any. |
forEachTileTreeRef(func: (treeRef: TileTreeReference) => void): void Inherited | ViewState3d | Execute a function against each TileTreeReference associated with this view. |
getAspectRatio(): number Inherited | ViewState3d | Get the aspect ratio (width/height) of this view |
getAspectRatioSkew(): number Inherited | ViewState3d | Get the aspect ratio skew (x/y, usually 1.0) that is used to exaggerate the y axis of the view. |
getAuxiliaryCoordinateSystemId(): string Inherited | ViewState3d | Get the Id of the auxiliary coordinate system for this ViewState |
getBackDistance(): number Inherited | ViewState3d | Get the distance from the eyePoint to the back plane for this view. |
getCartographicHeight(point: Readonly<WritableXYAndZ>): undefined | number Inherited | ViewState3d | |
getCenter(result?: Point3d): Point3d Inherited | ViewState3d | Get the point at the geometric center of the view. |
getDisplayStyle3d(): DisplayStyle3dState Inherited | ViewState3d | The style that controls how the contents of the view are displayed. |
getEarthFocalPoint(): undefined | Point3d Inherited | ViewState3d | If the background map is displayed, return the point on the globe in directly front of the eye (or in center of view if camera off) |
getExtents(): Vector3d Inherited | ViewState3d | Get the extents of this view in CoordSystem.World coordinates. |
getEyeCartographicHeight(): undefined | number Inherited | ViewState3d | |
getEyeOrOrthographicViewPoint(): Point3d Inherited | ViewState3d | Obtain an "eye" point for this view. |
getEyePoint(): Point3d Inherited | ViewState3d | Get the current location of the eyePoint for camera in this view. |
getFocusDistance(): number Inherited | ViewState3d | Get the distance from the eyePoint to the focus plane for this view. |
getFrontDistance(): number Inherited | ViewState3d | Get the distance from the eyePoint to the front plane for this view. |
getGlobeRotation(): undefined | Matrix3d Inherited | ViewState3d | If the view is not of the project as determined by getIsViewingProject then return |
getGridOrientation(): GridOrientationType Inherited | ViewState3d | Get the grid settings for this view |
getGridSettings(vp: Viewport, origin: Point3d, rMatrix: Matrix3d, orientation: GridOrientationType): void Inherited | ViewState3d | Populate the given origin and rotation with information from the grid settings from the grid orientation. |
getGridSpacing(): Readonly<WritableXAndY> Inherited | ViewState3d | |
getGridsPerRef(): number Inherited | ViewState3d | |
getGroundElevation(): number Inherited | ViewState3d | Returns the ground elevation taken from the environment added with the global z position of this imodel. |
getGroundExtents(vp?: Viewport): Range3d Inherited | ViewState3d | Return the ground extents, which will originate either from the viewport frustum or the extents of the imodel. |
getIsViewingProject(): boolean Inherited | ViewState3d | Return true if the view is looking at the current iModel project extents or |
getLensAngle(): Angle Inherited | ViewState3d | Get the lens angle for this view. |
getModelAppearanceOverride(id: string): undefined | FeatureAppearance Inherited | ViewState3d | Query the symbology overrides applied to a model when rendered using this ViewState. |
getOrigin(): Point3d Inherited | ViewState3d | Get the origin of this view in CoordSystem.World coordinates. |
getRotation(): Matrix3d Inherited | ViewState3d | Get the 3x3 ortho-normal Matrix3d for this view. |
getSubCategoryOverride(id: string): undefined | SubCategoryOverride Inherited | ViewState3d | Query the symbology overrides applied to geometry belonging to a specific subcategory when rendered using this ViewState. |
getTargetPoint(result?: Point3d): Point3d Inherited | ViewState3d | Get the target point of the view. |
getUpVector(point: Point3d): Vector3d Inherited | ViewState3d | Compute the vector in the "up" direction of a specific point in world space. |
getViewClip(): undefined | ClipVector Inherited | ViewState3d | Get the clipping volume for this view, if defined |
getXVector(result?: Vector3d): Vector3d Inherited | ViewState3d | Get the unit vector that points in the view X (left-to-right) direction. |
getYVector(result?: Vector3d): Vector3d Inherited | ViewState3d | Get the unit vector that points in the view Y (bottom-to-top) direction. |
getZVector(result?: Vector3d): Vector3d Inherited | ViewState3d | Get the unit vector that points in the view Z (front-to-back) direction. |
globalViewTransition(): number Inherited | ViewState3d | A value representing the degree to which a view is viewing the globe as opposed to a specific location |
hasSameCoordinates(other: ViewState): boolean Inherited | ViewState3d | Determine whether this ViewState has the same coordinate system as another one. |
is2d(): this is ViewState2d Inherited | ViewState3d | Returns true if this ViewState is-a ViewState2d |
is3d(): this is ViewState3d Inherited | ViewState3d | See is3d. |
isEyePointAbove(elevation: number): boolean Inherited | ViewState3d | |
isEyePointGlobalView(eyePoint: Readonly<WritableXYAndZ>): boolean Inherited | ViewState3d | |
isSheetView(): this is SheetViewState Inherited | ViewState3d | Returns true if this ViewState is-a SheetViewState |
load(): Promise<void> Inherited | ViewState3d | Asynchronously load any required data for this ViewState from the backend. |
lookAt(args: LookAtPerspectiveArgs | LookAtOrthoArgs | LookAtUsingLensAngle): ViewStatus Inherited | ViewState3d | Setup view state for either perspective or orthographic view. |
lookAtGlobalLocation(eyeHeight: number, pitchAngleRadians: number0, location?: GlobalLocation, eyePoint?: Point3d): number Inherited | ViewState3d | Look at a global location, placing the camera's eye at the specified eye height above a viewed location. |
lookAtGlobalLocationFromGcs(eyeHeight: number, pitchAngleRadians: number0, location?: GlobalLocation, eyePoint?: Point3d): Promise<number> Inherited | ViewState3d | Look at a global location, placing the camera's eye at the specified eye height above a viewed location using the GCS. |
lookAtViewAlignedVolume(volume: Range3d, aspect?: number, options?: MarginOptions & OnViewExtentsError): void Inherited | ViewState3d | Look at a volume of space defined by a range in view local coordinates, keeping its current rotation. |
lookAtVolume(volume: Readonly<WritableLowAndHighXYZ> | Readonly<WritableLowAndHighXY>, aspect?: number, options?: MarginOptions & OnViewExtentsError): void Inherited | ViewState3d | Change the volume that this view displays, keeping its current rotation. |
minimumFrontDistance(): number Inherited | ViewState3d | |
moveCameraGlobal(fromPoint: Point3d, toPoint: Point3d): ViewStatus Inherited | ViewState3d | Move camera about the global ellipsoid. |
moveCameraLocal(distance: Vector3d): ViewStatus Inherited | ViewState3d | Move the camera relative to its current location by a distance in camera coordinates. |
moveCameraWorld(distance: Vector3d): ViewStatus Inherited | ViewState3d | Move the camera relative to its current location by a distance in world coordinates. |
resetExtentLimits(): void Inherited | ViewState3d | Resets the largest and smallest values allowed for the extents of this ViewState to their default values. |
rootToCartographic(root: Readonly<WritableXYAndZ>, result?: Cartographic): undefined | Cartographic Inherited | ViewState3d | Convert a point in spatial coordinates to a cartographic coordinate. |
rootToCartographicFromGcs(root: Readonly<WritableXYAndZ>, result?: Cartographic): Promise<undefined | Cartographic> Inherited | ViewState3d | Convert a point in spatial coordinates to a cartographic coordinate using the GCS reprojection. |
rootToCartographicUsingGcs(root: Readonly<WritableXYAndZ>[]): Promise<undefined | Cartographic[]> Inherited | ViewState3d | Convert spatial coordinates to cartographic coordinates using the GCS reprojection. |
rotateCameraLocal(angle: Angle, axis: Vector3d, aboutPt?: Point3d): ViewStatus Inherited | ViewState3d | Rotate the camera from its current location about an axis relative to its current orientation. |
rotateCameraWorld(angle: Angle, axis: Vector3d, aboutPt?: Point3d): ViewStatus Inherited | ViewState3d | Rotate the camera from its current location about an axis in world coordinates. |
savePose(): ViewPose3d Inherited | ViewState3d | Capture a copy of the viewed volume and camera parameters. |
setAllow3dManipulations(allow: boolean): void Inherited | ViewState3d | Set whether ViewTools are allowed to operate in 3 dimensions on this view. |
setAspectRatioSkew(val: number): void Inherited | ViewState3d | Set the aspect ratio skew (x/y) for this view. |
setAuxiliaryCoordinateSystem(acs?: AuxCoordSystemState): void Inherited | ViewState3d | Set or clear the AuxiliaryCoordinateSystem for this view. |
setCategorySelector(categories: CategorySelectorState): void Inherited | ViewState3d | Set the CategorySelector for this view. |
setCenter(center: Point3d): void Inherited | ViewState3d | set the center of this view to a new position. |
setDisplayStyle(style: DisplayStyleState): void Inherited | ViewState3d | |
setExtents(extents: Readonly<WritableXYAndZ>): void Inherited | ViewState3d | Set the extents of this view in CoordSystem.World coordinates. |
setEyePoint(pt: Readonly<WritableXYAndZ>): void Inherited | ViewState3d | Change the location of the eyePoint for the camera in this view. |
setFocusDistance(dist: number): void Inherited | ViewState3d | Set the focus distance for this view. |
setGridSettings(orientation: GridOrientationType, spacing: Point2d, gridsPerRef: number): void Inherited | ViewState3d | Set the grid settings for this view |
setLensAngle(angle: Angle): void Inherited | ViewState3d | Set the lens angle for this view. |
setOrigin(origin: Readonly<WritableXYAndZ>): void Inherited | ViewState3d | Set the origin of this view in CoordSystem.World coordinates. |
setRotation(rot: Matrix3d): void Inherited | ViewState3d | Change the rotation of the view. |
setRotationAboutPoint(rotation: Matrix3d, point?: Point3d): void Inherited | ViewState3d | Set the rotation of this ViewState to the supplied rotation, by rotating it about a point. |
setStandardGlobalRotation(id: StandardViewId): void Inherited | ViewState3d | Orient this view to one of the StandardView rotations, if the the view is not viewing the project then the |
setStandardRotation(id: StandardViewId): void Inherited | ViewState3d | Orient this view to one of the StandardView rotations. |
setupFromFrustum(frustum: Frustum, opts?: OnViewExtentsError): ViewStatus Inherited | ViewState3d | Initialize the origin, extents, and rotation from an existing Frustum |
setViewClip(clip?: ClipVector): void Inherited | ViewState3d | Set or clear the clipping volume for this view. |
supportsCamera(): boolean Inherited | ViewState3d | |
turnCameraOff(): void Inherited | ViewState3d | Turn the camera off for this view. |
verifyFocusPlane(): void Inherited | ViewState3d | Ensure the focus plane lies between the front and back planes. |
viewsCategory(id: string): boolean Inherited | ViewState3d | Determine whether the specified Category is displayed in this view |
calculateMaxDepth(delta: Vector3d, zVec: Vector3d): number Protected Static Inherited | ViewState3d |
Properties
Name | Type | Description | |
---|---|---|---|
className Accessor Static ReadOnly | string | The name of the BIS class associated with this class. | |
defaultExtentLimits Accessor ReadOnly | { max: number, min: number } | Returns the default extent limits for this ViewState. | |
modelSelector Accessor | ModelSelectorState | ||
onViewedModelsChanged Readonly | BeEvent<() => void> | An event raised when the set of models viewed by this view changes, only if the view is attached to a Viewport. |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
_cameraOn Protected Inherited | boolean | ViewState3d | True if the camera is valid. |
analysisStyle Accessor Inherited ReadOnly | undefined | AnalysisStyle | ViewState3d | See DisplayStyleSettings.analysisStyle. |
areAllTileTreesLoaded Accessor Inherited ReadOnly | boolean | ViewState3d | Returns true if all TileTrees required by this view have been loaded. Note that the map tile trees associated to the viewport rather than the view, to check the map tiles as well call areAreAllTileTreesLoaded. |
auxiliaryCoordinateSystem Accessor Inherited ReadOnly | AuxCoordSystemState | ViewState3d | get the auxiliary coordinate system state object for this ViewState. |
backgroundColor Accessor Inherited ReadOnly | ColorDef | ViewState3d | Get this view's background color. |
camera Readonly Inherited | Camera | ViewState3d | The camera used for this view. |
categorySelector Accessor Inherited | CategorySelectorState | ViewState3d | Selects the categories that are display by this ViewState. |
classFullName Accessor Static Inherited ReadOnly | string | ViewState3d | Get full BIS class name of this Entity in the form "SchemaName:ClassName". |
classFullName Readonly Inherited | string | ViewState3d | The full class name in the form "schema:class". |
className Accessor Inherited ReadOnly | string | ViewState3d | The name of the BIS class associated with this class. |
code Readonly Inherited | Code | ViewState3d | The Code for this element |
description Inherited | string | undefined | ViewState3d | |
details Accessor Inherited ReadOnly | ViewDetails3d | ViewState3d | Provides access to optional detail settings for this view. |
displayStyle Accessor Inherited | DisplayStyle3dState | ViewState3d | The style that controls how the contents of the view are displayed. |
extentLimits Accessor Inherited | ExtentLimits | ViewState3d | Get or set the largest and smallest values allowed for the extents for this ViewState The default limits vary based on the type of view: - Spatial and drawing view extents cannot exceed the diameter of the earth. - Sheet view extents cannot exceed ten times the paper size of the sheet. Explicitly setting the extent limits overrides the default limits. |
extents Readonly Inherited | Vector3d | ViewState3d | The extent of the view frustum. |
federationGuid Readonly Inherited | string | undefined | ViewState3d | A FederationGuid assigned to this element by some other federated database |
forceMinFrontDist Inherited | number | ViewState3d | Minimum distance for front plane |
globalScopeFactor Accessor Inherited ReadOnly | number | ViewState3d | A value that represents the global scope of the view -- a value greater than one indicates that the scope of this view is global. |
id Readonly Inherited | string | ViewState3d | The Id of this Entity. |
iModel Readonly Inherited | IModelConnection | ViewState3d | The iModel from which this Entity was loaded |
isAttachedToViewport Accessor Inherited ReadOnly | boolean | ViewState3d | Returns whether this view is currently being displayed by a Viewport. |
isCameraOn Accessor Inherited ReadOnly | boolean | ViewState3d | |
isCameraValid Accessor Inherited ReadOnly | boolean | ViewState3d | Determine whether the camera is valid for this view |
isGlobalView Accessor Inherited ReadOnly | boolean | ViewState3d | |
isPrivate Inherited | boolean | undefined | ViewState3d | |
jsonProperties Readonly Inherited | { T } | ViewState3d | Optional json properties of this Entity. |
model Readonly Inherited | string | ViewState3d | The ModelId of the Model containing this element |
modelDisplayTransformProvider Accessor Inherited | undefined | ModelDisplayTransformProvider | ViewState3d | An object that can provide per-model transforms to be applied at display time. |
name Accessor Inherited ReadOnly | string | ViewState3d | Get the name of the ViewDefinition from which this ViewState originated. |
onDisplayStyleChanged Readonly Inherited | BeEvent<(newStyle: DisplayStyleState) => void> | ViewState3d | An event raised just before assignment to the displayStyle property, only if the view is attached to a Viewport. |
onModelDisplayTransformProviderChanged Readonly Inherited | BeEvent<(newProvider: ModelDisplayTransformProvider) => void> | ViewState3d | Event raised just before assignment to the modelDisplayTransformProvider property, only if the view is attached to a Viewport. |
onViewedCategoriesChanged Readonly Inherited | BeEvent<() => void> | ViewState3d | An event raised when the set of categories viewed by this view changes, only if the view is attached to a Viewport. |
origin Readonly Inherited | Point3d | ViewState3d | The lower left back corner of the view frustum. |
parent Readonly Inherited | RelatedElement | undefined | ViewState3d | The parent Element of this, or undefined if no parent. |
rotation Readonly Inherited | Matrix3d | ViewState3d | Rotation of the view frustum. |
scheduleScript Accessor Inherited ReadOnly | undefined | RenderSchedule.Script | ViewState3d | The RenderSchedule.Script that animates the contents of the view, if any. |
schemaName Accessor Static Inherited ReadOnly | string | ViewState3d | The name of the BIS schema for this class. |
userLabel Readonly Inherited | string | undefined | ViewState3d | A user-assigned label for this element. |
viewFlags Accessor Inherited | ViewFlags | ViewState3d | Flags controlling various aspects of this view's DisplayStyleState. |
Defined in
Last Updated: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.