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 - alwaysDrawn
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 Inherited | FeatureOverrides | Returns a feature's appearance overrides, or undefined if the feature is not visible. |
getElementOverridesById(id: string): undefined | FeatureAppearance Inherited | 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 Inherited | FeatureOverrides | Returns the feature's appearance overrides, or undefined if the feature is not visible. |
getModelOverridesById(id: string): undefined | FeatureAppearance Inherited | FeatureOverrides | Returns the overrides applied to geometry belonging to the specified model, if any such are defined. |
getSubCategoryOverridesById(id: string): undefined | FeatureAppearance Inherited | FeatureOverrides | Returns the overrides applied to geometry belonging to the specified subcategory, if any such are defined. |
ignoreAnimationOverrides(ignore: IgnoreAnimationOverrides): void Inherited | 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 Inherited | FeatureOverrides | Return whether geometry of the specified class should be drawn. |
isFeatureVisible(feature: Feature): boolean Inherited | FeatureOverrides | Returns true if the specified Feature will be drawn. |
isSubCategoryIdVisible(id: string): boolean Inherited | FeatureOverrides | Returns true if geometry belonging to the specified subcategory will be drawn. |
override(args: OverrideFeatureAppearanceArgs): void Inherited | 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 Inherited | FeatureOverrides | Specify overrides for all geometry originating from the specified animation node. |
overrideElement(id: string, app: FeatureAppearance, replaceExisting?: boolean): void Inherited | FeatureOverrides | Specify overrides for all geometry originating from the specified element. |
overrideModel(id: string, app: FeatureAppearance, replaceExisting?: boolean): void Inherited | FeatureOverrides | Specify overrides for all elements within the specified model. |
overrideSubCategory(id: string, app: FeatureAppearance, replaceExisting?: boolean): void Inherited | FeatureOverrides | Specify overrides for all geometry belonging to the specified SubCategory. |
setAlwaysDrawn(id: string): void Inherited | FeatureOverrides | Specify the Id of an element that should always be drawn. |
setAlwaysDrawnSet(ids: Iterable<string, any, any>, exclusive: boolean, ignoreSubCategory?: boolean): void Inherited | FeatureOverrides | Specify the Ids of elements that should always be drawn. |
setAnimationNodeNeverDrawn(id: number): void Inherited | FeatureOverrides | Specify the Id of a animation node that should never be drawn. |
setDefaultOverrides(appearance: FeatureAppearance, replaceExisting?: boolean): void Inherited | FeatureOverrides | Defines a default appearance to be applied to any Feature not explicitly overridden. |
setNeverDrawn(id: string): void Inherited | FeatureOverrides | Specify the Id of an element that should never be drawn. |
setNeverDrawnSet(ids: Iterable<string, any, any>): void Inherited | FeatureOverrides | Specify the Ids of elements that should never be drawn. |
setVisibleSubCategory(id: string): void Inherited | FeatureOverrides | Add a SubCategory to the set of visible subcategories. |
Inherited properties
Name | Type | Inherited from | Description |
---|---|---|---|
alwaysDrawn Accessor Inherited ReadOnly | Id64.Uint32Set | FeatureOverrides | A set of elements that are unconditionally displayed. |
alwaysDrawnIgnoresSubCategory Inherited | boolean | FeatureOverrides | If true, the always-drawn elements are drawn even if their subcategories are not visible. |
defaultOverrides Accessor Inherited ReadOnly | FeatureAppearance | FeatureOverrides | Overrides applied to features for which no other overrides are defined |
isAlwaysDrawnExclusive Inherited | boolean | FeatureOverrides | If true, no elements except those defined in the "always drawn" set will be drawn. |
lineWeights Accessor Inherited ReadOnly | boolean | FeatureOverrides | Whether or not line weights are applied. If false, all lines are drawn with a weight of 1. |
neverDrawn Accessor Inherited ReadOnly | Id64.Uint32Set | FeatureOverrides | A set of elements that are always invisible. |
Defined in
Last Updated: 17 December, 2024