DrawingViewState Class

A view of a DrawingModel

extensions

Extends

Methods

Name Description
constructor(props: ViewDefinition2dProps, iModel: IModelConnection, categories: CategorySelectorState, displayStyle: DisplayStyle2dState, extents: Range3d, sectionDrawing?: SectionDrawingViewProps): DrawingViewState    
getViewedExtents(): Range3d Get the extents of this view in CoordSystem.World coordinates.  
toProps(): ViewStateProps Serialize this ViewState as a set of properties that can be used to recreate it via ViewState.createFromProps.  
createFromProps(props: ViewStateProps, iModel: IModelConnection): DrawingViewState Static Create a new ViewState object from a set of properties.  

Inherited methods

Name Inherited from Description
_updateMaxGlobalScopeFactor(): void Protected ViewState2d  
adjustAspectRatio(aspect: number): void ViewState2d Adjust the aspect ratio of this ViewState so it matches the supplied value.
allow3dManipulations(): boolean ViewState2d Returns true if ViewTools are allowed to operate in three dimensions on this view.
calculateFocusCorners(): Point3d[] ViewState2d  
calculateFrustum(result?: Frustum): undefined | Frustum ViewState2d Calculate the world coordinate Frustum from the parameters of this ViewState.
clone(iModel?: IModelConnection): DrawingViewState ViewState2d Make an independent copy of this EntityState
computeDisplayTransform(args: ComputeDisplayTransformArgs): undefined | Transform ViewState2d Compute the transform applied to a model or element at display time, if any.
computeFitRange(): Range3d ViewState2d Compute a range in CoordSystem.World coordinates that tightly encloses the contents of this view.
createAuxCoordSystem(acsName: string): AuxCoordSystemState ViewState2d  
equals(other: DrawingViewState): boolean ViewState2d Determine whether this ViewState exactly matches another.
forEachModel(func: (model: GeometricModelState) => void): void ViewState2d Execute a function on each viewed model
getAspectRatio(): number ViewState2d Get the aspect ratio (width/height) of this view
getAspectRatioSkew(): number ViewState2d Get the aspect ratio skew (x/y, usually 1.0) that is used to exaggerate the y axis of the view.
getAuxiliaryCoordinateSystemId(): string ViewState2d Get the Id of the auxiliary coordinate system for this ViewState
getCenter(result?: Point3d): Point3d ViewState2d Get the point at the geometric center of the view.
getGlobeRotation(): undefined | Matrix3d ViewState2d If the view is not of the project as determined by ViewState2d.getIsViewingProject then return
getGridOrientation(): GridOrientationType ViewState2d Get the grid settings for this view
getGridSettings(vp: Viewport, origin: Point3d, rMatrix: Matrix3d, orientation: GridOrientationType): void ViewState2d Populate the given origin and rotation with information from the grid settings from the grid orientation.
getGridSpacing(): Readonly<WritableXAndY> ViewState2d  
getGridsPerRef(): number ViewState2d  
getIsViewingProject(): boolean ViewState2d Return true if the view is looking at the current iModel project extents or
getModelAppearanceOverride(id: string): undefined | FeatureAppearance ViewState2d Query the symbology overrides applied to a model when rendered using this ViewState.
getRotation(): Matrix3d ViewState2d Get the 3x3 ortho-normal Matrix3d for this view.
getSubCategoryOverride(id: string): undefined | SubCategoryOverride ViewState2d Query the symbology overrides applied to geometry belonging to a specific subcategory when rendered using this ViewState.
getTargetPoint(result?: Point3d): Point3d ViewState2d Get the target point of the view.
getUpVector(point: Point3d): Vector3d ViewState2d  
getViewClip(): undefined | ClipVector ViewState2d Get the clipping volume for this view, if defined
getViewedModel(): undefined | GeometricModel2dState ViewState2d Return the model for this 2d view.
getXVector(result?: Vector3d): Vector3d ViewState2d Get the unit vector that points in the view X (left-to-right) direction.
getYVector(result?: Vector3d): Vector3d ViewState2d Get the unit vector that points in the view Y (bottom-to-top) direction.
getZVector(result?: Vector3d): Vector3d ViewState2d Get the unit vector that points in the view Z (front-to-back) direction.
hasSameCoordinates(other: ViewState): boolean ViewState2d Determine whether this ViewState has the same coordinate system as another one.
is2d(): this is ViewState2d ViewState2d Returns true if this ViewState is-a ViewState2d
isSheetView(): this is SheetViewState ViewState2d Returns true if this ViewState is-a SheetViewState
load(): Promise<void> ViewState2d Asynchronously load any required data for this ViewState from the backend.
lookAtViewAlignedVolume(volume: Range3d, aspect?: number, options?: MarginOptions & OnViewExtentsError): void ViewState2d 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 ViewState2d Change the volume that this view displays, keeping its current rotation.
resetExtentLimits(): void ViewState2d Resets the largest and smallest values allowed for the extents of this ViewState to their default values.
savePose(): ViewPose2d ViewState2d Capture a copy of the viewed area.
setAspectRatioSkew(val: number): void ViewState2d Set the aspect ratio skew (x/y) for this view.
setAuxiliaryCoordinateSystem(acs?: AuxCoordSystemState): void ViewState2d Set or clear the AuxiliaryCoordinateSystem for this view.
setCategorySelector(categories: CategorySelectorState): void ViewState2d Set the CategorySelector for this view.
setCenter(center: Point3d): void ViewState2d set the center of this view to a new position.
setDisplayStyle(style: DisplayStyleState): void ViewState2d  
setExtents(delta: Readonly<WritableXAndY>): void ViewState2d Set the extents of this view in CoordSystem.World coordinates.
setGridSettings(orientation: GridOrientationType, spacing: Point2d, gridsPerRef: number): void ViewState2d Set the grid settings for this view
setOrigin(origin: Readonly<WritableXAndY>): void ViewState2d Set the origin of this view in CoordSystem.World coordinates.
setRotation(rot: Matrix3d): void ViewState2d Change the rotation of the view.
setRotationAboutPoint(rotation: Matrix3d, point?: Point3d): void ViewState2d Set the rotation of this ViewState to the supplied rotation, by rotating it about a point.
setStandardGlobalRotation(id: StandardViewId): void ViewState2d Orient this view to one of the StandardView rotations, if the the view is not viewing the project then the
setStandardRotation(id: StandardViewId): void ViewState2d Orient this view to one of the StandardView rotations.
setViewClip(clip?: ClipVector): void ViewState2d Set or clear the clipping volume for this view.
setupFromFrustum(inFrustum: Frustum, opts?: OnViewExtentsError): ViewStatus ViewState2d Initialize the origin, extents, and rotation from an existing Frustum
toJSON(): ViewDefinition2dProps ViewState2d Convert to JSON representation.
viewsCategory(id: string): boolean ViewState2d Determine whether the specified Category is displayed in this view
viewsModel(modelId: string): boolean ViewState2d Returns true if this view displays the contents of a ViewState2d.Model specified by Id.

