Functions
Filter Tables

Functions

StatusInt mdlFilterTable_initialize (DgnModelRefP pModelRefIn, WCharCP pFilterTableNameIn, bool bCreateIfRequiredIn)
 Filters give the ability to create simple "query"-type expressions which can then be evaluated on specified data. More...
 
bool mdlFilterTable_isValid (DgnModelRefP pModelRefIn, WCharCP pFilterTableNameIn)
 Check if a filter table with specified name exists. More...
 
StatusInt mdlFilterTable_rewrite (DgnModelRefP pModelRefIn, WCharCP pFilterTableNameIn)
 Write the filter table data to file. More...
 
int mdlFilterTable_mergeFilterTableDescr (MSElementDescrP pFilterTableDescrIO, DgnModelRefP pModelRefIn, WCharCP pFilterTableNameIn)
 Merge a given filter-table descriptor into the filters of specified filter-table. More...
 
StatusInt mdlFilterTable_traverseFilters (DgnModelRefP pModelRefIn, WCharCP pFilterTableNameIn, FilterTraverseCallback pUserFunctionIn, CallbackArgP pUserArgIn)
 Traverse thru' all the filters of given filter table name. More...
 
StatusInt mdlFilterTable_traverseMembers (DgnModelRefP pModelRefIn, WCharCP pFilterTableNameIn, MemberTraverseCallback pUserFunctionIn, CallbackArgP pUserArgIn)
 Traverse thru' all the members of given filter table name. More...
 
StatusInt mdlFilterTable_getFilterCount (int *pFilterCountOut, DgnModelRefP pModelRefIn, WCharCP pFilterTableNameIn, UShort filterCountTypeIn)
 Get the number of filters of given filter table. More...
 

Detailed Description

Function Documentation

StatusInt mdlFilterTable_getFilterCount ( int *  pFilterCountOut,
DgnModelRefP  pModelRefIn,
WCharCP  pFilterTableNameIn,
UShort  filterCountTypeIn 
)

Get the number of filters of given filter table.

Parameters
[out]pFilterCountOutfilter count
[in]pModelRefInmodel ref
[in]pFilterTableNameInfilter table name
[in]filterCountTypeInone of FILTER_COUNT_TYPE_... (defined in filtertable.h)
Returns
ERROR if the filter table name is not valid, else SUCCESS
StatusInt mdlFilterTable_initialize ( DgnModelRefP  pModelRefIn,
WCharCP  pFilterTableNameIn,
bool  bCreateIfRequiredIn 
)

Filters give the ability to create simple "query"-type expressions which can then be evaluated on specified data.

The result of the evaluation is "yes" or "no". "Yes" means that the data passed the "filter". "No" means that the data did not pass the "filter".

Following is a synposis of the support for filters:

  1. Ability to create different "named" filters. "Named" Filters are stored in a DGN file as regular table/table-entry elements.
  2. A filter can have one or more "filter members" (or criteria). Each Filter Member has a Name, an ID, a Type (such as Int, String, Double, Boolean, etc.) & an Expression "String". Levels will have a "level-name" member, whose "Value" will be a regular expression, such as "pi*". All levels which start with the words "pi" would meet this particular criteria. Other "level-filter" members will be based on level attributes like color, weight, style, etc. A level-color member's "Value" will be a comma separated list of color-ids. Levels, whose level color is a value within the comma separated list, would meet the level color criteria.
  3. Function "mdlFilter_apply" checks if given data passes thru' a specified filter. The function checks if the data passes thru' all of the filter's contained members (an AND relationship). mdlFilter_apply can be used in a variety of places. For example, the Level Manager will give an ability to display only those levels that pass thru' a specified named filter. To do this, the Level Manager will call mdlLevel_applyFilter.
  4. A set of filters can be grouped together to form a Parent Filter. This gives the ability to create an hierarchy of filters. Given data will pass thru' an Hierachical Filter if it passes thru' any one of its child/contained filters (an OR relationship).
  5. Filters can be derived from other filters. Using this way a new filter can composed of other filters using the standard set operators.

Initialize the specified filter table

Parameters
[in]pModelRefInmodel ref
[in]pFilterTableNameInfilter table name
[in]bCreateIfRequiredInif the filter-table cannot be extracted from file, then whether or not to create a default filter table
Returns
ERROR if the filter table cannot be initialized, else SUCCESS
bool mdlFilterTable_isValid ( DgnModelRefP  pModelRefIn,
WCharCP  pFilterTableNameIn 
)

Check if a filter table with specified name exists.

Parameters
[in]pModelRefInmodel ref
[in]pFilterTableNameInfilter table name
Returns
True if the filter-table exists, else false.
int mdlFilterTable_mergeFilterTableDescr ( MSElementDescrP  pFilterTableDescrIO,
DgnModelRefP  pModelRefIn,
WCharCP  pFilterTableNameIn 
)

Merge a given filter-table descriptor into the filters of specified filter-table.

The "filter-ids" of the merged filters is stored in "appData1" of the individual filter-entry descriptors.

Parameters
[in,out]pFilterTableDescrIOfilter table descriptor
[in]pModelRefInmodel ref
[in]pFilterTableNameInfilter table name
Returns
ERROR if the filter table name is not valid, else SUCCESS
StatusInt mdlFilterTable_rewrite ( DgnModelRefP  pModelRefIn,
WCharCP  pFilterTableNameIn 
)

Write the filter table data to file.

Parameters
[in]pModelRefInmodel ref
[in]pFilterTableNameInfilter table name
Returns
ERROR if the filter table name is not valid, else SUCCESS
StatusInt mdlFilterTable_traverseFilters ( DgnModelRefP  pModelRefIn,
WCharCP  pFilterTableNameIn,
FilterTraverseCallback  pUserFunctionIn,
CallbackArgP  pUserArgIn 
)

Traverse thru' all the filters of given filter table name.

The specified call-back function is called for each filter-entry.

Parameters
[in]pModelRefInmodel ref
[in]pFilterTableNameInfilter table name
[in]pUserFunctionInuser call-back function
[in]pUserArgInuser argument
Returns
ERROR if the filter table name is not valid, else SUCCESS
StatusInt mdlFilterTable_traverseMembers ( DgnModelRefP  pModelRefIn,
WCharCP  pFilterTableNameIn,
MemberTraverseCallback  pUserFunctionIn,
CallbackArgP  pUserArgIn 
)

Traverse thru' all the members of given filter table name.

The specified call-back function is called for each member-entry.

Parameters
[in]pModelRefInmodel ref
[in]pFilterTableNameInfilter table name
[in]pUserFunctionInuser call-back function
[in]pUserArgInuser argument
Returns
ERROR if the filter table name is not valid, else SUCCESS

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