Accessors
filteringState
get filteringState(): FilteringState
Returns the current FilteringState.
Returns: FilteringState
Methods
hideObjects
hideObjects(
objectIds: string[],
stateKey: string = null,
includeDescendants = false,
ghost = false
): FilteringState
Hides the specified object ids.
Parameters
- objectIds: The ids of the objects to hide
- optional stateKey: A way of splitting up commands coming from different controls (model explorer, filters, selection) so the viewer filtering api can know whether to reset its internal state or not
- optional includeDescendants: Whether to include the descendants of the provided object ids
- optional ghost Whether to ghost the rest of the objects
Returns: FilteringState
isolateObjects
isolateObjects(
objectIds: string[],
stateKey: string = null,
includeDescendants = true,
ghost = true
): FilteringState
Hides the specified object ids.
Parameters
- objectIds: The ids of the objects to hide
- optional stateKey: A way of splitting up commands coming from different controls (model explorer, filters, selection) so the viewer filtering api can know whether to reset its internal state or not
- optional includeDescendants: Whether to include the descendants of the provided object ids
- optional ghost Whether to ghost the rest of the objects
Returns: FilteringState
isolateObjects
removeColorFilter(): FilteringState
Removes any current color filters.
Returns: FilteringState
removeUserObjectColors
removeUserObjectColors(): FilteringState
Removes any current user color filters.
Returns: FilteringState
resetFilters
resetFilters(): FilteringState
Removes al the current filters.
Returns: FilteringState
setColorFilter
setColorFilter(prop: PropertyInfo, ghost = true): FilteringState
Applies a color filter.
Parameters
- prop: PropertyInfo
- optional ghost” Whether to ghost the rest of the objects
Returns: FilteringState
setUserObjectColors
setUserObjectColors(
groups: { objectIds: string[]; color: string }[]
): FilteringState
Applies a user color filter.
If used appropriately user color filters can typically be much more performant than applying multiple materials per color.
Parameters
- groups: Groups of objects organized by color
Returns: FilteringState
showObjects
showObjects(
objectIds: string[],
stateKey: string = null,
includeDescendants = false
): FilteringState
Shows the specified object ids.
Parameters
- objectIds: The ids of the objects to hide
- optional stateKey: A way of splitting up commands coming from different controls (model explorer, filters, selection) so the viewer filtering api can know whether to reset its internal state or not
- optional includeDescendants: Whether to include the descendants of the provided object ids
Returns: FilteringState
unIsolateObjects
unIsolateObjects(
objectIds: string[],
stateKey: string = null,
includeDescendants = true,
ghost = true
): FilteringState
Shows the specified object ids.
Parameters
- objectIds: The ids of the objects to hide
- optional stateKey: A way of splitting up commands coming from different controls (model explorer, filters, selection) so the viewer filtering api can know whether to reset its internal state or not
- optional includeDescendants: Whether to include the descendants of the provided object ids
- optional ghost Whether to ghost the rest of the objects
Returns: FilteringState
Typedefs
FilteringState
type FilteringState = {
selectedObjects?: string[];
hiddenObjects?: string[];
isolatedObjects?: string[];
colorGroups?: Record<string, string>[];
userColorGroups?: { ids: string[]; color: string }[];
activePropFilterKey?: string;
passMin?: number | null;
passMax?: number | null;
};
- selectedObjects: The current selected object ids
- hidenObjects: The current hidden object ids
- isolatedObjects: The current isolated object ids
- colorGroups: The current color groups
- userColorGroups: The current user color groups
- activePropFilterKey: The active property filtering key
- passMin: The minimal value of the property filtering value if numeric
- passMax: The maximum value of the property filtering value if numeric
PropertyInfo
interface PropertyInfo {
key: string;
objectCount: number;
type: 'number' | 'string';
}
Outline of a filterable property.
- key: The property key
- objectCount: The object count where the key is present
- type: Property type