2.3.0 Change Notes

Thematic display

New gradient modes

Thematic display supports several new gradient mode values for the mode property of ThematicGradientSettings:

  • ThematicGradientMode.Stepped applies a stepped color gradient to the scene.
  • ThematicGradientMode.SteppedWithDelimiter applies a stepped color gradient to the scene with delimiters (lines between the color steps).
  • ThematicGradientMode.IsoLines applies isolines to the scene to achieve an effect similar to a contour map.

Note: Gradient modes ThematicGradientMode.SteppedWithDelimiter and ThematicGradientMode.IsoLines cannot be used with thematic display mode values other than ThematicDisplayMode.Height.

stepped thematic gradient mode applied to height

Stepped thematic gradient mode applied to height

stepped-with-delimiter thematic gradient mode applied to height

Stepped-with-delimiter thematic gradient mode applied to height

isoline thematic gradient mode applied to height

Isoline thematic gradient mode applied to height

New display modes

Thematic display supports several new display mode values for the displayMode property of ThematicDisplay:

  • ThematicDisplayMode.Slope applies a color gradient to surface geometry based on the slope of the surface relative to a specified axis. The slope value is calculated based on the angle between the surface and the axis specified in the associated ThematicDisplay object.
  • ThematicDisplayMode.HillShade applies a color gradient to surface geometry based on the direction of a sun shining on the surface.
    • ThematicDisplay has a new property named sunDirection, a 3d vector, which describes the solar direction used by this display mode.
    • If desired, in order to create a sun direction from azimuth and altitude values, a new API function is available: calculateSolarDirectionFromAngles. This function takes an azimuth and altitude as input and returns a solar direction vector.

slope display mode applied relative to a Z axis with a range of 0 to 90 degrees and a blue-red color scheme

Slope display mode applied relative to a Z axis with a range of 0 to 90 degrees and a blue-red color scheme

hillshade display mode applied with a monochrome color scheme

Hillshade display mode applied with a monochrome color scheme

Hyper-modeling

The hyper-modeling Extension has been replaced by the hypermodeling-frontend package to permit customization of its behavior.

Rendering styles

A DisplayStyle defines how the contents of a ViewDefinition are rendered. However, the display style contains some data that is specific to the containing iModel, or to the project to which the iModel belongs. It can be very useful to be able to define various "rendering styles" that can be applied to any display style in any iModel or project to change the lighting, thematic display settings, and other visual aspects of the view. To facilitate this, three new methods have been introduced:

A "rendering style" is simply a partial DisplayStyle3dSettingsProps. When applied to a DisplayStyleSettings, any settings explicitly defined by the rendering style will be overridden; the remainder will retain their original values.

Examples of some general-purpose rendering styles can be found in display-test-app.

Multiple feature override providers

Viewport now allows multiple FeatureOverrideProviders to be registered at any given time. Use Viewport.addFeatureOverrideProvider to register a provider and Viewport.dropFeatureOverrideProvider to unregister it. To query for a registered provider, use Viewport.findFeatureOverrideProvider or Viewport.findFeatureOverrideProviderOfType.

When multiple providers are registered, no attempt is made to reconcile conflicts between two providers overriding the same Feature - that is left to the application. Note that most FeatureSymbology.Overrides methods like overrideModel take an optional replaceExisting argument indicating whether or not to replace an existing override for the same entity, so if you have two providers, one of which should never overwrite changes made by the other, that one should pass false for replaceExisting while the other one should pass true (the default).

This change necessitates the deprecation of Viewport.featureOverrideProvider, previously used to get or set the sole provider. This property will be removed in a future version. For now, the getter will return a provider if and only if exactly one provider is currently registered. The setter will remove all existing providers and, if a new provider is supplied, register it as the sole provider. We recommend migrating to the new APIs. You can do so as follows:

  • Replace viewport.featureOverrideProvider = myProvider with viewport.addFeatureOverrideProvider(myProvider).
  • Replace viewport.featureOverrideProvider = undefined with viewport.dropFeatureOverrideProvider(myProvider).
  • Replace calls to the getter with a call to findFeatureOverrideProvider or findFeatureOverrideProviderOfType. For example:
  class MyProvider implements FeatureOverrideProvider {
    public id: string;
    public addFeatureOverrides(ovrs: FeatureSymbology.Overrides, vp: Viewport): void { /* ... */ }
  }

  // If you know that at most one provider of type MyProvider should be registered at any one time:
  let provider = viewport.findFeatureOverrideProviderOfType<MyProvider>(MyProvider);
  // Or, if you can identify your provider by some other means, like a property:
  provider = viewport.findFeatureOverrideProvider((x) => x instanceof MyProvider && x.id === "my provider");

ECSql Enhancements

Added the following expressions and functions:

  1. <type> IS [NOT] (type-list) - Filter parent type by subtype
  2. CASE-WHEN-THEN-ELSE - Conditional expression
  3. IIF() - Conditional expression
  4. ec_classname() - Get formatted class names for a ECClassId
  5. ec_classid()) - Get ECClassId from a qualified classname.

Schema upgrades

Domain schemas can now be upgraded when opening BriefcaseDb-s and StandaloneDb-s. See new UpgradeOptions options that can be passed in to the BriefcaseDb.open call.

Last Updated: 02 February, 2022