ViewState3d Class

Defines the state of a view of 3d models.

see ViewState Parameters

Extends

Extended by

Methods

Name Description
constructor(props: ViewDefinition3dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle3dState): ViewState3d    
allow3dManipulations(): boolean Returns true if ViewTools are allowed to operate in three dimensions on this view.  
calcLensAngle(): Angle Calculate the lens angle formed by the current delta and focus distance  
cartographicToRoot(cartographic: Cartographic, result?: Point3d): undefined | Point3d Convert a cartographic coordinate to a point in spatial space.  
cartographicToRootFromGcs(cartographic: Cartographic, result?: Point3d): Promise<undefined | Point3d> Convert a cartographic coordinate to a point in spatial space using the GCS reprojection.  
centerEyePoint(backDistance?: number): void Place the eyepoint of the camera so it is aligned with the center of the view.  
centerFocusDistance(): void Center the focus distance of the camera halfway between the front plane and the back plane, keeping the eyepoint,  
createAuxCoordSystem(acsName: string): AuxCoordSystemState    
decorate(context: DecorateContext): void Add view-specific decorations.  
getBackDistance(): number Get the distance from the eyePoint to the back plane for this view.  
getCartographicHeight(point: Readonly<WritableXYAndZ>): undefined | number    
getDisplayStyle3d(): DisplayStyle3dState The style that controls how the contents of the view are displayed.  
getExtents(): Vector3d Get the extents of this view in CoordSystem.World coordinates.  
getEyeCartographicHeight(): undefined | number    
getEyePoint(): Point3d Get the current location of the eyePoint for camera in this view.  
getFocusDistance(): number Get the distance from the eyePoint to the focus plane for this view.  
getFrontDistance(): number Get the distance from the eyePoint to the front plane for this view.  
getGroundElevation(): number Returns the ground elevation taken from the environment added with the global z position of this imodel.  
getGroundExtents(vp?: Viewport): Range3d Return the ground extents, which will originate either from the viewport frustum or the extents of the imodel.  
getLensAngle(): Angle Get the lens angle for this view.  
getOrigin(): Point3d Get the origin of this view in CoordSystem.World coordinates.  
getRotation(): Matrix3d Get the 3x3 ortho-normal Matrix3d for this view.  
getTargetPoint(result?: Point3d): Point3d Get the target point of the view.  
globalViewTransition(): number    
isEyePointAbove(elevation: number): boolean    
isEyePointGlobalView(eyePoint: Readonly<WritableXYAndZ>): boolean    
lookAt(eyePoint: Readonly<WritableXYAndZ>, targetPoint: Readonly<WritableXYAndZ>, upVector: Vector3d, newExtents?: Readonly<WritableXAndY>, frontDistance?: number, backDistance?: number, opts?: ViewChangeOptions): ViewStatus Position the camera for this view and point it at a new target point.  
lookAtGlobalLocation(eyeHeight: number, pitchAngleRadians: number = 0, location?: GlobalLocation, eyePoint?: Point3d): number Look at a global location, placing the camera's eye at the specified eye height above a viewed location.  
lookAtGlobalLocationFromGcs(eyeHeight: number, pitchAngleRadians: number = 0, location?: GlobalLocation, eyePoint?: Point3d): Promise<number> Look at a global location, placing the camera's eye at the specified eye height above a viewed location using the GCS.  
lookAtUsingLensAngle(eyePoint: Point3d, targetPoint: Point3d, upVector: Vector3d, fov: Angle, frontDistance?: number, backDistance?: number, opts?: ViewChangeOptions): ViewStatus Position the camera for this view and point it at a new target point, using a specified lens angle.  
minimumFrontDistance(): number    
moveCameraLocal(distance: Vector3d): ViewStatus Move the camera relative to its current location by a distance in camera coordinates.  
moveCameraWorld(distance: Vector3d): ViewStatus Move the camera relative to its current location by a distance in world coordinates.  
onRenderFrame(_viewport: Viewport): void This function is never called. Deprecated  
rootToCartographic(root: Readonly<WritableXYAndZ>, result?: Cartographic): undefined | Cartographic Convert a point in spatial space to a cartographic coordinate.  
rootToCartographicFromGcs(root: Readonly<WritableXYAndZ>, result?: Cartographic): Promise<undefined | Cartographic> Convert a point in spatial space to a cartographic coordinate using the GCS reprojection.  
rotateCameraLocal(angle: Angle, axis: Vector3d, aboutPt?: Point3d): ViewStatus Rotate the camera from its current location about an axis relative to its current orientation.  
rotateCameraWorld(angle: Angle, axis: Vector3d, aboutPt?: Point3d): ViewStatus Rotate the camera from its current location about an axis in world coordinates.  
setAllow3dManipulations(allow: boolean): void Set whether ViewTools are allowed to operate in 3 dimensions on this view.  
setExtents(extents: Readonly<WritableXYAndZ>): void Set the extents of this view in CoordSystem.World coordinates.  
setEyePoint(pt: Readonly<WritableXYAndZ>): void Change the location of the eyePoint for the camera in this view.  
setFocusDistance(dist: number): void Set the focus distance for this view.  
setLensAngle(angle: Angle): void Set the lens angle for this view.  
setOrigin(origin: Readonly<WritableXYAndZ>): void Set the origin of this view in CoordSystem.World coordinates.  
setRotation(rot: Matrix3d): void Change the rotation of the view.  
setupFromFrustum(frustum: Frustum, opts?: ViewChangeOptions): ViewStatus Initialize the origin, extents, and rotation from an existing Frustum  
supportsCamera(): boolean    
toJSON(): ViewDefinition3dProps Convert to JSON representation.  
turnCameraOff(): void Turn the camera off for this view.  
verifyFocusPlane(): void Ensure the focus plane lies between the front and back planes.  
calculateMaxDepth(delta: Vector3d, zVec: Vector3d): number ProtectedStatic    

