File

projects/angular-cesium/src/lib/angular-cesium/services/drawers/static-dynamic/static-primitive-drawer/static-primitive-drawer.service.ts

Description

This drawer is deprecated. General static primitives drawer responsible of drawing static Cesium primitives with material.

Extends

PrimitivesDrawerService

Index

Properties
Methods

Constructor

constructor(geometryType: any, cesiumService: CesiumService)
Parameters :
Name Type Optional
geometryType any No
cesiumService CesiumService No

Properties

Protected _cesiumCollection
_cesiumCollection: any
Type : any
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:11
Private _primitiveCollectionWrap
_primitiveCollectionWrap: any
Type : any
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:10
Protected _propsAssigner
_propsAssigner: Function
Type : Function
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:12
Private _show
_show:
Default value : true
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:9
Protected _propsAssigner
_propsAssigner: Function
Type : Function
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:6

Methods

add
add(geometryProps: any, instanceProps: any, primitiveProps: any)
Parameters :
Name Type Optional
geometryProps any No
instanceProps any No
primitiveProps any No
Returns : any
update
update(primitive: any, geometryProps: any, instanceProps: any, primitiveProps: any)
Parameters :
Name Type Optional
primitive any No
geometryProps any No
instanceProps any No
primitiveProps any No
Returns : any
add
add(cesiumProps: any, ...args: any[])
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:25
Parameters :
Name Type Optional
cesiumProps any No
args any[] No
Returns : any
getShow
getShow()
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:50
Returns : boolean
init
init()
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:18
Returns : void
remove
remove(entity: any)
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:37
Parameters :
Name Type Optional
entity any No
Returns : void
removeAll
removeAll()
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:41
Returns : void
setShow
setShow(showValue: boolean)
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:45
Parameters :
Name Type Optional
showValue boolean No
Returns : void
update
update(entity: any, cesiumProps: any, ...args: any[])
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:29
Parameters :
Name Type Optional
entity any No
cesiumProps any No
args any[] No
Returns : void
Abstract add
add(cesiumProps: any, ...args: any[])
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:11
Parameters :
Name Type Optional
cesiumProps any No
args any[] No
Returns : any
Abstract init
init(options?: any)
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:21
Parameters :
Name Type Optional
options any Yes
Returns : any
Abstract remove
remove(primitive: any)
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:15
Parameters :
Name Type Optional
primitive any No
Returns : void
Abstract removeAll
removeAll()
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:17
Returns : void
setPropsAssigner
setPropsAssigner(assigner: Function)
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:23
Parameters :
Name Type Optional
assigner Function No
Returns : void
Abstract setShow
setShow(showValue: boolean)
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:19
Parameters :
Name Type Optional
showValue boolean No
Returns : void
Abstract update
update(primitive: any, cesiumProps: any, ...args: any[])
Inherited from PrimitivesDrawerService
Defined in PrimitivesDrawerService:13
Parameters :
Name Type Optional
primitive any No
cesiumProps any No
args any[] No
Returns : void
import { PrimitivesDrawerService } from '../../primitives-drawer/primitives-drawer.service';
import { CesiumService } from '../../../cesium/cesium.service';

/**
 *
 * This drawer is deprecated.
 * General static primitives drawer responsible of drawing static Cesium primitives with material.
 */
export abstract class StaticPrimitiveDrawer extends PrimitivesDrawerService {
  constructor(private geometryType: any, cesiumService: CesiumService) {
    super(Cesium.PrimitiveCollection, cesiumService);
  }

  add(geometryProps: any, instanceProps: any, primitiveProps: any): any {
    if (Object.keys(instanceProps).length === 0) {
      throw(new Error('instanceProps object is empty'));
    }
    instanceProps.geometry = new this.geometryType(geometryProps);
    primitiveProps.geometryInstances = new Cesium.GeometryInstance(instanceProps);
    primitiveProps.asynchronous = false;
    const primitive = new Cesium.Primitive(primitiveProps);
    return super.add(primitive);
  }

  update(primitive: any, geometryProps: any, instanceProps: any, primitiveProps: any) {
    instanceProps.geometry = new this.geometryType(geometryProps);
    primitiveProps.geometryInstances = new Cesium.GeometryInstance(instanceProps);
    this._cesiumCollection.remove(primitive);
    return super.add(new Cesium.Primitive(primitiveProps));
  }
}

result-matching ""

    No results matching ""