Classes | Typedefs | Enumerations
Display Styles

A display style is essentially a collection of overrides that you can apply to a view to achieve different display modes and effects. More...

Classes

struct  DisplayStyleFlags
 This sub-structure describes the 'flags' part of a DisplayStyle. More...
 
struct  ViewDisplayOverrides
 This sub-structure describes the 'overrides' part of a display style. More...
 
struct  DisplayStyleGroundPlane
 
struct  DisplayStyle
 A display style is a collection of view-related settings that can be applied to the whole or part of a view. More...
 
struct  DisplayStyleList
 Provides utilities for getting collections of display styles from various sources. More...
 
struct  DisplayStyleManager
 Provides static methods for reading, writing, and modifying display styles in files. More...
 

Typedefs

typedef RefCountedPtr
< DisplayStyle > 
DisplayStylePtr
 Smart pointer wrapper for DisplayStyle. More...
 
typedef bvector< DisplayStyleCP > DisplayStyleCPVector
 A collection of DisplayStyleCP. More...
 
typedef DisplayStyleGroundPlane * DisplayStyleGroundPlaneP
 
typedef
DisplayStyleGroundPlane const * 
DisplayStyleGroundPlaneCP
 
typedef DisplayStyleGroundPlane & DisplayStyleGroundPlaneR
 
typedef
DisplayStyleGroundPlane const & 
DisplayStyleGroundPlaneCR
 

Enumerations

enum  DisplayStyleImportStatus { InvalidSourceIndex, NotRemapped, RemappedToExistingStyle, RemappedToNewStyle }
 Describes the outcome of importing a display style from one file to another. More...
 
enum  DisplayStyleBuiltInUsage { View = 0, ClipVolume = 1 }
 Lists the possible intended usages of a display style. More...
 
enum  DisplayStyleApplyValidity { CanBeApplied, NonWireframeForSheet, ShadowedOn2DModel, NotValidForHandler }
 Describes if a display style can be applied to a view, and if not, why. More...
 
enum  DisplayStyleSource { File, HardCodedDefault }
 Describes where the display style came from. More...
 
enum  SpecialDisplayStyleIndex : int { SpecialDisplayStyleIndex_None = -1, SpecialDisplayStyleIndex_FromParent = -2 }
 Lists the (fake) indices of special display styles. More...
 
enum  EnvironmentDisplay { Color = 0, Luxology = 1 }
 When display environment is checked descibes what type of environment is displayed. More...
 
enum  DisplayStyleListOptions { DISPLAY_STYLE_LIST_OPTIONS_IncludeHiddenForPickers = 1 << 0, DISPLAY_STYLE_LIST_OPTIONS_Default = 0, DISPLAY_STYLE_LIST_OPTIONS_IncludeAll = 0xffff }
 

Detailed Description

A display style is essentially a collection of overrides that you can apply to a view to achieve different display modes and effects.

It can be applied to the entire view, or to sections in a view.

While each display style has a unique ID, its name must also be unique in the file. Elements may reference the style by its ID for size concerns, but many methods refer to display styles by-name.

Display styles are stored per-file, and must exist in a file if they are to be used in a view of that file. Display styles can come from DGN libraries, but are always copied local when used. Display styles store file-dependent data (e.g. color and material IDs), so each instance also the stores the file it came from (or is based on in the case of creating them). Display styles come from two primary sources: hard-coded defaults, or files. Most purposes don't care if if came from the active file or a DGN library; methods such as DisplayStyleManager::EnsureDisplayStyleIsInFile do nothing if the display style is already in the provided file. Hard-coded defaults only exist if no display styles can be found (in the local file or any DGN libraries).

Not all display styles can be used in all situations; for example, a display style with shadows enabled cannot be applied to a 2D sheet. IsValidForViewport can be used to determine if a display style can technically be applied to a Viewport. If you attempt to apply the style anyway, your request will be ignored. Aside from technical limitations, display styles also have usage flags which determine their intended usage. While this is most useful for GUI pickers, you should also respect the usage flags. For example, do not apply a display style to the entire view if the view usage is not enabled (vs. the clip volume usage). Using the IViewManager methods to apply a display style will automatically ignore requests if the display style was not intended to be used for a view.

To apply a display style to a view, see DisplayStyleManager::ApplyDisplayStyleToView.

Display style indices are not re-used; when a new display style is added to the file, it is granted the next highest available ID. At this time, no attempt is made to clean up existing elements which may reference a display style. This is generally safe because IDs are not reused, and code must be written to assume a display style by any given ID does not actually exist.

From a technical standpoint, display styles are odd hybrids in several ways:

Typedef Documentation

typedef bvector<DisplayStyleCP> DisplayStyleCPVector

A collection of DisplayStyleCP.

typedef DisplayStyleGroundPlane const* DisplayStyleGroundPlaneCP
typedef DisplayStyleGroundPlane const& DisplayStyleGroundPlaneCR
typedef DisplayStyleGroundPlane* DisplayStyleGroundPlaneP
typedef DisplayStyleGroundPlane& DisplayStyleGroundPlaneR
typedef RefCountedPtr<DisplayStyle> DisplayStylePtr

Smart pointer wrapper for DisplayStyle.

Enumeration Type Documentation

enum DisplayStyleApplyValidity
strong

Describes if a display style can be applied to a view, and if not, why.

Enumerator
CanBeApplied 

Display style can be applied to the view.

NonWireframeForSheet 

Display style's display mode is non-wireframe, and view is a sheet.

ShadowedOn2DModel 

Display style has shadows enabled, and view is a sheet.

NotValidForHandler 
enum DisplayStyleBuiltInUsage
strong

Lists the possible intended usages of a display style.

Display styles have an intrinsic 'usage' property which describes their intended use. This is taken into account when displaying lists of display styles in the user interface, depending on the list's or picker's purpose. A display style can have zero or many usages specified.

Enumerator
View 

The display style is meant to be used for entire views.

ClipVolume 

The display style is meant to be used for sections of clip volumes.

enum DisplayStyleImportStatus
strong

Describes the outcome of importing a display style from one file to another.

Enumerator
InvalidSourceIndex 

Could not find a display style in the source file with the provided index.

NotRemapped 

Occurs if source and destination file are the same, or an unexpected error occured.

RemappedToExistingStyle 

A display style by the same name existed in the destination file, and the existing style was updated to match the source version.

RemappedToNewStyle 

The source display style was copied into the destination with no overlap */.

enum DisplayStyleListOptions
Enumerator
DISPLAY_STYLE_LIST_OPTIONS_IncludeHiddenForPickers 

Include display styles that should not be shown in pickers.

DISPLAY_STYLE_LIST_OPTIONS_Default 

The "default" set of display styles; this is optimized for showing pickers.

DISPLAY_STYLE_LIST_OPTIONS_IncludeAll 

Includes all display styles.

enum DisplayStyleSource
strong

Describes where the display style came from.

Enumerator
File 

From a file (active or DGNLIB)

HardCodedDefault 

A hard-coded fallback default.

enum EnvironmentDisplay
strong

When display environment is checked descibes what type of environment is displayed.

Enumerator
Color 
Luxology 
enum SpecialDisplayStyleIndex : int

Lists the (fake) indices of special display styles.

There are several 'special' display styles (which aren't actually display styles stored in the file), generally for use within pickers and lists. This enumerates the special indices used to identify them.

Enumerator
SpecialDisplayStyleIndex_None 

Specifies no display style should be used (note that 0 is the first valid display style)

SpecialDisplayStyleIndex_FromParent 

For references, specifies to use the parent's display style.


Copyright © 2017 Bentley Systems, Incorporated. All rights reserved.