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 });
with and 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. copy and 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 with or withRenderMode potentially creating a new object.
@see 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 visibleEdges flag. | |
equals(other: Readonly<Mutable<NonFunctionPropertiesOf<ViewFlags>>>): boolean | Returns true if this and other are equivalent. |
|
hiddenEdgesVisible(): boolean | Returns true if edges that could be occluded by other geometry are visible for the current RenderMode. | |
override(overrides: Partial<Mutable<NonFunctionPropertiesOf<ViewFlags>>>): ViewFlags | Produce a copy of these ViewFlags, overriding some of its properties. | |
toFullyDefinedJSON(): Required<ViewFlagProps> | Like toJSON, but no properties are omitted. | |
toJSON(): ViewFlagProps | Convert to JSON representation. | |
with(flag: "fill" | "transparency" | "dimensions" | "patterns" | "weights" | "styles" | "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 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 SmoothShade, whether to apply 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 Construction. | |
defaults Static Readonly | ViewFlags | A ViewFlags object with all properties initialized to their default values. | |
dimensions Readonly | boolean | Whether to display geometry of class Dimension. | |
fill Readonly | boolean | In 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 Wireframe, whether to display the edges of surfaces occluded by other geometry. | |
lighting Readonly | boolean | In SmoothShade, whether to apply lighting to surfaces. | |
materials Readonly | boolean | In 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 Pattern. | |
renderMode Readonly | RenderMode | The basic rendering mode applied to the view. | |
shadows Readonly | boolean | In SmoothShade, whether to display solar shadows. | |
styles Readonly | boolean | Whether LinePixels are allowed to apply patterns to lines and edges. | |
textures Readonly | boolean | In 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 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: 14 November, 2024
Found something wrong, missing, or unclear on this page?Raise an issue in our repo.