import { NgZone } from '@angular/core'; import { ActivatedRoute, Router } from '@angular/router'; import { Subject } from 'rxjs'; import { MattertagData } from '../mattertagData'; import { DbObjectType, IObject3D, MattertagActionMode, POI, PoiType, SpModule } from '../types.service'; import { BaseTagService } from './tag.service'; import { BaseVisibilityService } from './baseVisibility.service'; import { Config } from '../config'; import { CameraMode } from '../types.service'; import * as i0 from "@angular/core"; /** * Custom Threejs Object 3D interface */ interface ThreeJSObject3D { id: string; uuid?: string; position?: { x: number; y: number; z: number; }; rotation?: { x: number; y: number; z: number; }; scale?: { x: number; y: number; z: number; }; } declare global { interface Window { MP_SDK: { connect: Function; }; } } export declare class MatterportService { private router; private activeRoute; private visibilityService; private ngZone; private slots; private nodes; sdk: any; private container; private poseMatterport; poseCamera: { rotation: any; position: any; sweep: any; }; lastCameraPosition: any; private azimuthalCrown; private pointerButton; private getCursorPositionButton; private cursorPositionButtonDisplayed; private intervalCursorPointerPosition; private textDisplayCursorPositionPanel; private oldPoseMatterportPosition; private isMeasureModeOn; private interactionMode; private mattertagIDs; private dictionnaryTags; private dictionnaryObjects3D; private dictionnarySceneObjects3D; threeJSScene: any; private lastMeasure; private distancesLastMeasure; private resolution; private visibility; tagsAttachments: Object; private lastScreenshotUri; sweeps: Array | null; currentSweep: Subject; currentCameraPose: Subject; private floors?; private _currentSpaceID; private lastObject3D; private currentFloor; get currentSpaceID(): string; set currentSpaceID(value: string); timerPointer: any; forbiddenSweeps: string[]; tagAction: Subject<{ action: string; data: string; }>; mattertagToFollow: string | null; tagService: BaseTagService; config: Config; inTransitionMode: boolean; inTransitionSweep: boolean; private noLightForObjects; currentCameraMode: CameraMode; onCameraModeChanged: Subject; onGoToTag: Subject; tagMessengerOn: boolean; SPModule: SpModule; objectControl: any; private securityCameraAnimator; /** * Actions on left click when positioning mattertag in visit */ pointerLeftClickHandler: () => void; pointerRightClickHandler: (e: any) => void; pointerMiddleClickHandler: (e: any) => void; constructor(config: Config, router: Router, activeRoute: ActivatedRoute, visibilityService: BaseVisibilityService, ngZone: NgZone); /** * Initializes Matterport and all listeners/data * @param tagService BaseTagService (to inject html) * @param module SpModule (Museum, Immo) to subscribe only to needed functionnnalities * @returns boolean */ initSdk(tagService: BaseTagService, module?: SpModule): Promise; setLightingOff(): void; pointToString(point: { x: number; y: number; z: number; }): string; /** * Callback after measurement is performed */ getDistanceForLastMeasurement(): void; getLastDistances(): number[]; /** * Takes screenshot and saves base64 in lastScreenshotUri * @returns Promise */ takeScreenShot(): Promise; getScreenShotUri(): any; getLastMeasurement(): Object; /** * Styling of pointer */ updatePointerTrick(): void; /** * Realtime mattertag following the cursor * @param mattertag string */ enable_following_tag(mattertag: string): void; /** * Get the distance betwween two 3D positions * Used in order to see how much the cursor has moved from the previous position * @param pos1 * @param pos2 */ getDistPosition(pos1: any, pos2: any): number; /** * Creates the Mattertag that will follow the cursor * @param mattertagData MattertagData */ addCursorMattertag(mattertagData: MattertagData): Promise; /** * Adds Mattertag to viewer for an existing object with coordinates (in mattertagData.poi) * (position, injected html, set icon) * @param mattertagData * returns mattertagID */ addMattertagToViewer(mattertagData: MattertagData): Promise; /** * Actions when position of mattertag is validated by left click */ onValidatedMattertag(): void; /** * Registers new icon (path to image) and set its for Mattertag * @param mattertagID string * @param iconPath string */ addNewIconAndSetForTag(mattertagID: string, iconPath: string): Promise; /** * Changes icon of Mattertag (the iconName should be registered = one of default ones) * @param mattertagID string * @param iconName string */ setRegistredIconForTag(mattertagID: string, iconName: string): Promise; /** * Sets default icon for a tag (registered in initSdk) OR uses tagIcon from POI (available from MattertagData) * @param mattertagID string * @param mattertagData MattertagData * @returns */ setTagIconAndOpacity(mattertagID: string, mattertagData: MattertagData): Promise; /** * Moves viewer to last tag created */ goToLastTag(): void; /** * Moves viewer to Mattertag with ID provided * @param mattertagID string * @returns */ goToTag(mattertagID: string): Promise; /** * Updates content of Mattertag with mattertagID (billboard, injected html, tag icon) * @param mattertagID string * @param object Ticket, Equipment, Feature, etc * @param tagType PoiType */ updateMatterTagContentForTagID(mattertagID: string, object?: DbObjectType, tagType?: PoiType): Promise; /** * Updates injected html for Mattertag * @param mattertagID string * @param object Ticket, Equipment, Feature, etc * @param tagType PoiType */ updateInjectedHtmlForTagID(mattertagID: string, object: any, tagType: PoiType): Promise; /** * Deletes Mattertag from Viewer by its ID * @param mattertagID string */ deleteMattertagFromId(mattertagID: string): void; /** * Deletes latest created mattertag */ deleteLastMattertag(): void; /** * Legacy: used to be called action_add_mattertag_from_POI * Adds and configures Mattertag for an object (Ticket, Equipment, Feature, etc) that corresponds to POI (coordinates, tagIcon) * @param tagType PoiType * @param object Ticket, Equipment, Feature... * @param poi POI * @returns */ createMattertagFromPOI(tagType: PoiType, object: DbObjectType, poi: POI): Promise; /** * Inject custom HTML as Mattertag content * @param tagType PoiType * @param object Ticket, Equipment, Feature etc * @param tagID string */ injectHtmlInTag(tagType: PoiType, object: DbObjectType, tagID: string): Promise; action_delete_all_mattertags(): Promise; /** * Deletes Mattertag from visit associated with object ID (ticketID, etc) * @param elementID string */ deleteMattertagForObject(elementID: string): Promise; /** * uuid from threejs * @param uuid */ deleteObject3D(uuid: string): Promise; getObject3DModelNodeFromDictionnary(uuid: string): any; /** * Creates MattertagData and start repositioning (creates temporary mattertag that follows the cursor) * @param poiType PoiType * @param element Ticket, Equipment, Feature, etc */ addMattertagWhenRepositioning(poiType: PoiType, element: DbObjectType): Promise; /** * Creates MattertagData and mattertag that follows the cursor when choosing position for a new object * @param poiType */ addMattertagWhenAdding(poiType: PoiType): Promise; /** * Cancels following of cursor (meaning deleting last Mattertag) */ cancelFollowingCursor(): void; setLastObject3D(lastObject3D: ThreeJSObject3D): void; getLastObject3D(): ThreeJSObject3D; /** * Performs callback after mattertag position was validated (creation of object or repositioning) * @param mode MattertagActionMode */ callbackAfterMattertagValidation(mode: MattertagActionMode): void; /** * Fully updates existing Mattertag content with data of object (Ticket, Equipment, Desk) * @param mattertagID string * @param object Ticket, Equipment, Feature, Desk * @param poiType PoiType * @param poi POI */ setObjectAndPoiInTag(mattertagID: string, object: DbObjectType, poiType: PoiType, poi?: POI | null): Promise; updateMatterTagPosInSdkViewer(mattertagID: string, object: DbObjectType, poiType: PoiType, poi?: POI | null): Promise; /** * Gets matterTagID and its sweep for an object ID (ticket ID, etc) * @param elementID string * @returns {tag: string | null, sweep: string | null} */ getTagFromElementId(elementID: string): { tag: string | null; sweep: string | null; }; /** * Gets latest tag created in the visit (when following the cursor to position) * @returns string mattertagID */ getLastTag(): string | null; /** * Gets MattertagData for Mattertag (replaces getTagDataFromId) * @param mattertagID * @returns MattertagData */ getMatterTagDataForMattertag(mattertagID: string): MattertagData | null; action_toolbox_floorplan(): Promise; action_toolbox_inside_view(): void; actionShowAllFloors(): void; action_toolbox_dollhouse(): Promise; action_toolbox_mesure(): void; action_toolbox_cancel_mesure(): void; action_go_to_floor(floorName: string, matterportFloorSequence?: number): Promise; action_go_to_sweep(sweep: string, rotation?: { x: number; y: number; }): Promise; getCurrentSweep(): string | null; getCurrentCameraPosition(): { rotation: any; position: any; sweep: any; } | null; setInteractionMode(interactionMode: number): void; getInteractionMode(): number; /** * Clear all variables, deletes all tags (when viewer is remover or model changed=reload needed) */ clearAll(): Promise; removeForbiddenSweeps(forbiddenSweeps: string[]): Promise; init3DObjectViewer(): Promise; add3DObject(obj: IObject3D, mode?: 'translate' | 'rotate'): Promise; toggleObjectVisibility(objectId: any): void; isObjectVisible(objectId: any): boolean; pointCameraTo3DObject(objectId: any): Promise; getSceneNodeFromObject3DId(uuid: string): any; displayAzimutalCrown(): Promise; attachGizmoControlTo3DObject(modelNode: any, sceneObject: any, mode: 'translate' | 'rotate' | 'scale', visible: boolean, isNewObject: boolean): Promise; removeGizmoFromLastObject(): void; toggleViewFrustum(): void; static ɵfac: i0.ɵɵFactoryDeclaration; static ɵprov: i0.ɵɵInjectableDeclaration; } export {};