feature:package改为npm引用
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,7 +6,7 @@
|
|||||||
.pnp.js
|
.pnp.js
|
||||||
package-lock.json
|
package-lock.json
|
||||||
.idea
|
.idea
|
||||||
/public/demo/projects
|
/public/demo/libs
|
||||||
|
|
||||||
# testing
|
# testing
|
||||||
/coverage
|
/coverage
|
||||||
|
31
config-overrides.js
Normal file
31
config-overrides.js
Normal file
@ -0,0 +1,31 @@
|
|||||||
|
const CopyPlugin = require("copy-webpack-plugin");
|
||||||
|
const path = require("path");
|
||||||
|
|
||||||
|
const sdkPath = path.resolve(
|
||||||
|
__dirname,
|
||||||
|
"node_modules/@pattern-x/gemini-viewer-threejs/dist"
|
||||||
|
);
|
||||||
|
|
||||||
|
module.exports = {
|
||||||
|
webpack: function (config, env) {
|
||||||
|
let demoDistPath = path.resolve(__dirname, "public/demo/libs");
|
||||||
|
if (env === 'production') {
|
||||||
|
demoDistPath = path.resolve(__dirname, "build/demo/libs");
|
||||||
|
}
|
||||||
|
//do stuff with the webpack config...
|
||||||
|
config.optimization.minimizer[0].options.extractComments = false;
|
||||||
|
config.plugins.push(
|
||||||
|
new CopyPlugin({
|
||||||
|
patterns: [{ force: true, from: sdkPath, to: demoDistPath }],
|
||||||
|
})
|
||||||
|
);
|
||||||
|
return config;
|
||||||
|
},
|
||||||
|
devServer: function(configFunction) {
|
||||||
|
return function(proxy, allowedHost) {
|
||||||
|
const config = configFunction(proxy, allowedHost);
|
||||||
|
config.devMiddleware.writeToDisk = true;
|
||||||
|
return config;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
};
|
11
package.json
11
package.json
@ -9,6 +9,7 @@
|
|||||||
"@codemirror/lang-javascript": "^6.1.1",
|
"@codemirror/lang-javascript": "^6.1.1",
|
||||||
"@codemirror/state": "^6.1.2",
|
"@codemirror/state": "^6.1.2",
|
||||||
"@codemirror/view": "^6.4.0",
|
"@codemirror/view": "^6.4.0",
|
||||||
|
"@pattern-x/gemini-viewer-threejs": "latest",
|
||||||
"@testing-library/jest-dom": "^5.16.5",
|
"@testing-library/jest-dom": "^5.16.5",
|
||||||
"@testing-library/react": "^13.4.0",
|
"@testing-library/react": "^13.4.0",
|
||||||
"@testing-library/user-event": "^13.5.0",
|
"@testing-library/user-event": "^13.5.0",
|
||||||
@ -29,9 +30,9 @@
|
|||||||
"web-vitals": "^2.1.4"
|
"web-vitals": "^2.1.4"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "react-scripts start",
|
"start": "react-app-rewired start",
|
||||||
"build": "react-scripts build",
|
"build": "react-app-rewired build",
|
||||||
"test": "react-scripts test",
|
"test": "react-app-rewired test",
|
||||||
"eject": "react-scripts eject"
|
"eject": "react-scripts eject"
|
||||||
},
|
},
|
||||||
"eslintConfig": {
|
"eslintConfig": {
|
||||||
@ -51,5 +52,9 @@
|
|||||||
"last 1 firefox version",
|
"last 1 firefox version",
|
||||||
"last 1 safari version"
|
"last 1 safari version"
|
||||||
]
|
]
|
||||||
|
},
|
||||||
|
"devDependencies": {
|
||||||
|
"copy-webpack-plugin": "^11.0.0",
|
||||||
|
"react-app-rewired": "^2.2.1"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
4
public/demo/libs/gemini-viewer.esm.min.js
vendored
4
public/demo/libs/gemini-viewer.esm.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,6 +1,6 @@
|
|||||||
import { IconClass } from "../../core/utils/CommonUtils";
|
import { Tooltip } from "../../components/tool-tip";
|
||||||
import { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
import { IconClass } from "../../core/utils";
|
||||||
import { Tooltip } from "../tool-tip/Tooltip";
|
import { BaseViewer } from "../../core/viewers/BaseViewer";
|
||||||
declare enum BottomBarItemId {
|
declare enum BottomBarItemId {
|
||||||
statistics = "statistics",
|
statistics = "statistics",
|
||||||
cameraInfo = "cameraInfo",
|
cameraInfo = "cameraInfo",
|
||||||
@ -16,16 +16,16 @@ interface BottomBarItemConfig {
|
|||||||
onUpdate?: (item: BottomBarItem) => void;
|
onUpdate?: (item: BottomBarItem) => void;
|
||||||
}
|
}
|
||||||
export declare class BottomBar {
|
export declare class BottomBar {
|
||||||
protected readonly viewer: BimViewer | DxfViewer | VRViewer;
|
protected readonly viewer: BaseViewer;
|
||||||
private element;
|
private element;
|
||||||
itemList: Map<string, BottomBarItem>;
|
itemList: Map<string, BottomBarItem>;
|
||||||
constructor(viewer: BimViewer | DxfViewer | VRViewer);
|
constructor(viewer: BaseViewer);
|
||||||
update(): void;
|
update(): void;
|
||||||
private init;
|
private init;
|
||||||
private createItem;
|
private createItem;
|
||||||
}
|
}
|
||||||
declare class BottomBarItem {
|
declare class BottomBarItem {
|
||||||
readonly viewer: BimViewer | DxfViewer | VRViewer;
|
readonly viewer: BaseViewer;
|
||||||
private readonly bottomBar;
|
private readonly bottomBar;
|
||||||
protected readonly menuId: string;
|
protected readonly menuId: string;
|
||||||
protected cfg: BottomBarItemConfig;
|
protected cfg: BottomBarItemConfig;
|
||||||
@ -34,7 +34,7 @@ declare class BottomBarItem {
|
|||||||
tooltip: Tooltip;
|
tooltip: Tooltip;
|
||||||
element: HTMLElement;
|
element: HTMLElement;
|
||||||
active: boolean;
|
active: boolean;
|
||||||
constructor(viewer: BimViewer | DxfViewer | VRViewer, bottomBar: BottomBar, menuId: string, cfg: BottomBarItemConfig);
|
constructor(viewer: BaseViewer, bottomBar: BottomBar, menuId: string, cfg: BottomBarItemConfig);
|
||||||
private createButton;
|
private createButton;
|
||||||
setActive(active: boolean): void;
|
setActive(active: boolean): void;
|
||||||
update(): void;
|
update(): void;
|
||||||
|
@ -1,9 +1,9 @@
|
|||||||
|
import { Toolbar } from "../../components/toolbar";
|
||||||
import { Context as ContextFromConfigs, ContextMenuConfig as ContextMenuConfigFromConfigs, ContextMenuItem } from "../../core/Configs";
|
import { Context as ContextFromConfigs, ContextMenuConfig as ContextMenuConfigFromConfigs, ContextMenuItem } from "../../core/Configs";
|
||||||
import { AxisPlaneSection, ObjectsBoxSection, ObjectsPlaneSection, PickPlaneSection } from "../../core/section";
|
import type { AxisPlaneSection, ObjectsBoxSection, PickPlaneSection } from "../../core/section";
|
||||||
import { BimViewer } from "../../core/viewers";
|
import type { BimViewer } from "../../core/viewers";
|
||||||
import { Toolbar } from "../toolbar";
|
|
||||||
export interface Context extends ContextFromConfigs {
|
export interface Context extends ContextFromConfigs {
|
||||||
section?: ObjectsBoxSection | ObjectsPlaneSection | PickPlaneSection | AxisPlaneSection;
|
section?: ObjectsBoxSection | PickPlaneSection | AxisPlaneSection;
|
||||||
toolbar?: Toolbar<BimViewer>;
|
toolbar?: Toolbar<BimViewer>;
|
||||||
}
|
}
|
||||||
export interface ContextMenuConfig extends ContextMenuConfigFromConfigs {
|
export interface ContextMenuConfig extends ContextMenuConfigFromConfigs {
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as dat from "dat.gui";
|
import * as dat from "dat.gui";
|
||||||
import { Exploder } from "../../core/exploder/Exploder";
|
import { Exploder } from "../../core/exploder/Exploder";
|
||||||
import { BimViewer } from "../../core/viewers";
|
import type { BimViewer } from "../../core/viewers";
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { DxfViewer } from "../../core/viewers";
|
import type { DxfViewer } from "../../core/viewers";
|
||||||
export declare class DxfLayoutBar {
|
export declare class DxfLayoutBar {
|
||||||
protected readonly viewer: DxfViewer;
|
protected readonly viewer: DxfViewer;
|
||||||
private element?;
|
private element?;
|
||||||
|
@ -1,18 +1,16 @@
|
|||||||
import { Emitter } from "mitt";
|
|
||||||
import { PopPanel } from "./PopPanel";
|
import { PopPanel } from "./PopPanel";
|
||||||
import { AxisType } from "../../core/section/AxisPlaneSection";
|
import { AxisPlaneSection } from "../../core/section/AxisPlaneSection";
|
||||||
export type Events = {
|
import type { BaseViewer } from "../../core/viewers/BaseViewer";
|
||||||
axis: AxisType;
|
|
||||||
visible: boolean;
|
|
||||||
};
|
|
||||||
export declare class AxisSectionPopPanel extends PopPanel {
|
export declare class AxisSectionPopPanel extends PopPanel {
|
||||||
protected axis: string;
|
protected axis: string;
|
||||||
protected activeItem?: string;
|
protected activeItem?: string;
|
||||||
protected groupSelectNode?: HTMLElement;
|
protected groupSelectNode?: HTMLElement;
|
||||||
protected activeSelectNode?: HTMLElement;
|
protected activeSelectNode?: HTMLElement;
|
||||||
protected isVisible: boolean;
|
protected isVisible: boolean;
|
||||||
eventBus: Emitter<Events>;
|
protected section: AxisPlaneSection;
|
||||||
constructor(container?: HTMLElement);
|
constructor(viewer: BaseViewer);
|
||||||
|
keydown: (e: KeyboardEvent) => void;
|
||||||
|
destroy(): void;
|
||||||
createGroupSelectLayout(): void;
|
createGroupSelectLayout(): void;
|
||||||
addGroupSelectItems(): void;
|
addGroupSelectItems(): void;
|
||||||
createActiveSelectLayout(): void;
|
createActiveSelectLayout(): void;
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
import { Emitter } from "mitt";
|
|
||||||
import { PopPanel } from "./PopPanel";
|
import { PopPanel } from "./PopPanel";
|
||||||
export type Events = {
|
import type { PickPlaneSection } from "../../core/section/PickPlaneSection";
|
||||||
visible: boolean;
|
import type { BaseViewer } from "../../core/viewers/BaseViewer";
|
||||||
reset: void;
|
|
||||||
};
|
|
||||||
export declare class PickSectionPopPanel extends PopPanel {
|
export declare class PickSectionPopPanel extends PopPanel {
|
||||||
eventBus: Emitter<Events>;
|
|
||||||
protected activeSelectNode?: Element;
|
protected activeSelectNode?: Element;
|
||||||
protected isVisible: boolean;
|
protected isVisible: boolean;
|
||||||
protected enabled: boolean;
|
protected enabled: boolean;
|
||||||
protected visibleNode?: HTMLElement;
|
protected visibleNode?: HTMLElement;
|
||||||
protected resetNode?: HTMLElement;
|
protected resetNode?: HTMLElement;
|
||||||
constructor(container?: HTMLElement);
|
protected section: PickPlaneSection;
|
||||||
|
constructor(viewer: BaseViewer);
|
||||||
|
keydown: (e: KeyboardEvent) => void;
|
||||||
|
destroy(): void;
|
||||||
createActiveSelectLayout(): void;
|
createActiveSelectLayout(): void;
|
||||||
addActiveItems(): void;
|
addActiveItems(): void;
|
||||||
enable(): void;
|
enable(): void;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Toolbar } from "./Toolbar";
|
import { Toolbar } from "./Toolbar";
|
||||||
import { ToolbarConfig, ToolbarMenuId } from "./Toolbar.constants";
|
import { ToolbarConfig, ToolbarMenuId } from "./Toolbar.constants";
|
||||||
import { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
import type { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
@ -10,4 +10,5 @@ export declare const DEFAULT_MARKUP_TOOLBAR_CONFIG: ToolbarConfig<DxfViewer>;
|
|||||||
*/
|
*/
|
||||||
export declare class MarkupToolbar<T extends BimViewer | DxfViewer | VRViewer> extends Toolbar<T> {
|
export declare class MarkupToolbar<T extends BimViewer | DxfViewer | VRViewer> extends Toolbar<T> {
|
||||||
constructor(bimViewer: T, menuConfig: ToolbarConfig<T>, groupConfig?: ToolbarMenuId[][] | string[][]);
|
constructor(bimViewer: T, menuConfig: ToolbarConfig<T>, groupConfig?: ToolbarMenuId[][] | string[][]);
|
||||||
|
keydown: () => void;
|
||||||
}
|
}
|
||||||
|
@ -1,16 +1,9 @@
|
|||||||
import { ToolbarConfig, ToolbarMenuId } from "./Toolbar.constants";
|
import { ToolbarConfig } from "./Toolbar.constants";
|
||||||
import { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
import type { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
||||||
/**
|
|
||||||
* Toolbar.config
|
|
||||||
**/
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export declare const DEFAULT_BIMVIEWER_TOOLBAR_CONFIG: ToolbarConfig<BimViewer>;
|
export declare const DEFAULT_BIMVIEWER_TOOLBAR_CONFIG: ToolbarConfig<BimViewer>;
|
||||||
/**
|
|
||||||
* @internal
|
|
||||||
*/
|
|
||||||
export declare const GROUP_CONFIG: ToolbarMenuId[][];
|
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
import { Toolbar } from "./Toolbar";
|
import type { Toolbar } from "./Toolbar";
|
||||||
import { IconClass } from "../../core/utils";
|
import { IconClass } from "../../core/utils";
|
||||||
import type { BaseViewer } from "../../core/viewers";
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
/**
|
/**
|
||||||
@ -53,7 +53,7 @@ export declare enum ToolbarMenuId {
|
|||||||
Section = "Section",
|
Section = "Section",
|
||||||
SectionBox = "SectionBox",
|
SectionBox = "SectionBox",
|
||||||
SectionPlane = "SectionPlane",
|
SectionPlane = "SectionPlane",
|
||||||
AxisSectionPlane = "AxisSectionPlane",
|
SectionAxis = "SectionAxis",
|
||||||
BimTree = "BimTree",
|
BimTree = "BimTree",
|
||||||
Viewpoint = "Viewpoint",
|
Viewpoint = "Viewpoint",
|
||||||
Annotation = "Annotation",
|
Annotation = "Annotation",
|
||||||
@ -64,7 +64,8 @@ export declare enum ToolbarMenuId {
|
|||||||
Fullscreen = "FullScreen",
|
Fullscreen = "FullScreen",
|
||||||
SceneClear = "SceneClear",
|
SceneClear = "SceneClear",
|
||||||
Layers = "Layers",
|
Layers = "Layers",
|
||||||
ZoomToRectangle = "ZoomToRectangle"
|
ZoomToRectangle = "ZoomToRectangle",
|
||||||
|
Screenshot = "GetScreenshot"
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* ToolbarConfig
|
* ToolbarConfig
|
||||||
@ -89,3 +90,7 @@ export interface ToolbarMenuConfig<T extends BaseViewer> {
|
|||||||
export type ToolbarConfig<T extends BaseViewer> = {
|
export type ToolbarConfig<T extends BaseViewer> = {
|
||||||
[key in ToolbarMenuId]?: ToolbarMenuConfig<T>;
|
[key in ToolbarMenuId]?: ToolbarMenuConfig<T>;
|
||||||
};
|
};
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
export declare const GROUP_CONFIG: ToolbarMenuId[][];
|
||||||
|
@ -44,9 +44,13 @@ declare class Toolbar<T extends BaseViewer> {
|
|||||||
readonly menuConfig: ToolbarConfig<T>;
|
readonly menuConfig: ToolbarConfig<T>;
|
||||||
groupConfig: ToolbarMenuId[][] | string[][];
|
groupConfig: ToolbarMenuId[][] | string[][];
|
||||||
private element;
|
private element;
|
||||||
|
private visible;
|
||||||
|
activateMenuId?: string;
|
||||||
menuList: Map<string, ToolbarMenu<T>>;
|
menuList: Map<string, ToolbarMenu<T>>;
|
||||||
constructor(bimViewer: T, menuConfig: ToolbarConfig<T>, groupConfig?: ToolbarMenuId[][] | string[][]);
|
constructor(bimViewer: T, menuConfig: ToolbarConfig<T>, groupConfig?: ToolbarMenuId[][] | string[][]);
|
||||||
private init;
|
private init;
|
||||||
|
keydown: (e: KeyboardEvent) => void;
|
||||||
|
clearActive(): void;
|
||||||
private createToolbarMenu;
|
private createToolbarMenu;
|
||||||
/**
|
/**
|
||||||
* @description Modify the menu configuration and update the toolbar.
|
* @description Modify the menu configuration and update the toolbar.
|
||||||
|
47
public/demo/libs/types/src/core/Configs.d.ts
vendored
47
public/demo/libs/types/src/core/Configs.d.ts
vendored
@ -1,5 +1,5 @@
|
|||||||
import type { BimViewer, DxfViewer, VRViewer } from "./viewers";
|
|
||||||
import { ToolbarMenuConfig, ToolbarMenuId } from "../components/toolbar";
|
import { ToolbarMenuConfig, ToolbarMenuId } from "../components/toolbar";
|
||||||
|
import type { BimViewer, DxfViewer, VRViewer } from "../core/viewers";
|
||||||
/**
|
/**
|
||||||
* Camera config
|
* Camera config
|
||||||
*/
|
*/
|
||||||
@ -72,6 +72,7 @@ export interface ModelConfig {
|
|||||||
instantiate?: boolean;
|
instantiate?: boolean;
|
||||||
/**
|
/**
|
||||||
* If we want to merge meshes/lines/points with the same material
|
* If we want to merge meshes/lines/points with the same material
|
||||||
|
* @internal
|
||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
merge?: boolean;
|
merge?: boolean;
|
||||||
@ -146,6 +147,20 @@ export interface BaseViewerConfig {
|
|||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
language?: "cn" | "en";
|
language?: "cn" | "en";
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
logLevel?: "debug" | "info" | "warn" | "error" | "silent";
|
||||||
|
/**
|
||||||
|
* @description just for react native
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
context?: WebGLRenderingContext | WebGL2RenderingContext;
|
||||||
|
/**
|
||||||
|
* @description just for react native
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
context2d?: CanvasRenderingContext2D;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This wrappers most config for BimViewer
|
* This wrappers most config for BimViewer
|
||||||
@ -211,12 +226,27 @@ export interface BimViewerConfig extends BaseViewerConfig {
|
|||||||
* This wrappers most config for DxfViewer
|
* This wrappers most config for DxfViewer
|
||||||
*/
|
*/
|
||||||
export interface DxfViewerConfig extends BaseViewerConfig {
|
export interface DxfViewerConfig extends BaseViewerConfig {
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
enableAxisGizmo?: boolean;
|
enableAxisGizmo?: boolean;
|
||||||
enableLayoutBar?: boolean;
|
enableLayoutBar?: boolean;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
enableStats?: boolean;
|
enableStats?: boolean;
|
||||||
enableToolbar?: boolean;
|
enableToolbar?: boolean;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
enableSpinner?: boolean;
|
enableSpinner?: boolean;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
enableProgressBar?: boolean;
|
enableProgressBar?: boolean;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
enableBottomBar?: boolean;
|
enableBottomBar?: boolean;
|
||||||
/**
|
/**
|
||||||
* If to cache model into indexeddb (or maybe local storage in future).
|
* If to cache model into indexeddb (or maybe local storage in future).
|
||||||
@ -227,6 +257,7 @@ export interface DxfViewerConfig extends BaseViewerConfig {
|
|||||||
enableLocalCache?: boolean;
|
enableLocalCache?: boolean;
|
||||||
/**
|
/**
|
||||||
* If user can select an entity by mouse click
|
* If user can select an entity by mouse click
|
||||||
|
* @internal
|
||||||
* @default false
|
* @default false
|
||||||
*/
|
*/
|
||||||
enableSelection?: boolean;
|
enableSelection?: boolean;
|
||||||
@ -242,8 +273,14 @@ export interface DxfViewerConfig extends BaseViewerConfig {
|
|||||||
*/
|
*/
|
||||||
export interface VRViewerConfig extends BaseViewerConfig {
|
export interface VRViewerConfig extends BaseViewerConfig {
|
||||||
autoRotateSpeed?: number;
|
autoRotateSpeed?: number;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
enableAxisGizmo?: boolean;
|
enableAxisGizmo?: boolean;
|
||||||
enableToolbar?: boolean;
|
enableToolbar?: boolean;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
enableBottomBar?: boolean;
|
enableBottomBar?: boolean;
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
@ -318,3 +355,11 @@ export interface IsolateObjectsParam {
|
|||||||
export interface IsolateObjectsParams {
|
export interface IsolateObjectsParams {
|
||||||
familyInstanceIds: IsolateObjectsParam[];
|
familyInstanceIds: IsolateObjectsParam[];
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
|
export interface ScreenshotConfig {
|
||||||
|
type: string;
|
||||||
|
quality: number;
|
||||||
|
includeOverlay: boolean;
|
||||||
|
}
|
||||||
|
16
public/demo/libs/types/src/core/Constants.d.ts
vendored
16
public/demo/libs/types/src/core/Constants.d.ts
vendored
@ -100,20 +100,16 @@ export declare enum SectionType {
|
|||||||
PickPlaneSection = "PickPlaneSection",
|
PickPlaneSection = "PickPlaneSection",
|
||||||
AxisPlaneSection = "AxisPlaneSection"
|
AxisPlaneSection = "AxisPlaneSection"
|
||||||
}
|
}
|
||||||
/**
|
export interface Vector2 {
|
||||||
* @deprecated Use SectionType instead
|
x: number;
|
||||||
*/
|
y: number;
|
||||||
export declare enum SectionMode {
|
|
||||||
ObjectsBoxSection = "ObjectsBoxSection",
|
|
||||||
PickPlaneSection = "PickPlaneSection",
|
|
||||||
AxisPlaneSection = "AxisPlaneSection"
|
|
||||||
}
|
}
|
||||||
export interface Vector3 {
|
export interface Vector3 {
|
||||||
x: number;
|
x: number;
|
||||||
y: number;
|
y: number;
|
||||||
z: number;
|
z: number;
|
||||||
}
|
}
|
||||||
export interface Vector2 {
|
export interface Box2 {
|
||||||
x: number;
|
min: Vector2;
|
||||||
y: number;
|
max: Vector2;
|
||||||
}
|
}
|
||||||
|
@ -1,10 +1,16 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { DrawableData } from "./Constants";
|
import { DrawableData } from "./Constants";
|
||||||
import { Drawable } from "./Drawable";
|
import { Drawable } from "./Drawable";
|
||||||
import { DrawableList } from "./DrawableList";
|
import type { DrawableList } from "./DrawableList";
|
||||||
import { Event } from "../utils";
|
import { Event } from "../../core/utils";
|
||||||
import type { BimViewer, DxfViewer } from "../viewers";
|
import type { BimViewer, DxfViewer } from "../../core/viewers";
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
export type constructorReturnType<T> = new (...arg: any) => T;
|
export type constructorReturnType<T> = new (...arg: any) => T;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
export declare class CanvasRender extends Event {
|
export declare class CanvasRender extends Event {
|
||||||
private viewer;
|
private viewer;
|
||||||
private drawableLists;
|
private drawableLists;
|
||||||
@ -33,5 +39,10 @@ export declare class CanvasRender extends Event {
|
|||||||
type: string;
|
type: string;
|
||||||
quality: number;
|
quality: number;
|
||||||
}): Promise<string | undefined>;
|
}): Promise<string | undefined>;
|
||||||
|
getImage(option?: {
|
||||||
|
type: string;
|
||||||
|
quality: number;
|
||||||
|
}): string | undefined;
|
||||||
|
getCanvas(): HTMLCanvasElement | undefined;
|
||||||
destroy(): void;
|
destroy(): void;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
/**
|
/**
|
||||||
* Markup data
|
* Markup data
|
||||||
|
* @internal
|
||||||
*/
|
*/
|
||||||
export interface DrawableData {
|
export interface DrawableData {
|
||||||
/**
|
/**
|
||||||
@ -7,15 +8,16 @@ export interface DrawableData {
|
|||||||
*/
|
*/
|
||||||
id: string;
|
id: string;
|
||||||
/**
|
/**
|
||||||
* Two dimension float array stores 2d points.
|
* Two dimension float array stores 2d or 3d points.
|
||||||
* e.g. [[1, 1], [2.5, 3]]
|
* e.g., You can use "[[1, 1], [2.5, 3]]" to represent a distance measurement result
|
||||||
|
* "[1, 1]" is the first point, and "[2.5, 3]" is the second point.
|
||||||
*/
|
*/
|
||||||
points: number[][];
|
points: number[][];
|
||||||
lineWidth?: number;
|
lineWidth?: number;
|
||||||
lineColor?: string;
|
lineColor?: string;
|
||||||
fillColor?: string;
|
fillColor?: string;
|
||||||
/**
|
/**
|
||||||
* is class type for serialize
|
* Drawable dta type
|
||||||
*/
|
*/
|
||||||
type: string;
|
type: string;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,9 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { DrawableData } from "./Constants";
|
import { DrawableData } from "./Constants";
|
||||||
import { Event } from "../utils";
|
import { Event } from "../../core/utils";
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
export declare abstract class Drawable extends Event {
|
export declare abstract class Drawable extends Event {
|
||||||
protected readonly DEFAULT_LINE_WIDTH = 1;
|
protected readonly DEFAULT_LINE_WIDTH = 1;
|
||||||
protected readonly DEFAULT_STROKE_STYLE = "#000000";
|
protected readonly DEFAULT_STROKE_STYLE = "#000000";
|
||||||
|
@ -1,9 +1,16 @@
|
|||||||
import { DrawableData } from "./Constants";
|
import { DrawableData } from "./Constants";
|
||||||
import { Drawable } from "./Drawable";
|
import { Drawable } from "./Drawable";
|
||||||
|
import { Event } from "../../core/utils";
|
||||||
|
type DrawableListHandler = {
|
||||||
|
addDrawable: DrawableData;
|
||||||
|
updateDrawable: DrawableData;
|
||||||
|
removeDrawable: DrawableData;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* A group of Drawlables for a certain category
|
* A group of Drawlables for a certain category
|
||||||
|
* @internal
|
||||||
*/
|
*/
|
||||||
export declare class DrawableList {
|
export declare class DrawableList extends Event<DrawableListHandler> {
|
||||||
private category;
|
private category;
|
||||||
private drawableMap;
|
private drawableMap;
|
||||||
constructor(category: string);
|
constructor(category: string);
|
||||||
@ -17,3 +24,4 @@ export declare class DrawableList {
|
|||||||
setDrawableDatas(drawableDatas: DrawableData[]): void;
|
setDrawableDatas(drawableDatas: DrawableData[]): void;
|
||||||
getDrawableByPosition(p: THREE.Vector3, raycaster?: THREE.Raycaster): Drawable | undefined;
|
getDrawableByPosition(p: THREE.Vector3, raycaster?: THREE.Raycaster): Drawable | undefined;
|
||||||
}
|
}
|
||||||
|
export {};
|
||||||
|
@ -1,4 +1,4 @@
|
|||||||
export * from "./CanvasRender";
|
export * from "./CanvasRender";
|
||||||
export { DrawableList } from "./DrawableList";
|
export * from "./DrawableList";
|
||||||
export { Drawable } from "./Drawable";
|
export * from "./Drawable";
|
||||||
export * from "./Constants";
|
export * from "./Constants";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { Drawable } from "../canvas";
|
import { Drawable } from "../../core/canvas";
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
@ -1,12 +1,11 @@
|
|||||||
import { DxfChange } from "../dxf";
|
|
||||||
import { Event } from "../utils";
|
|
||||||
import type { DxfViewer } from "../viewers";
|
import type { DxfViewer } from "../viewers";
|
||||||
|
import { DxfChange } from "../../core/dxf";
|
||||||
|
import { Event } from "../../core/utils";
|
||||||
export declare class DxfCompareMarkupManager extends Event {
|
export declare class DxfCompareMarkupManager extends Event {
|
||||||
private viewer;
|
private viewer;
|
||||||
private overlayRender?;
|
private overlayRender?;
|
||||||
private drawableList;
|
private drawableList;
|
||||||
constructor(viewer: DxfViewer);
|
constructor(viewer: DxfViewer);
|
||||||
render(): void;
|
|
||||||
drawCompareDrawable(changes: Record<string, DxfChange>): void;
|
drawCompareDrawable(changes: Record<string, DxfChange>): void;
|
||||||
setCompareDrawableVisible(visilbe: boolean): void;
|
setCompareDrawableVisible(visilbe: boolean): void;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { EventDispatcher, PerspectiveCamera, Vector3 } from "three";
|
import { EventDispatcher, PerspectiveCamera, Vector3 } from "three";
|
||||||
import { ControlsHelper } from "../helpers/ControlsHelper";
|
import type { ControlsHelper } from "../../core/helpers";
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
@ -1 +1,2 @@
|
|||||||
export * from "./VRControls";
|
export * from "./VRControls";
|
||||||
|
export * from "./CameraControlsEx";
|
||||||
|
@ -89,7 +89,7 @@ export interface ILineTypeTableDefinition {
|
|||||||
parseTableRecords(): Record<string, ILineType>;
|
parseTableRecords(): Record<string, ILineType>;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* @internal
|
* dwg layer
|
||||||
*/
|
*/
|
||||||
export interface ILayer {
|
export interface ILayer {
|
||||||
name: string;
|
name: string;
|
||||||
@ -302,4 +302,9 @@ export default class DxfParser {
|
|||||||
parseSync(source: string | ArrayBuffer): IDxf;
|
parseSync(source: string | ArrayBuffer): IDxf;
|
||||||
parseStream(stream: Readable): Promise<IDxf>;
|
parseStream(stream: Readable): Promise<IDxf>;
|
||||||
private _parse;
|
private _parse;
|
||||||
|
/**
|
||||||
|
* Splits a string to string array by line separator, "\r\n", "\r", "\n", etc.
|
||||||
|
* We do this instead of using "String.prototype.split(/\r\n|\r|\n/g)", because it is extreamly slow!
|
||||||
|
*/
|
||||||
|
private splitByLineSeparator;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface I3DfaceEntity extends IEntity {
|
export interface I3DfaceEntity extends IEntity {
|
||||||
shape: boolean;
|
shape: boolean;
|
||||||
hasContinuousLinetypePattern: boolean;
|
hasContinuousLinetypePattern: boolean;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface IAttdefEntity extends IEntity {
|
export interface IAttdefEntity extends IEntity {
|
||||||
xScale: number;
|
xScale: number;
|
||||||
textStyle: "STANDARD" | string;
|
textStyle: "STANDARD" | string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface IAttribEntity extends IEntity {
|
export interface IAttribEntity extends IEntity {
|
||||||
xScale: number;
|
xScale: number;
|
||||||
textStyle: "STANDARD" | string;
|
textStyle: "STANDARD" | string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface ICircleEntity extends IEntity {
|
export interface ICircleEntity extends IEntity {
|
||||||
center: IPoint;
|
center: IPoint;
|
||||||
radius: number;
|
radius: number;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface IDimensionEntity extends IEntity {
|
export interface IDimensionEntity extends IEntity {
|
||||||
block: string;
|
block: string;
|
||||||
dimStyleName: string;
|
dimStyleName: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface IEllipseEntity extends IEntity {
|
export interface IEllipseEntity extends IEntity {
|
||||||
center: IPoint;
|
center: IPoint;
|
||||||
majorAxisEndPoint: IPoint;
|
majorAxisEndPoint: IPoint;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export declare enum HatchBoundaryPathTypeFlag {
|
export declare enum HatchBoundaryPathTypeFlag {
|
||||||
Default = 0,
|
Default = 0,
|
||||||
External = 1,
|
External = 1,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface ILeaderEntity extends IEntity {
|
export interface ILeaderEntity extends IEntity {
|
||||||
leaderStyleId: number;
|
leaderStyleId: number;
|
||||||
leaderLineType: number;
|
leaderLineType: number;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity } from "./geomtry";
|
||||||
export interface IOleEntity extends IEntity {
|
export interface IOleEntity extends IEntity {
|
||||||
documentType: string;
|
documentType: string;
|
||||||
version: number;
|
version: number;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity } from "./geomtry";
|
||||||
export interface IRegionEntity extends IEntity {
|
export interface IRegionEntity extends IEntity {
|
||||||
modelerVersion?: number;
|
modelerVersion?: number;
|
||||||
proprietaryData?: string;
|
proprietaryData?: string;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface ISolidEntity extends IEntity {
|
export interface ISolidEntity extends IEntity {
|
||||||
points: IPoint[];
|
points: IPoint[];
|
||||||
extrusionDirection: IPoint;
|
extrusionDirection: IPoint;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface ISplineEntity extends IEntity {
|
export interface ISplineEntity extends IEntity {
|
||||||
controlPoints?: IPoint[];
|
controlPoints?: IPoint[];
|
||||||
fitPoints?: IPoint[];
|
fitPoints?: IPoint[];
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface ITextEntity extends IEntity {
|
export interface ITextEntity extends IEntity {
|
||||||
startPoint: IPoint;
|
startPoint: IPoint;
|
||||||
endPoint: IPoint;
|
endPoint: IPoint;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||||
export interface IViewportEntity extends IEntity {
|
export interface IViewportEntity extends IEntity {
|
||||||
centerPoint: IPoint;
|
centerPoint: IPoint;
|
||||||
width_paperSpace: number;
|
width_paperSpace: number;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IObject, IObjectParser } from "./common";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import { IObject, IObjectParser } from "./common";
|
||||||
export declare enum DictionaryCloningFlags {
|
export declare enum DictionaryCloningFlags {
|
||||||
NotApplicable = 0,
|
NotApplicable = 0,
|
||||||
KeepExisting = 1,
|
KeepExisting = 1,
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { IObject, IObjectParser } from "./common";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
|
import { IObject, IObjectParser } from "./common";
|
||||||
export interface ISortEntsObject extends IObject {
|
export interface ISortEntsObject extends IObject {
|
||||||
entityHandles: string[][];
|
entityHandles: string[][];
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { IObject, IObjectParser } from "./common";
|
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
import { IPoint } from "../entities/geomtry";
|
import { IPoint } from "../entities/geomtry";
|
||||||
|
import { IObject, IObjectParser } from "./common";
|
||||||
export interface ISpatialFilterObject extends IObject {
|
export interface ISpatialFilterObject extends IObject {
|
||||||
origin: IPoint;
|
origin: IPoint;
|
||||||
numberOfPointsOnClipBoundary: number;
|
numberOfPointsOnClipBoundary: number;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
|
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||||
import { IObject, IObjectParser } from "./common";
|
import { IObject, IObjectParser } from "./common";
|
||||||
import { DictionaryCloningFlags } from "./dictionary";
|
import { DictionaryCloningFlags } from "./dictionary";
|
||||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
|
||||||
export interface IXRecord extends IObject {
|
export interface IXRecord extends IObject {
|
||||||
binaryData: string | undefined;
|
binaryData: string | undefined;
|
||||||
cloningFlag: DictionaryCloningFlags;
|
cloningFlag: DictionaryCloningFlags;
|
||||||
|
@ -1,11 +1,11 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { Font } from "three/examples/jsm/loaders/FontLoader.js";
|
import { Font } from "three/examples/jsm/loaders/FontLoader.js";
|
||||||
import { DxfChange, DxfChangeType } from "./DxfCompare";
|
import { DxfChange, DxfChangeType } from "./DxfCompare";
|
||||||
import { Units } from "../Units";
|
import { Units } from "../../core/Units";
|
||||||
import { IBlock, IDxf, IEntity, ILayer, ILayoutObject, IPoint, IViewPort, IViewportEntity } from "../dxf-parser";
|
import { IBlock, IDxf, IEntity, ILayer, ILayoutObject, IPoint, IViewPort, IViewportEntity } from "../../core/dxf-parser";
|
||||||
import { IMLeaderContextData } from "../dxf-parser/entities/mleader";
|
import { IMLeaderContextData } from "../../core/dxf-parser/entities/mleader";
|
||||||
import { ISpatialFilterObject } from "../dxf-parser/objects/spatialfilter";
|
import { ISpatialFilterObject } from "../../core/dxf-parser/objects/spatialfilter";
|
||||||
import { ShxFont } from "../shx-parser/ShxFont";
|
import { ShxFont } from "../../core/shx-parser";
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
@ -15,8 +15,14 @@ export interface DxfData extends IDxf {
|
|||||||
loadedEntityCount: number;
|
loadedEntityCount: number;
|
||||||
layoutViewportsMap: Record<string, IViewportEntity[]>;
|
layoutViewportsMap: Record<string, IViewportEntity[]>;
|
||||||
}
|
}
|
||||||
export interface DxfLayer extends ILayer {
|
/**
|
||||||
}
|
* Dxf/dwg layer, which contains a number of objects in it.
|
||||||
|
*
|
||||||
|
* A layer has "name", "handle", "color", "visible" and many other properties.
|
||||||
|
*
|
||||||
|
* We can change a layer's visibility, color, etc.
|
||||||
|
*/
|
||||||
|
export type DxfLayer = ILayer;
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
@ -145,7 +151,7 @@ export interface DxfSpatialFilter extends ISpatialFilterObject {
|
|||||||
* @author Sourabh Soni / https://www.prolincur.com
|
* @author Sourabh Soni / https://www.prolincur.com
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export declare class DXFLoader extends THREE.Loader {
|
export declare class DxfLoader extends THREE.Loader {
|
||||||
static readonly MODEL_LAYOUT_NAME = "Model";
|
static readonly MODEL_LAYOUT_NAME = "Model";
|
||||||
private timer;
|
private timer;
|
||||||
private ignorePaperSpace;
|
private ignorePaperSpace;
|
||||||
@ -290,19 +296,7 @@ export declare class DXFLoader extends THREE.Loader {
|
|||||||
};
|
};
|
||||||
private getTextLineNum;
|
private getTextLineNum;
|
||||||
draw3DFace(entity: DxfEntity): THREE.Line<THREE.BufferGeometry, THREE.LineBasicMaterial> | undefined;
|
draw3DFace(entity: DxfEntity): THREE.Line<THREE.BufferGeometry, THREE.LineBasicMaterial> | undefined;
|
||||||
drawSpline(entity: DxfEntity): THREE.Line | undefined;
|
drawSpline(entity: DxfEntity, blockEntity?: IEntity): THREE.Line | undefined;
|
||||||
/**
|
|
||||||
* Interpolate a b-spline. The algorithm examins the knot vector
|
|
||||||
* to create segments for interpolation. The parameterisation value
|
|
||||||
* is re-normalised back to [0,1] as that is what the lib expects (
|
|
||||||
* and t i de-normalised in the b-spline library)
|
|
||||||
*
|
|
||||||
* @param controlPoints the control points
|
|
||||||
* @param degree the b-spline degree
|
|
||||||
* @param knots the knot vector
|
|
||||||
* @returns the polyline
|
|
||||||
*/
|
|
||||||
getBSplinePolyline(controlPoints: IPoint[], degree: number, knots: number[], interpolationsPerSplineSegment?: number, weights?: number[]): THREE.Vector3[];
|
|
||||||
drawXLine(entity: DxfEntity): THREE.Line | undefined;
|
drawXLine(entity: DxfEntity): THREE.Line | undefined;
|
||||||
drawRay(entity: DxfEntity): THREE.Line | undefined;
|
drawRay(entity: DxfEntity): THREE.Line | undefined;
|
||||||
drawLine(entity: DxfEntity): THREE.LineSegments | THREE.Points | undefined;
|
drawLine(entity: DxfEntity): THREE.LineSegments | THREE.Points | undefined;
|
||||||
@ -344,6 +338,10 @@ export declare class DXFLoader extends THREE.Loader {
|
|||||||
* Note that, when entity is in layer "0", it tries to get its parent blockEntity's layer name.
|
* Note that, when entity is in layer "0", it tries to get its parent blockEntity's layer name.
|
||||||
*/
|
*/
|
||||||
private getLayerName;
|
private getLayerName;
|
||||||
|
/**
|
||||||
|
* Sets object's material after being created
|
||||||
|
* TODO: hatch is handled separately, and may move its logic here.
|
||||||
|
*/
|
||||||
private setMaterial;
|
private setMaterial;
|
||||||
private setHatchMaterial;
|
private setHatchMaterial;
|
||||||
private setRenderOrderByObjectType;
|
private setRenderOrderByObjectType;
|
||||||
@ -360,6 +358,13 @@ export declare class DXFLoader extends THREE.Loader {
|
|||||||
* @param size may not be accurate, can be the radius, long size of bbox, etc.
|
* @param size may not be accurate, can be the radius, long size of bbox, etc.
|
||||||
*/
|
*/
|
||||||
getDivision(startAngle: number, endAngle: number, size: number): number;
|
getDivision(startAngle: number, endAngle: number, size: number): number;
|
||||||
|
/**
|
||||||
|
* Gets a proper interpolation for bspline.
|
||||||
|
* A bigger interpolation value generates smooth bspline, but with a bad performance, so we need to limit this value.
|
||||||
|
* @param pointCount control point count
|
||||||
|
* @param size may not be accurate, can be the long side of bbox, etc.
|
||||||
|
*/
|
||||||
|
getBSplineInterpolationsPerSplineSegment(pointCount: number, size: number): number;
|
||||||
/**
|
/**
|
||||||
* Gets proper simplify tolerance.
|
* Gets proper simplify tolerance.
|
||||||
* If tolerance is bigger, more points are simpified.
|
* If tolerance is bigger, more points are simpified.
|
||||||
|
@ -1,8 +1,13 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { DxfEntity } from "./DXFLoader";
|
import type { DxfEntity } from "./DxfLoader";
|
||||||
import { IDxf } from "../dxf-parser";
|
import { IDxf } from "../../core/dxf-parser";
|
||||||
/**
|
/**
|
||||||
* Dxf change type
|
* Dxf change type, which can be "Added", "Removed" or "Modified".
|
||||||
|
*
|
||||||
|
* Note that a "Modified" change can be represented as a "Removed" and an "Added" types.
|
||||||
|
*
|
||||||
|
* The system can display "Added" object in a specific color (green, etc.),
|
||||||
|
* and "Removed" in another color (red, etc.).
|
||||||
*/
|
*/
|
||||||
export declare enum DxfChangeType {
|
export declare enum DxfChangeType {
|
||||||
Added = "Added",
|
Added = "Added",
|
||||||
@ -11,12 +16,24 @@ export declare enum DxfChangeType {
|
|||||||
NoChange = "NoChange"
|
NoChange = "NoChange"
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* Dxf change
|
* Describes a dxf change
|
||||||
*/
|
*/
|
||||||
export interface DxfChange {
|
export interface DxfChange {
|
||||||
|
/**
|
||||||
|
* An integer type id. It is unique in the lifecycle of a DxfViewer.
|
||||||
|
*/
|
||||||
id: number;
|
id: number;
|
||||||
|
/**
|
||||||
|
* Change type, which can be "Added", "Removed", "Modified" or "NoChange".
|
||||||
|
*/
|
||||||
type: DxfChangeType;
|
type: DxfChangeType;
|
||||||
|
/**
|
||||||
|
* AutoCAD entity handle
|
||||||
|
*/
|
||||||
handle: string;
|
handle: string;
|
||||||
|
/**
|
||||||
|
* @internal
|
||||||
|
*/
|
||||||
parentHandles?: string[];
|
parentHandles?: string[];
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
|
10
public/demo/libs/types/src/core/dxf/index.d.ts
vendored
10
public/demo/libs/types/src/core/dxf/index.d.ts
vendored
@ -1,5 +1,9 @@
|
|||||||
export * from "./DxfCompare";
|
export * from "./DxfCompare";
|
||||||
export * from "./DXFLoader";
|
export * from "./DxfLoader";
|
||||||
export * from "./bspline";
|
export * as bspline from "./bspline";
|
||||||
export * from "./dxfom-mtext";
|
export * from "./dxfom-mtext";
|
||||||
export * from "./round10";
|
export * as round10 from "./round10";
|
||||||
|
export * from "./DxfConstants";
|
||||||
|
export * from "./HatchPatternShaders";
|
||||||
|
export * from "./LinePatternShaders";
|
||||||
|
export * from "./dxfom-text";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { VRControls } from "../controls/VRControls";
|
import type { VRControls } from "../../core/controls";
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { Font } from "three/examples/jsm/loaders/FontLoader.js";
|
import { Font } from "three/examples/jsm/loaders/FontLoader.js";
|
||||||
import { DxfData } from "../dxf";
|
import type { DxfData } from "../../core/dxf";
|
||||||
import { ShxFont } from "../shx-parser/ShxFont";
|
import type { ShxFont } from "../../core/shx-parser";
|
||||||
export declare class LoadingHelper {
|
export declare class LoadingHelper {
|
||||||
private gltfLoader?;
|
private gltfLoader?;
|
||||||
private font?;
|
private font?;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BvhParameter } from "../workers/GenerateMeshBvhWorker";
|
import { BvhParameter } from "../../core/workers";
|
||||||
/**
|
/**
|
||||||
* Bvh: Bounding volume hierarchy
|
* Bvh: Bounding volume hierarchy
|
||||||
*/
|
*/
|
||||||
|
@ -1,8 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { CanvasRender } from "../canvas/CanvasRender";
|
import { CanvasRender, Drawable } from "../../core/canvas";
|
||||||
import { Drawable } from "../canvas/Drawable";
|
import { ILine, SnapType } from "../../core/utils";
|
||||||
import { ILine } from "../utils/GeometryUtils";
|
|
||||||
import { SnapType } from "../utils/SVGObjectUtils";
|
|
||||||
export declare class SnapDrawable extends Drawable {
|
export declare class SnapDrawable extends Drawable {
|
||||||
static readonly LINE_COLOR = "rgba(255, 240, 0, 0.8)";
|
static readonly LINE_COLOR = "rgba(255, 240, 0, 0.8)";
|
||||||
static readonly FILL_COLOR = "rgba(135, 206, 250, 0.5)";
|
static readonly FILL_COLOR = "rgba(135, 206, 250, 0.5)";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { OrbitControls } from "../controls/OrbitControls";
|
import { CameraControlsEx } from "../../core/controls";
|
||||||
/**
|
/**
|
||||||
* Helper class to adjust object visual size
|
* Helper class to adjust object visual size
|
||||||
*/
|
*/
|
||||||
@ -8,6 +8,6 @@ export declare class ObjectPixelSizeHelper {
|
|||||||
private camera;
|
private camera;
|
||||||
targetPixelHeight: number;
|
targetPixelHeight: number;
|
||||||
canvasHeight: number;
|
canvasHeight: number;
|
||||||
constructor(camera: THREE.Camera, controls: OrbitControls, object: THREE.Object3D, targetPixelHeight: number, canvasHeight: number);
|
constructor(camera: THREE.Camera, controls: CameraControlsEx, object: THREE.Object3D, targetPixelHeight: number, canvasHeight: number);
|
||||||
adjustSize(): void;
|
adjustSize(): void;
|
||||||
}
|
}
|
||||||
|
@ -1,30 +1,15 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BimViewer, DxfViewer } from "../viewers";
|
import type { BimViewer, DxfViewer } from "../../core/viewers";
|
||||||
export declare class ZoomToRectHelper {
|
export declare class ZoomToRectHelper {
|
||||||
private viewer;
|
protected viewer: DxfViewer | BimViewer;
|
||||||
protected mouseDown: boolean;
|
private boxSelectHelper?;
|
||||||
protected mouseMove: boolean;
|
|
||||||
protected mouseDownPositionX: number;
|
|
||||||
protected mouseDownPositionY: number;
|
|
||||||
protected tempKey?: number;
|
|
||||||
protected tempEnableRotate: boolean;
|
|
||||||
protected rectDom?: HTMLDivElement;
|
|
||||||
private actived;
|
|
||||||
static readonly BORDER_COLOR = "#fff000";
|
|
||||||
static readonly BORDER_WIDTH = "2px";
|
|
||||||
constructor(viewer: DxfViewer | BimViewer);
|
constructor(viewer: DxfViewer | BimViewer);
|
||||||
get viewerContainer(): HTMLCanvasElement;
|
private get viewerContainer();
|
||||||
get camera(): THREE.OrthographicCamera | THREE.PerspectiveCamera;
|
get camera(): THREE.OrthographicCamera | THREE.PerspectiveCamera;
|
||||||
get raycaster(): THREE.Raycaster;
|
get raycaster(): THREE.Raycaster;
|
||||||
isActived(): boolean;
|
|
||||||
activate(): void;
|
activate(): void;
|
||||||
deactivate(): void;
|
deactivate(): void;
|
||||||
mousedown: (e: MouseEvent) => void;
|
protected pickPositionByScreenPoint(p: THREE.Vector2): THREE.Vector3 | undefined;
|
||||||
mousemove: (e: MouseEvent) => void;
|
protected handleZoomToRect(leftTop: THREE.Vector2, rightBottom: THREE.Vector2): void;
|
||||||
mouseup: (e: MouseEvent) => void;
|
|
||||||
private pickPositionByScreenPoint;
|
|
||||||
private handleZoomToRect;
|
|
||||||
drawRect(leftTop: THREE.Vector2, rightBottom: THREE.Vector2): void;
|
|
||||||
setRectDomVisible(visible: boolean): void;
|
|
||||||
destroy(): void;
|
destroy(): void;
|
||||||
}
|
}
|
||||||
|
@ -1,4 +1,11 @@
|
|||||||
export * from "./ControlsHelper";
|
export * from "./ControlsHelper";
|
||||||
export * from "../../components/dat-gui/BimViewerDatGui";
|
|
||||||
export * from "./InstantiateHelper";
|
export * from "./InstantiateHelper";
|
||||||
export * from "./RafHelper";
|
export * from "./RafHelper";
|
||||||
|
export * from "./BinaryReader";
|
||||||
|
export * from "./LoadingHelper";
|
||||||
|
export * from "./MeshBvhHelper";
|
||||||
|
export * from "./ObjectPixelSizeHelper";
|
||||||
|
export * from "./OSnapHelper";
|
||||||
|
export * from "./BoxSelectHelper";
|
||||||
|
export * from "./UndoRedoHelper";
|
||||||
|
export * from "./ZoomToRectHelper";
|
||||||
|
25
public/demo/libs/types/src/core/index.d.ts
vendored
25
public/demo/libs/types/src/core/index.d.ts
vendored
@ -1,15 +1,28 @@
|
|||||||
export * from "./patches";
|
export * from "./patches";
|
||||||
|
export * from "./axes";
|
||||||
export * from "./canvas";
|
export * from "./canvas";
|
||||||
export * from "./Configs";
|
export * from "./compare";
|
||||||
export * from "./controls";
|
export * from "./controls";
|
||||||
export * from "./Constants";
|
|
||||||
export * from "./dxf";
|
export * from "./dxf";
|
||||||
export type { ILayoutObject, IPoint } from "./dxf-parser";
|
export * from "./dxf-parser";
|
||||||
export * from "./exploder";
|
export * from "./exploder";
|
||||||
|
export * from "./geometry-offset";
|
||||||
export * from "./helpers";
|
export * from "./helpers";
|
||||||
|
export * from "./indexeddb";
|
||||||
export * from "./local-model-uploader";
|
export * from "./local-model-uploader";
|
||||||
export { MarkupType } from "./markup";
|
export * from "./input";
|
||||||
export { MeasurementType } from "./measure";
|
export * from "./markup";
|
||||||
export * from "../components/toolbar";
|
export * from "./measure";
|
||||||
|
export * from "./navcube";
|
||||||
|
export * from "./section";
|
||||||
|
export * from "./shp-js";
|
||||||
|
export * from "./shx-parser";
|
||||||
export * from "./utils";
|
export * from "./utils";
|
||||||
export * from "./viewers";
|
export * from "./viewers";
|
||||||
|
export * from "./vr";
|
||||||
|
export * from "./webcam";
|
||||||
|
export * from "./workers";
|
||||||
|
export * from "./Configs";
|
||||||
|
export * from "./Constants";
|
||||||
|
export * from "./Units";
|
||||||
|
export * from "./VersionManager";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { BaseTable } from "./BaseTable";
|
import { BaseTable } from "./BaseTable";
|
||||||
import type { Orientation, ShxFontType } from "../shx-parser/files/FontFile";
|
import type { Orientation, ShxFontType } from "../../core/shx-parser";
|
||||||
export interface FontDataTableRecord {
|
export interface FontDataTableRecord {
|
||||||
url: string;
|
url: string;
|
||||||
type: ShxFontType;
|
type: ShxFontType;
|
||||||
|
@ -2,3 +2,5 @@ export * from "./AnnotationTable";
|
|||||||
export * from "./BaseTable";
|
export * from "./BaseTable";
|
||||||
export * from "./IndexedDbManager";
|
export * from "./IndexedDbManager";
|
||||||
export * from "./ViewpointTable";
|
export * from "./ViewpointTable";
|
||||||
|
export * from "./DxfDataTable";
|
||||||
|
export * from "./FontDataTable";
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import type { BimViewer, DxfViewer, VRViewer } from "../viewers";
|
import type { ModelConfig } from "../..";
|
||||||
import type { ModelConfig } from "@";
|
import type { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||||
import { MarkupType } from "./Constants";
|
import { MarkupType } from "../../core/markup/Constants";
|
||||||
export declare class ArrowMarkup extends BaseMarkup {
|
export declare class ArrowMarkup extends BaseMarkup {
|
||||||
type: MarkupType;
|
type: MarkupType;
|
||||||
constructor(id: string, points: THREE.Vector3[]);
|
constructor(id: string, points: THREE.Vector3[]);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { Drawable, DrawableData } from "../canvas";
|
import { Drawable, DrawableData } from "../../core/canvas";
|
||||||
export declare abstract class BaseMarkup extends Drawable {
|
export declare abstract class BaseMarkup extends Drawable {
|
||||||
protected editPointSize: number;
|
protected editPointSize: number;
|
||||||
protected editPointColor: string;
|
protected editPointColor: string;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||||
import { MarkupType } from "./Constants";
|
import { MarkupType } from "../../core/markup/Constants";
|
||||||
export declare class CircleMarkup extends BaseMarkup {
|
export declare class CircleMarkup extends BaseMarkup {
|
||||||
radius: number;
|
radius: number;
|
||||||
type: MarkupType;
|
type: MarkupType;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||||
import { MarkupType } from "./Constants";
|
import { MarkupType } from "../../core/markup/Constants";
|
||||||
export declare class CloudLineMarkup extends BaseMarkup {
|
export declare class CloudLineMarkup extends BaseMarkup {
|
||||||
type: MarkupType;
|
type: MarkupType;
|
||||||
constructor(id: string, points: THREE.Vector3[]);
|
constructor(id: string, points: THREE.Vector3[]);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||||
import { MarkupType } from "./Constants";
|
import { MarkupType } from "../../core/markup/Constants";
|
||||||
export declare class CloudRectMarkup extends BaseMarkup {
|
export declare class CloudRectMarkup extends BaseMarkup {
|
||||||
type: MarkupType;
|
type: MarkupType;
|
||||||
constructor(id: string, points: THREE.Vector3[]);
|
constructor(id: string, points: THREE.Vector3[]);
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||||
export declare class DotMarkup extends BaseMarkup {
|
export declare class DotMarkup extends BaseMarkup {
|
||||||
radius: number;
|
radius: number;
|
||||||
constructor(id: string, points: THREE.Vector3[]);
|
constructor(id: string, points: THREE.Vector3[]);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||||
import { MarkupType } from "./Constants";
|
import { MarkupType } from "../../core/markup/Constants";
|
||||||
export declare class EllipseMarkup extends BaseMarkup {
|
export declare class EllipseMarkup extends BaseMarkup {
|
||||||
radiusX: number;
|
radiusX: number;
|
||||||
radiusY: number;
|
radiusY: number;
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { BaseMarkup } from "./BaseMarkup";
|
||||||
import { MarkupType } from "./Constants";
|
import { MarkupType } from "./Constants";
|
||||||
import { DrawableData } from "../canvas";
|
import { DrawableData } from "../../core/canvas";
|
||||||
import { Event } from "../utils";
|
import type { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||||
import { BimViewer, DxfViewer } from "../viewers";
|
import { Event } from "../../core/utils";
|
||||||
export declare class MarkupManager extends Event {
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
|
type MarkupHandler = {};
|
||||||
|
export declare class MarkupManager extends Event<MarkupHandler> {
|
||||||
private viewer;
|
private viewer;
|
||||||
|
private inputManager;
|
||||||
private overlayRender?;
|
private overlayRender?;
|
||||||
private drawableList;
|
private drawableList;
|
||||||
private lineWidth;
|
private lineWidth;
|
||||||
@ -27,11 +30,11 @@ export declare class MarkupManager extends Event {
|
|||||||
private textInput?;
|
private textInput?;
|
||||||
private actived;
|
private actived;
|
||||||
private undoRedoHelper;
|
private undoRedoHelper;
|
||||||
constructor(viewer: BimViewer | DxfViewer);
|
constructor(viewer: BaseViewer, input: InputManager);
|
||||||
get viewerCanvas(): HTMLCanvasElement;
|
get viewerCanvas(): HTMLCanvasElement;
|
||||||
get camera(): THREE.OrthographicCamera | THREE.PerspectiveCamera;
|
get camera(): THREE.OrthographicCamera | THREE.PerspectiveCamera;
|
||||||
get raycaster(): THREE.Raycaster;
|
get raycaster(): THREE.Raycaster;
|
||||||
private removeMarkupEventFromViewer;
|
setMarkupVisibility(id: string, visible: boolean): boolean;
|
||||||
setMarkupsVisibility(visible: boolean): void;
|
setMarkupsVisibility(visible: boolean): void;
|
||||||
clearAll(): void;
|
clearAll(): void;
|
||||||
isMarkupActive(): boolean;
|
isMarkupActive(): boolean;
|
||||||
@ -48,11 +51,12 @@ export declare class MarkupManager extends Event {
|
|||||||
setFontSize(fontSize: number): void;
|
setFontSize(fontSize: number): void;
|
||||||
getFontSize(): number;
|
getFontSize(): number;
|
||||||
pickPositionByScreenPoint(p: THREE.Vector2): THREE.Vector3;
|
pickPositionByScreenPoint(p: THREE.Vector2): THREE.Vector3;
|
||||||
pickThreejsPositionByMouse(e: MouseEvent): THREE.Vector3;
|
pickThreejsPositionByMouse(e: EventInfo): THREE.Vector3;
|
||||||
mousedown: (e: MouseEvent) => void;
|
mousedown: (e: EventInfo) => void;
|
||||||
mousemove: (e: MouseEvent) => void;
|
mousemove: (e: EventInfo) => void;
|
||||||
mouseup: (e: MouseEvent) => void;
|
mouseup: (e: EventInfo) => void;
|
||||||
keydown: (e: KeyboardEvent) => void;
|
keydown: (e: EventInfo) => void;
|
||||||
|
confirmToRemove(isConfirm: boolean): void;
|
||||||
isEditing(): boolean;
|
isEditing(): boolean;
|
||||||
endEdit(selectMarkup: BaseMarkup): void;
|
endEdit(selectMarkup: BaseMarkup): void;
|
||||||
endDraw(createdMarkup?: BaseMarkup): void;
|
endDraw(createdMarkup?: BaseMarkup): void;
|
||||||
@ -62,7 +66,7 @@ export declare class MarkupManager extends Event {
|
|||||||
addMarkup(markup: BaseMarkup, needRecord?: boolean): void;
|
addMarkup(markup: BaseMarkup, needRecord?: boolean): void;
|
||||||
updateMarkup(markup: BaseMarkup, newData: DrawableData, needRecord?: boolean): void;
|
updateMarkup(markup: BaseMarkup, newData: DrawableData, needRecord?: boolean): void;
|
||||||
removeMarkup(markup: BaseMarkup, needRecord?: boolean): void;
|
removeMarkup(markup: BaseMarkup, needRecord?: boolean): void;
|
||||||
removeMarkupById(id: string, needRecord?: boolean): void;
|
removeMarkupById(id: string, needRecord?: boolean): boolean;
|
||||||
createMarkup(data: DrawableData): BaseMarkup;
|
createMarkup(data: DrawableData): BaseMarkup;
|
||||||
getMarkupById(id: string): BaseMarkup;
|
getMarkupById(id: string): BaseMarkup;
|
||||||
getMarkupData(): DrawableData[];
|
getMarkupData(): DrawableData[];
|
||||||
@ -80,3 +84,4 @@ export declare class MarkupManager extends Event {
|
|||||||
clearUndoRedo(): void;
|
clearUndoRedo(): void;
|
||||||
destroy(): void;
|
destroy(): void;
|
||||||
}
|
}
|
||||||
|
export {};
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { MarkupManager } from "./MarkupManager";
|
import { OperationRecord, UndoRedoHelper } from "../../core/helpers";
|
||||||
import { OperationRecord, UndoRedoHelper } from "../helpers/UndoRedoHelper";
|
import type { MarkupManager } from "../../core/markup";
|
||||||
export declare enum MarkupState {
|
export declare enum MarkupState {
|
||||||
Add = "Add",
|
Add = "Add",
|
||||||
Update = "Update",
|
Update = "Update",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||||
import { MarkupType } from "./Constants";
|
import { MarkupType } from "../../core/markup/Constants";
|
||||||
export declare class PolylineMarkup extends BaseMarkup {
|
export declare class PolylineMarkup extends BaseMarkup {
|
||||||
type: MarkupType;
|
type: MarkupType;
|
||||||
constructor(id: string, points: THREE.Vector3[]);
|
constructor(id: string, points: THREE.Vector3[]);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||||
import { MarkupType } from "./Constants";
|
import { MarkupType } from "../../core/markup/Constants";
|
||||||
export declare class RectMarkup extends BaseMarkup {
|
export declare class RectMarkup extends BaseMarkup {
|
||||||
type: MarkupType;
|
type: MarkupType;
|
||||||
constructor(id: string, points: THREE.Vector3[]);
|
constructor(id: string, points: THREE.Vector3[]);
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { DrawableData } from "../../core/canvas";
|
||||||
import { MarkupType } from "./Constants";
|
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||||
import { DrawableData } from "../canvas";
|
import { MarkupType } from "../../core/markup/Constants";
|
||||||
export interface TextShape extends DrawableData {
|
export interface TextShape extends DrawableData {
|
||||||
text: string;
|
text: string;
|
||||||
fontSize: number;
|
fontSize: number;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMarkup } from "./BaseMarkup";
|
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||||
import { MarkupType } from "./Constants";
|
import { MarkupType } from "../../core/markup/Constants";
|
||||||
export declare class XMarkup extends BaseMarkup {
|
export declare class XMarkup extends BaseMarkup {
|
||||||
type: MarkupType;
|
type: MarkupType;
|
||||||
constructor(id: string, points: THREE.Vector3[]);
|
constructor(id: string, points: THREE.Vector3[]);
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
import { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||||
import { MeasurementType } from "./BaseMeasurement";
|
import { MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||||
export declare class AngleMeasureDrawable extends BaseMeasureDrawable {
|
export declare class AngleMeasureDrawable extends BaseMeasureDrawable {
|
||||||
type: MeasurementType;
|
type: MeasurementType;
|
||||||
constructor(id: string, points: THREE.Vector3[]);
|
constructor(id: string, points: THREE.Vector3[]);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMeasurement } from "./BaseMeasurement";
|
import { DrawableList } from "../../core/canvas";
|
||||||
import { DrawableList } from "../canvas/DrawableList";
|
import { OSnapHelper } from "../../core/helpers";
|
||||||
import { OSnapHelper } from "../helpers/OSnapHelper";
|
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
import { BaseMeasurement } from "../../core/measure/BaseMeasurement";
|
||||||
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
export declare class AngleMeasurement extends BaseMeasurement {
|
export declare class AngleMeasurement extends BaseMeasurement {
|
||||||
constructor(viewer: BaseViewer, drawList: DrawableList, osnapHelper: OSnapHelper);
|
constructor(viewer: BaseViewer, input: InputManager, drawList: DrawableList, osnapHelper: OSnapHelper);
|
||||||
protected onMouseMove(position: THREE.Vector3): void;
|
protected onMouseMove(position: THREE.Vector3): void;
|
||||||
protected onMouseClick(e: MouseEvent): void;
|
protected onMouseClick(e: EventInfo): void;
|
||||||
protected complete(): void;
|
protected complete(): void;
|
||||||
cancel(): void;
|
cancel(): void;
|
||||||
deactivate(): void;
|
deactivate(): void;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
import { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||||
import { MeasurementType } from "./BaseMeasurement";
|
import { MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||||
export declare class AreaMeasureDrawable extends BaseMeasureDrawable {
|
export declare class AreaMeasureDrawable extends BaseMeasureDrawable {
|
||||||
type: MeasurementType;
|
type: MeasurementType;
|
||||||
constructor(id: string, points: THREE.Vector3[]);
|
constructor(id: string, points: THREE.Vector3[]);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMeasurement } from "./BaseMeasurement";
|
import { DrawableList } from "../../core/canvas";
|
||||||
import { DrawableList } from "../canvas/DrawableList";
|
import { OSnapHelper } from "../../core/helpers";
|
||||||
import { OSnapHelper } from "../helpers/OSnapHelper";
|
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
import { BaseMeasurement } from "../../core/measure/BaseMeasurement";
|
||||||
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
export declare class AreaMeasurement extends BaseMeasurement {
|
export declare class AreaMeasurement extends BaseMeasurement {
|
||||||
constructor(viewer: BaseViewer, drawList: DrawableList, osnapHelper: OSnapHelper);
|
constructor(viewer: BaseViewer, input: InputManager, drawList: DrawableList, osnapHelper: OSnapHelper);
|
||||||
protected onMouseMove(position: THREE.Vector3): void;
|
protected onMouseMove(position: THREE.Vector3): void;
|
||||||
protected onMouseClick(e: MouseEvent): void;
|
protected onMouseClick(e: EventInfo): void;
|
||||||
protected complete(): void;
|
protected complete(): void;
|
||||||
cancel(): void;
|
cancel(): void;
|
||||||
deactivate(): void;
|
deactivate(): void;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { MeasurementData, MeasurementType } from "./BaseMeasurement";
|
import { Drawable } from "../../core/canvas";
|
||||||
import { Drawable } from "../canvas/Drawable";
|
import { MeasurementData, MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||||
export declare abstract class BaseMeasureDrawable extends Drawable {
|
export declare abstract class BaseMeasureDrawable extends Drawable {
|
||||||
type: MeasurementType;
|
type: MeasurementType;
|
||||||
static readonly MAJOR_COLOR = "rgba(249, 157, 11, 0.9)";
|
static readonly MAJOR_COLOR = "rgba(249, 157, 11, 0.9)";
|
||||||
|
@ -1,11 +1,14 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
import { Tooltip } from "../../components/tool-tip";
|
||||||
import { Tooltip } from "../../components/tool-tip/Tooltip";
|
import { DrawableData, DrawableList } from "../../core/canvas";
|
||||||
import { DrawableData } from "../canvas";
|
import { OSnapHelper } from "../../core/helpers";
|
||||||
import { DrawableList } from "../canvas/DrawableList";
|
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||||
import { OSnapHelper } from "../helpers/OSnapHelper";
|
import type { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||||
import { Event } from "../utils";
|
import { Event } from "../../core/utils";
|
||||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
|
/**
|
||||||
|
* Measurement type. e.g. distance measurement, area measurement, etc.
|
||||||
|
*/
|
||||||
export declare enum MeasurementType {
|
export declare enum MeasurementType {
|
||||||
Distance = "Distance",
|
Distance = "Distance",
|
||||||
Area = "Area",
|
Area = "Area",
|
||||||
@ -26,23 +29,43 @@ export interface MeasurementData extends DrawableData {
|
|||||||
id: string;
|
id: string;
|
||||||
/**
|
/**
|
||||||
* Two dimension float array stores 2d or 3d points.
|
* Two dimension float array stores 2d or 3d points.
|
||||||
* e.g. [[1, 1, 1], [2.5, 3, 5]]
|
* e.g., You can use "[[1, 1], [2.5, 3]]" to represent a distance measurement result
|
||||||
|
* "[1, 1]" is the first point, and "[2.5, 3]" is the second point.
|
||||||
*/
|
*/
|
||||||
points: number[][];
|
points: number[][];
|
||||||
}
|
}
|
||||||
|
type MeasureHandler = {
|
||||||
|
/**
|
||||||
|
* click measure
|
||||||
|
*/
|
||||||
|
clickedonmeasurement: BaseMeasureDrawable;
|
||||||
|
/**
|
||||||
|
* draw measure complete
|
||||||
|
*/
|
||||||
|
complete: BaseMeasureDrawable;
|
||||||
|
/**
|
||||||
|
* deactivate measure
|
||||||
|
*/
|
||||||
|
deactivate: MeasurementType;
|
||||||
|
/**
|
||||||
|
* draw first point
|
||||||
|
*/
|
||||||
|
firstpointpicked: BaseMeasureDrawable;
|
||||||
|
};
|
||||||
/**
|
/**
|
||||||
* BaseMeasurement class
|
* BaseMeasurement class
|
||||||
*/
|
*/
|
||||||
export declare abstract class BaseMeasurement extends Event {
|
export declare abstract class BaseMeasurement extends Event<MeasureHandler> {
|
||||||
static MAX_DISTANCE: number;
|
static MAX_DISTANCE: number;
|
||||||
protected type: MeasurementType;
|
protected type: MeasurementType;
|
||||||
protected viewer: BaseViewer;
|
protected viewer: BaseViewer;
|
||||||
|
private inputManager;
|
||||||
protected drawList: DrawableList;
|
protected drawList: DrawableList;
|
||||||
protected osnapHelper: OSnapHelper;
|
protected osnapHelper: OSnapHelper;
|
||||||
protected raycaster?: THREE.Raycaster;
|
protected raycaster?: THREE.Raycaster;
|
||||||
protected mouseMoved: boolean;
|
protected mouseMoved: boolean;
|
||||||
protected mouseDowned: boolean;
|
protected mouseDowned: boolean;
|
||||||
protected lastMoveEvent?: MouseEvent;
|
protected lastMoveEvent?: EventInfo;
|
||||||
protected mouseDownPositionX: number;
|
protected mouseDownPositionX: number;
|
||||||
protected mouseDownPositionY: number;
|
protected mouseDownPositionY: number;
|
||||||
protected currentMeasureDrawable?: BaseMeasureDrawable;
|
protected currentMeasureDrawable?: BaseMeasureDrawable;
|
||||||
@ -53,9 +76,10 @@ export declare abstract class BaseMeasurement extends Event {
|
|||||||
protected snapPoint?: THREE.Vector3 | undefined;
|
protected snapPoint?: THREE.Vector3 | undefined;
|
||||||
protected completed?: boolean;
|
protected completed?: boolean;
|
||||||
protected clickedOnMeasurementDrawable?: BaseMeasureDrawable;
|
protected clickedOnMeasurementDrawable?: BaseMeasureDrawable;
|
||||||
constructor(type: MeasurementType, viewer: BaseViewer, drawList: DrawableList, osnapHelper: OSnapHelper);
|
constructor(type: MeasurementType, viewer: BaseViewer, input: InputManager, drawList: DrawableList, osnapHelper: OSnapHelper);
|
||||||
get canvas(): HTMLCanvasElement;
|
get canvas(): HTMLCanvasElement;
|
||||||
get camera(): THREE.Camera;
|
get camera(): THREE.Camera;
|
||||||
|
get renderer(): THREE.WebGLRenderer;
|
||||||
/**
|
/**
|
||||||
* If measurement is active.
|
* If measurement is active.
|
||||||
* Here let's use raycaster to identify whether this measurement is active.
|
* Here let's use raycaster to identify whether this measurement is active.
|
||||||
@ -69,12 +93,12 @@ export declare abstract class BaseMeasurement extends Event {
|
|||||||
deactivate(): void;
|
deactivate(): void;
|
||||||
protected removeDrawable(drawable: BaseMeasureDrawable): void;
|
protected removeDrawable(drawable: BaseMeasureDrawable): void;
|
||||||
clearClickedDrawable(): void;
|
clearClickedDrawable(): void;
|
||||||
mousedown: (e: MouseEvent) => void;
|
mousedown: (e: EventInfo) => void;
|
||||||
mousemove: (e: MouseEvent) => void;
|
mousemove: (e: EventInfo) => void;
|
||||||
mouseup: (e: MouseEvent) => void;
|
mouseup: (e: EventInfo) => void;
|
||||||
dblclick: () => void;
|
dblclick: () => void;
|
||||||
protected onMouseClick(e: MouseEvent): void;
|
protected onMouseClick(e: EventInfo): void;
|
||||||
keydown: (e: KeyboardEvent) => void;
|
keydown: (e: EventInfo) => void;
|
||||||
protected abstract complete(): void;
|
protected abstract complete(): void;
|
||||||
abstract cancel(): void;
|
abstract cancel(): void;
|
||||||
protected abstract setTooltipContent(): void;
|
protected abstract setTooltipContent(): void;
|
||||||
@ -83,8 +107,9 @@ export declare abstract class BaseMeasurement extends Event {
|
|||||||
* The closest intersection
|
* The closest intersection
|
||||||
* @param e
|
* @param e
|
||||||
*/
|
*/
|
||||||
getIntersections: (e: MouseEvent) => THREE.Intersection[];
|
getIntersections: (e: EventInfo) => THREE.Intersection[];
|
||||||
private getIntersectsOutline;
|
private getIntersectsOutline;
|
||||||
lastMouseDownPosition?: THREE.Vector3;
|
lastMouseDownPosition?: THREE.Vector3;
|
||||||
private handleSnap;
|
private handleSnap;
|
||||||
}
|
}
|
||||||
|
export {};
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
import { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||||
import { MeasurementType } from "./BaseMeasurement";
|
import { MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||||
export declare class CoordinateMeasureDrawable extends BaseMeasureDrawable {
|
export declare class CoordinateMeasureDrawable extends BaseMeasureDrawable {
|
||||||
type: MeasurementType;
|
type: MeasurementType;
|
||||||
constructor(id: string, points: THREE.Vector3[]);
|
constructor(id: string, points: THREE.Vector3[]);
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMeasurement } from "./BaseMeasurement";
|
import { DrawableList } from "../../core/canvas";
|
||||||
import { DrawableList } from "../canvas/DrawableList";
|
import { OSnapHelper } from "../../core/helpers";
|
||||||
import { OSnapHelper } from "../helpers/OSnapHelper";
|
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
import { BaseMeasurement } from "../../core/measure/BaseMeasurement";
|
||||||
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
export declare class CoordinateMeasurement extends BaseMeasurement {
|
export declare class CoordinateMeasurement extends BaseMeasurement {
|
||||||
constructor(viewer: BaseViewer, drawList: DrawableList, osnapHelper: OSnapHelper);
|
constructor(viewer: BaseViewer, input: InputManager, drawList: DrawableList, osnapHelper: OSnapHelper);
|
||||||
protected onMouseMove(position: THREE.Vector3): void;
|
protected onMouseMove(position: THREE.Vector3): void;
|
||||||
protected onMouseClick(e: MouseEvent): void;
|
protected onMouseClick(e: EventInfo): void;
|
||||||
protected complete(): void;
|
protected complete(): void;
|
||||||
cancel(): void;
|
cancel(): void;
|
||||||
protected setTooltipContent(): void;
|
protected setTooltipContent(): void;
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
import { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||||
import { MeasurementType } from "./BaseMeasurement";
|
import { MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||||
export declare class DistanceMeasureDrawable extends BaseMeasureDrawable {
|
export declare class DistanceMeasureDrawable extends BaseMeasureDrawable {
|
||||||
static readonly SHORT_LINE_LENGTH = 12;
|
static readonly SHORT_LINE_LENGTH = 12;
|
||||||
type: MeasurementType;
|
type: MeasurementType;
|
||||||
|
@ -1,12 +1,13 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMeasurement } from "./BaseMeasurement";
|
import { DrawableList } from "../../core/canvas";
|
||||||
import { DrawableList } from "../canvas/DrawableList";
|
import { OSnapHelper } from "../../core/helpers";
|
||||||
import { OSnapHelper } from "../helpers/OSnapHelper";
|
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
import { BaseMeasurement } from "../../core/measure/BaseMeasurement";
|
||||||
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
export declare class DistanceMeasurement extends BaseMeasurement {
|
export declare class DistanceMeasurement extends BaseMeasurement {
|
||||||
constructor(viewer: BaseViewer, drawList: DrawableList, osnapHelper: OSnapHelper);
|
constructor(viewer: BaseViewer, input: InputManager, drawList: DrawableList, osnapHelper: OSnapHelper);
|
||||||
protected onMouseMove(position: THREE.Vector3): void;
|
protected onMouseMove(position: THREE.Vector3): void;
|
||||||
protected onMouseClick(e: MouseEvent): void;
|
protected onMouseClick(e: EventInfo): void;
|
||||||
protected complete(): void;
|
protected complete(): void;
|
||||||
cancel(): void;
|
cancel(): void;
|
||||||
deactivate(): void;
|
deactivate(): void;
|
||||||
|
@ -1,37 +1,36 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||||
import { MeasurementData, MeasurementType } from "./BaseMeasurement";
|
import { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
import { MeasurementData, MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||||
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
export declare class MeasurementManager {
|
export declare class MeasurementManager {
|
||||||
scene: THREE.Scene;
|
scene: THREE.Scene;
|
||||||
selectedMeasurementDrawable: BaseMeasureDrawable | undefined;
|
selectedMeasurementDrawable: BaseMeasureDrawable | undefined;
|
||||||
private overlayRender?;
|
private overlayRender?;
|
||||||
private drawableList;
|
private drawableList;
|
||||||
private viewer;
|
private viewer;
|
||||||
|
private inputManager;
|
||||||
private osnapHelper;
|
private osnapHelper;
|
||||||
private measurements;
|
private measurements;
|
||||||
private activeMeasurementType;
|
private activeMeasurementType;
|
||||||
private undoRedoHelper;
|
private undoRedoHelper;
|
||||||
constructor(viewer: BaseViewer);
|
constructor(viewer: BaseViewer, input: InputManager);
|
||||||
private initEvents;
|
private initEvents;
|
||||||
get canvas(): HTMLCanvasElement;
|
get canvas(): HTMLCanvasElement;
|
||||||
get raycaster(): THREE.Raycaster | undefined;
|
get raycaster(): THREE.Raycaster | undefined;
|
||||||
getPixelSizeInWorldCoord(): number;
|
getPixelSizeInWorldCoord(): number;
|
||||||
/**
|
|
||||||
* The closest intersection
|
|
||||||
* @param e
|
|
||||||
*/
|
|
||||||
getIntersections: (e: MouseEvent) => THREE.Intersection[];
|
|
||||||
addMeasurement(drawable: BaseMeasureDrawable, needRecord?: boolean): void;
|
addMeasurement(drawable: BaseMeasureDrawable, needRecord?: boolean): void;
|
||||||
createMeasurement(data: MeasurementData): import("..").Drawable;
|
createMeasurement(data: MeasurementData): import("../../core/canvas").Drawable;
|
||||||
removeMeasurement(drawable: BaseMeasureDrawable, needRecord?: boolean): void;
|
removeMeasurement(drawable: BaseMeasureDrawable, needRecord?: boolean): void;
|
||||||
updateSnapTolerance(pixelSize?: number): void;
|
updateSnapTolerance(pixelSize?: number): void;
|
||||||
activateMeasurement(type: MeasurementType): void;
|
activateMeasurement(type: MeasurementType): void;
|
||||||
deactivateMeasurement(): void;
|
deactivateMeasurement(): void;
|
||||||
getActiveMeasurementType(): MeasurementType | undefined;
|
getActiveMeasurementType(): MeasurementType | undefined;
|
||||||
isMeasurementActive(): boolean;
|
isMeasurementActive(): boolean;
|
||||||
|
isMeasurementMeasuring(): boolean;
|
||||||
getMeasurementsData(): MeasurementData[];
|
getMeasurementsData(): MeasurementData[];
|
||||||
setMeasurementsData(dataArray: MeasurementData[]): void;
|
setMeasurementsData(dataArray: MeasurementData[]): void;
|
||||||
|
setMeasurementVisibility(id: string, visible: boolean): boolean;
|
||||||
setMeasurementsVisibility(visible: boolean): void;
|
setMeasurementsVisibility(visible: boolean): void;
|
||||||
clearMeasurements(): void;
|
clearMeasurements(): void;
|
||||||
removeMeasurementById(id: string, needRecord?: boolean): void;
|
removeMeasurementById(id: string, needRecord?: boolean): void;
|
||||||
@ -42,5 +41,5 @@ export declare class MeasurementManager {
|
|||||||
redo(): void;
|
redo(): void;
|
||||||
clearUndoRedo(): void;
|
clearUndoRedo(): void;
|
||||||
destroy(): void;
|
destroy(): void;
|
||||||
keydown: (e: KeyboardEvent) => void;
|
keydown: (e: EventInfo) => void;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { MeasurementManager } from "./MeasurementManager";
|
import { OperationRecord, UndoRedoHelper } from "../../core/helpers";
|
||||||
import { OperationRecord, UndoRedoHelper } from "../helpers/UndoRedoHelper";
|
import type { MeasurementManager } from "../../core/measure/MeasurementManager";
|
||||||
export declare enum MeasurementState {
|
export declare enum MeasurementState {
|
||||||
Add = "ADD",
|
Add = "ADD",
|
||||||
Remove = "REMOVE"
|
Remove = "REMOVE"
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import { OrthographicCamera, Scene, Vector3 } from "three";
|
import { OrthographicCamera, Scene, Vector3 } from "three";
|
||||||
import { CSS3DRenderer } from "three/examples/jsm/renderers/CSS3DRenderer.js";
|
import { CSS3DRenderer } from "three/examples/jsm/renderers/CSS3DRenderer.js";
|
||||||
import { NavCube } from "./NavCube";
|
import { NavCube } from "./NavCube";
|
||||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
/**
|
/**
|
||||||
* This renderer monitors the host renderer's camera, and keeps a NavCube
|
* This renderer monitors the host renderer's camera, and keeps a NavCube
|
||||||
* the same direction as host renderer's
|
* the same direction as host renderer's
|
||||||
|
@ -1,34 +1,38 @@
|
|||||||
import { Scene, Vector3, WebGLRenderer } from "three";
|
import * as THREE from "three";
|
||||||
import { OrbitControls } from "../controls/OrbitControls";
|
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
import { BaseSection } from "../../core/section/BaseSection";
|
||||||
|
import { SectionGizmo } from "../../core/section/SectionGizmo";
|
||||||
|
import { SectionPlane } from "../../core/section/SectionPlane";
|
||||||
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
export declare enum AxisType {
|
export declare enum AxisType {
|
||||||
X = "x",
|
X = "X",
|
||||||
Y = "y",
|
Y = "Y",
|
||||||
Z = "z"
|
Z = "Z"
|
||||||
}
|
}
|
||||||
export declare class AxisPlaneSection {
|
export declare class AxisPlaneSection extends BaseSection {
|
||||||
private readonly container?;
|
protected activeAxis: AxisType;
|
||||||
protected viewer: BaseViewer;
|
protected gizmo?: SectionGizmo;
|
||||||
protected camera: THREE.Camera;
|
protected planeMesh?: SectionPlane;
|
||||||
protected controls: OrbitControls;
|
protected clipPlane?: THREE.Plane;
|
||||||
protected scene: Scene;
|
protected selectedObject?: SectionPlane | THREE.Mesh;
|
||||||
protected renderer: WebGLRenderer;
|
|
||||||
protected objectIds: number[];
|
|
||||||
private sectionPlane?;
|
|
||||||
isShowSectionPlane: boolean;
|
|
||||||
private popPanel?;
|
|
||||||
protected axisInfoMap: {
|
protected axisInfoMap: {
|
||||||
[key in AxisType]: {
|
[key in AxisType]: {
|
||||||
normal: Vector3;
|
normal: THREE.Vector3;
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
constructor(viewer: BaseViewer, objectIds: number[], container?: HTMLElement | undefined);
|
protected center: THREE.Vector3;
|
||||||
getRotateParam(axisType: AxisType): (number | Vector3)[];
|
constructor(viewer: BaseViewer, input: InputManager);
|
||||||
initPlane(axisType: AxisType): void;
|
activate(): void;
|
||||||
open(): void;
|
deactivate(): void;
|
||||||
close(): void;
|
resetSection(): void;
|
||||||
enableSection(): void;
|
setActiveAxis(type: AxisType): void;
|
||||||
cancelSection(): void;
|
setSectionVisible(visible: boolean): void;
|
||||||
showSectionPlane(): void;
|
initOrUpdateClipPlane(): void;
|
||||||
hideSectionPlane(): void;
|
initOrUpdateSectionPlane(): void;
|
||||||
|
initOrUpdateGizmo(): void;
|
||||||
|
onDragStart(e: EventInfo): void;
|
||||||
|
onDragMove(e: EventInfo): void;
|
||||||
|
onDragEnd(e: EventInfo): void;
|
||||||
|
getIntersectObjects(): THREE.Object3D<THREE.Event>[];
|
||||||
|
activateSelectedObject(active: boolean): void;
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Box3, Group, LineSegments, Mesh, OrthographicCamera, PerspectiveCamera, Plane, Raycaster, Scene, Vector2, Vector3, WebGLRenderer } from "three";
|
import { Box3, Group, LineSegments, Mesh, OrthographicCamera, PerspectiveCamera, Plane, Raycaster, Scene, Vector2, Vector3, WebGLRenderer } from "three";
|
||||||
import { OrbitControls } from "../controls/OrbitControls";
|
import { CameraControlsEx } from "../controls/CameraControlsEx";
|
||||||
import { Views } from "../utils/Viewer3DUtils";
|
import { Views } from "../utils/Viewer3DUtils";
|
||||||
/**
|
/**
|
||||||
* Object's box section
|
* Object's box section
|
||||||
@ -10,13 +10,13 @@ export declare class BaseBoxSection {
|
|||||||
protected scene: Scene;
|
protected scene: Scene;
|
||||||
protected camera: PerspectiveCamera | OrthographicCamera;
|
protected camera: PerspectiveCamera | OrthographicCamera;
|
||||||
protected renderer: WebGLRenderer;
|
protected renderer: WebGLRenderer;
|
||||||
protected controls: OrbitControls;
|
protected controls: CameraControlsEx;
|
||||||
protected draggableArrowView: Views | string;
|
protected draggableArrowView: Views | string;
|
||||||
protected visibleArrowView: Views | string;
|
protected visibleArrowView: Views | string;
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
constructor(scene: Scene, camera: PerspectiveCamera | OrthographicCamera, renderer: WebGLRenderer, controls: OrbitControls);
|
constructor(scene: Scene, camera: PerspectiveCamera | OrthographicCamera, renderer: WebGLRenderer, controls: CameraControlsEx);
|
||||||
/**
|
/**
|
||||||
* If sectionBox is not assigned in constructor, then set it here.
|
* If sectionBox is not assigned in constructor, then set it here.
|
||||||
* For now, we only support it to be set once. Otherwise, need to check isOpen status, and initSectionBox properly.
|
* For now, we only support it to be set once. Otherwise, need to check isOpen status, and initSectionBox properly.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { Box3, Group, LineSegments, Matrix4, Mesh, Plane, Raycaster, Scene, Vector2, Vector3, WebGLRenderer } from "three";
|
import { Box3, Group, LineSegments, Matrix4, Mesh, Plane, Raycaster, Scene, Vector2, Vector3, WebGLRenderer } from "three";
|
||||||
import { OrbitControls } from "../controls/OrbitControls";
|
import { CameraControlsEx } from "../controls/CameraControlsEx";
|
||||||
import { ObjectPixelSizeHelper } from "../helpers/ObjectPixelSizeHelper";
|
import { ObjectPixelSizeHelper } from "../helpers/ObjectPixelSizeHelper";
|
||||||
declare enum ActionType {
|
declare enum ActionType {
|
||||||
None = "",
|
None = "",
|
||||||
@ -19,7 +19,7 @@ export declare class BasePlaneSection {
|
|||||||
protected scene: Scene;
|
protected scene: Scene;
|
||||||
protected camera: THREE.Camera;
|
protected camera: THREE.Camera;
|
||||||
protected renderer: WebGLRenderer;
|
protected renderer: WebGLRenderer;
|
||||||
protected controls: OrbitControls;
|
protected controls: CameraControlsEx;
|
||||||
protected isSectionObjectVisible: boolean;
|
protected isSectionObjectVisible: boolean;
|
||||||
protected gizmo: THREE.Group;
|
protected gizmo: THREE.Group;
|
||||||
protected objectPixelSizeHelper?: ObjectPixelSizeHelper;
|
protected objectPixelSizeHelper?: ObjectPixelSizeHelper;
|
||||||
@ -27,7 +27,7 @@ export declare class BasePlaneSection {
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
constructor(scene: Scene, camera: THREE.Camera, renderer: WebGLRenderer, controls: OrbitControls);
|
constructor(scene: Scene, camera: THREE.Camera, renderer: WebGLRenderer, controls: CameraControlsEx);
|
||||||
/**
|
/**
|
||||||
* If plane is not assigned in constructor, then set it here.
|
* If plane is not assigned in constructor, then set it here.
|
||||||
* For now, we only support it to be set once. Otherwise, need to check isOpen status, and initSectionPlane properly.
|
* For now, we only support it to be set once. Otherwise, need to check isOpen status, and initSectionPlane properly.
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Box3, OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from "three";
|
import { Box3, OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from "three";
|
||||||
|
import { CameraControlsEx } from "../controls/CameraControlsEx";
|
||||||
import { BasePlaneSection } from "./BasePlaneSection";
|
import { BasePlaneSection } from "./BasePlaneSection";
|
||||||
import { OrbitControls } from "../controls/OrbitControls";
|
|
||||||
/**
|
/**
|
||||||
* GlobalPlaneSection section
|
* GlobalPlaneSection section
|
||||||
*/
|
*/
|
||||||
@ -8,7 +8,7 @@ export declare class GlobalPlaneSection extends BasePlaneSection {
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
constructor(sectionBox: Box3, scene: Scene, camera: PerspectiveCamera | OrthographicCamera, renderer: WebGLRenderer, controls: OrbitControls);
|
constructor(sectionBox: Box3, scene: Scene, camera: PerspectiveCamera | OrthographicCamera, renderer: WebGLRenderer, controls: CameraControlsEx);
|
||||||
/**
|
/**
|
||||||
* Initialize section box
|
* Initialize section box
|
||||||
*/
|
*/
|
||||||
|
@ -1,21 +1,27 @@
|
|||||||
import { OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from "three";
|
import * as THREE from "three";
|
||||||
import { BaseBoxSection } from "./BaseBoxSection";
|
import { Views } from "../utils/Viewer3DUtils";
|
||||||
import { OrbitControls } from "../controls/OrbitControls";
|
import { BaseViewer } from "../viewers/BaseViewer";
|
||||||
/**
|
import { BaseSection } from "./BaseSection";
|
||||||
* Object's box section
|
import { SectionPlane } from "./SectionPlane";
|
||||||
**/
|
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||||
export declare class ObjectsBoxSection extends BaseBoxSection {
|
export declare class ObjectsBoxSection extends BaseSection {
|
||||||
private objectIds;
|
protected selectedObject?: SectionPlane;
|
||||||
/**
|
protected planesMesh?: SectionPlane[];
|
||||||
* Constructor
|
protected sectionRange: Record<string, number[]>;
|
||||||
*/
|
constructor(viewer: BaseViewer, input: InputManager);
|
||||||
constructor(scene: Scene, camera: PerspectiveCamera | OrthographicCamera, renderer: WebGLRenderer, controls: OrbitControls, objectIds: number[]);
|
activate(): void;
|
||||||
/**
|
deactivate(): void;
|
||||||
* Initialize 6 section plane
|
protected initOrUpdateVertices(): void;
|
||||||
**/
|
initOrUpdateClipPlane(): void;
|
||||||
protected initPlanes(): void;
|
initOrUpdateSectionPlane(): void;
|
||||||
/**
|
activateSelectedObject(active: boolean): void;
|
||||||
* Clears section box
|
onDragStart(e: EventInfo): void;
|
||||||
**/
|
onDragMove(e: EventInfo): void;
|
||||||
protected clearSectionBox(): void;
|
onDragEnd(e: EventInfo): void;
|
||||||
|
protected dragTranslateSectionPlane(axis: THREE.Vector3, from: THREE.Vector3, to: THREE.Vector3, actionType: Views): void;
|
||||||
|
protected isInRange(value: number, range: number[]): boolean;
|
||||||
|
protected getIntersections(e: EventInfo): THREE.Intersection | undefined;
|
||||||
|
getIntersectObjects(): SectionPlane[];
|
||||||
|
resetSection(): void;
|
||||||
|
setSectionVisible(visible: boolean): void;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from "three";
|
import { OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from "three";
|
||||||
|
import { CameraControlsEx } from "../controls/CameraControlsEx";
|
||||||
import { BasePlaneSection } from "./BasePlaneSection";
|
import { BasePlaneSection } from "./BasePlaneSection";
|
||||||
import { OrbitControls } from "../controls/OrbitControls";
|
|
||||||
/**
|
/**
|
||||||
* Objects' plane section
|
* Objects' plane section
|
||||||
**/
|
**/
|
||||||
@ -9,7 +9,7 @@ export declare class ObjectsPlaneSection extends BasePlaneSection {
|
|||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
*/
|
*/
|
||||||
constructor(objectIds: number[], scene: Scene, camera: PerspectiveCamera | OrthographicCamera, renderer: WebGLRenderer, controls: OrbitControls);
|
constructor(objectIds: number[], scene: Scene, camera: PerspectiveCamera | OrthographicCamera, renderer: WebGLRenderer, controls: CameraControlsEx);
|
||||||
/**
|
/**
|
||||||
* Initialize 6 section plane
|
* Initialize 6 section plane
|
||||||
**/
|
**/
|
||||||
|
@ -1,33 +1,36 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { Raycaster, Scene, WebGLRenderer } from "three";
|
import { Tooltip } from "../../components/tool-tip";
|
||||||
import { BasePlaneSection } from "./BasePlaneSection";
|
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||||
import { PickSectionPopPanel } from "../../components/pop-panel/PickSectionPopPanel";
|
import { BaseSection } from "../../core/section/BaseSection";
|
||||||
import { Tooltip } from "../../components/tool-tip/Tooltip";
|
import { SectionGizmo } from "../../core/section/SectionGizmo";
|
||||||
import { OrbitControls } from "../controls/OrbitControls";
|
import { SectionPlane } from "../../core/section/SectionPlane";
|
||||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
import type { BaseViewer } from "../../core/viewers";
|
||||||
export declare class PickPlaneSection {
|
export declare class PickPlaneSection extends BaseSection {
|
||||||
private readonly container?;
|
protected faceInfo?: {
|
||||||
protected viewer: BaseViewer;
|
position: THREE.Vector3;
|
||||||
protected camera: THREE.Camera;
|
normal: THREE.Vector3;
|
||||||
protected controls: OrbitControls;
|
};
|
||||||
protected scene: Scene;
|
protected gizmo?: SectionGizmo;
|
||||||
protected renderer: WebGLRenderer;
|
protected planeMesh?: SectionPlane;
|
||||||
protected objectIds: number[];
|
protected clipPlane?: THREE.Plane;
|
||||||
isShowSectionPlane: boolean;
|
protected selectedObject?: SectionPlane | THREE.Mesh | THREE.Object3D;
|
||||||
protected sectionPlane?: BasePlaneSection;
|
protected center: THREE.Vector3;
|
||||||
protected popPanel?: PickSectionPopPanel;
|
|
||||||
protected tooltip?: Tooltip;
|
protected tooltip?: Tooltip;
|
||||||
protected isSelected: boolean;
|
constructor(viewer: BaseViewer, input: InputManager);
|
||||||
protected raycaster: Raycaster;
|
activate(): void;
|
||||||
constructor(viewer: BaseViewer, objectIds: number[], container?: HTMLElement | undefined);
|
deactivate(): void;
|
||||||
protected updateMouseAndRay(event: MouseEvent): void;
|
setSection(): void;
|
||||||
protected pickFace(evt: MouseEvent): boolean;
|
resetSection(): void;
|
||||||
init(): void;
|
setSectionVisible(visible: boolean): void;
|
||||||
protected clickOnceListerner: (event: MouseEvent) => void;
|
initOrUpdateClipPlane(): void;
|
||||||
open(): void;
|
initOrUpdateSectionPlane(): void;
|
||||||
close(): void;
|
initOrUpdateGizmo(): void;
|
||||||
enableSection(): void;
|
mousedown: (e: EventInfo) => void;
|
||||||
cancelSection(): void;
|
mousemove: (e: EventInfo) => void;
|
||||||
hideSectionPlane(): void;
|
onDragStart(e: EventInfo): void;
|
||||||
showSectionPlane(): void;
|
onDragMove(e: EventInfo): void;
|
||||||
|
onDragEnd(e: EventInfo): void;
|
||||||
|
getIntersectObjects(): THREE.Object3D<THREE.Event>[];
|
||||||
|
activateSelectedObject(active: boolean): void;
|
||||||
|
pickFace(e: EventInfo): THREE.Intersection<THREE.Object3D<THREE.Event>> | undefined;
|
||||||
}
|
}
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { Box3, Group, Plane, Scene, Vector3 } from "three";
|
import { Box3, Group, Plane, Scene, Vector3 } from "three";
|
||||||
import { BoxFace, BoxLine } from "./BaseBoxSection";
|
|
||||||
import { Views } from "../utils/Viewer3DUtils";
|
import { Views } from "../utils/Viewer3DUtils";
|
||||||
|
import { BoxFace, BoxLine } from "./BaseBoxSection";
|
||||||
/**
|
/**
|
||||||
* For dxf viewport section, only 4 section planes are required.
|
* For dxf viewport section, only 4 section planes are required.
|
||||||
*/
|
*/
|
||||||
|
@ -1,4 +1,5 @@
|
|||||||
|
export * from "./BaseSection";
|
||||||
export * from "./AxisPlaneSection";
|
export * from "./AxisPlaneSection";
|
||||||
export * from "./ObjectsBoxSection";
|
export * from "./ObjectsBoxSection";
|
||||||
export * from "./ObjectsPlaneSection";
|
|
||||||
export * from "./PickPlaneSection";
|
export * from "./PickPlaneSection";
|
||||||
|
export * from "./SectionManager";
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { TextShape } from "./TextShape";
|
|
||||||
import { FontFile } from "./files/FontFile";
|
|
||||||
import { BinaryReader } from "../helpers/BinaryReader";
|
import { BinaryReader } from "../helpers/BinaryReader";
|
||||||
|
import { TextShape } from "./TextShape";
|
||||||
|
import type { FontFile } from "./files/FontFile";
|
||||||
export declare class ShxParser {
|
export declare class ShxParser {
|
||||||
static stopFlag: string;
|
static stopFlag: string;
|
||||||
static FILE_STOP_FLAG: string[];
|
static FILE_STOP_FLAG: string[];
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { FontFile, ShxFontType } from "./FontFile";
|
|
||||||
import { BinaryReader } from "../../helpers/BinaryReader";
|
import { BinaryReader } from "../../helpers/BinaryReader";
|
||||||
|
import { ShxFontType } from "../Shx.constants";
|
||||||
|
import { FontFile } from "./FontFile";
|
||||||
export declare class BigFontFile extends FontFile {
|
export declare class BigFontFile extends FontFile {
|
||||||
isExtend: boolean;
|
isExtend: boolean;
|
||||||
type: ShxFontType;
|
type: ShxFontType;
|
||||||
|
@ -1,17 +1,8 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { FontDataTableRecord } from "../../../core/indexeddb/FontDataTable";
|
import { FontDataTableRecord } from "../../../core/indexeddb/FontDataTable";
|
||||||
import { BinaryReader } from "../../helpers/BinaryReader";
|
import { BinaryReader } from "../../helpers/BinaryReader";
|
||||||
|
import { Orientation, ShxFontType } from "../Shx.constants";
|
||||||
import { TextShape } from "../TextShape";
|
import { TextShape } from "../TextShape";
|
||||||
export declare enum Orientation {
|
|
||||||
Horizontal = 0,
|
|
||||||
Vertical = 1,
|
|
||||||
All = 2
|
|
||||||
}
|
|
||||||
export declare enum ShxFontType {
|
|
||||||
Shapes = 0,
|
|
||||||
Bigfont = 1,
|
|
||||||
Unifont = 2
|
|
||||||
}
|
|
||||||
export declare abstract class FontFile {
|
export declare abstract class FontFile {
|
||||||
type: ShxFontType;
|
type: ShxFontType;
|
||||||
info: string;
|
info: string;
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { FontFile, ShxFontType } from "./FontFile";
|
|
||||||
import { BinaryReader } from "../../helpers/BinaryReader";
|
import { BinaryReader } from "../../helpers/BinaryReader";
|
||||||
|
import { ShxFontType } from "../Shx.constants";
|
||||||
|
import { FontFile } from "./FontFile";
|
||||||
export declare class ShapeFontFile extends FontFile {
|
export declare class ShapeFontFile extends FontFile {
|
||||||
type: ShxFontType;
|
type: ShxFontType;
|
||||||
constructor(url: string);
|
constructor(url: string);
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
import { FontFile, ShxFontType } from "./FontFile";
|
|
||||||
import { BinaryReader } from "../../helpers/BinaryReader";
|
import { BinaryReader } from "../../helpers/BinaryReader";
|
||||||
|
import { ShxFontType } from "../Shx.constants";
|
||||||
|
import { FontFile } from "./FontFile";
|
||||||
export declare class UniFontFile extends FontFile {
|
export declare class UniFontFile extends FontFile {
|
||||||
type: ShxFontType;
|
type: ShxFontType;
|
||||||
isUniCode: boolean;
|
isUniCode: boolean;
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
import { SVGObject } from "../patches/SVGRenderer";
|
import { SVGObject } from "src/core/patches/SVGRenderer";
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
@ -75,6 +75,11 @@ export declare class CommonUtils {
|
|||||||
static roundNumber(value: number, n: number): number;
|
static roundNumber(value: number, n: number): number;
|
||||||
static convertDecimalToHex(decimal: number | string): string;
|
static convertDecimalToHex(decimal: number | string): string;
|
||||||
static canvasToImage(canvas: HTMLCanvasElement): Promise<HTMLImageElement>;
|
static canvasToImage(canvas: HTMLCanvasElement): Promise<HTMLImageElement>;
|
||||||
|
/**
|
||||||
|
* Takes screenshot to given rendering context and return base64 string in png/jpeg format.
|
||||||
|
* @param bbox If valid, takes screenshot of a sub image with given bounding box in screen coordinate.
|
||||||
|
*/
|
||||||
|
static renderingContextToImage(context: CanvasRenderingContext2D, bbox?: THREE.Box2, type?: string, quality?: number): string;
|
||||||
/**
|
/**
|
||||||
* Prints memory usage
|
* Prints memory usage
|
||||||
*/
|
*/
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
import * as THREE from "three";
|
import * as THREE from "three";
|
||||||
|
import type { EventInfo, IPointerEvent } from "../../core/input/InputManager";
|
||||||
/**
|
/**
|
||||||
* @internal
|
* @internal
|
||||||
*/
|
*/
|
||||||
export declare class CoordinateConversionUtils {
|
export declare class CoordinateConversionUtils {
|
||||||
static getScreenPointByEvent(event: MouseEvent, container: HTMLElement): THREE.Vector2;
|
static getScreenPointByEvent(event: IPointerEvent | EventInfo | MouseEvent | PointerEvent, container: HTMLElement): THREE.Vector2;
|
||||||
static getScreenPointByTouchEvent(event: TouchEvent, container: HTMLElement): THREE.Vector2;
|
static getScreenPointByTouchEvent(event: TouchEvent, container: HTMLElement): THREE.Vector2;
|
||||||
static worldPosition2ScreenPoint(vector: THREE.Vector3, camera: THREE.Camera, container: HTMLElement): THREE.Vector2;
|
static worldPosition2ScreenPoint(vector: THREE.Vector3, camera: THREE.Camera, container: HTMLElement): THREE.Vector2;
|
||||||
static screenPoint2worldPosition(vector: THREE.Vector2, camera: THREE.Camera, container: HTMLElement): THREE.Vector3;
|
static screenPoint2worldPosition(vector: THREE.Vector2, camera: THREE.Camera, container: HTMLElement): THREE.Vector3;
|
||||||
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user