Class: ComponentTree

ComponentTree(reporter, settings, instructions)

The ComponentTree, which is itself a buildable

Constructor

new ComponentTree(reporter, settings, instructions)

Parameters:
Name Type Description
reporter Reporter
settings Object
instructions Object
Properties
Name Type Attributes Default Description
externalTrees Array.<ComponentTree> <optional>
loader ComponentLoader <optional>
import Array.<Object.<string, ComponentClass>> <optional>
autoLinkDependencies Boolean <optional>
true
renderer WebGLRenderer <optional>
Source:

Extends

Members

(protected) _allDependencies :Array.<Component>

All "lower" components on which this component depends, either directly or indirectly
Type:
Overrides:
Source:

(protected) _applicableMaterialVariantGroups :Array.<MaterialSet>

The distinct material variant groups of this components and its dependencies
Type:
Overrides:
Source:

(protected) _assignableDependencies :Array.<(PositionedMesh|PositionedMeshGroup)>

Dependencies that can be assigned a material (does not necessarily affect the component itself)
Type:
Overrides:
Source:

(protected) _dependencies :Object

Type:
  • Object
Properties:
Name Type Description
main DependencyList
UI DependencyList
specs DependencyList
Overrides:
Source:

(protected) _directDependencies :Array.<Component>

All "lower" components on which this component depends directly
Type:
Overrides:
Source:

(protected) _externalTrees :Array.<ComponentTree>

External trees that components in this tree can depend on
Type:
Source:

(protected) _importInlined :Object.<string, ComponentClass>

The classes (constructors) that need to be imported inline, documented as any, bc of jsdoc/typescript incompatibility
Type:
Source:

(protected) _materializableDependencies :Array.<Component>

Dependencies that have a variable material (not necessarily directly assignable)
Type:
Overrides:
Source:

dependencies :Object

Type:
  • Object
Properties:
Name Type Description
main DependencyList
UI DependencyList
specs DependencyList
Overrides:
Source:

loader :ComponentLoader

Type:
Source:

partSettings :Array.<string>

Known UI settings (right now only thumbnail)
Type:
  • Array.<string>
Overrides:
Source:

pmremGenerator :PMREMGenerator

Type:
  • PMREMGenerator
Source:

renderer :WebGLRenderer

Renderer from project
Type:
  • WebGLRenderer
Source:

Methods

(static) linkJSONObj(tree, obj) → {Object}

Parameters:
Name Type Description
tree ComponentTree
obj Object Object to link
Source:
Returns:
Type
Object

(static) linkSetting(tree, prop, val) → {any}

Converts a JSON/text settings object to an object with built objects that can be used to instantiate new Components
Parameters:
Name Type Description
tree ComponentTree
prop string
val any
Source:
Returns:
Type
any

(protected) _addComponent(component, …moreComponents)

Parameters:
Name Type Attributes Description
component Component
moreComponents Component <repeatable>
Source:

(async, protected) _build(quality, dependencies) → {Promise.<Component>}

Parameters:
Name Type Description
quality LoadingQuality
dependencies Object.<string, Component> Dependencies that are loaded with the corresponding quality
Overrides:
Source:
Returns:
Type
Promise.<Component>

(protected) _throwIfDependingComponents(component)

Parameters:
Name Type Description
component Component
Source:

(protected) addComponent(component, …moreComponents)

Parameters:
Name Type Attributes Description
component Component
moreComponents Component <repeatable>
Source:

(async) autoUpdateStatus()

Updates the component's status according to the status of its dependencies
Overrides:
Source:

(async) build(instructionsopt) → {Promise.<BuildableComponent>}

Parameters:
Name Type Attributes Description
instructions Object <optional>
Properties
Name Type Attributes Default Description
componentLoader ComponentLoader <optional>
defaultLoader
part ComponentPart <optional>
'main'
quality LoadingQuality <optional>
'medium'
highPriority Boolean <optional>
false
Overrides:
Source:
Returns:
Type
Promise.<BuildableComponent>

dependsDirectlyOn() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

dependsOn() → {Boolean}

Overrides:
Source:
Returns:
Type
Boolean

findComponentById(id) → {Component|undefined}

Find a Component by Id in this class or its external trees
Parameters:
Name Type Description
id UUID
Source:
Returns:
Type
Component | undefined

findDependingComponents(component) → {Array.<Component>}

Parameters:
Name Type Description
component Component
Source:
Returns:
Type
Array.<Component>

importJSON(JSONObject) → {Array.<Component>}

Import from JSON
Parameters:
Name Type Description
JSONObject Object
Source:
Returns:
Type
Array.<Component>

removeComponent(component, includeDependenciesopt)

Parameters:
Name Type Attributes Description
component Component
includeDependencies Boolean <optional>
Source: