feature:package改为npm引用
This commit is contained in:
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,7 +6,7 @@
|
||||
.pnp.js
|
||||
package-lock.json
|
||||
.idea
|
||||
/public/demo/projects
|
||||
/public/demo/libs
|
||||
|
||||
# testing
|
||||
/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/state": "^6.1.2",
|
||||
"@codemirror/view": "^6.4.0",
|
||||
"@pattern-x/gemini-viewer-threejs": "latest",
|
||||
"@testing-library/jest-dom": "^5.16.5",
|
||||
"@testing-library/react": "^13.4.0",
|
||||
"@testing-library/user-event": "^13.5.0",
|
||||
@ -29,9 +30,9 @@
|
||||
"web-vitals": "^2.1.4"
|
||||
},
|
||||
"scripts": {
|
||||
"start": "react-scripts start",
|
||||
"build": "react-scripts build",
|
||||
"test": "react-scripts test",
|
||||
"start": "react-app-rewired start",
|
||||
"build": "react-app-rewired build",
|
||||
"test": "react-app-rewired test",
|
||||
"eject": "react-scripts eject"
|
||||
},
|
||||
"eslintConfig": {
|
||||
@ -51,5 +52,9 @@
|
||||
"last 1 firefox 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 { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
||||
import { Tooltip } from "../tool-tip/Tooltip";
|
||||
import { Tooltip } from "../../components/tool-tip";
|
||||
import { IconClass } from "../../core/utils";
|
||||
import { BaseViewer } from "../../core/viewers/BaseViewer";
|
||||
declare enum BottomBarItemId {
|
||||
statistics = "statistics",
|
||||
cameraInfo = "cameraInfo",
|
||||
@ -16,16 +16,16 @@ interface BottomBarItemConfig {
|
||||
onUpdate?: (item: BottomBarItem) => void;
|
||||
}
|
||||
export declare class BottomBar {
|
||||
protected readonly viewer: BimViewer | DxfViewer | VRViewer;
|
||||
protected readonly viewer: BaseViewer;
|
||||
private element;
|
||||
itemList: Map<string, BottomBarItem>;
|
||||
constructor(viewer: BimViewer | DxfViewer | VRViewer);
|
||||
constructor(viewer: BaseViewer);
|
||||
update(): void;
|
||||
private init;
|
||||
private createItem;
|
||||
}
|
||||
declare class BottomBarItem {
|
||||
readonly viewer: BimViewer | DxfViewer | VRViewer;
|
||||
readonly viewer: BaseViewer;
|
||||
private readonly bottomBar;
|
||||
protected readonly menuId: string;
|
||||
protected cfg: BottomBarItemConfig;
|
||||
@ -34,7 +34,7 @@ declare class BottomBarItem {
|
||||
tooltip: Tooltip;
|
||||
element: HTMLElement;
|
||||
active: boolean;
|
||||
constructor(viewer: BimViewer | DxfViewer | VRViewer, bottomBar: BottomBar, menuId: string, cfg: BottomBarItemConfig);
|
||||
constructor(viewer: BaseViewer, bottomBar: BottomBar, menuId: string, cfg: BottomBarItemConfig);
|
||||
private createButton;
|
||||
setActive(active: boolean): void;
|
||||
update(): void;
|
||||
|
@ -1,9 +1,9 @@
|
||||
import { Toolbar } from "../../components/toolbar";
|
||||
import { Context as ContextFromConfigs, ContextMenuConfig as ContextMenuConfigFromConfigs, ContextMenuItem } from "../../core/Configs";
|
||||
import { AxisPlaneSection, ObjectsBoxSection, ObjectsPlaneSection, PickPlaneSection } from "../../core/section";
|
||||
import { BimViewer } from "../../core/viewers";
|
||||
import { Toolbar } from "../toolbar";
|
||||
import type { AxisPlaneSection, ObjectsBoxSection, PickPlaneSection } from "../../core/section";
|
||||
import type { BimViewer } from "../../core/viewers";
|
||||
export interface Context extends ContextFromConfigs {
|
||||
section?: ObjectsBoxSection | ObjectsPlaneSection | PickPlaneSection | AxisPlaneSection;
|
||||
section?: ObjectsBoxSection | PickPlaneSection | AxisPlaneSection;
|
||||
toolbar?: Toolbar<BimViewer>;
|
||||
}
|
||||
export interface ContextMenuConfig extends ContextMenuConfigFromConfigs {
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as dat from "dat.gui";
|
||||
import { Exploder } from "../../core/exploder/Exploder";
|
||||
import { BimViewer } from "../../core/viewers";
|
||||
import type { BimViewer } from "../../core/viewers";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { DxfViewer } from "../../core/viewers";
|
||||
import type { DxfViewer } from "../../core/viewers";
|
||||
export declare class DxfLayoutBar {
|
||||
protected readonly viewer: DxfViewer;
|
||||
private element?;
|
||||
|
@ -1,18 +1,16 @@
|
||||
import { Emitter } from "mitt";
|
||||
import { PopPanel } from "./PopPanel";
|
||||
import { AxisType } from "../../core/section/AxisPlaneSection";
|
||||
export type Events = {
|
||||
axis: AxisType;
|
||||
visible: boolean;
|
||||
};
|
||||
import { AxisPlaneSection } from "../../core/section/AxisPlaneSection";
|
||||
import type { BaseViewer } from "../../core/viewers/BaseViewer";
|
||||
export declare class AxisSectionPopPanel extends PopPanel {
|
||||
protected axis: string;
|
||||
protected activeItem?: string;
|
||||
protected groupSelectNode?: HTMLElement;
|
||||
protected activeSelectNode?: HTMLElement;
|
||||
protected isVisible: boolean;
|
||||
eventBus: Emitter<Events>;
|
||||
constructor(container?: HTMLElement);
|
||||
protected section: AxisPlaneSection;
|
||||
constructor(viewer: BaseViewer);
|
||||
keydown: (e: KeyboardEvent) => void;
|
||||
destroy(): void;
|
||||
createGroupSelectLayout(): void;
|
||||
addGroupSelectItems(): void;
|
||||
createActiveSelectLayout(): void;
|
||||
|
@ -1,17 +1,16 @@
|
||||
import { Emitter } from "mitt";
|
||||
import { PopPanel } from "./PopPanel";
|
||||
export type Events = {
|
||||
visible: boolean;
|
||||
reset: void;
|
||||
};
|
||||
import type { PickPlaneSection } from "../../core/section/PickPlaneSection";
|
||||
import type { BaseViewer } from "../../core/viewers/BaseViewer";
|
||||
export declare class PickSectionPopPanel extends PopPanel {
|
||||
eventBus: Emitter<Events>;
|
||||
protected activeSelectNode?: Element;
|
||||
protected isVisible: boolean;
|
||||
protected enabled: boolean;
|
||||
protected visibleNode?: HTMLElement;
|
||||
protected resetNode?: HTMLElement;
|
||||
constructor(container?: HTMLElement);
|
||||
protected section: PickPlaneSection;
|
||||
constructor(viewer: BaseViewer);
|
||||
keydown: (e: KeyboardEvent) => void;
|
||||
destroy(): void;
|
||||
createActiveSelectLayout(): void;
|
||||
addActiveItems(): void;
|
||||
enable(): void;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { Toolbar } from "./Toolbar";
|
||||
import { ToolbarConfig, ToolbarMenuId } from "./Toolbar.constants";
|
||||
import { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
||||
import type { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
||||
/**
|
||||
* @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> {
|
||||
constructor(bimViewer: T, menuConfig: ToolbarConfig<T>, groupConfig?: ToolbarMenuId[][] | string[][]);
|
||||
keydown: () => void;
|
||||
}
|
||||
|
@ -1,16 +1,9 @@
|
||||
import { ToolbarConfig, ToolbarMenuId } from "./Toolbar.constants";
|
||||
import { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
||||
/**
|
||||
* Toolbar.config
|
||||
**/
|
||||
import { ToolbarConfig } from "./Toolbar.constants";
|
||||
import type { BimViewer, DxfViewer, VRViewer } from "../../core/viewers";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const DEFAULT_BIMVIEWER_TOOLBAR_CONFIG: ToolbarConfig<BimViewer>;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const GROUP_CONFIG: ToolbarMenuId[][];
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
@ -1,4 +1,4 @@
|
||||
import { Toolbar } from "./Toolbar";
|
||||
import type { Toolbar } from "./Toolbar";
|
||||
import { IconClass } from "../../core/utils";
|
||||
import type { BaseViewer } from "../../core/viewers";
|
||||
/**
|
||||
@ -53,7 +53,7 @@ export declare enum ToolbarMenuId {
|
||||
Section = "Section",
|
||||
SectionBox = "SectionBox",
|
||||
SectionPlane = "SectionPlane",
|
||||
AxisSectionPlane = "AxisSectionPlane",
|
||||
SectionAxis = "SectionAxis",
|
||||
BimTree = "BimTree",
|
||||
Viewpoint = "Viewpoint",
|
||||
Annotation = "Annotation",
|
||||
@ -64,7 +64,8 @@ export declare enum ToolbarMenuId {
|
||||
Fullscreen = "FullScreen",
|
||||
SceneClear = "SceneClear",
|
||||
Layers = "Layers",
|
||||
ZoomToRectangle = "ZoomToRectangle"
|
||||
ZoomToRectangle = "ZoomToRectangle",
|
||||
Screenshot = "GetScreenshot"
|
||||
}
|
||||
/**
|
||||
* ToolbarConfig
|
||||
@ -89,3 +90,7 @@ export interface ToolbarMenuConfig<T extends BaseViewer> {
|
||||
export type ToolbarConfig<T extends BaseViewer> = {
|
||||
[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>;
|
||||
groupConfig: ToolbarMenuId[][] | string[][];
|
||||
private element;
|
||||
private visible;
|
||||
activateMenuId?: string;
|
||||
menuList: Map<string, ToolbarMenu<T>>;
|
||||
constructor(bimViewer: T, menuConfig: ToolbarConfig<T>, groupConfig?: ToolbarMenuId[][] | string[][]);
|
||||
private init;
|
||||
keydown: (e: KeyboardEvent) => void;
|
||||
clearActive(): void;
|
||||
private createToolbarMenu;
|
||||
/**
|
||||
* @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 type { BimViewer, DxfViewer, VRViewer } from "../core/viewers";
|
||||
/**
|
||||
* Camera config
|
||||
*/
|
||||
@ -72,6 +72,7 @@ export interface ModelConfig {
|
||||
instantiate?: boolean;
|
||||
/**
|
||||
* If we want to merge meshes/lines/points with the same material
|
||||
* @internal
|
||||
* @default false
|
||||
*/
|
||||
merge?: boolean;
|
||||
@ -146,6 +147,20 @@ export interface BaseViewerConfig {
|
||||
* @internal
|
||||
*/
|
||||
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
|
||||
@ -211,12 +226,27 @@ export interface BimViewerConfig extends BaseViewerConfig {
|
||||
* This wrappers most config for DxfViewer
|
||||
*/
|
||||
export interface DxfViewerConfig extends BaseViewerConfig {
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
enableAxisGizmo?: boolean;
|
||||
enableLayoutBar?: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
enableStats?: boolean;
|
||||
enableToolbar?: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
enableSpinner?: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
enableProgressBar?: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
enableBottomBar?: boolean;
|
||||
/**
|
||||
* If to cache model into indexeddb (or maybe local storage in future).
|
||||
@ -227,6 +257,7 @@ export interface DxfViewerConfig extends BaseViewerConfig {
|
||||
enableLocalCache?: boolean;
|
||||
/**
|
||||
* If user can select an entity by mouse click
|
||||
* @internal
|
||||
* @default false
|
||||
*/
|
||||
enableSelection?: boolean;
|
||||
@ -242,8 +273,14 @@ export interface DxfViewerConfig extends BaseViewerConfig {
|
||||
*/
|
||||
export interface VRViewerConfig extends BaseViewerConfig {
|
||||
autoRotateSpeed?: number;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
enableAxisGizmo?: boolean;
|
||||
enableToolbar?: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
enableBottomBar?: boolean;
|
||||
/**
|
||||
* @internal
|
||||
@ -318,3 +355,11 @@ export interface IsolateObjectsParam {
|
||||
export interface IsolateObjectsParams {
|
||||
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",
|
||||
AxisPlaneSection = "AxisPlaneSection"
|
||||
}
|
||||
/**
|
||||
* @deprecated Use SectionType instead
|
||||
*/
|
||||
export declare enum SectionMode {
|
||||
ObjectsBoxSection = "ObjectsBoxSection",
|
||||
PickPlaneSection = "PickPlaneSection",
|
||||
AxisPlaneSection = "AxisPlaneSection"
|
||||
export interface Vector2 {
|
||||
x: number;
|
||||
y: number;
|
||||
}
|
||||
export interface Vector3 {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
}
|
||||
export interface Vector2 {
|
||||
x: number;
|
||||
y: number;
|
||||
export interface Box2 {
|
||||
min: Vector2;
|
||||
max: Vector2;
|
||||
}
|
||||
|
@ -1,10 +1,16 @@
|
||||
import * as THREE from "three";
|
||||
import { DrawableData } from "./Constants";
|
||||
import { Drawable } from "./Drawable";
|
||||
import { DrawableList } from "./DrawableList";
|
||||
import { Event } from "../utils";
|
||||
import type { BimViewer, DxfViewer } from "../viewers";
|
||||
import type { DrawableList } from "./DrawableList";
|
||||
import { Event } from "../../core/utils";
|
||||
import type { BimViewer, DxfViewer } from "../../core/viewers";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export type constructorReturnType<T> = new (...arg: any) => T;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare class CanvasRender extends Event {
|
||||
private viewer;
|
||||
private drawableLists;
|
||||
@ -33,5 +39,10 @@ export declare class CanvasRender extends Event {
|
||||
type: string;
|
||||
quality: number;
|
||||
}): Promise<string | undefined>;
|
||||
getImage(option?: {
|
||||
type: string;
|
||||
quality: number;
|
||||
}): string | undefined;
|
||||
getCanvas(): HTMLCanvasElement | undefined;
|
||||
destroy(): void;
|
||||
}
|
||||
|
@ -1,5 +1,6 @@
|
||||
/**
|
||||
* Markup data
|
||||
* @internal
|
||||
*/
|
||||
export interface DrawableData {
|
||||
/**
|
||||
@ -7,15 +8,16 @@ export interface DrawableData {
|
||||
*/
|
||||
id: string;
|
||||
/**
|
||||
* Two dimension float array stores 2d points.
|
||||
* e.g. [[1, 1], [2.5, 3]]
|
||||
* Two dimension float array stores 2d or 3d points.
|
||||
* 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[][];
|
||||
lineWidth?: number;
|
||||
lineColor?: string;
|
||||
fillColor?: string;
|
||||
/**
|
||||
* is class type for serialize
|
||||
* Drawable dta type
|
||||
*/
|
||||
type: string;
|
||||
}
|
||||
|
@ -1,6 +1,9 @@
|
||||
import * as THREE from "three";
|
||||
import { DrawableData } from "./Constants";
|
||||
import { Event } from "../utils";
|
||||
import { Event } from "../../core/utils";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare abstract class Drawable extends Event {
|
||||
protected readonly DEFAULT_LINE_WIDTH = 1;
|
||||
protected readonly DEFAULT_STROKE_STYLE = "#000000";
|
||||
|
@ -1,9 +1,16 @@
|
||||
import { DrawableData } from "./Constants";
|
||||
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
|
||||
* @internal
|
||||
*/
|
||||
export declare class DrawableList {
|
||||
export declare class DrawableList extends Event<DrawableListHandler> {
|
||||
private category;
|
||||
private drawableMap;
|
||||
constructor(category: string);
|
||||
@ -17,3 +24,4 @@ export declare class DrawableList {
|
||||
setDrawableDatas(drawableDatas: DrawableData[]): void;
|
||||
getDrawableByPosition(p: THREE.Vector3, raycaster?: THREE.Raycaster): Drawable | undefined;
|
||||
}
|
||||
export {};
|
||||
|
@ -1,4 +1,4 @@
|
||||
export * from "./CanvasRender";
|
||||
export { DrawableList } from "./DrawableList";
|
||||
export { Drawable } from "./Drawable";
|
||||
export * from "./DrawableList";
|
||||
export * from "./Drawable";
|
||||
export * from "./Constants";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as THREE from "three";
|
||||
import { Drawable } from "../canvas";
|
||||
import { Drawable } from "../../core/canvas";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
@ -1,12 +1,11 @@
|
||||
import { DxfChange } from "../dxf";
|
||||
import { Event } from "../utils";
|
||||
import type { DxfViewer } from "../viewers";
|
||||
import { DxfChange } from "../../core/dxf";
|
||||
import { Event } from "../../core/utils";
|
||||
export declare class DxfCompareMarkupManager extends Event {
|
||||
private viewer;
|
||||
private overlayRender?;
|
||||
private drawableList;
|
||||
constructor(viewer: DxfViewer);
|
||||
render(): void;
|
||||
drawCompareDrawable(changes: Record<string, DxfChange>): void;
|
||||
setCompareDrawableVisible(visilbe: boolean): void;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { EventDispatcher, PerspectiveCamera, Vector3 } from "three";
|
||||
import { ControlsHelper } from "../helpers/ControlsHelper";
|
||||
import type { ControlsHelper } from "../../core/helpers";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
@ -1 +1,2 @@
|
||||
export * from "./VRControls";
|
||||
export * from "./CameraControlsEx";
|
||||
|
@ -89,7 +89,7 @@ export interface ILineTypeTableDefinition {
|
||||
parseTableRecords(): Record<string, ILineType>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
* dwg layer
|
||||
*/
|
||||
export interface ILayer {
|
||||
name: string;
|
||||
@ -302,4 +302,9 @@ export default class DxfParser {
|
||||
parseSync(source: string | ArrayBuffer): IDxf;
|
||||
parseStream(stream: Readable): Promise<IDxf>;
|
||||
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 IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface I3DfaceEntity extends IEntity {
|
||||
shape: boolean;
|
||||
hasContinuousLinetypePattern: boolean;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IAttdefEntity extends IEntity {
|
||||
xScale: number;
|
||||
textStyle: "STANDARD" | string;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IAttribEntity extends IEntity {
|
||||
xScale: number;
|
||||
textStyle: "STANDARD" | string;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ICircleEntity extends IEntity {
|
||||
center: IPoint;
|
||||
radius: number;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IDimensionEntity extends IEntity {
|
||||
block: string;
|
||||
dimStyleName: string;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IEllipseEntity extends IEntity {
|
||||
center: IPoint;
|
||||
majorAxisEndPoint: IPoint;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export declare enum HatchBoundaryPathTypeFlag {
|
||||
Default = 0,
|
||||
External = 1,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ILeaderEntity extends IEntity {
|
||||
leaderStyleId: number;
|
||||
leaderLineType: number;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity } from "./geomtry";
|
||||
export interface IOleEntity extends IEntity {
|
||||
documentType: string;
|
||||
version: number;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity } from "./geomtry";
|
||||
export interface IRegionEntity extends IEntity {
|
||||
modelerVersion?: number;
|
||||
proprietaryData?: string;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ISolidEntity extends IEntity {
|
||||
points: IPoint[];
|
||||
extrusionDirection: IPoint;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ISplineEntity extends IEntity {
|
||||
controlPoints?: IPoint[];
|
||||
fitPoints?: IPoint[];
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ITextEntity extends IEntity {
|
||||
startPoint: IPoint;
|
||||
endPoint: IPoint;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IViewportEntity extends IEntity {
|
||||
centerPoint: IPoint;
|
||||
width_paperSpace: number;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
export declare enum DictionaryCloningFlags {
|
||||
NotApplicable = 0,
|
||||
KeepExisting = 1,
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
export interface ISortEntsObject extends IObject {
|
||||
entityHandles: string[][];
|
||||
}
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import { IPoint } from "../entities/geomtry";
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
export interface ISpatialFilterObject extends IObject {
|
||||
origin: IPoint;
|
||||
numberOfPointsOnClipBoundary: number;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
import { DictionaryCloningFlags } from "./dictionary";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
export interface IXRecord extends IObject {
|
||||
binaryData: string | undefined;
|
||||
cloningFlag: DictionaryCloningFlags;
|
||||
|
@ -1,11 +1,11 @@
|
||||
import * as THREE from "three";
|
||||
import { Font } from "three/examples/jsm/loaders/FontLoader.js";
|
||||
import { DxfChange, DxfChangeType } from "./DxfCompare";
|
||||
import { Units } from "../Units";
|
||||
import { IBlock, IDxf, IEntity, ILayer, ILayoutObject, IPoint, IViewPort, IViewportEntity } from "../dxf-parser";
|
||||
import { IMLeaderContextData } from "../dxf-parser/entities/mleader";
|
||||
import { ISpatialFilterObject } from "../dxf-parser/objects/spatialfilter";
|
||||
import { ShxFont } from "../shx-parser/ShxFont";
|
||||
import { Units } from "../../core/Units";
|
||||
import { IBlock, IDxf, IEntity, ILayer, ILayoutObject, IPoint, IViewPort, IViewportEntity } from "../../core/dxf-parser";
|
||||
import { IMLeaderContextData } from "../../core/dxf-parser/entities/mleader";
|
||||
import { ISpatialFilterObject } from "../../core/dxf-parser/objects/spatialfilter";
|
||||
import { ShxFont } from "../../core/shx-parser";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@ -15,8 +15,14 @@ export interface DxfData extends IDxf {
|
||||
loadedEntityCount: number;
|
||||
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
|
||||
*/
|
||||
@ -145,7 +151,7 @@ export interface DxfSpatialFilter extends ISpatialFilterObject {
|
||||
* @author Sourabh Soni / https://www.prolincur.com
|
||||
* @internal
|
||||
*/
|
||||
export declare class DXFLoader extends THREE.Loader {
|
||||
export declare class DxfLoader extends THREE.Loader {
|
||||
static readonly MODEL_LAYOUT_NAME = "Model";
|
||||
private timer;
|
||||
private ignorePaperSpace;
|
||||
@ -290,19 +296,7 @@ export declare class DXFLoader extends THREE.Loader {
|
||||
};
|
||||
private getTextLineNum;
|
||||
draw3DFace(entity: DxfEntity): THREE.Line<THREE.BufferGeometry, THREE.LineBasicMaterial> | undefined;
|
||||
drawSpline(entity: DxfEntity): 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[];
|
||||
drawSpline(entity: DxfEntity, blockEntity?: IEntity): THREE.Line | undefined;
|
||||
drawXLine(entity: DxfEntity): THREE.Line | undefined;
|
||||
drawRay(entity: DxfEntity): THREE.Line | 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.
|
||||
*/
|
||||
private getLayerName;
|
||||
/**
|
||||
* Sets object's material after being created
|
||||
* TODO: hatch is handled separately, and may move its logic here.
|
||||
*/
|
||||
private setMaterial;
|
||||
private setHatchMaterial;
|
||||
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.
|
||||
*/
|
||||
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.
|
||||
* If tolerance is bigger, more points are simpified.
|
||||
|
@ -1,8 +1,13 @@
|
||||
import * as THREE from "three";
|
||||
import { DxfEntity } from "./DXFLoader";
|
||||
import { IDxf } from "../dxf-parser";
|
||||
import type { DxfEntity } from "./DxfLoader";
|
||||
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 {
|
||||
Added = "Added",
|
||||
@ -11,12 +16,24 @@ export declare enum DxfChangeType {
|
||||
NoChange = "NoChange"
|
||||
}
|
||||
/**
|
||||
* Dxf change
|
||||
* Describes a dxf change
|
||||
*/
|
||||
export interface DxfChange {
|
||||
/**
|
||||
* An integer type id. It is unique in the lifecycle of a DxfViewer.
|
||||
*/
|
||||
id: number;
|
||||
/**
|
||||
* Change type, which can be "Added", "Removed", "Modified" or "NoChange".
|
||||
*/
|
||||
type: DxfChangeType;
|
||||
/**
|
||||
* AutoCAD entity handle
|
||||
*/
|
||||
handle: string;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
parentHandles?: string[];
|
||||
/**
|
||||
* @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 "./DXFLoader";
|
||||
export * from "./bspline";
|
||||
export * from "./DxfLoader";
|
||||
export * as bspline from "./bspline";
|
||||
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 { VRControls } from "../controls/VRControls";
|
||||
import type { VRControls } from "../../core/controls";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as THREE from "three";
|
||||
import { Font } from "three/examples/jsm/loaders/FontLoader.js";
|
||||
import { DxfData } from "../dxf";
|
||||
import { ShxFont } from "../shx-parser/ShxFont";
|
||||
import type { DxfData } from "../../core/dxf";
|
||||
import type { ShxFont } from "../../core/shx-parser";
|
||||
export declare class LoadingHelper {
|
||||
private gltfLoader?;
|
||||
private font?;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as THREE from "three";
|
||||
import { BvhParameter } from "../workers/GenerateMeshBvhWorker";
|
||||
import { BvhParameter } from "../../core/workers";
|
||||
/**
|
||||
* Bvh: Bounding volume hierarchy
|
||||
*/
|
||||
|
@ -1,8 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { CanvasRender } from "../canvas/CanvasRender";
|
||||
import { Drawable } from "../canvas/Drawable";
|
||||
import { ILine } from "../utils/GeometryUtils";
|
||||
import { SnapType } from "../utils/SVGObjectUtils";
|
||||
import { CanvasRender, Drawable } from "../../core/canvas";
|
||||
import { ILine, SnapType } from "../../core/utils";
|
||||
export declare class SnapDrawable extends Drawable {
|
||||
static readonly LINE_COLOR = "rgba(255, 240, 0, 0.8)";
|
||||
static readonly FILL_COLOR = "rgba(135, 206, 250, 0.5)";
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as THREE from "three";
|
||||
import { OrbitControls } from "../controls/OrbitControls";
|
||||
import { CameraControlsEx } from "../../core/controls";
|
||||
/**
|
||||
* Helper class to adjust object visual size
|
||||
*/
|
||||
@ -8,6 +8,6 @@ export declare class ObjectPixelSizeHelper {
|
||||
private camera;
|
||||
targetPixelHeight: 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;
|
||||
}
|
||||
|
@ -1,30 +1,15 @@
|
||||
import * as THREE from "three";
|
||||
import { BimViewer, DxfViewer } from "../viewers";
|
||||
import type { BimViewer, DxfViewer } from "../../core/viewers";
|
||||
export declare class ZoomToRectHelper {
|
||||
private viewer;
|
||||
protected mouseDown: boolean;
|
||||
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";
|
||||
protected viewer: DxfViewer | BimViewer;
|
||||
private boxSelectHelper?;
|
||||
constructor(viewer: DxfViewer | BimViewer);
|
||||
get viewerContainer(): HTMLCanvasElement;
|
||||
private get viewerContainer();
|
||||
get camera(): THREE.OrthographicCamera | THREE.PerspectiveCamera;
|
||||
get raycaster(): THREE.Raycaster;
|
||||
isActived(): boolean;
|
||||
activate(): void;
|
||||
deactivate(): void;
|
||||
mousedown: (e: MouseEvent) => void;
|
||||
mousemove: (e: MouseEvent) => void;
|
||||
mouseup: (e: MouseEvent) => void;
|
||||
private pickPositionByScreenPoint;
|
||||
private handleZoomToRect;
|
||||
drawRect(leftTop: THREE.Vector2, rightBottom: THREE.Vector2): void;
|
||||
setRectDomVisible(visible: boolean): void;
|
||||
protected pickPositionByScreenPoint(p: THREE.Vector2): THREE.Vector3 | undefined;
|
||||
protected handleZoomToRect(leftTop: THREE.Vector2, rightBottom: THREE.Vector2): void;
|
||||
destroy(): void;
|
||||
}
|
||||
|
@ -1,4 +1,11 @@
|
||||
export * from "./ControlsHelper";
|
||||
export * from "../../components/dat-gui/BimViewerDatGui";
|
||||
export * from "./InstantiateHelper";
|
||||
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 "./axes";
|
||||
export * from "./canvas";
|
||||
export * from "./Configs";
|
||||
export * from "./compare";
|
||||
export * from "./controls";
|
||||
export * from "./Constants";
|
||||
export * from "./dxf";
|
||||
export type { ILayoutObject, IPoint } from "./dxf-parser";
|
||||
export * from "./dxf-parser";
|
||||
export * from "./exploder";
|
||||
export * from "./geometry-offset";
|
||||
export * from "./helpers";
|
||||
export * from "./indexeddb";
|
||||
export * from "./local-model-uploader";
|
||||
export { MarkupType } from "./markup";
|
||||
export { MeasurementType } from "./measure";
|
||||
export * from "../components/toolbar";
|
||||
export * from "./input";
|
||||
export * from "./markup";
|
||||
export * from "./measure";
|
||||
export * from "./navcube";
|
||||
export * from "./section";
|
||||
export * from "./shp-js";
|
||||
export * from "./shx-parser";
|
||||
export * from "./utils";
|
||||
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 type { Orientation, ShxFontType } from "../shx-parser/files/FontFile";
|
||||
import type { Orientation, ShxFontType } from "../../core/shx-parser";
|
||||
export interface FontDataTableRecord {
|
||||
url: string;
|
||||
type: ShxFontType;
|
||||
|
@ -2,3 +2,5 @@ export * from "./AnnotationTable";
|
||||
export * from "./BaseTable";
|
||||
export * from "./IndexedDbManager";
|
||||
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
|
||||
*/
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { MarkupType } from "./Constants";
|
||||
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||
import { MarkupType } from "../../core/markup/Constants";
|
||||
export declare class ArrowMarkup extends BaseMarkup {
|
||||
type: MarkupType;
|
||||
constructor(id: string, points: THREE.Vector3[]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as THREE from "three";
|
||||
import { Drawable, DrawableData } from "../canvas";
|
||||
import { Drawable, DrawableData } from "../../core/canvas";
|
||||
export declare abstract class BaseMarkup extends Drawable {
|
||||
protected editPointSize: number;
|
||||
protected editPointColor: string;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { MarkupType } from "./Constants";
|
||||
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||
import { MarkupType } from "../../core/markup/Constants";
|
||||
export declare class CircleMarkup extends BaseMarkup {
|
||||
radius: number;
|
||||
type: MarkupType;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { MarkupType } from "./Constants";
|
||||
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||
import { MarkupType } from "../../core/markup/Constants";
|
||||
export declare class CloudLineMarkup extends BaseMarkup {
|
||||
type: MarkupType;
|
||||
constructor(id: string, points: THREE.Vector3[]);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { MarkupType } from "./Constants";
|
||||
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||
import { MarkupType } from "../../core/markup/Constants";
|
||||
export declare class CloudRectMarkup extends BaseMarkup {
|
||||
type: MarkupType;
|
||||
constructor(id: string, points: THREE.Vector3[]);
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||
export declare class DotMarkup extends BaseMarkup {
|
||||
radius: number;
|
||||
constructor(id: string, points: THREE.Vector3[]);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { MarkupType } from "./Constants";
|
||||
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||
import { MarkupType } from "../../core/markup/Constants";
|
||||
export declare class EllipseMarkup extends BaseMarkup {
|
||||
radiusX: number;
|
||||
radiusY: number;
|
||||
|
@ -1,11 +1,14 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { MarkupType } from "./Constants";
|
||||
import { DrawableData } from "../canvas";
|
||||
import { Event } from "../utils";
|
||||
import { BimViewer, DxfViewer } from "../viewers";
|
||||
export declare class MarkupManager extends Event {
|
||||
import { DrawableData } from "../../core/canvas";
|
||||
import type { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||
import { Event } from "../../core/utils";
|
||||
import type { BaseViewer } from "../../core/viewers";
|
||||
type MarkupHandler = {};
|
||||
export declare class MarkupManager extends Event<MarkupHandler> {
|
||||
private viewer;
|
||||
private inputManager;
|
||||
private overlayRender?;
|
||||
private drawableList;
|
||||
private lineWidth;
|
||||
@ -27,11 +30,11 @@ export declare class MarkupManager extends Event {
|
||||
private textInput?;
|
||||
private actived;
|
||||
private undoRedoHelper;
|
||||
constructor(viewer: BimViewer | DxfViewer);
|
||||
constructor(viewer: BaseViewer, input: InputManager);
|
||||
get viewerCanvas(): HTMLCanvasElement;
|
||||
get camera(): THREE.OrthographicCamera | THREE.PerspectiveCamera;
|
||||
get raycaster(): THREE.Raycaster;
|
||||
private removeMarkupEventFromViewer;
|
||||
setMarkupVisibility(id: string, visible: boolean): boolean;
|
||||
setMarkupsVisibility(visible: boolean): void;
|
||||
clearAll(): void;
|
||||
isMarkupActive(): boolean;
|
||||
@ -48,11 +51,12 @@ export declare class MarkupManager extends Event {
|
||||
setFontSize(fontSize: number): void;
|
||||
getFontSize(): number;
|
||||
pickPositionByScreenPoint(p: THREE.Vector2): THREE.Vector3;
|
||||
pickThreejsPositionByMouse(e: MouseEvent): THREE.Vector3;
|
||||
mousedown: (e: MouseEvent) => void;
|
||||
mousemove: (e: MouseEvent) => void;
|
||||
mouseup: (e: MouseEvent) => void;
|
||||
keydown: (e: KeyboardEvent) => void;
|
||||
pickThreejsPositionByMouse(e: EventInfo): THREE.Vector3;
|
||||
mousedown: (e: EventInfo) => void;
|
||||
mousemove: (e: EventInfo) => void;
|
||||
mouseup: (e: EventInfo) => void;
|
||||
keydown: (e: EventInfo) => void;
|
||||
confirmToRemove(isConfirm: boolean): void;
|
||||
isEditing(): boolean;
|
||||
endEdit(selectMarkup: BaseMarkup): void;
|
||||
endDraw(createdMarkup?: BaseMarkup): void;
|
||||
@ -62,7 +66,7 @@ export declare class MarkupManager extends Event {
|
||||
addMarkup(markup: BaseMarkup, needRecord?: boolean): void;
|
||||
updateMarkup(markup: BaseMarkup, newData: DrawableData, 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;
|
||||
getMarkupById(id: string): BaseMarkup;
|
||||
getMarkupData(): DrawableData[];
|
||||
@ -80,3 +84,4 @@ export declare class MarkupManager extends Event {
|
||||
clearUndoRedo(): void;
|
||||
destroy(): void;
|
||||
}
|
||||
export {};
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MarkupManager } from "./MarkupManager";
|
||||
import { OperationRecord, UndoRedoHelper } from "../helpers/UndoRedoHelper";
|
||||
import { OperationRecord, UndoRedoHelper } from "../../core/helpers";
|
||||
import type { MarkupManager } from "../../core/markup";
|
||||
export declare enum MarkupState {
|
||||
Add = "Add",
|
||||
Update = "Update",
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { MarkupType } from "./Constants";
|
||||
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||
import { MarkupType } from "../../core/markup/Constants";
|
||||
export declare class PolylineMarkup extends BaseMarkup {
|
||||
type: MarkupType;
|
||||
constructor(id: string, points: THREE.Vector3[]);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { MarkupType } from "./Constants";
|
||||
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||
import { MarkupType } from "../../core/markup/Constants";
|
||||
export declare class RectMarkup extends BaseMarkup {
|
||||
type: MarkupType;
|
||||
constructor(id: string, points: THREE.Vector3[]);
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { MarkupType } from "./Constants";
|
||||
import { DrawableData } from "../canvas";
|
||||
import { DrawableData } from "../../core/canvas";
|
||||
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||
import { MarkupType } from "../../core/markup/Constants";
|
||||
export interface TextShape extends DrawableData {
|
||||
text: string;
|
||||
fontSize: number;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMarkup } from "./BaseMarkup";
|
||||
import { MarkupType } from "./Constants";
|
||||
import { BaseMarkup } from "../../core/markup/BaseMarkup";
|
||||
import { MarkupType } from "../../core/markup/Constants";
|
||||
export declare class XMarkup extends BaseMarkup {
|
||||
type: MarkupType;
|
||||
constructor(id: string, points: THREE.Vector3[]);
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
||||
import { MeasurementType } from "./BaseMeasurement";
|
||||
import { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||
import { MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||
export declare class AngleMeasureDrawable extends BaseMeasureDrawable {
|
||||
type: MeasurementType;
|
||||
constructor(id: string, points: THREE.Vector3[]);
|
||||
|
@ -1,12 +1,13 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMeasurement } from "./BaseMeasurement";
|
||||
import { DrawableList } from "../canvas/DrawableList";
|
||||
import { OSnapHelper } from "../helpers/OSnapHelper";
|
||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
||||
import { DrawableList } from "../../core/canvas";
|
||||
import { OSnapHelper } from "../../core/helpers";
|
||||
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||
import { BaseMeasurement } from "../../core/measure/BaseMeasurement";
|
||||
import type { BaseViewer } from "../../core/viewers";
|
||||
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 onMouseClick(e: MouseEvent): void;
|
||||
protected onMouseClick(e: EventInfo): void;
|
||||
protected complete(): void;
|
||||
cancel(): void;
|
||||
deactivate(): void;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
||||
import { MeasurementType } from "./BaseMeasurement";
|
||||
import { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||
import { MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||
export declare class AreaMeasureDrawable extends BaseMeasureDrawable {
|
||||
type: MeasurementType;
|
||||
constructor(id: string, points: THREE.Vector3[]);
|
||||
|
@ -1,12 +1,13 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMeasurement } from "./BaseMeasurement";
|
||||
import { DrawableList } from "../canvas/DrawableList";
|
||||
import { OSnapHelper } from "../helpers/OSnapHelper";
|
||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
||||
import { DrawableList } from "../../core/canvas";
|
||||
import { OSnapHelper } from "../../core/helpers";
|
||||
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||
import { BaseMeasurement } from "../../core/measure/BaseMeasurement";
|
||||
import type { BaseViewer } from "../../core/viewers";
|
||||
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 onMouseClick(e: MouseEvent): void;
|
||||
protected onMouseClick(e: EventInfo): void;
|
||||
protected complete(): void;
|
||||
cancel(): void;
|
||||
deactivate(): void;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { MeasurementData, MeasurementType } from "./BaseMeasurement";
|
||||
import { Drawable } from "../canvas/Drawable";
|
||||
import { Drawable } from "../../core/canvas";
|
||||
import { MeasurementData, MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||
export declare abstract class BaseMeasureDrawable extends Drawable {
|
||||
type: MeasurementType;
|
||||
static readonly MAJOR_COLOR = "rgba(249, 157, 11, 0.9)";
|
||||
|
@ -1,11 +1,14 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
||||
import { Tooltip } from "../../components/tool-tip/Tooltip";
|
||||
import { DrawableData } from "../canvas";
|
||||
import { DrawableList } from "../canvas/DrawableList";
|
||||
import { OSnapHelper } from "../helpers/OSnapHelper";
|
||||
import { Event } from "../utils";
|
||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
||||
import { Tooltip } from "../../components/tool-tip";
|
||||
import { DrawableData, DrawableList } from "../../core/canvas";
|
||||
import { OSnapHelper } from "../../core/helpers";
|
||||
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||
import type { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||
import { Event } from "../../core/utils";
|
||||
import type { BaseViewer } from "../../core/viewers";
|
||||
/**
|
||||
* Measurement type. e.g. distance measurement, area measurement, etc.
|
||||
*/
|
||||
export declare enum MeasurementType {
|
||||
Distance = "Distance",
|
||||
Area = "Area",
|
||||
@ -26,23 +29,43 @@ export interface MeasurementData extends DrawableData {
|
||||
id: string;
|
||||
/**
|
||||
* 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[][];
|
||||
}
|
||||
type MeasureHandler = {
|
||||
/**
|
||||
* click measure
|
||||
*/
|
||||
clickedonmeasurement: BaseMeasureDrawable;
|
||||
/**
|
||||
* draw measure complete
|
||||
*/
|
||||
complete: BaseMeasureDrawable;
|
||||
/**
|
||||
* deactivate measure
|
||||
*/
|
||||
deactivate: MeasurementType;
|
||||
/**
|
||||
* draw first point
|
||||
*/
|
||||
firstpointpicked: BaseMeasureDrawable;
|
||||
};
|
||||
/**
|
||||
* BaseMeasurement class
|
||||
*/
|
||||
export declare abstract class BaseMeasurement extends Event {
|
||||
export declare abstract class BaseMeasurement extends Event<MeasureHandler> {
|
||||
static MAX_DISTANCE: number;
|
||||
protected type: MeasurementType;
|
||||
protected viewer: BaseViewer;
|
||||
private inputManager;
|
||||
protected drawList: DrawableList;
|
||||
protected osnapHelper: OSnapHelper;
|
||||
protected raycaster?: THREE.Raycaster;
|
||||
protected mouseMoved: boolean;
|
||||
protected mouseDowned: boolean;
|
||||
protected lastMoveEvent?: MouseEvent;
|
||||
protected lastMoveEvent?: EventInfo;
|
||||
protected mouseDownPositionX: number;
|
||||
protected mouseDownPositionY: number;
|
||||
protected currentMeasureDrawable?: BaseMeasureDrawable;
|
||||
@ -53,9 +76,10 @@ export declare abstract class BaseMeasurement extends Event {
|
||||
protected snapPoint?: THREE.Vector3 | undefined;
|
||||
protected completed?: boolean;
|
||||
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 camera(): THREE.Camera;
|
||||
get renderer(): THREE.WebGLRenderer;
|
||||
/**
|
||||
* If 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;
|
||||
protected removeDrawable(drawable: BaseMeasureDrawable): void;
|
||||
clearClickedDrawable(): void;
|
||||
mousedown: (e: MouseEvent) => void;
|
||||
mousemove: (e: MouseEvent) => void;
|
||||
mouseup: (e: MouseEvent) => void;
|
||||
mousedown: (e: EventInfo) => void;
|
||||
mousemove: (e: EventInfo) => void;
|
||||
mouseup: (e: EventInfo) => void;
|
||||
dblclick: () => void;
|
||||
protected onMouseClick(e: MouseEvent): void;
|
||||
keydown: (e: KeyboardEvent) => void;
|
||||
protected onMouseClick(e: EventInfo): void;
|
||||
keydown: (e: EventInfo) => void;
|
||||
protected abstract complete(): void;
|
||||
abstract cancel(): void;
|
||||
protected abstract setTooltipContent(): void;
|
||||
@ -83,8 +107,9 @@ export declare abstract class BaseMeasurement extends Event {
|
||||
* The closest intersection
|
||||
* @param e
|
||||
*/
|
||||
getIntersections: (e: MouseEvent) => THREE.Intersection[];
|
||||
getIntersections: (e: EventInfo) => THREE.Intersection[];
|
||||
private getIntersectsOutline;
|
||||
lastMouseDownPosition?: THREE.Vector3;
|
||||
private handleSnap;
|
||||
}
|
||||
export {};
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
||||
import { MeasurementType } from "./BaseMeasurement";
|
||||
import { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||
import { MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||
export declare class CoordinateMeasureDrawable extends BaseMeasureDrawable {
|
||||
type: MeasurementType;
|
||||
constructor(id: string, points: THREE.Vector3[]);
|
||||
|
@ -1,12 +1,13 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMeasurement } from "./BaseMeasurement";
|
||||
import { DrawableList } from "../canvas/DrawableList";
|
||||
import { OSnapHelper } from "../helpers/OSnapHelper";
|
||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
||||
import { DrawableList } from "../../core/canvas";
|
||||
import { OSnapHelper } from "../../core/helpers";
|
||||
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||
import { BaseMeasurement } from "../../core/measure/BaseMeasurement";
|
||||
import type { BaseViewer } from "../../core/viewers";
|
||||
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 onMouseClick(e: MouseEvent): void;
|
||||
protected onMouseClick(e: EventInfo): void;
|
||||
protected complete(): void;
|
||||
cancel(): void;
|
||||
protected setTooltipContent(): void;
|
||||
|
@ -1,6 +1,6 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
||||
import { MeasurementType } from "./BaseMeasurement";
|
||||
import { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||
import { MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||
export declare class DistanceMeasureDrawable extends BaseMeasureDrawable {
|
||||
static readonly SHORT_LINE_LENGTH = 12;
|
||||
type: MeasurementType;
|
||||
|
@ -1,12 +1,13 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMeasurement } from "./BaseMeasurement";
|
||||
import { DrawableList } from "../canvas/DrawableList";
|
||||
import { OSnapHelper } from "../helpers/OSnapHelper";
|
||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
||||
import { DrawableList } from "../../core/canvas";
|
||||
import { OSnapHelper } from "../../core/helpers";
|
||||
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||
import { BaseMeasurement } from "../../core/measure/BaseMeasurement";
|
||||
import type { BaseViewer } from "../../core/viewers";
|
||||
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 onMouseClick(e: MouseEvent): void;
|
||||
protected onMouseClick(e: EventInfo): void;
|
||||
protected complete(): void;
|
||||
cancel(): void;
|
||||
deactivate(): void;
|
||||
|
@ -1,37 +1,36 @@
|
||||
import * as THREE from "three";
|
||||
import { BaseMeasureDrawable } from "./BaseMeasureDrawable";
|
||||
import { MeasurementData, MeasurementType } from "./BaseMeasurement";
|
||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
||||
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||
import { BaseMeasureDrawable } from "../../core/measure/BaseMeasureDrawable";
|
||||
import { MeasurementData, MeasurementType } from "../../core/measure/BaseMeasurement";
|
||||
import type { BaseViewer } from "../../core/viewers";
|
||||
export declare class MeasurementManager {
|
||||
scene: THREE.Scene;
|
||||
selectedMeasurementDrawable: BaseMeasureDrawable | undefined;
|
||||
private overlayRender?;
|
||||
private drawableList;
|
||||
private viewer;
|
||||
private inputManager;
|
||||
private osnapHelper;
|
||||
private measurements;
|
||||
private activeMeasurementType;
|
||||
private undoRedoHelper;
|
||||
constructor(viewer: BaseViewer);
|
||||
constructor(viewer: BaseViewer, input: InputManager);
|
||||
private initEvents;
|
||||
get canvas(): HTMLCanvasElement;
|
||||
get raycaster(): THREE.Raycaster | undefined;
|
||||
getPixelSizeInWorldCoord(): number;
|
||||
/**
|
||||
* The closest intersection
|
||||
* @param e
|
||||
*/
|
||||
getIntersections: (e: MouseEvent) => THREE.Intersection[];
|
||||
addMeasurement(drawable: BaseMeasureDrawable, needRecord?: boolean): void;
|
||||
createMeasurement(data: MeasurementData): import("..").Drawable;
|
||||
createMeasurement(data: MeasurementData): import("../../core/canvas").Drawable;
|
||||
removeMeasurement(drawable: BaseMeasureDrawable, needRecord?: boolean): void;
|
||||
updateSnapTolerance(pixelSize?: number): void;
|
||||
activateMeasurement(type: MeasurementType): void;
|
||||
deactivateMeasurement(): void;
|
||||
getActiveMeasurementType(): MeasurementType | undefined;
|
||||
isMeasurementActive(): boolean;
|
||||
isMeasurementMeasuring(): boolean;
|
||||
getMeasurementsData(): MeasurementData[];
|
||||
setMeasurementsData(dataArray: MeasurementData[]): void;
|
||||
setMeasurementVisibility(id: string, visible: boolean): boolean;
|
||||
setMeasurementsVisibility(visible: boolean): void;
|
||||
clearMeasurements(): void;
|
||||
removeMeasurementById(id: string, needRecord?: boolean): void;
|
||||
@ -42,5 +41,5 @@ export declare class MeasurementManager {
|
||||
redo(): void;
|
||||
clearUndoRedo(): void;
|
||||
destroy(): void;
|
||||
keydown: (e: KeyboardEvent) => void;
|
||||
keydown: (e: EventInfo) => void;
|
||||
}
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { MeasurementManager } from "./MeasurementManager";
|
||||
import { OperationRecord, UndoRedoHelper } from "../helpers/UndoRedoHelper";
|
||||
import { OperationRecord, UndoRedoHelper } from "../../core/helpers";
|
||||
import type { MeasurementManager } from "../../core/measure/MeasurementManager";
|
||||
export declare enum MeasurementState {
|
||||
Add = "ADD",
|
||||
Remove = "REMOVE"
|
||||
|
@ -1,7 +1,7 @@
|
||||
import { OrthographicCamera, Scene, Vector3 } from "three";
|
||||
import { CSS3DRenderer } from "three/examples/jsm/renderers/CSS3DRenderer.js";
|
||||
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
|
||||
* the same direction as host renderer's
|
||||
|
@ -1,34 +1,38 @@
|
||||
import { Scene, Vector3, WebGLRenderer } from "three";
|
||||
import { OrbitControls } from "../controls/OrbitControls";
|
||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
||||
import * as THREE from "three";
|
||||
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||
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 {
|
||||
X = "x",
|
||||
Y = "y",
|
||||
Z = "z"
|
||||
X = "X",
|
||||
Y = "Y",
|
||||
Z = "Z"
|
||||
}
|
||||
export declare class AxisPlaneSection {
|
||||
private readonly container?;
|
||||
protected viewer: BaseViewer;
|
||||
protected camera: THREE.Camera;
|
||||
protected controls: OrbitControls;
|
||||
protected scene: Scene;
|
||||
protected renderer: WebGLRenderer;
|
||||
protected objectIds: number[];
|
||||
private sectionPlane?;
|
||||
isShowSectionPlane: boolean;
|
||||
private popPanel?;
|
||||
export declare class AxisPlaneSection extends BaseSection {
|
||||
protected activeAxis: AxisType;
|
||||
protected gizmo?: SectionGizmo;
|
||||
protected planeMesh?: SectionPlane;
|
||||
protected clipPlane?: THREE.Plane;
|
||||
protected selectedObject?: SectionPlane | THREE.Mesh;
|
||||
protected axisInfoMap: {
|
||||
[key in AxisType]: {
|
||||
normal: Vector3;
|
||||
normal: THREE.Vector3;
|
||||
};
|
||||
};
|
||||
constructor(viewer: BaseViewer, objectIds: number[], container?: HTMLElement | undefined);
|
||||
getRotateParam(axisType: AxisType): (number | Vector3)[];
|
||||
initPlane(axisType: AxisType): void;
|
||||
open(): void;
|
||||
close(): void;
|
||||
enableSection(): void;
|
||||
cancelSection(): void;
|
||||
showSectionPlane(): void;
|
||||
hideSectionPlane(): void;
|
||||
protected center: THREE.Vector3;
|
||||
constructor(viewer: BaseViewer, input: InputManager);
|
||||
activate(): void;
|
||||
deactivate(): void;
|
||||
resetSection(): void;
|
||||
setActiveAxis(type: AxisType): void;
|
||||
setSectionVisible(visible: boolean): void;
|
||||
initOrUpdateClipPlane(): 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 { OrbitControls } from "../controls/OrbitControls";
|
||||
import { CameraControlsEx } from "../controls/CameraControlsEx";
|
||||
import { Views } from "../utils/Viewer3DUtils";
|
||||
/**
|
||||
* Object's box section
|
||||
@ -10,13 +10,13 @@ export declare class BaseBoxSection {
|
||||
protected scene: Scene;
|
||||
protected camera: PerspectiveCamera | OrthographicCamera;
|
||||
protected renderer: WebGLRenderer;
|
||||
protected controls: OrbitControls;
|
||||
protected controls: CameraControlsEx;
|
||||
protected draggableArrowView: Views | string;
|
||||
protected visibleArrowView: Views | string;
|
||||
/**
|
||||
* 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.
|
||||
* 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 { 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";
|
||||
declare enum ActionType {
|
||||
None = "",
|
||||
@ -19,7 +19,7 @@ export declare class BasePlaneSection {
|
||||
protected scene: Scene;
|
||||
protected camera: THREE.Camera;
|
||||
protected renderer: WebGLRenderer;
|
||||
protected controls: OrbitControls;
|
||||
protected controls: CameraControlsEx;
|
||||
protected isSectionObjectVisible: boolean;
|
||||
protected gizmo: THREE.Group;
|
||||
protected objectPixelSizeHelper?: ObjectPixelSizeHelper;
|
||||
@ -27,7 +27,7 @@ export declare class BasePlaneSection {
|
||||
/**
|
||||
* 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.
|
||||
* 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 { CameraControlsEx } from "../controls/CameraControlsEx";
|
||||
import { BasePlaneSection } from "./BasePlaneSection";
|
||||
import { OrbitControls } from "../controls/OrbitControls";
|
||||
/**
|
||||
* GlobalPlaneSection section
|
||||
*/
|
||||
@ -8,7 +8,7 @@ export declare class GlobalPlaneSection extends BasePlaneSection {
|
||||
/**
|
||||
* 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
|
||||
*/
|
||||
|
@ -1,21 +1,27 @@
|
||||
import { OrthographicCamera, PerspectiveCamera, Scene, WebGLRenderer } from "three";
|
||||
import { BaseBoxSection } from "./BaseBoxSection";
|
||||
import { OrbitControls } from "../controls/OrbitControls";
|
||||
/**
|
||||
* Object's box section
|
||||
**/
|
||||
export declare class ObjectsBoxSection extends BaseBoxSection {
|
||||
private objectIds;
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
constructor(scene: Scene, camera: PerspectiveCamera | OrthographicCamera, renderer: WebGLRenderer, controls: OrbitControls, objectIds: number[]);
|
||||
/**
|
||||
* Initialize 6 section plane
|
||||
**/
|
||||
protected initPlanes(): void;
|
||||
/**
|
||||
* Clears section box
|
||||
**/
|
||||
protected clearSectionBox(): void;
|
||||
import * as THREE from "three";
|
||||
import { Views } from "../utils/Viewer3DUtils";
|
||||
import { BaseViewer } from "../viewers/BaseViewer";
|
||||
import { BaseSection } from "./BaseSection";
|
||||
import { SectionPlane } from "./SectionPlane";
|
||||
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||
export declare class ObjectsBoxSection extends BaseSection {
|
||||
protected selectedObject?: SectionPlane;
|
||||
protected planesMesh?: SectionPlane[];
|
||||
protected sectionRange: Record<string, number[]>;
|
||||
constructor(viewer: BaseViewer, input: InputManager);
|
||||
activate(): void;
|
||||
deactivate(): void;
|
||||
protected initOrUpdateVertices(): void;
|
||||
initOrUpdateClipPlane(): void;
|
||||
initOrUpdateSectionPlane(): void;
|
||||
activateSelectedObject(active: boolean): void;
|
||||
onDragStart(e: EventInfo): void;
|
||||
onDragMove(e: EventInfo): 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 { CameraControlsEx } from "../controls/CameraControlsEx";
|
||||
import { BasePlaneSection } from "./BasePlaneSection";
|
||||
import { OrbitControls } from "../controls/OrbitControls";
|
||||
/**
|
||||
* Objects' plane section
|
||||
**/
|
||||
@ -9,7 +9,7 @@ export declare class ObjectsPlaneSection extends BasePlaneSection {
|
||||
/**
|
||||
* 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
|
||||
**/
|
||||
|
@ -1,33 +1,36 @@
|
||||
import * as THREE from "three";
|
||||
import { Raycaster, Scene, WebGLRenderer } from "three";
|
||||
import { BasePlaneSection } from "./BasePlaneSection";
|
||||
import { PickSectionPopPanel } from "../../components/pop-panel/PickSectionPopPanel";
|
||||
import { Tooltip } from "../../components/tool-tip/Tooltip";
|
||||
import { OrbitControls } from "../controls/OrbitControls";
|
||||
import type { BaseViewer } from "../viewers/BaseViewer";
|
||||
export declare class PickPlaneSection {
|
||||
private readonly container?;
|
||||
protected viewer: BaseViewer;
|
||||
protected camera: THREE.Camera;
|
||||
protected controls: OrbitControls;
|
||||
protected scene: Scene;
|
||||
protected renderer: WebGLRenderer;
|
||||
protected objectIds: number[];
|
||||
isShowSectionPlane: boolean;
|
||||
protected sectionPlane?: BasePlaneSection;
|
||||
protected popPanel?: PickSectionPopPanel;
|
||||
import { Tooltip } from "../../components/tool-tip";
|
||||
import { EventInfo, InputManager } from "../../core/input/InputManager";
|
||||
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 class PickPlaneSection extends BaseSection {
|
||||
protected faceInfo?: {
|
||||
position: THREE.Vector3;
|
||||
normal: THREE.Vector3;
|
||||
};
|
||||
protected gizmo?: SectionGizmo;
|
||||
protected planeMesh?: SectionPlane;
|
||||
protected clipPlane?: THREE.Plane;
|
||||
protected selectedObject?: SectionPlane | THREE.Mesh | THREE.Object3D;
|
||||
protected center: THREE.Vector3;
|
||||
protected tooltip?: Tooltip;
|
||||
protected isSelected: boolean;
|
||||
protected raycaster: Raycaster;
|
||||
constructor(viewer: BaseViewer, objectIds: number[], container?: HTMLElement | undefined);
|
||||
protected updateMouseAndRay(event: MouseEvent): void;
|
||||
protected pickFace(evt: MouseEvent): boolean;
|
||||
init(): void;
|
||||
protected clickOnceListerner: (event: MouseEvent) => void;
|
||||
open(): void;
|
||||
close(): void;
|
||||
enableSection(): void;
|
||||
cancelSection(): void;
|
||||
hideSectionPlane(): void;
|
||||
showSectionPlane(): void;
|
||||
constructor(viewer: BaseViewer, input: InputManager);
|
||||
activate(): void;
|
||||
deactivate(): void;
|
||||
setSection(): void;
|
||||
resetSection(): void;
|
||||
setSectionVisible(visible: boolean): void;
|
||||
initOrUpdateClipPlane(): void;
|
||||
initOrUpdateSectionPlane(): void;
|
||||
initOrUpdateGizmo(): void;
|
||||
mousedown: (e: EventInfo) => void;
|
||||
mousemove: (e: EventInfo) => void;
|
||||
onDragStart(e: EventInfo): 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 { BoxFace, BoxLine } from "./BaseBoxSection";
|
||||
import { Views } from "../utils/Viewer3DUtils";
|
||||
import { BoxFace, BoxLine } from "./BaseBoxSection";
|
||||
/**
|
||||
* For dxf viewport section, only 4 section planes are required.
|
||||
*/
|
||||
|
@ -1,4 +1,5 @@
|
||||
export * from "./BaseSection";
|
||||
export * from "./AxisPlaneSection";
|
||||
export * from "./ObjectsBoxSection";
|
||||
export * from "./ObjectsPlaneSection";
|
||||
export * from "./PickPlaneSection";
|
||||
export * from "./SectionManager";
|
||||
|
@ -1,7 +1,7 @@
|
||||
import * as THREE from "three";
|
||||
import { TextShape } from "./TextShape";
|
||||
import { FontFile } from "./files/FontFile";
|
||||
import { BinaryReader } from "../helpers/BinaryReader";
|
||||
import { TextShape } from "./TextShape";
|
||||
import type { FontFile } from "./files/FontFile";
|
||||
export declare class ShxParser {
|
||||
static stopFlag: string;
|
||||
static FILE_STOP_FLAG: string[];
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { FontFile, ShxFontType } from "./FontFile";
|
||||
import { BinaryReader } from "../../helpers/BinaryReader";
|
||||
import { ShxFontType } from "../Shx.constants";
|
||||
import { FontFile } from "./FontFile";
|
||||
export declare class BigFontFile extends FontFile {
|
||||
isExtend: boolean;
|
||||
type: ShxFontType;
|
||||
|
@ -1,17 +1,8 @@
|
||||
import * as THREE from "three";
|
||||
import { FontDataTableRecord } from "../../../core/indexeddb/FontDataTable";
|
||||
import { BinaryReader } from "../../helpers/BinaryReader";
|
||||
import { Orientation, ShxFontType } from "../Shx.constants";
|
||||
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 {
|
||||
type: ShxFontType;
|
||||
info: string;
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { FontFile, ShxFontType } from "./FontFile";
|
||||
import { BinaryReader } from "../../helpers/BinaryReader";
|
||||
import { ShxFontType } from "../Shx.constants";
|
||||
import { FontFile } from "./FontFile";
|
||||
export declare class ShapeFontFile extends FontFile {
|
||||
type: ShxFontType;
|
||||
constructor(url: string);
|
||||
|
@ -1,5 +1,6 @@
|
||||
import { FontFile, ShxFontType } from "./FontFile";
|
||||
import { BinaryReader } from "../../helpers/BinaryReader";
|
||||
import { ShxFontType } from "../Shx.constants";
|
||||
import { FontFile } from "./FontFile";
|
||||
export declare class UniFontFile extends FontFile {
|
||||
type: ShxFontType;
|
||||
isUniCode: boolean;
|
||||
|
@ -1,5 +1,5 @@
|
||||
import * as THREE from "three";
|
||||
import { SVGObject } from "../patches/SVGRenderer";
|
||||
import { SVGObject } from "src/core/patches/SVGRenderer";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
@ -75,6 +75,11 @@ export declare class CommonUtils {
|
||||
static roundNumber(value: number, n: number): number;
|
||||
static convertDecimalToHex(decimal: number | string): string;
|
||||
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
|
||||
*/
|
||||
|
@ -1,9 +1,10 @@
|
||||
import * as THREE from "three";
|
||||
import type { EventInfo, IPointerEvent } from "../../core/input/InputManager";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
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 worldPosition2ScreenPoint(vector: THREE.Vector3, camera: THREE.Camera, container: HTMLElement): THREE.Vector2;
|
||||
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