FeatureOverrides Class

Specifies how to customize the appearance of individual Features, typically within the context of a Viewport. Individual aspects of a feature's appearance - like visibility, color, and transparency - are overridden by supplying a FeatureAppearance. Those overrides can be specified on the basis of the feature's model, element, and/or subcategory. A default set of overrides can also be specified to apply to the appearance of any feature not otherwise overridden.

It is possible to override multiple aspects of a feature on different bases. For example, you might specify that all features belonging to subcategory "A" should be drawn in red, and that all features belonging to model "B" should be drawn 50% transparent. In this case, a feature belonging to both subcategory "A" and model "B" will be drawn as 50% transparent red - the separate overrides are combined to produce the feature's overall appearance.

In the case of conflicts, there is an order of precedence:

  • Model overrides take highest precedence.
  • Element overrides are of higher precedence than subcategory and animation overrides.
  • Overrides applied by a RenderSchedule.Script's ElementTimeline are of higher precedence than subcategory overrides, but can be suppressed on a per-element basis via ignoreAnimationOverrides.
  • Subcategory overrides have lowest precedence.

For example, you might specify that all features belonging to subcategory "A" should be drawn in red, and all those belonging to model "B" should be drawn in green. Then a feature belonging to subcategory "A" and model "B" will be drawn in green, because the model overrides take precedence.

Instances of this class are not typically instantiated by an application directly; instead, an application can implement a FeatureOverrideProvider that augments the overrides supplied by a viewport.

@see - FeatureSymbology.Overrides to create overrides specific to a Viewport or ViewState.

Implements

Methods

Name Description
constructor(): FeatureOverrides Construct a new Overrides that overrides nothing.  
getAppearance(elemLo: number, elemHi: number, subcatLo: number, subcatHi: number, geomClass: GeometryClass, modelLo: number, modelHi: number, type: BatchType, animationNodeId: number): undefined | FeatureAppearance Returns a feature's appearance overrides, or undefined if the feature is not visible.  
getElementOverridesById(id: string): undefined | FeatureAppearance Returns the overrides applied to geometry belonging to the specified element, if any such are defined.  
getFeatureAppearance(feature: Feature, modelId: string, type: BatchTypeBatchType.Primary, animationNodeId: number0): undefined | FeatureAppearance Returns the feature's appearance overrides, or undefined if the feature is not visible.  
getModelOverridesById(id: string): undefined | FeatureAppearance Returns the overrides applied to geometry belonging to the specified model, if any such are defined.  
getSubCategoryOverridesById(id: string): undefined | FeatureAppearance Returns the overrides applied to geometry belonging to the specified subcategory, if any such are defined.  
ignoreAnimationOverrides(ignore: IgnoreAnimationOverrides): void 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 Return whether geometry of the specified class should be drawn.  
isFeatureVisible(feature: Feature): boolean Returns true if the specified Feature will be drawn.  
isSubCategoryIdVisible(id: string): boolean Returns true if geometry belonging to the specified subcategory will be drawn.  
override(args: OverrideFeatureAppearanceArgs): void 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 Specify overrides for all geometry originating from the specified animation node.  
overrideElement(id: string, app: FeatureAppearance, replaceExisting: booleantrue): void Specify overrides for all geometry originating from the specified element. Deprecated  
overrideModel(id: string, app: FeatureAppearance, replaceExisting: booleantrue): void Specify overrides for all elements within the specified model. Deprecated  
overrideSubCategory(id: string, app: FeatureAppearance, replaceExisting: booleantrue): void Specify overrides for all geometry belonging to the specified SubCategory. Deprecated  
setAlwaysDrawn(id: string): void Specify the Id of an element that should always be drawn.  
setAlwaysDrawnSet(ids: Iterable<string>, exclusive: boolean, ignoreSubCategory: booleantrue): void Specify the Ids of elements that should always be drawn.  
setAnimationNodeNeverDrawn(id: number): void Specify the Id of a animation node that should never be drawn.  
setDefaultOverrides(appearance: FeatureAppearance, replaceExisting: booleantrue): void Defines a default appearance to be applied to any Feature not explicitly overridden.  
setNeverDrawn(id: string): void Specify the Id of an element that should never be drawn.  
setNeverDrawnSet(ids: Iterable<string>): void Specify the Ids of elements that should never be drawn.  
setVisibleSubCategory(id: string): void Add a SubCategory to the set of visible subcategories.  

Properties

Name Type Description
alwaysDrawn Accessor ReadOnly Id64.Uint32Set A set of elements that are unconditionally displayed.  
alwaysDrawnIgnoresSubCategory boolean If true, the always-drawn elements are drawn even if their subcategories are not visible.  
defaultOverrides Accessor ReadOnly FeatureAppearance Overrides applied to features for which no other overrides are defined  
isAlwaysDrawnExclusive boolean If true, no elements except those defined in the "always drawn" set will be drawn.  
lineWeights Accessor ReadOnly boolean Whether or not line weights are applied.  
neverDrawn Accessor ReadOnly Id64.Uint32Set A set of elements that are always invisible.  

Defined in

Last Updated: 28 October, 2024