ViewState2d Class
Defines the state of a view of a single 2d model.
Extends
Extended by
Methods
Name | Description | |
---|---|---|
constructor(props: ViewDefinition2dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle2dState): ViewState2d | ||
allow3dManipulations(): boolean | Returns true if ViewTools are allowed to operate in three dimensions on this view. | |
applyPose(val: ViewPose): ViewState2d | See applyPose. | |
changeViewedModel(newViewedModelId: string): Promise<void> | Change the model viewed by this view. | |
computeFitRange(): Range3d | Compute a range in CoordSystem.World coordinates that tightly encloses the contents of this view. | |
forEachModel(func: (model: GeometricModelState) => void): void | Execute a function on each viewed model | |
getExtents(): Vector3d | Get the extents of this view in CoordSystem.World coordinates. | |
getOrigin(): Point3d | Get the origin of this view in CoordSystem.World coordinates. | |
getRotation(): Matrix3d | Get the 3x3 ortho-normal Matrix3d for this view. | |
getViewedModel(): undefined | GeometricModel2dState | Return the model for this 2d view. | |
is3d(): this is ViewState3d | See is3d. | |
savePose(): ViewPose2d | Capture a copy of the viewed area. | |
setExtents(delta: Readonly<WritableXAndY>): void | Set the extents of this view in CoordSystem.World coordinates. | |
setOrigin(origin: Readonly<WritableXAndY>): void | Set the origin of this view in CoordSystem.World coordinates. | |
setRotation(rot: Matrix3d): void | Change the rotation of the view. | |
toJSON(): ViewDefinition2dProps | Convert to JSON representation. | |
viewsModel(modelId: string): boolean | Returns true if this view displays the contents of a Model specified by Id. |
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. |
attachToViewport(_args: Viewport): void | ViewState | Invoked when this view becomes the view displayed by the specified Viewport. |
calculateFocusCorners(): Point3d[] | ViewState | |
calculateFrustum(result?: Frustum): undefined | Frustum | ViewState | Calculate the world coordinate Frustum from the parameters of this ViewState. |
clone(iModel?: IModelConnection): this | ViewState | Make an independent copy of this EntityState |
computeDisplayTransform(args: ComputeDisplayTransformArgs): undefined | Transform | ViewState | Compute the transform applied to a model or element at display time, if any. |
detachFromViewport(): void | ViewState | Invoked when this view, previously attached to the specified Viewport via attachToViewport, is no longer the view displayed by that Viewport. |
equals(other: this): boolean | ViewState | Determine whether this ViewState exactly matches another. |
forEachTileTreeRef(func: (treeRef: TileTreeReference) => void): void | ViewState | Execute a function against each TileTreeReference associated with this view. |
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. |
getGlobeRotation(): undefined | Matrix3d | ViewState | If the view is not of the project as determined by getIsViewingProject then return |
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 | |
getIsViewingProject(): boolean | ViewState | Return true if the view is looking at the current iModel project extents or |
getModelAppearanceOverride(id: string): undefined | FeatureAppearance | ViewState | Query the symbology overrides applied to a model when rendered using this ViewState. |
getSubCategoryOverride(id: string): undefined | SubCategoryOverride | ViewState | Query the symbology overrides applied to geometry belonging to a specific subcategory when rendered using this ViewState. |
getTargetPoint(result?: Point3d): Point3d | ViewState | Get the target point of the view. |
getUpVector(point: Point3d): Vector3d | ViewState | Compute the vector in the "up" direction of a specific point in world space. |
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 |
isDrawingView(): this is DrawingViewState Abstract | ViewState | Returns true if this ViewState is-a DrawingViewState |
isSheetView(): this is SheetViewState | ViewState | Returns true if this ViewState is-a SheetViewState |
load(): Promise<void> | ViewState | Asynchronously load any required data for this ViewState from the backend. |
lookAtViewAlignedVolume(volume: Range3d, aspect?: number, options?: MarginOptions & OnViewExtentsError): 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?: MarginOptions & OnViewExtentsError): 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. |
setStandardGlobalRotation(id: StandardViewId): void | ViewState | Orient this view to one of the StandardView rotations, if the the view is not viewing the project then the |
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. |
setupFromFrustum(inFrustum: Frustum, opts?: OnViewExtentsError): ViewStatus | ViewState | Initialize the origin, extents, and rotation from an existing Frustum |
toProps(): ViewStateProps | ViewState | Serialize this ViewState as a set of properties that can be used to recreate it via createFromProps. |
viewsCategory(id: string): boolean | ViewState | Determine whether the specified Category is displayed in this view |
createFromProps(_props: ViewStateProps, _iModel: IModelConnection): undefined | ViewState Static | ViewState | Create a new ViewState object from a set of properties. |
Properties
Name | Type | Description | |
---|---|---|---|
_baseModelId Protected | string | ||
angle Readonly | Angle | ||
baseModelId Accessor ReadOnly | string | ||
className Accessor Static ReadOnly | string | The name of the BIS class associated with this class. | |
delta Readonly | Point2d | ||
details Accessor ReadOnly | ViewDetails | Provides access to optional detail settings for this view. | |
origin Readonly | Point2d |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
analysisStyle Accessor ReadOnly | undefined | AnalysisStyle | ViewState | See DisplayStyleSettings.analysisStyle. |
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 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 Static ReadOnly | 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 Abstract ReadOnly | ExtentLimits | ViewState | Returns the default extent limits for this ViewState. These limits are used if the extentLimits have not been explicitly overridden. |
description | string | undefined | ViewState | |
displayStyle Accessor | DisplayStyleState | ViewState | The style that controls how the contents of the view are displayed. |
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 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. |
federationGuid Readonly | string | undefined | ViewState | A FederationGuid assigned to this element by some other federated database |
globalScopeFactor Accessor ReadOnly | number | ViewState | A value that represents the global scope of the view -- a value greater than one indicates that the scope of this view is global (viewing most of Earth). |
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 | boolean | undefined | ViewState | |
jsonProperties Readonly | [key: string]: any | ViewState | Optional json properties of this Entity. |
model Readonly | string | ViewState | The ModelId of the Model containing this element |
modelDisplayTransformProvider Accessor | undefined | ModelDisplayTransformProvider | ViewState | An object that can provide per-model transforms to be applied at display time. |
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 displayStyle property, only if the view is attached to a Viewport. |
onModelDisplayTransformProviderChanged Readonly | BeEvent<(newProvider: ModelDisplayTransformProvider) => void> | ViewState | Event raised just before assignment to the 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 | RelatedElement | undefined | ViewState | The parent Element of this, or undefined if no parent. |
scheduleScript Accessor ReadOnly | undefined | RenderSchedule.Script | ViewState | The RenderSchedule.Script that animates the contents of the view, if any. |
schemaName Accessor Static ReadOnly | string | ViewState | The name of the BIS schema for this class. |
userLabel Readonly | string | undefined | 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: 28 October, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.