InstanceGraphAPI#
Interface InstanceGraphAPI
Hierarchy
- InstanceGraphAPI
Index
Methods
Methods
add
- add(options): number
-
Adds a new Node to the InstanceGraph.
Parameters
-
options: AddNodeOptions
Specifies the options for the new Node.
Returns number
The id of added Node
-
- add(dataURI, parentID?, usage?, label?, contentType?, initialProperties?, cacheStrategy?): number
-
Parameters
-
dataURI: string
Specifies the URI to the data resource.
-
Optional
parentID: numberSpecifies the parent Node ID of the added Node.
-
Optional
usage: UsageStringThe usage parameter allows to define how the resource should be inserted in the InstanceGraph.
-
Optional
label: stringSpecifies a custom label for the added Node.
-
Optional
contentType: stringSpecifies the MimeType of the data resource.
-
Optional
initialProperties: InitialNodePropertiesSpecifies initialProperties of the added Node.
-
Optional
cacheStrategy: CacheStrategySpecifies the strategy which is used when a data cache is requested from the Hub.
Returns number
The id of added Node
Deprecated
Adds a new Node to the InstanceGraph.
-
add Custom Node
- add
Custom Node(customNodeType, data, dataType?): number -
Creates a custom Node with custom data which is stored in an Attachment.
Parameters
-
customNodeType: string
{string} Specifies the custom Node type.
-
data: any
{any} Specifies the data of the custom Node.
-
Optional
dataType: AttachmentType{AttachmentType="json"} Specifies the type of the data.
Returns number
-
collect Runtime Nodes Of Type
- collect
Runtime Nodes Of Type(nodeType, subType?): number[] -
Returns a list of all existing runtime Node ids of a specified type.
Parameters
-
nodeType: NodeType
The Node type to collect.
-
Optional
subType: stringThe sub type to collect. Only used for Custom-Nodes.
Returns number[]
A list of runtime Node ids of the specified type.
-
get Enabled Aux Nodes
- get
Enabled Aux Nodes(nodeID?): Promise<number[]> -
Parameters
-
Optional
nodeID: numberSpecifies the entry point of the subtree traversal (default: 0)
Returns Promise<number[]>
An Array of all enabled aux Node id's
Deprecated
This function will no longer be available in future webvis releases
Traverses the subtree of a given nodeID and collects all enabled aux Nodes.
-
get Metadata
get Properties
- get
Properties<T>(nodeID, properties): Promise<PropertyType<T>[]> -
Returns the values of the properties on the Node with the matching id.
Type Parameters
-
T extends string
Parameters
-
nodeID: number
The id of the Node whose properties should be read.
-
properties: T[]
The names of the properties whose value should be read.
Returns Promise<PropertyType<T>[]>
The retrieved values of the Node's properties.
-
get Property
- get
Property<T>(nodeID, property): Promise<PropertyType<T>> -
Returns the value of the property on the Node with the matching id.
Type Parameters
-
T extends string
Parameters
-
nodeID: number
The id of the Node whose property should be read.
-
property: T
The name of the property whose value should be read.
Returns Promise<PropertyType<T>>
The retrieved value of the Node property.
-
get Root Node Id
- get
Root Node Id(target, includeTarget?): number -
Returns the root Node id of the given Node or Topology Element.
Parameters
-
target: number | TopologyHandle
Specifies the target Node or Topology Element.
-
Optional
includeTarget: booleanControls if the target Node itself can be returned as root Node. If set to false and a root Node id is passed in, it returns the next higher root Node id.
Returns number
- The root Node id of the given Node id or Topology handle.
-
get Statistics
- get
Statistics(nodeType?, nodeID?, recursive?): Promise<any> -
Traverses the subtree of a given nodeID and collects all statistics (currently only available for AUX-Nodes).
Parameters
-
Optional
nodeType: NodeTypeSpecifies the target Node type.
-
Optional
nodeID: numberSpecifies the entry point of the subtree traversal (default: 0).
-
Optional
recursive: boolean
Returns Promise<any>
An Object of Type/Count pairs.
-
invert Enabled States
is Node Deletable
is Node Type
- is
Node Type(nodeID, nodeType): boolean -
Parameters
-
nodeID: number
-
nodeType: NodeType
Returns boolean
Checks the Node's type for the given Node id.
-
register Custom Property
remove
- remove(nodeID?, safe?): Promise<RemoveState>
-
Removes the Node for the given nodeID from the Scene and all related Snapshots. If no nodeID is supplied all Nodes are deleted.
Parameters
-
Optional
nodeID: number | number[]The id of the Node that should be removed.
-
Optional
safe: booleanPerforms a safe remove which interrupt the removal process if the Node is part of one or more Snapshots.
Returns Promise<RemoveState>
-
request Active Scene Volume
request Aux Root Node Ids
request Full Scene Volume
request L3DInformation
request Node Ids By Box Volume
- request
Node Ids By Box Volume(boxVolume, includeOverlappingNodes?, includeDisabledNodes?, forceExpand?, scopeNodeId?): Promise<number[]> -
Returns a List of all Node ids which are included or overlapped by the specified 3D world space Bounding Volume.
Parameters
-
boxVolume: BoxVolume
Specifies the 3D world space Bounding Volume.
-
Optional
includeOverlappingNodes: booleanSpecifies that the result should include Nodes which overlap the specified 3D world space Bounding Volume as well.
-
Optional
includeDisabledNodes: booleanSpecifies that the result should include Nodes which are disabled as well.
-
Optional
forceExpand: boolean -
Optional
scopeNodeId: numberSpecifies the top one Node id of the subtree to be searched.
Returns Promise<number[]>
List of all NodeIds which are included or overlapped by the specified 3D world space Bounding Volume.
-
request Root Node Ids
- request
Root Node Ids(scopeNodeId?, recursive?): Promise<number[]> -
Returns a list of all existing root Node ids below the specified subtree.
Parameters
-
Optional
scopeNodeId: numberSpecifies the top one Node id of the subtree to be searched.
-
Optional
recursive: booleanSpecifies if the subtree is traversed recursively.
Returns Promise<number[]>
A list of root Node ids.
-
reset Properties
- reset
Properties<T>(nodeID, properties, recursive?): Promise<void> -
Resets the value of the specified properties on the given Node.
Type Parameters
-
T extends string
Parameters
-
nodeID: number
The id of the Node whose property should be reset.
-
properties: T[]
List of properties which should be reset.
-
Optional
recursive: booleanIf set to true, the properties are reset recursively.
Returns Promise<void>
-
reset Property
- reset
Property<T>(nodeID, property, recursive?): Promise<void> -
Resets the value of the property on the Node with the matching id.
Type Parameters
-
T extends string
Parameters
-
nodeID: number
The id of the Node whose property should be reset.
-
property: T
Property which should be reset.
-
Optional
recursive: booleanIf set to true, the properties are reset recursively.
Returns Promise<void>
-
set Parent
set Property
- set
Property<T>(nodeID, property, value, silent?): Promise<void> -
Sets the property named property to value on the Node with id nodeID.
Type Parameters
-
T extends string
Parameters
-
nodeID: number | number[]
The id of the Node whose property has to be set.
-
property: T
The name of the property that has to be set.
-
value: PropertyType<T>
The new value of the specified property.
-
Optional
silent: booleanThe silent flag indicates that no NODE_CHANGED event is fired.
Returns Promise<void>
-
With the InstanceGraphAPI the content of webvis can be controlled and manipulated. It resembles a scene graph like tree structure of Nodes. Every Node can contain links to 3D geometry and/or group other Nodes.
The get- and set-Property functions allow setting and retrieving properties of arbitrary type on the Nodes. Properties are used to modify any Node dependent data like color, local transformation, etc. There is a set of predefined Node properties that webvis will react on, but the surrounding application might add any other property to the Nodes.