File

projects/atft/src/lib/object/loader/abstract-model-loader.ts

Description

Helper parentScene class for model loader.

See ObjLoaderComponent

Extends

AbstractLazyObject3D

Index

Properties
Methods
Inputs
Outputs
Accessors

Inputs

model
Type : string

The model data source (usually a URI). Settings this property only hides the previous model upon successful loading of the new one. This especially means that if the new data source is invalid, the old model will not be removed from the scene.

layer
Type : number
Default value : 0
Inherited from AbstractObject3D
name
Type : string
Default value : uuidv4()
Inherited from AbstractObject3D
rotateX
Type : number
Inherited from AbstractObject3D

Rotation in Euler angles (radians) with order X, Y, Z.

rotateY
Type : number
Inherited from AbstractObject3D
rotateZ
Type : number
Inherited from AbstractObject3D
scaleX
Type : number
Default value : 1
Inherited from AbstractObject3D
scaleY
Type : number
Default value : 1
Inherited from AbstractObject3D
scaleZ
Type : number
Default value : 1
Inherited from AbstractObject3D
translateX
Type : number
Inherited from AbstractObject3D

Translate the geometry. This is typically done as a one time operation, and not during a loop.

translateY
Type : number
Inherited from AbstractObject3D
translateZ
Type : number
Inherited from AbstractObject3D

Outputs

changed
Type : EventEmitter
Inherited from AbstractObject3D

Methods

Protected afterInit
afterInit()
Inherited from AbstractObject3D
Returns : void
Protected Abstract loadLazyObject
loadLazyObject()
Inherited from AbstractLazyObject3D

Abstract method for lazy loading

Returns : Promise<THREE.Object3D>
Protected newObject3DInstance
newObject3DInstance()
Inherited from AbstractObject3D
Returns : THREE.Object3D
ngOnDestroy
ngOnDestroy()
Inherited from AbstractObject3D
Returns : void
Protected startLoading
startLoading()
Inherited from AbstractLazyObject3D
Returns : void
Public addChild
addChild(object: AbstractObject3D<any>)
Inherited from AbstractObject3D
Parameters :
Name Type Optional
object AbstractObject3D<any> No
Returns : void
Public applyRotation
applyRotation()
Inherited from AbstractObject3D
Returns : void
Public applyScale
applyScale()
Inherited from AbstractObject3D
Returns : void
Public applyTranslation
applyTranslation()
Inherited from AbstractObject3D
Returns : void
Public findByName
findByName(name: string)
Inherited from AbstractObject3D
Parameters :
Name Type Optional
name string No
Returns : any
Public getChildren
getChildren()
Inherited from AbstractObject3D
Public getObject
getObject()
Inherited from AbstractObject3D
Returns : T
Public ngAfterViewInit
ngAfterViewInit()
Inherited from AbstractObject3D
Returns : void
Public ngOnChanges
ngOnChanges(changes: SimpleChanges)
Inherited from AbstractObject3D
Parameters :
Name Type Optional
changes SimpleChanges No
Returns : void
Public ngOnInit
ngOnInit()
Inherited from AbstractObject3D
Returns : void
Protected recursionByName
recursionByName(currentNode: AbstractObject3D<any>, name: string)
Inherited from AbstractObject3D
Parameters :
Name Type Optional
currentNode AbstractObject3D<any> No
name string No
Returns : any
Public removeChild
removeChild(object: AbstractObject3D<any>)
Inherited from AbstractObject3D
Parameters :
Name Type Optional
object AbstractObject3D<any> No
Returns : void
Public removeChildByName
removeChildByName(name: string)
Inherited from AbstractObject3D
Parameters :
Name Type Optional
name string No
Returns : void
Public updateParent
updateParent()
Inherited from AbstractObject3D
Returns : void

Properties

Protected _model
Type : string
Protected lazyObject
Type : THREE.Object3D | undefined
Inherited from AbstractLazyObject3D

This is reference to lazy loaded Object3D (async after init)

Private parentInitialized
Default value : false
Inherited from AbstractLazyObject3D

Flag to signal whether the parentScene class instance AbstractObject3D called the overwritten method AbstractModelLoader yet.

Unless that method was called, no methods and properties of AbstractObject3D may be safely accessed, especially AbstractObject3D and AbstractObject3D.renderer.

Protected childlren
Type : Array<AbstractObject3D<any>>
Default value : []
Inherited from AbstractObject3D
Protected object
Type : T
Inherited from AbstractObject3D

Accessors

model
getmodel()

The current model data source (usually a URI).

setmodel(newModelUrl: string)

The model data source (usually a URI). Settings this property only hides the previous model upon successful loading of the new one. This especially means that if the new data source is invalid, the old model will not be removed from the scene.

Parameters :
Name Type Optional
newModelUrl string No
Returns : void
import {Directive, Input} from '@angular/core';
import {AbstractLazyObject3D} from '../abstract-lazy-object-3d';

/**
 * Helper parentScene class for model loader.
 *
 * @see ObjLoaderComponent
 */
@Directive()
export abstract class AbstractModelLoader extends AbstractLazyObject3D {

  protected _model!: string;

  /**
   * The model data source (usually a URI).
   * Settings this property only hides the previous model upon successful
   * loading of the new one. This especially means that if the new data source
   * is invalid, the old model will *not* be removed from the scene.
   */
  @Input()
  public set model(newModelUrl: string) {
    // console.log('AbstractModelLoader.model', newModelUrl);
    this._model = newModelUrl;
    if (this.object) {
      super.startLoading();
    }
  }

  /**
   * The current model data source (usually a URI).
   */
  public get model() {
    return this._model;
  }

}

results matching ""

    No results matching ""