Inherited methods

Name Inherited from Description
_updateMaxGlobalScopeFactor(): void Protected ViewState  
adjustAspectRatio(aspect: number): void ViewState Adjust the aspect ratio of this ViewState so it matches the supplied value.
calculateFocusCorners(): Point3d[] ViewState  
calculateFrustum(result?: Frustum): undefined | Frustum ViewState Calculate the world coordinate Frustum from the parameters of this ViewState.
clone(iModel?: IModelConnection): ViewState3d ViewState Make an independent copy of this EntityState
computeFitRange(): Range3d Abstract ViewState Compute a range in CoordSystem.World coordinates that tightly encloses the contents of this view.
equals(other: ViewState3d): boolean ViewState Determine whether this ViewState exactly matches another.
forEachModel(func: (model: GeometricModelState) => void): void Abstract ViewState Execute a function on each viewed model
getAspectRatio(): number ViewState Get the aspect ratio (width/height) of this view
getAspectRatioSkew(): number ViewState Get the aspect ratio skew (x/y, usually 1.0) that is used to exaggerate the y axis of the view.
getAuxiliaryCoordinateSystemId(): string ViewState Get the Id of the auxiliary coordinate system for this ViewState
getCenter(result?: Point3d): Point3d ViewState Get the point at the geometric center of the view.
getGridOrientation(): GridOrientationType ViewState Get the grid settings for this view
getGridSettings(vp: Viewport, origin: Point3d, rMatrix: Matrix3d, orientation: GridOrientationType): void ViewState Populate the given origin and rotation with information from the grid settings from the grid orientation.
getGridSpacing(): Readonly<WritableXAndY> ViewState  
getGridsPerRef(): number ViewState  
getModelAppearanceOverride(id: string): undefined | FeatureAppearance ViewState Query the symbology overrides applied to a model when rendered using this ViewState.
getModelDisplayTransform(modelId: string, baseTransform: Transform): Transform ViewState Obtain the transform with which the specified model will be displayed, accounting for this view's ModelDisplayTransformProvider.
getSubCategoryOverride(id: string): undefined | SubCategoryOverride ViewState Query the symbology overrides applied to geometry belonging to a specific subcategory when rendered using this ViewState.
getUpVector(point: Point3d): Vector3d ViewState  
getViewClip(): undefined | ClipVector ViewState Get the clipping volume for this view, if defined
getViewedExtents(): Range3d Abstract ViewState Get the extents of this view in CoordSystem.World coordinates.
getXVector(result?: Vector3d): Vector3d ViewState Get the unit vector that points in the view X (left-to-right) direction.
getYVector(result?: Vector3d): Vector3d ViewState Get the unit vector that points in the view Y (bottom-to-top) direction.
getZVector(result?: Vector3d): Vector3d ViewState Get the unit vector that points in the view Z (front-to-back) direction.
hasSameCoordinates(other: ViewState): boolean ViewState Determine whether this ViewState has the same coordinate system as another one.
is2d(): this is ViewState2d ViewState Returns true if this ViewState is-a ViewState2d
isCameraEnabled(): this is ViewState3d ViewState Returns true if this ViewState is-a ViewState3d with the camera currently on.
isSheetView(): this is SheetViewState ViewState Returns true if this ViewState is-a SheetViewState
isSpatialView(): this is SpatialViewState Abstract ViewState Returns true if this ViewState is-a SpatialViewState
load(): Promise<void> ViewState Asynchronously load any required data for this ViewState from the backend.
lookAtViewAlignedVolume(volume: Range3d, aspect?: number, options?: ViewChangeOptions): void ViewState 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?: ViewChangeOptions): void ViewState Change the volume that this view displays, keeping its current rotation.
resetExtentLimits(): void ViewState Resets the largest and smallest values allowed for the extents of this ViewState to their default values.
setAspectRatioSkew(val: number): void ViewState Set the aspect ratio skew (x/y) for this view.
setAuxiliaryCoordinateSystem(acs?: AuxCoordSystemState): void ViewState Set or clear the AuxiliaryCoordinateSystem for this view.
setCategorySelector(categories: CategorySelectorState): void ViewState Set the CategorySelector for this view.
setCenter(center: Point3d): void ViewState set the center of this view to a new position.
setDisplayStyle(style: DisplayStyleState): void ViewState  
setGridSettings(orientation: GridOrientationType, spacing: Point2d, gridsPerRef: number): void ViewState Set the grid settings for this view
setRotationAboutPoint(rotation: Matrix3d, point?: Point3d): void ViewState Set the rotation of this ViewState to the supplied rotation, by rotating it about a point.
setStandardRotation(id: StandardViewId): void ViewState Orient this view to one of the StandardView rotations.
setViewClip(clip?: ClipVector): void ViewState Set or clear the clipping volume for this view.
toProps(): ViewStateProps ViewState Serialize this ViewState as a set of properties that can be used to recreate it via ViewState.createFromProps.
viewsCategory(id: string): boolean ViewState Determine whether the specified Category is displayed in this view
viewsModel(modelId: string): boolean Abstract ViewState Returns true if this view displays the contents of a ViewState.Model specified by Id.
createFromProps(_props: ViewStateProps, _iModel: IModelConnection): undefined | ViewState Static ViewState Create a new ViewState object from a set of properties.