Properties

Name Type Description
attachment Accessor ReadOnly undefined | Object Strictly for testing.  
attachmentInfo Accessor ReadOnly Object Strictly for testing.  
defaultExtentLimits Accessor ReadOnly ExtentLimits    
sectionDrawingInfo Accessor ReadOnly Strictly for testing.  
sectionDrawingProps Accessor ReadOnly undefined | SectionDrawingViewProps Strictly for testing.  

Inherited properties

Name Type Inherited from Description
_baseModelId Protected string ViewState2d  
analysisStyle Accessor ReadOnly undefined | AnalysisStyle ViewState2d See DisplayStyleSettings.analysisStyle.
angle Readonly Angle ViewState2d  
auxiliaryCoordinateSystem Accessor ReadOnly AuxCoordSystemState ViewState2d get the auxiliary coordinate system state object for this ViewState.
backgroundColor Accessor ReadOnly ColorDef ViewState2d Get this view's background color.
baseModelId Accessor ReadOnly string ViewState2d  
categorySelector Accessor CategorySelectorState ViewState2d Selects the categories that are display by this ViewState.
classFullName Accessor StaticReadOnly string ViewState2d Get full BIS class name of this Entity in the form "SchemaName:ClassName".
classFullName Readonly string ViewState2d The full class name in the form "schema:class".
className Accessor ReadOnly string ViewState2d The name of the BIS class associated with this class.
code Readonly Code ViewState2d The Code for this element
delta Readonly Point2d ViewState2d  
description undefined | string ViewState2d  
details Accessor ReadOnly ViewDetails ViewState2d Provides access to optional detail settings for this view.
displayStyle Accessor DisplayStyleState ViewState2d The style that controls how the contents of the view are displayed.
extentLimits Accessor ExtentLimits ViewState2d 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 ViewState2d A FederationGuid assigned to this element by some other federated database
globalScopeFactor Accessor ReadOnly number ViewState2d 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 ViewState2d The Id of this Entity.
iModel Readonly IModelConnection ViewState2d The iModel from which this Entity was loaded
isAttachedToViewport Accessor ReadOnly boolean ViewState2d Returns whether this view is currently being displayed by a Viewport.
isPrivate undefined | boolean ViewState2d  
jsonProperties Readonly { T } ViewState2d Optional json properties of this Entity.
model Readonly string ViewState2d The ModelId of the Model containing this element
modelDisplayTransformProvider Accessor undefined | ModelDisplayTransformProvider ViewState2d An object that can provide per-model transforms to be applied at display time.
name Accessor ReadOnly string ViewState2d Get the name of the ViewDefinition from which this ViewState originated.
onDisplayStyleChanged Readonly BeEvent<(newStyle: DisplayStyleState) => void> ViewState2d An event raised just before assignment to the ViewState2d.displayStyle property, only if the view is attached to a Viewport.
onModelDisplayTransformProviderChanged Readonly BeEvent<(newProvider: undefined | ModelDisplayTransformProvider) => void> ViewState2d Event raised just before assignment to the ViewState2d.modelDisplayTransformProvider property, only if the view is attached to a Viewport.
onViewedCategoriesChanged Readonly BeEvent<() => void> ViewState2d An event raised when the set of categories viewed by this view changes, only if the view is attached to a Viewport.
origin Readonly Point2d ViewState2d  
parent Readonly undefined | RelatedElement ViewState2d The parent Element of this, or undefined if no parent.
scheduleScript Accessor ReadOnly undefined | Script ViewState2d The RenderSchedule.Script that animates the contents of the view, if any.
schemaName Accessor StaticReadOnly string ViewState2d The name of the BIS schema for this class.
userLabel Readonly undefined | string ViewState2d A user-assigned label for this element.
viewFlags Accessor ViewFlags ViewState2d Flags controlling various aspects of this view's DisplayStyleState.

Defined in

Last Updated: 20 June, 2023