Static Public Member Functions | List of all members
DisplayRulesManager Struct Reference

Provides static methods for reading, writing, and modifying display rules sets in files. More...

#include <DisplayRulesManager.h>

Static Public Member Functions

static DisplayRuleSetCPVector const GetDisplayRuleSetsInFile (DgnFileR dgnFile)
 Returns list of DisplayRuleSets stored in the give file. More...
 
static DisplayRuleSetCP GetDisplayRuleSetByIndex (DisplayRuleSetCPVector::size_type index, DgnFileR dgnFile)
 Returns the display rule set, if present, from the file's display rule set collection as indicated by the provided index. More...
 
static DisplayRuleSetCP GetDisplayRuleSetByName (WCharCP name, DgnFileR dgnFile)
 Returns the display rule set, if present, from the file's display rule set collection as indicated by the provided name. More...
 
static DisplayRuleSetCP WriteDisplayRuleSetToFile (DisplayRuleSetCR displayRuleSet, DgnFileR destinationDgnFile, bool notifyListeners)
 Writes the given display rule set to the given file. More...
 
static StatusInt RenameDisplayRuleSetInFile (WCharCP originalName, WCharCP newName, DgnFileR dgnFile)
 Renames a display rule set in a file. More...
 
static void RemoveDisplayRuleSetFromFile (WCharCP ruleSetName, DgnFileR dgnFile)
 Removes a display rule set from a file. More...
 
static void SetDisplayRuleSetToDisplayStyle (DisplayRuleSetCR displayRuleSet, DisplayStyleR displayStyle)
 Sets DisplayRuleSet association to DisplayStyle. More...
 
static DisplayRuleSetCP GetDisplayRuleSetFromDisplayStyle (DisplayStyleCR displayStyle)
 Returns DisplayRuleSet associated to DisplayStyle. More...
 

Detailed Description

Provides static methods for reading, writing, and modifying display rules sets in files.

Examples:

See also
DisplayRule for more details on Display Rules.
DisplayRuleSet for more details on DisplayRuleSets.
Remarks
Required library : DgnPlatform<ApiNumber>.lib i.e. DgnPlatform5.lib

Member Function Documentation

static DisplayRuleSetCP GetDisplayRuleSetByIndex ( DisplayRuleSetCPVector::size_type  index,
DgnFileR  dgnFile 
)
static

Returns the display rule set, if present, from the file's display rule set collection as indicated by the provided index.

Parameters
[in]indexDisplayRuleSetCPVector::size_type
[in]dgnFilethe object of MSDgnFileP
Returns
DisplayRuleSetCP type of object
static DisplayRuleSetCP GetDisplayRuleSetByName ( WCharCP  name,
DgnFileR  dgnFile 
)
static

Returns the display rule set, if present, from the file's display rule set collection as indicated by the provided name.

Parameters
[in]nameDisplayRuleSet
[in]dgnFilethe object of MSDgnFileP
Returns
DisplayRuleSetCP type of object
static DisplayRuleSetCP GetDisplayRuleSetFromDisplayStyle ( DisplayStyleCR  displayStyle)
static

Returns DisplayRuleSet associated to DisplayStyle.

Returns nullptr if association doesn't exist.

static DisplayRuleSetCPVector const GetDisplayRuleSetsInFile ( DgnFileR  dgnFile)
static

Returns list of DisplayRuleSets stored in the give file.

Parameters
[in]dgnFilethe object of MSDgnFileR where DisplayRuleSets are stored.
static void RemoveDisplayRuleSetFromFile ( WCharCP  ruleSetName,
DgnFileR  dgnFile 
)
static

Removes a display rule set from a file.

Its ID cannot be re-used at this point.

Note
When a display rule set is removed, no attempts are currently made to normalize existing elements. Thus elements may still attempt to reference a missing display rule set, but must be written to assume such a display rule set doesn't exist.
Parameters
[in]ruleSetNamethe rule set which will be removed
[in]dgnFilethe object of MSDgnFileR from where display rule set will be removed
static StatusInt RenameDisplayRuleSetInFile ( WCharCP  originalName,
WCharCP  newName,
DgnFileR  dgnFile 
)
static

Renames a display rule set in a file.

Its ID remains the same.

Note
When a display rule set is renamed, no attempts are currently made to normalize existing elements. The is acceptable because all current known elements store display rule set IDs, which are unaffected by this operation.
Parameters
[in]originalNamethe old rule set name
[in]newNamethe new rule set name
[in]dgnFilethe object of MSDgnFileR where it will be renamed
static void SetDisplayRuleSetToDisplayStyle ( DisplayRuleSetCR  displayRuleSet,
DisplayStyleR  displayStyle 
)
static

Sets DisplayRuleSet association to DisplayStyle.

DisplayStyle is modified, but not saved.

Note
DisplayRuleSet and DisplayStyle should be stored in the same file.
static DisplayRuleSetCP WriteDisplayRuleSetToFile ( DisplayRuleSetCR  displayRuleSet,
DgnFileR  destinationDgnFile,
bool  notifyListeners 
)
static

Writes the given display rule set to the given file.

If one by the same name already exists, it is replaced. A replaced display rule set retains the ID of the version already in the file. The persisted version of the display rule set is returned, and should be used from this point on.

Parameters
[in]displayRuleSetthe object of type DisplayRuleSetCR
[in]destinationDgnFilethe object of MSDgnFileR
[in]notifyListenerspass true if listeners needs to be notified
Returns
DisplayRuleSetCP type of object

The documentation for this struct was generated from the following file:

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