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 17import {TransformMatrix} from 'common/geometry_types'; 18 19export enum ColorType { 20 VISIBLE, 21 VISIBLE_WITH_OPACITY, 22 NOT_VISIBLE, 23 HIGHLIGHTED, 24 HAS_CONTENT, 25 EMPTY, 26 HAS_CONTENT_AND_OPACITY, 27} 28 29export enum ShadingMode { 30 WIRE_FRAME = 'Wire frame', 31 GRADIENT = 'Shaded by gradient', 32 OPACITY = 'Shaded by opacity', 33} 34 35export class Distance2D { 36 constructor(public dx: number, public dy: number) {} 37} 38 39export interface Box3D { 40 width: number; 41 height: number; 42 depth: number; 43 center: Point3D; 44 diagonal: number; 45} 46 47export interface Rect3D { 48 id: string; 49 topLeft: Point3D; 50 bottomRight: Point3D; 51 cornerRadius: number; 52 darkFactor: number; 53 colorType: ColorType; 54 isClickable: boolean; 55 transform: TransformMatrix; 56 isOversized: boolean; 57} 58 59export interface Point3D { 60 x: number; 61 y: number; 62 z: number; 63} 64 65export interface Label3D { 66 circle: Circle3D; 67 linePoints: Point3D[]; 68 textCenter: Point3D; 69 text: string; 70 isHighlighted: boolean; 71 rectId: string; 72} 73 74export interface Circle3D { 75 radius: number; 76 center: Point3D; 77} 78 79export interface Scene3D { 80 boundingBox: Box3D; 81 camera: Camera; 82 rects: Rect3D[]; 83 labels: Label3D[]; 84} 85 86export interface Camera { 87 rotationFactor: number; 88 zoomFactor: number; 89 panScreenDistance: Distance2D; 90} 91