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 RenderSchedule.ElementTimeline are of higher precedence than subcategory overrides, but can be suppressed on a per-element basis via FeatureOverrides.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.

see FeatureOverrideProvider to customize the appearance of features within a Viewport.

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: BatchType = BatchType.Primary, animationNodeId: number = 0): 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.  
isSubCategoryVisible(idLo: number, idHi: number): boolean Returns true if the SubCategory specified by Id is in the set of visible subcategories.  
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: boolean = true): void Specify overrides for all geometry originating from the specified element. Deprecated  
overrideModel(id: string, app: FeatureAppearance, replaceExisting: boolean = true): void Specify overrides for all elements within the specified model. Deprecated  
overrideSubCategory(id: string, app: FeatureAppearance, replaceExisting: boolean = true): 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: boolean = true): 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: boolean = true): 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 ProtectedReadonly Uint32Set Ids of elements that should always be drawn.  
_constructions Protected boolean Whether construction geometry should be drawn.  
_defaultOverrides Protected FeatureAppearance Overrides applied to any feature not explicitly overridden.  
_dimensions Protected boolean Whether dimensions should be drawn.  
_elementOverrides ProtectedReadonly Uint32Map<FeatureAppearance> Overrides applied to specific elements.  
_lineWeights Protected boolean Whether line weights should be applied.  
_modelOverrides ProtectedReadonly Uint32Map<FeatureAppearance> Overrides applied to all elements belonging to each model.  
_neverDrawn ProtectedReadonly Uint32Set Ids of elements that should never be drawn.  
_patterns Protected boolean Whether area patterns should be drawn.  
_subCategoryOverrides ProtectedReadonly Uint32Map<FeatureAppearance> Overrides applied to geometry belonging to each subcategory.  
_subCategoryPriorities ProtectedReadonly Uint32Map<number> Display priorities assigned to subcategories, possibly overridden by display style.  
_visibleSubCategories ProtectedReadonly Uint32Set The set of displayed subcategories.  
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.  

Defined in

Last Updated: 30 November, 2023