Enumeration VisualStates

The VisualStates enum tells how the elements of the DMU are rendered.

A DMU is composed of parts, like a bolt, a rivet, a panel. All the parts in the API are referenced by a unique part id. The majority of the parts of the DMU may have a graphical representation (model), but it is not required. Some part do not have any graphical representation at all. Some different parts may share the same graphical representation (depending on their path of instantiation).

A part will potentially be instantiated several times (it is rare that a DMU is composed of only 1 bolt !). Each instance has a unique part instance id. And each instance of the same part shares the same graphical representation. All the part instances that share the same graphical representation, at the same position and orientation will share a unique and identical geometric instance id. Thus, generally all the part instances represented by the same geometric instance ids are the expression of the same part, but there may be cases when they do not come from the same part. A single geometric instance id may be the expression of multiple part instance id, and multiple part id!

The API features multiple converters {@link PartInstanceConverterInterface}, {@link DocumentIdConverterInterface}, {@link GeometricInstanceConverterInterface} that allows the conversion between these ids.

Warning : there is no continuity of these ids whenever a new build is created. Storing such ids in applications is not a reliable way to replay a result !!!. The developer should focus on storing the information of filters (part name, etc ...) and search (content on search query) rather than storing these ids.
Each geometric Instance id has a visibility (or visual) state, telling if such an object is hidden, selected, ghosted, or set to ignore cut planes. The VisualStates enumeration tells about the graphical representation of a geometric Instance id. The state is a set of flags (with the "|" (or) operator) to allow the combination of multiple states.

Warning : the API uses internally other flags that should not be messed with. The developer should only change flags exposed here.

The flag manipulation is set with the methods InfiniteEngineInterface.updateGeometricState and InfiniteEngineInterface.updateGeometricStateForAll that takes a mask to show the bits that will be modified:
ex: (VisualStates.S_Hidden | VisualStates.S_Ghost) to change the hidden and ghost states at once
and the actual bits to set:
ex : ((~VisualStates.S_Hidden) | VisualStates.S_Ghost) to set the objects visible and ghosted.

/** 
* Sample to illustrate how to change the visibility of a set of `geometric instances`.
*/
import { InfiniteEngineInterface, VisualStates } from 'generated_files/documentation/appinfiniteapi';

// created previously
let lInfiniteEngine : InfiniteEngineInterface;

// 8 bits for visibility
// sets all instances visible and not ghosted (do not care about "x" values)
// Mask => xxxx 1101
//
// not ghosted => xxxx x0xx
// not hidden (visible) => xxxx 0xx0
// we want to set => xxxx 00x0
// we can use 0 for values !!!!
lInfiniteEngine.updateGeometricStateForAll(VisualStates.S_Ghost | VisualStates.S_Hidden, 0);

// sets 2 instances hidden, but clear the ghost for them, and clear selection
// Mask => xxxx 1111
//
// not ghosted => xxxx x0xx
// hidden => xxxx 1xx1
// not selected => xxxx xx0x
// we want to set => xxxx 1001
// we can use VisualStates.S_Hidden for values !!!!
const lCurrentGeometries : Uint32Array = new Uint32Array(2);
lCurrentGeometries[0] = 57;
lCurrentGeometries[1] = 64;
lInfiniteEngine.updateGeometricState(lCurrentGeometries, VisualStates.S_Ghost | VisualStates.S_Hidden | VisualStates.S_Selected, VisualStates.S_Hidden);

VisualStates are used with an InfiniteEngineInterface.
3D Rendering

Enumeration Members

S_Ghost: 4

The object is ghosted. If there is an InfiniteEngineInterface, then the object is rendered semi transparent in a light blue color.

S_Hidden: 1

The object is hidden.

S_IgnoreCutPlane: 128

The object is not impacted by cut planes. Cut plane will not be applied to this object.

S_Selected: 2

The object is selected. If there is an InfiniteEngineInterface, then the object is rendered with an orange pulse. Any object with the S_Selected "flag" is visible, even if S_Hidden is set. Such an object is NOT rendered as ghosted even is S_Ghost is set.