@c8y/ngx-components
Version:
Angular modules for Cumulocity IoT applications
94 lines (88 loc) • 4.4 kB
TypeScript
import * as i0 from '@angular/core';
import { AfterViewInit, OnInit, OnDestroy, OnChanges, SimpleChanges } from '@angular/core';
import { Observable, BehaviorSubject } from 'rxjs';
import * as THREE from 'three';
import { DynamicComponent, DynamicComponentAlertAggregator, MeasurementRealtimeService, OnBeforeSave } from '@c8y/ngx-components';
import { ContextDashboardComponent } from '@c8y/ngx-components/context-dashboard';
import { FormBuilder, NgForm } from '@angular/forms';
interface ThreeDRotationWidgetConfig {
device: {
id: string | number;
name?: string;
};
isWireframe: boolean;
objectModel: string;
cameraType: string;
}
interface ThreeDRotationWidgetRotate {
x: number;
y: number;
z: number;
}
declare class ThreeDRotationComponent implements AfterViewInit, OnInit, OnDestroy {
private canvasRef;
angles$: Observable<ThreeDRotationWidgetRotate>;
modelObj$: Observable<any>;
cameraType$: Observable<string>;
isWireframe$: Observable<boolean>;
get canvas(): HTMLCanvasElement | null;
scene: THREE.Scene;
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
model: THREE.Object3D;
private renderer;
private afterViewInit$;
private renderSubscription;
private controls;
ngOnInit(): void;
ngOnDestroy(): void;
ngAfterViewInit(): void;
loadModel(modelObj: any, three: typeof THREE): Promise<THREE.Object3D<THREE.Object3DEventMap>>;
setupRenderer(three: typeof THREE): Promise<void>;
setWireframe(parsedModel: THREE.Object3D, isWireframe: boolean): THREE.Object3D<THREE.Object3DEventMap>;
private render;
private createScene;
private createCamera;
private getAspectRatio;
static ɵfac: i0.ɵɵFactoryDeclaration<ThreeDRotationComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ThreeDRotationComponent, "c8y-three-d-rotation", never, { "angles$": { "alias": "angles$"; "required": false; }; "modelObj$": { "alias": "modelObj$"; "required": false; }; "cameraType$": { "alias": "cameraType$"; "required": false; }; "isWireframe$": { "alias": "isWireframe$"; "required": false; }; }, {}, never, never, true, never>;
}
declare class ThreeDRotationWidgetViewComponent implements OnChanges, OnInit, DynamicComponent {
private measurementRealtime;
private dashboard;
config: ThreeDRotationWidgetConfig;
alerts: DynamicComponentAlertAggregator;
webGLAvailable: i0.WritableSignal<boolean>;
angles$: Observable<ThreeDRotationWidgetRotate>;
modelObj$: Observable<any>;
deviceId$: BehaviorSubject<string>;
modelName$: BehaviorSubject<string>;
cameraType$: BehaviorSubject<string>;
isWireframe$: BehaviorSubject<boolean>;
private webGLErrorText;
constructor(measurementRealtime: MeasurementRealtimeService, dashboard: ContextDashboardComponent);
ngOnInit(): void;
ngOnChanges(changes: SimpleChanges): void;
private onConfigChange;
private getModelUrl;
private getAnglesOfDevice$;
private convertValues;
private isWebGLAvailable;
static ɵfac: i0.ɵɵFactoryDeclaration<ThreeDRotationWidgetViewComponent, [null, { optional: true; }]>;
static ɵcmp: i0.ɵɵComponentDeclaration<ThreeDRotationWidgetViewComponent, "c8y-three-d-rotation-widget-view", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
}
declare class ThreeDRotationWidgetConfigComponent implements OnInit, OnBeforeSave {
private formBuilder;
private form;
config: ThreeDRotationWidgetConfig;
formGroup: ReturnType<ThreeDRotationWidgetConfigComponent['createForm']>;
constructor(formBuilder: FormBuilder, form: NgForm);
onBeforeSave(config?: ThreeDRotationWidgetConfig): boolean | Promise<boolean> | Observable<boolean>;
ngOnInit(): void;
private initForm;
private createForm;
static ɵfac: i0.ɵɵFactoryDeclaration<ThreeDRotationWidgetConfigComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<ThreeDRotationWidgetConfigComponent, "c8y-three-d-rotation-widget-config", never, { "config": { "alias": "config"; "required": false; }; }, {}, never, never, true, never>;
}
export { ThreeDRotationComponent, ThreeDRotationWidgetConfigComponent, ThreeDRotationWidgetViewComponent };
export type { ThreeDRotationWidgetConfig, ThreeDRotationWidgetRotate };
//# sourceMappingURL=index.d.ts.map