Properties

Name Type Description
_cameraOn Protected boolean True if the camera is valid.  
camera Readonly Camera The camera used for this view.  
details Accessor ReadOnly ViewDetails3d Provides access to optional detail settings for this view.  
displayStyle Accessor DisplayStyle3dState The style that controls how the contents of the view are displayed.  
extents Readonly Vector3d The extent of the view frustum.  
forceMinFrontDist number Minimum distance for front plane  
globalScopeFactor Accessor ReadOnly number A value that represents the global scope of the view -- a value greater than one indicates that the scope of this view is global.  
isCameraOn Accessor ReadOnly boolean    
isCameraValid Accessor ReadOnly boolean Determine whether the camera is valid for this view  
isGlobalView Accessor ReadOnly boolean    
origin Readonly Point3d The lower left back corner of the view frustum.  
rotation Readonly Matrix3d Rotation of the view frustum.  

Inherited properties

Name Type Inherited from Description
analysisStyle Accessor ReadOnly undefined | AnalysisStyle ViewState  
areAllTileTreesLoaded Accessor ReadOnly boolean ViewState 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 Viewport.areAreAllTileTreesLoaded.
auxiliaryCoordinateSystem Accessor ReadOnly AuxCoordSystemState ViewState get the auxiliary coordinate system state object for this ViewState.
backgroundColor Accessor ReadOnly ColorDef ViewState Get this view's background color.
categorySelector Accessor CategorySelectorState ViewState Selects the categories that are display by this ViewState.
classFullName Accessor StaticReadOnly string ViewState Get full BIS class name of this Entity in the form "SchemaName:ClassName".
classFullName Readonly string ViewState The full class name in the form "schema:class".
className Accessor ReadOnly string ViewState The name of the BIS class associated with this class.
code Readonly Code ViewState The Code for this element
defaultExtentLimits Accessor AbstractReadOnly ExtentLimits ViewState Returns the default extent limits for this ViewState. These limits are used if the ViewState.extentLimits have not been explicitly overridden.
description undefined | string ViewState  
extentLimits Accessor ExtentLimits ViewState 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 view extents cannot exceed the diameter of the earth.
- Drawing view extents cannot exceed twice the longest axis of the drawing model's range.
- Sheet view extents cannot exceed ten times the paper size of the sheet.
Explicitly setting the extent limits overrides the default limits.
federationGuid Readonly undefined | string ViewState A FederationGuid assigned to this element by some other federated database
id Readonly string ViewState The Id of this Entity.
iModel Readonly IModelConnection ViewState The iModel from which this Entity was loaded
isAttachedToViewport Accessor ReadOnly boolean ViewState Returns whether this view is currently being displayed by a Viewport.
isPrivate undefined | boolean ViewState  
jsonProperties Readonly { T } ViewState Optional json properties of this Entity.
model Readonly string ViewState The ModelId of the Model containing this element
modelDisplayTransformProvider Accessor undefined | ModelDisplayTransformProvider ViewState Specify a provider of per-model display transforms. Intended chiefly for use by model alignment tools.
name Accessor ReadOnly string ViewState Get the name of the ViewDefinition from which this ViewState originated.
onDisplayStyleChanged Readonly BeEvent<(newStyle: DisplayStyleState) => void> ViewState An event raised just before assignment to the ViewState.displayStyle property, only if the view is attached to a Viewport.
onModelDisplayTransformProviderChanged Readonly BeEvent<(newProvider: undefined | ModelDisplayTransformProvider) => void> ViewState Event raised just before assignment to the ViewState.modelDisplayTransformProvider property, only if the view is attached to a Viewport.
onViewedCategoriesChanged Readonly BeEvent<() => void> ViewState An event raised when the set of categories viewed by this view changes, only if the view is attached to a Viewport.
parent Readonly undefined | RelatedElement ViewState The parent Element of this, or undefined if no parent.
scheduleScript Accessor ReadOnly undefined | Script ViewState The RenderSchedule.Script that animates the contents of the view, if any.
schemaName Accessor StaticReadOnly string ViewState The name of the BIS schema for this class.
userLabel Readonly undefined | string ViewState A user-assigned label for this element.
viewFlags Accessor ViewFlags ViewState Flags controlling various aspects of this view's DisplayStyleState.

Defined in

Last Updated: 11 June, 2024