MetaScene
Metadata corresponding to a Scene.
- Located in Viewer#metaScene.
- Contains MetaModels and MetaObjects.
- Scene graph example with metadata
Member Summary
Public Members | ||
public |
metaModels: {String: MetaModel} The MetaModels belonging to this MetaScene, each mapped to its MetaModel#modelId. |
|
public |
metaObjects: {String: MetaObject} The MetaObjects belonging to this MetaScene, each mapped to its MetaObject#id. |
|
public |
metaObjectsByType: {String: MetaObject} The MetaObjects belonging to this MetaScene, each mapped to its MetaObject#type. |
|
public |
propertySets: {String: PropertySet} The PropertySets belonging to this MetaScene, each mapped to its PropertySet#id. |
|
public |
rootMetaObjects: {String: MetaObject} The root MetaObjects belonging to this MetaScene, each mapped to its MetaObject#id. |
|
public |
The Scene. |
|
public |
The Viewer. |
Method Summary
Public Methods | ||
public |
createMetaModel(modelId: String, metaModelData: Object, options: Object): MetaModel Creates a MetaModel in this MetaScene. |
|
public |
destroyMetaModel(metaModelId: String) Removes a MetaModel from this MetaScene. |
|
public |
Fires an event at this Viewer. |
|
public |
getObjectIDsByType(type: String): String[] Gets the MetaObject#ids of the MetaObjects that have the given MetaObject#type. |
|
public |
getObjectIDsInSubtree(id: String, includeTypes: String[], excludeTypes: String[]): String[] Gets the MetaObject#ids of the MetaObjects within the given subtree. |
|
public |
off(event: *) Unsubscribes from an event fired at this Viewer. |
|
public |
Subscribes to an event fired at this Viewer. |
|
public |
withMetaObjectsInSubtree(id: String, callback: Function) Iterates over the MetaObjects within the subtree. |
Public Members
public metaModels: {String: MetaModel} source
The MetaModels belonging to this MetaScene, each mapped to its MetaModel#modelId.
public metaObjects: {String: MetaObject} source
The MetaObjects belonging to this MetaScene, each mapped to its MetaObject#id.
public metaObjectsByType: {String: MetaObject} source
The MetaObjects belonging to this MetaScene, each mapped to its MetaObject#type.
public propertySets: {String: PropertySet} source
The PropertySets belonging to this MetaScene, each mapped to its PropertySet#id.
public rootMetaObjects: {String: MetaObject} source
The root MetaObjects belonging to this MetaScene, each mapped to its MetaObject#id.
Public Methods
public createMetaModel(modelId: String, metaModelData: Object, options: Object): MetaModel source
Creates a MetaModel in this MetaScene.
The MetaModel will contain a hierarchy of MetaObjects, created from the
meta objects in metaModelData
.
The meta object hierarchy in metaModelData
is expected to be non-cyclic, with a single root. If the meta
objects are cyclic, then this method will log an error and attempt to recover by creating a dummy root MetaObject
of type "Model" and connecting all other MetaObjects as its direct children. If the meta objects contain multiple
roots, then this method similarly attempts to recover by creating a dummy root MetaObject of type "Model" and
connecting all the root MetaObjects as its children.
Params:
Name | Type | Attribute | Description |
modelId | String | ID for the new MetaModel, which will have MetaModel#id set to this value. |
|
metaModelData | Object | Data for the MetaModel. |
|
options | Object |
|
Options for creating the MetaModel. |
options.globalizeObjectIds | Boolean |
|
Whether to globalize each MetaObject#id. Set this |
public destroyMetaModel(metaModelId: String) source
Removes a MetaModel from this MetaScene.
Fires a "metaModelDestroyed" event with the value of the MetaModel#id.
public getObjectIDsByType(type: String): String[] source
Gets the MetaObject#ids of the MetaObjects that have the given MetaObject#type.
Params:
Name | Type | Attribute | Description |
type | String | The type. |
public getObjectIDsInSubtree(id: String, includeTypes: String[], excludeTypes: String[]): String[] source
Gets the MetaObject#ids of the MetaObjects within the given subtree.
Params:
Name | Type | Attribute | Description |
id | String | ID of the root MetaObject of the given subtree. |
|
includeTypes | String[] |
|
Optional list of types to include. |
excludeTypes | String[] |
|
Optional list of types to exclude. |
public off(event: *) source
Unsubscribes from an event fired at this Viewer.
Params:
Name | Type | Attribute | Description |
event | * |
public withMetaObjectsInSubtree(id: String, callback: Function) source
Iterates over the MetaObjects within the subtree.
Params:
Name | Type | Attribute | Description |
id | String | ID of root MetaObject. |
|
callback | Function | Callback fired at each MetaObject. |