1/* 2 * Copyright (C) 2022 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17export enum ColorType { 18 VISIBLE, 19 NOT_VISIBLE, 20 HIGHLIGHTED, 21} 22 23export class Distance2D { 24 constructor(public dx: number, public dy: number) {} 25} 26 27export interface Box3D { 28 width: number; 29 height: number; 30 depth: number; 31 center: Point3D; 32 diagonal: number; 33} 34 35export interface Rect3D { 36 id: string; 37 topLeft: Point3D; 38 bottomRight: Point3D; 39 cornerRadius: number; 40 darkFactor: number; 41 colorType: ColorType; 42 isClickable: boolean; 43 transform: Transform3D; 44 isOversized: boolean; 45} 46 47export interface Transform3D { 48 dsdx: number; 49 dsdy: number; 50 tx: number; 51 dtdx: number; 52 dtdy: number; 53 ty: number; 54} 55 56export interface Point3D { 57 x: number; 58 y: number; 59 z: number; 60} 61 62export interface Label3D { 63 circle: Circle3D; 64 linePoints: Point3D[]; 65 textCenter: Point3D; 66 text: string; 67 isHighlighted: boolean; 68 rectId: string; 69} 70 71export interface Circle3D { 72 radius: number; 73 center: Point3D; 74} 75 76export interface Scene3D { 77 boundingBox: Box3D; 78 camera: Camera; 79 rects: Rect3D[]; 80 labels: Label3D[]; 81} 82 83export interface Camera { 84 rotationFactor: number; 85 zoomFactor: number; 86 panScreenDistance: Distance2D; 87} 88