ViewFlags Class
Flags controlling how graphics appear within a view. A ViewFlags object is immutable. There are several ways to produce a modified copy of a ViewFlags object:
// Start with the default values for all properties.
let vf = ViewFlags.defaults;
// Change a single boolean property:
vf = vf.with("visibleEdges", true);
// Change only the render mode:
vf = vf.withRenderMode(RenderMode.HiddenLine);
// Change multiple properties:
vf = vf.copy({ renderMode: RenderMode.SmoothShade, visibleEdges: true });
// Reset multiple properties to their default values:
vf = vf.copy({ renderMode: undefined, visibleEdges: undefined });
ViewFlags.with and ViewFlags.withRenderMode should be preferred if you only need to change a single property, as they will not create a new object unless the new value differs from the current value. ViewFlags.copy and ViewFlags.override should be preferred if you need to change multiple properties, as they will create no more than one new object, vs each call to ViewFlags.with or ViewFlags.withRenderMode potentially creating a new object.
see DisplayStyleSettings.viewFlags to define the view flags for a DisplayStyle.
Methods
Name | Description | |
---|---|---|
constructor(flags?: Partial<Mutable<NonFunctionPropertiesOf<ViewFlags>>>): ViewFlags | Create a new ViewFlags. | |
copy(changedFlags: Partial<Mutable<NonFunctionPropertiesOf<ViewFlags>>>): ViewFlags | Produce a copy of these ViewFlags with some modified properties. | |
edgesRequired(): boolean | Returns true if the edges of surfaces should be displayed, based on RenderMode and the ViewFlags.visibleEdges flag. | |
equals(other: Readonly<Mutable<NonFunctionPropertiesOf<ViewFlags>>>): boolean | Returns true if this and other are equivalent. |
|
override(overrides: Partial<Mutable<NonFunctionPropertiesOf<ViewFlags>>>): ViewFlags | Produce a copy of these ViewFlags, overriding some of its properties. | |
toJSON(): ViewFlagProps | Convert to JSON representation. | |
with(flag: "transparency" | "dimensions" | "patterns" | "weights" | "styles" | "fill" | "textures" | "materials" | "acsTriad" | "grid" | "visibleEdges" | "hiddenEdges" | "shadows" | "clipVolume" | "constructions" | "monochrome" | "backgroundMap" | "ambientOcclusion" | "thematicDisplay" | "wiremesh" | "forceSurfaceDiscard" | "whiteOnWhiteReversal" | "lighting", value: boolean): ViewFlags | Produce a copy of these ViewFlags with a single boolean property changed. | |
withRenderMode(renderMode: RenderMode): ViewFlags | Produce a copy of these ViewFlags with a different ViewFlags.renderMode. | |
create(flags?: Partial<Mutable<NonFunctionPropertiesOf<ViewFlags>>>): ViewFlags Static | Create a ViewFlags. | |
fromJSON(json?: ViewFlagProps): ViewFlags Static | Create a ViewFlags from its JSON representation. |
Properties
Name | Type | Description | |
---|---|---|---|
acsTriad Readonly | boolean | Whether to display a graphical representation of the view's AuxCoordSystem. | |
ambientOcclusion Readonly | boolean | In RenderMode.SmoothShade, whether to apply ViewFlags.AmbientOcclusion. | |
backgroundMap Readonly | boolean | Whether to display background map imagery. | |
clipVolume Readonly | boolean | Whether to apply the view's clip volume to the geometry in the scene. | |
constructions Readonly | boolean | Whether to display geometry of class GeometryClass.Construction. | |
defaults StaticReadonly | ViewFlags | A ViewFlags object with all properties initialized to their default values. | |
dimensions Readonly | boolean | Whether to display geometry of class GeometryClass.Dimension. | |
fill Readonly | boolean | In RenderMode.Wireframe only, whether to display the interiors of planar regions with FillFlags.ByView. | |
forceSurfaceDiscard Readonly | boolean | Controls whether surface discard is always applied regardless of other ViewFlags. | |
grid Readonly | boolean | Whether to display a grid. | |
hiddenEdges Readonly | boolean | In any mode except RenderMode.Wireframe, whether to display the edges of surfaces occluded by other geometry. | |
lighting Readonly | boolean | In RenderMode.SmoothShade, whether to apply lighting to surfaces. | |
materials Readonly | boolean | In RenderMode.SmoothShade, whether to apply RenderMaterials to surfaces. | |
monochrome Readonly | boolean | Whether to produce a monochrome image. | |
patterns Readonly | boolean | Whether to display geometry of class GeometryClass.Pattern. | |
renderMode Readonly | RenderMode | The basic rendering mode applied to the view. | |
shadows Readonly | boolean | In RenderMode.SmoothShade, whether to display solar shadows. | |
styles Readonly | boolean | Whether LinePixels are allowed to apply patterns to lines and edges. | |
textures Readonly | boolean | In RenderMode.SmoothShade, whether to apply RenderTextures to surfaces. | |
thematicDisplay Readonly | boolean | Whether to apply ThematicDisplay. | |
transparency Readonly | boolean | Whether element transparency is applied. | |
visibleEdges Readonly | boolean | In RenderMode.SmoothShade, whether to display the edges of surfaces. | |
weights Readonly | boolean | Whether to allow lines and edges to draw with width greater than one pixel. | |
whiteOnWhiteReversal Readonly | boolean | Whether to apply white-on-white reversal. | |
wiremesh Readonly | boolean | If true, overlay surfaces with wiremesh to reveal their triangulation. |
Defined in
- core/common/src/ViewFlags.ts Line 143
Last Updated: 30 November, 2023