FeatureSymbology.Overrides Class

Allows a Viewport to customize the appearance of individual Features within it.

The Viewport computes its base Overrides based on the following:

  • The set of categories enabled for display in its CategorySelectorState. Every SubCategory belonging to an enabled Category is added to the set of visible subcategories - all other subcategories are assumed to be invisible.
  • For the set of visible subcategories, any SubCategoryOverrides defined by the view's DisplayStyleState are applied. This may render some subcategories invisible, and change the symbology of others.
  • The visibility of each GeometryClass is set based on the view's ViewFlags.
  • The line weight is overridden to 1 pixel for all Features if line weight has been disabled by the view's ViewFlags.
  • The sets of elements which are always drawn and never drawn are initialized from the Viewport's sets. An application can further customize the symbology of any Features by registering a FeatureOverrideProvider with a Viewport. That provider's addFeatureOverrides function will be invoked whenever the Overrides need to be regenerated.

To override the symbology of most Features within a view, specify a defaultOverrides to be applied to any Feature not explicitly overridden. If default overrides are defined and some Features should draw normally without being affected by the default overrides, override that Feature with an Appearance which defines no overrides.

It is possible to override multiple aspects of a Feature. For example, you might specify that all elements belonging to subcategory "A" should be drawn in red, and that the element with Id "0x123" should be drawn with 0.25 transparency. In this case, when drawing a Feature with subcategory "A" and element Id "0x123", the two overrides will be merged, causing the Feature's geometry to draw 25% transparent red. On the other hand, if subcategory "A" is specified to draw in red and element "0x123" to draw in green, the color specified by the element override will take precedence over that specified for the subcategory, resulting in a green Feature.

see Viewport.alwaysDrawn

see Viewport.neverDrawn

Extends

Methods

Name Description
constructor(view?: Viewport | ViewState): FeatureSymbology.Overrides Construct a new Overrides.  

Inherited methods

Name Inherited from Description
getAppearance(elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): undefined | FeatureAppearance FeatureOverrides Returns a feature's appearance overrides, or undefined if the feature is not visible.
getElementOverridesById(id: string): undefined | FeatureAppearance FeatureOverrides Returns the overrides applied to geometry belonging to the specified element, if any such are defined.
getFeatureAppearance(feature: Feature, modelId: string, type?: BatchType, animationNodeId?: number): undefined | FeatureAppearance FeatureOverrides Returns the feature's appearance overrides, or undefined if the feature is not visible.
getModelOverridesById(id: string): undefined | FeatureAppearance FeatureOverrides Returns the overrides applied to geometry belonging to the specified model, if any such are defined.
getSubCategoryOverridesById(id: string): undefined | FeatureAppearance FeatureOverrides Returns the overrides applied to geometry belonging to the specified subcategory, if any such are defined.
ignoreAnimationOverrides(ignore: IgnoreAnimationOverrides): void FeatureOverrides Accepts a criterion that determines whether color and transparency overrides originating from the view's RenderSchedule.Script should be ignored for a given element.
isClassVisible(geomClass: GeometryClass): boolean FeatureOverrides Return whether geometry of the specified class should be drawn.
isFeatureVisible(feature: Feature): boolean FeatureOverrides Returns true if the specified Feature will be drawn.
isSubCategoryIdVisible(id: string): boolean FeatureOverrides Returns true if geometry belonging to the specified subcategory will be drawn.
isSubCategoryVisible(idLo: number, idHi: number): boolean FeatureOverrides Returns true if the SubCategory specified by Id is in the set of visible subcategories.
override(args: OverrideFeatureAppearanceArgs): void FeatureOverrides Specify overrides for all elements belonging to a specified GeometricModel, or all geometry belonging to a specified GeometricElement or SubCategory.
overrideAnimationNode(id: number, app: FeatureAppearance): void FeatureOverrides Specify overrides for all geometry originating from the specified animation node.
overrideElement(id: string, app: FeatureAppearance, replaceExisting?: boolean): void FeatureOverrides Specify overrides for all geometry originating from the specified element.
overrideModel(id: string, app: FeatureAppearance, replaceExisting?: boolean): void FeatureOverrides Specify overrides for all elements within the specified model.
overrideSubCategory(id: string, app: FeatureAppearance, replaceExisting?: boolean): void FeatureOverrides Specify overrides for all geometry belonging to the specified SubCategory.
setAlwaysDrawn(id: string): void FeatureOverrides Specify the Id of an element that should always be drawn.
setAlwaysDrawnSet(ids: Iterable<string>, exclusive: boolean, ignoreSubCategory?: boolean): void FeatureOverrides Specify the Ids of elements that should always be drawn.
setAnimationNodeNeverDrawn(id: number): void FeatureOverrides Specify the Id of a animation node that should never be drawn.
setDefaultOverrides(appearance: FeatureAppearance, replaceExisting?: boolean): void FeatureOverrides Defines a default appearance to be applied to any FeatureOverrides.Feature not explicitly overridden.
setNeverDrawn(id: string): void FeatureOverrides Specify the Id of an element that should never be drawn.
setNeverDrawnSet(ids: Iterable<string>): void FeatureOverrides Specify the Ids of elements that should never be drawn.
setVisibleSubCategory(id: string): void FeatureOverrides Add a SubCategory to the set of visible subcategories.

Inherited properties

Name Type Inherited from Description
_alwaysDrawn ProtectedReadonly Uint32Set FeatureOverrides Ids of elements that should always be drawn.
_constructions Protected boolean FeatureOverrides Whether construction geometry should be drawn.
_defaultOverrides Protected FeatureAppearance FeatureOverrides Overrides applied to any feature not explicitly overridden.
_dimensions Protected boolean FeatureOverrides Whether dimensions should be drawn.
_elementOverrides ProtectedReadonly Uint32Map<FeatureAppearance> FeatureOverrides Overrides applied to specific elements.
_lineWeights Protected boolean FeatureOverrides Whether line weights should be applied.
_modelOverrides ProtectedReadonly Uint32Map<FeatureAppearance> FeatureOverrides Overrides applied to all elements belonging to each model.
_neverDrawn ProtectedReadonly Uint32Set FeatureOverrides Ids of elements that should never be drawn.
_patterns Protected boolean FeatureOverrides Whether area patterns should be drawn.
_subCategoryOverrides ProtectedReadonly Uint32Map<FeatureAppearance> FeatureOverrides Overrides applied to geometry belonging to each subcategory.
_subCategoryPriorities ProtectedReadonly Uint32Map<number> FeatureOverrides Display priorities assigned to subcategories, possibly overridden by display style.
_visibleSubCategories ProtectedReadonly Uint32Set FeatureOverrides The set of displayed subcategories.
alwaysDrawnIgnoresSubCategory boolean FeatureOverrides If true, the always-drawn elements are drawn even if their subcategories are not visible.
defaultOverrides Accessor ReadOnly FeatureAppearance FeatureOverrides Overrides applied to features for which no other overrides are defined
isAlwaysDrawnExclusive boolean FeatureOverrides If true, no elements except those defined in the "always drawn" set will be drawn.
lineWeights Accessor ReadOnly boolean FeatureOverrides Whether or not line weights are applied. If false, all lines are drawn with a weight of 1.

Defined in

Last Updated: 20 June, 2023