2
.github/workflows/ci.yaml
vendored
2
.github/workflows/ci.yaml
vendored
@ -1,5 +1,5 @@
|
||||
# 当前 workflow 的名称
|
||||
name: Gemini Viewer Examples
|
||||
name: Gemini Viewer Build
|
||||
|
||||
# 指定 workflow 触发的 event
|
||||
on:
|
||||
|
2
.gitignore
vendored
2
.gitignore
vendored
@ -6,7 +6,7 @@
|
||||
.pnp.js
|
||||
package-lock.json
|
||||
.idea
|
||||
/public/demo/libs
|
||||
public/demo/libs
|
||||
|
||||
# testing
|
||||
/coverage
|
||||
|
@ -55,7 +55,7 @@
|
||||
"title": "Panorama(6 images)",
|
||||
"url": "./demo/vr_1.html"
|
||||
}, {
|
||||
"title": "Panorama(6 images)",
|
||||
"title": "Panorama(6 images2)",
|
||||
"url": "./demo/vr_2.html"
|
||||
}, {
|
||||
"title": "Panorama(24 images)",
|
||||
|
@ -3,19 +3,12 @@
|
||||
<head>
|
||||
<link rel="icon" href="./demo/favicon.ico">
|
||||
<link rel="stylesheet" type="text/css" href="./demo/global.css">
|
||||
<!-- <style>
|
||||
<style>
|
||||
#myCanvas {
|
||||
position: absolute;
|
||||
width: calc(100% - 100px);
|
||||
width: -moz-calc(100% - 100px);
|
||||
width: -webkit-calc(100% - 100px);
|
||||
height: calc(100% - 80px);
|
||||
height: -moz-calc(100% - 80px);
|
||||
height: -webkit-calc(100vh - 80px);
|
||||
left: 50px;
|
||||
top: 40px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style> -->
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -3,6 +3,12 @@
|
||||
<head>
|
||||
<link rel="icon" href="./demo/favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="./demo/global.css" />
|
||||
<style>
|
||||
#myCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -6,19 +6,12 @@
|
||||
<link rel="stylesheet" type="text/css" href="./demo/iconfont/iconfont.css">
|
||||
<link rel="stylesheet" href="./demo/layerManager/layerManager.css">
|
||||
<link rel="stylesheet" href="./demo/settings/SettingsPanel.css">
|
||||
<!-- <style>
|
||||
<style>
|
||||
#myCanvas {
|
||||
position: absolute;
|
||||
width: calc(100% - 100px);
|
||||
width: -moz-calc(100% - 100px);
|
||||
width: -webkit-calc(100% - 100px);
|
||||
height: calc(100% - 80px);
|
||||
height: -moz-calc(100% - 80px);
|
||||
height: -webkit-calc(100vh - 80px);
|
||||
left: 50px;
|
||||
top: 40px;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style> -->
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -6,6 +6,12 @@
|
||||
<link rel="stylesheet" type="text/css" href="./demo/iconfont/iconfont.css" />
|
||||
<link rel="stylesheet" href="./demo/layerManager/layerManager.css" />
|
||||
<link rel="stylesheet" href="./demo/settings/SettingsPanel.css">
|
||||
<style>
|
||||
#myCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -6,6 +6,12 @@
|
||||
<link rel="stylesheet" type="text/css" href="./demo/iconfont/iconfont.css" />
|
||||
<link rel="stylesheet" href="./demo/layerManager/layerManager.css" />
|
||||
<link rel="stylesheet" href="./demo/settings/SettingsPanel.css">
|
||||
<style>
|
||||
#myCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -7,6 +7,12 @@
|
||||
<link rel="stylesheet" href="./demo/compare/dxfComparePanel.css" />
|
||||
<link rel="stylesheet" href="./demo/layerManager/layerManager.css" />
|
||||
<link rel="stylesheet" href="./demo/settings/SettingsPanel.css" />
|
||||
<style>
|
||||
#myCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
<body>
|
||||
|
@ -7,17 +7,10 @@
|
||||
<link rel="stylesheet" href="./demo/layerManager/layerManager.css">
|
||||
<link rel="stylesheet" href="./demo/settings/SettingsPanel.css">
|
||||
<style>
|
||||
/* #myCanvas {
|
||||
position: absolute;
|
||||
width: calc(100% - 100px);
|
||||
width: -moz-calc(100% - 100px);
|
||||
width: -webkit-calc(100% - 100px);
|
||||
height: calc(100% - 80px);
|
||||
height: -moz-calc(100% - 80px);
|
||||
height: -webkit-calc(100vh - 80px);
|
||||
left: 50px;
|
||||
top: 40px;
|
||||
} */
|
||||
#myCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.markup-toolbar {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
|
@ -7,17 +7,10 @@
|
||||
<link rel="stylesheet" href="./demo/layerManager/layerManager.css">
|
||||
<link rel="stylesheet" href="./demo/settings/SettingsPanel.css">
|
||||
<style>
|
||||
/* #myCanvas {
|
||||
position: absolute;
|
||||
width: calc(100% - 100px);
|
||||
width: -moz-calc(100% - 100px);
|
||||
width: -webkit-calc(100% - 100px);
|
||||
height: calc(100% - 80px);
|
||||
height: -moz-calc(100% - 80px);
|
||||
height: -webkit-calc(100vh - 80px);
|
||||
left: 50px;
|
||||
top: 40px;
|
||||
} */
|
||||
#myCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.hotpoint-toolbar {
|
||||
position: absolute;
|
||||
right: 20px;
|
||||
|
@ -7,17 +7,10 @@
|
||||
<link rel="stylesheet" href="./demo/layerManager/layerManager.css">
|
||||
<link rel="stylesheet" href="./demo/settings/SettingsPanel.css">
|
||||
<style>
|
||||
/* #myCanvas {
|
||||
position: absolute;
|
||||
width: calc(100% - 100px);
|
||||
width: -moz-calc(100% - 100px);
|
||||
width: -webkit-calc(100% - 100px);
|
||||
height: calc(100% - 80px);
|
||||
height: -moz-calc(100% - 80px);
|
||||
height: -webkit-calc(100vh - 80px);
|
||||
left: 50px;
|
||||
top: 40px;
|
||||
} */
|
||||
#myCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
|
||||
|
@ -6,6 +6,10 @@
|
||||
<link rel="stylesheet" href="./demo/layerManager/layerManager.css">
|
||||
<link rel="stylesheet" href="./demo/settings/SettingsPanel.css">
|
||||
<style>
|
||||
#myCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.upload-btn {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
@ -4,6 +4,10 @@
|
||||
<link rel="icon" href="./demo/favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="./demo/global.css" />
|
||||
<style>
|
||||
#myCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.upload-btn {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
@ -4,6 +4,10 @@
|
||||
<link rel="icon" href="./demo/favicon.ico" />
|
||||
<link rel="stylesheet" type="text/css" href="./demo/global.css" />
|
||||
<style>
|
||||
#myCanvas {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
.upload-btn {
|
||||
margin-top: 2em;
|
||||
}
|
||||
|
7
public/demo/libs/gemini-viewer.esm.min.js
vendored
7
public/demo/libs/gemini-viewer.esm.min.js
vendored
File diff suppressed because one or more lines are too long
@ -1,19 +0,0 @@
|
||||
export interface Annotation {
|
||||
id?: string;
|
||||
projectId: string;
|
||||
name: string;
|
||||
content: string;
|
||||
creator?: string;
|
||||
camera: {
|
||||
position: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
target: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
};
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
import { DxfViewer } from "../../core/viewers";
|
||||
export declare class DxfLayoutBar {
|
||||
protected readonly viewer: DxfViewer;
|
||||
private element?;
|
||||
private content?;
|
||||
private itemList;
|
||||
constructor(viewer: DxfViewer);
|
||||
init(): void;
|
||||
private handleMouseWheel;
|
||||
private createItem;
|
||||
destroy(): void;
|
||||
show(): void;
|
||||
hide(): void;
|
||||
}
|
||||
export declare class ModelLayoutSwitchItem {
|
||||
protected readonly viewer: DxfViewer;
|
||||
private eventBus;
|
||||
element: HTMLElement;
|
||||
resetActivate?: () => void;
|
||||
active: boolean;
|
||||
constructor(viewer: DxfViewer, name: string);
|
||||
private createItem;
|
||||
setActive(active: boolean): void;
|
||||
resetActive(): void;
|
||||
destroy(): void;
|
||||
}
|
@ -1 +0,0 @@
|
||||
export * from "./DxfLayoutBar";
|
@ -1,20 +0,0 @@
|
||||
import { Emitter } from "mitt";
|
||||
import { PopPanel } from "./PopPanel";
|
||||
import { AxisType } from "../../core/section/AxisPlaneSection";
|
||||
export declare type Events = {
|
||||
axis: AxisType;
|
||||
visible: boolean;
|
||||
};
|
||||
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);
|
||||
createGroupSelectLayout(): void;
|
||||
addGroupSelectItems(): void;
|
||||
createActiveSelectLayout(): void;
|
||||
addActiveItems(): void;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
import { Emitter } from "mitt";
|
||||
import { PopPanel } from "./PopPanel";
|
||||
export declare type Events = {
|
||||
visible: boolean;
|
||||
reset: void;
|
||||
};
|
||||
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);
|
||||
createActiveSelectLayout(): void;
|
||||
addActiveItems(): void;
|
||||
enable(): void;
|
||||
disable(): void;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
export declare class PopPanel {
|
||||
private readonly container;
|
||||
private element;
|
||||
header: HTMLElement;
|
||||
body: HTMLElement;
|
||||
private isFollowing;
|
||||
private diffX;
|
||||
private diffY;
|
||||
constructor(id: string, content: string | HTMLElement, container?: HTMLElement);
|
||||
start: (event: MouseEvent) => void;
|
||||
stop: () => void;
|
||||
follow: (event: MouseEvent) => void;
|
||||
destroy(): void;
|
||||
}
|
@ -1,34 +0,0 @@
|
||||
export interface ProgressItem {
|
||||
id: string;
|
||||
div: HTMLDivElement;
|
||||
}
|
||||
export declare class ProgressBar {
|
||||
private element;
|
||||
private progresseItems;
|
||||
constructor(parentElement: HTMLElement);
|
||||
setVisibility(visible: boolean): void;
|
||||
/**
|
||||
* Adds a progress item
|
||||
* @param progressItemId
|
||||
* @param message Initial message
|
||||
* @param progress number between 0-100
|
||||
*/
|
||||
addProgressItem(progressItemId: string, message?: string): void;
|
||||
/**
|
||||
* Updates a progress item
|
||||
* @param progressItemId
|
||||
* @param message
|
||||
* @param progress number between 0-100
|
||||
*/
|
||||
updateProgress(progressItemId: string, message?: string, progress?: number): void;
|
||||
/**
|
||||
* Removes a progress item
|
||||
* @param progressItemId
|
||||
*/
|
||||
removeProgressItem(progressItemId: string): void;
|
||||
/**
|
||||
* Removes a progress item after some time
|
||||
* @param progressItemId
|
||||
*/
|
||||
delayRemoveProgressItem(progressItemId: string, delayInMs?: number): void;
|
||||
}
|
@ -1 +0,0 @@
|
||||
export * from "./ProgressBar";
|
@ -1,44 +0,0 @@
|
||||
/**
|
||||
* Perspective and Orthographic camera share the same settings
|
||||
* @internal
|
||||
*/
|
||||
export interface CameraSettings {
|
||||
near: number;
|
||||
far: number;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface MouseSetting {
|
||||
sensitivity: number;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface KeyboardSetting {
|
||||
sensitivity: number;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface Settings {
|
||||
unit: string;
|
||||
decimalPrecision: number;
|
||||
camera: CameraSettings;
|
||||
mouse: MouseSetting;
|
||||
keyboard: KeyboardSetting;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const defaultSettings: Settings;
|
||||
export declare const cameraNearRange: number[];
|
||||
export declare const cameraFarRange: number[];
|
||||
export declare const unitRange: {
|
||||
[key: string]: string;
|
||||
};
|
||||
export declare const sensitivityRange: number[];
|
||||
export declare const decimalPrecisionRange: {
|
||||
[key: string]: number;
|
||||
};
|
||||
export declare const settingStoreKeyName = "THREE_RENDER_SETTING";
|
@ -1,20 +0,0 @@
|
||||
interface TooltipConfig {
|
||||
showOnCreate?: boolean;
|
||||
followPointer?: boolean;
|
||||
parentNode?: HTMLElement;
|
||||
target?: HTMLElement;
|
||||
}
|
||||
export declare class Tooltip {
|
||||
private node;
|
||||
private parentNode;
|
||||
private target;
|
||||
private childNode;
|
||||
constructor(id: string, content?: string | HTMLElement | null, cfg?: TooltipConfig);
|
||||
setContent(content: string | HTMLElement): void;
|
||||
updateChildContent(content: string | HTMLElement): void;
|
||||
follow: (event: MouseEvent) => void;
|
||||
show: () => false | void;
|
||||
hide: () => false | void;
|
||||
destroy: () => void;
|
||||
}
|
||||
export {};
|
@ -1,15 +0,0 @@
|
||||
export interface Viewpoint {
|
||||
id?: string;
|
||||
projectId: string;
|
||||
name: string;
|
||||
position: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
target: {
|
||||
x: number;
|
||||
y: number;
|
||||
z: number;
|
||||
};
|
||||
}
|
306
public/demo/libs/types/core/Configs.d.ts
vendored
306
public/demo/libs/types/core/Configs.d.ts
vendored
@ -1,306 +0,0 @@
|
||||
import { BimViewer, DxfViewer, VRViewer } from "./viewers";
|
||||
import { ToolbarMenuConfig, ToolbarMenuId } from "./toolbar";
|
||||
/**
|
||||
* Camera config
|
||||
*/
|
||||
export interface CameraConfig {
|
||||
/**
|
||||
* The camera location
|
||||
*/
|
||||
eye: number[];
|
||||
/**
|
||||
* The location that the camera looks to
|
||||
*/
|
||||
look: number[];
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
up?: number[];
|
||||
/**
|
||||
* The camera's near clip plane
|
||||
*/
|
||||
near?: number;
|
||||
/**
|
||||
* The camera's far clip plane
|
||||
*/
|
||||
far?: number;
|
||||
}
|
||||
/**
|
||||
* Model config
|
||||
*/
|
||||
export interface ModelConfig {
|
||||
/**
|
||||
* Unique id of the model
|
||||
*/
|
||||
modelId?: string;
|
||||
/**
|
||||
* Model name
|
||||
*/
|
||||
name?: string;
|
||||
/**
|
||||
* Source url of the model
|
||||
*/
|
||||
src: string;
|
||||
/**
|
||||
* Used to distinguish format, because it may be hard to know the format by src!
|
||||
* @internal
|
||||
*/
|
||||
fileFormat?: string;
|
||||
/**
|
||||
* A float array of length 16, definds model's position, rotation and scale
|
||||
*/
|
||||
matrix?: number[];
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated Uses matrix instead
|
||||
*/
|
||||
position?: number[];
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated Uses matrix instead
|
||||
*/
|
||||
rotation?: number[];
|
||||
/**
|
||||
* @internal
|
||||
* @deprecated Uses matrix instead
|
||||
*/
|
||||
scale?: number[];
|
||||
/**
|
||||
* If we want to do instantiate to the model
|
||||
* @internal
|
||||
*/
|
||||
instantiate?: boolean;
|
||||
/**
|
||||
* If we want to merge meshes/lines/points with the same material
|
||||
* @default false
|
||||
*/
|
||||
merge?: boolean;
|
||||
/**
|
||||
* If we want to generate and show edges/outlines to the modle.
|
||||
* It is useful for BimViewer.
|
||||
* @internal
|
||||
*/
|
||||
edges?: boolean;
|
||||
/**
|
||||
* If this model is visible by default.
|
||||
* @internal
|
||||
*/
|
||||
visible?: boolean;
|
||||
}
|
||||
/**
|
||||
* Dxf model config
|
||||
*/
|
||||
export interface DxfModelConfig extends ModelConfig {
|
||||
/**
|
||||
* If to ignore anything of paper space.
|
||||
* There are some scenarios to ignore paper space by default, includes:
|
||||
* - Dxf overlay, aka, loading more than one dxf files into a viewer. We'll only load model space for the first file.
|
||||
* - Dxf compare. Since we'll only compare model space, it won't load paper space at all.
|
||||
*
|
||||
* This option is useful when user want to explicitly ignore paper space.
|
||||
* @default false
|
||||
*/
|
||||
ignorePaperSpace?: boolean;
|
||||
}
|
||||
/**
|
||||
* Context for ContextMenu
|
||||
* @internal
|
||||
*/
|
||||
export interface Context {
|
||||
bimViewer: BimViewer;
|
||||
hit?: any;
|
||||
instanceId?: number;
|
||||
batchId?: number;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ContextMenuConfig {
|
||||
context: Context;
|
||||
id?: string;
|
||||
container?: HTMLElement;
|
||||
items?: ContextMenuItem[][];
|
||||
hideOnMouseDown?: boolean;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ContextMenuItem {
|
||||
title?: string;
|
||||
enabled?: boolean;
|
||||
shown?: boolean;
|
||||
getTitle?: (context: Context) => string;
|
||||
getEnabled?: (context: Context) => boolean;
|
||||
getShown?: (context: Context) => boolean;
|
||||
doAction?: (context: Context) => void;
|
||||
}
|
||||
/**
|
||||
* This wrappers most config for BimViewer
|
||||
*/
|
||||
export interface BimViewerConfig {
|
||||
/**
|
||||
* Shows the NavCube.
|
||||
* @internal
|
||||
*/
|
||||
enableNavCube?: boolean;
|
||||
/**
|
||||
* Shows the AxisGizmo.
|
||||
* @internal
|
||||
*/
|
||||
enableAxisGizmo?: boolean;
|
||||
/**
|
||||
* Shows the stats output.
|
||||
* @internal
|
||||
*/
|
||||
enableStats?: boolean;
|
||||
/**
|
||||
* Shows the toolbar.
|
||||
* @description Default is `true`.
|
||||
*/
|
||||
enableToolbar?: boolean;
|
||||
/**
|
||||
* shows the bottom-bar.
|
||||
* @internal
|
||||
*/
|
||||
enableBottomBar?: boolean;
|
||||
/**
|
||||
* Shows the context-menu.
|
||||
*/
|
||||
enableContextMenu?: boolean;
|
||||
/**
|
||||
* Enables spinner
|
||||
* @internal
|
||||
*/
|
||||
enableSpinner?: boolean;
|
||||
/**
|
||||
* @description canvas id to contain the Viewer.
|
||||
*/
|
||||
containerId: string;
|
||||
/**
|
||||
* Default is `meters`
|
||||
* @internal
|
||||
*/
|
||||
units?: string;
|
||||
/**
|
||||
* Sets the default locale
|
||||
* @internal
|
||||
*/
|
||||
locale?: "cn" | "en";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
toolbarMenuConfig?: {
|
||||
[key in ToolbarMenuId]?: ToolbarMenuConfig<BimViewer>;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* This wrappers most config for DxfViewer
|
||||
*/
|
||||
export interface DxfViewerConfig {
|
||||
/**
|
||||
* @description Container id to contain the viewer
|
||||
*/
|
||||
containerId: string;
|
||||
enableAxisGizmo?: boolean;
|
||||
enableLayoutBar?: boolean;
|
||||
enableStats?: boolean;
|
||||
enableToolbar?: boolean;
|
||||
enableSpinner?: boolean;
|
||||
enableProgressBar?: boolean;
|
||||
enableBottomBar?: boolean;
|
||||
/**
|
||||
* If user can select an entity by mouse click
|
||||
*/
|
||||
enableSelection?: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
toolbarMenuConfig?: {
|
||||
[key in ToolbarMenuId]?: ToolbarMenuConfig<DxfViewer>;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* This wrappers most config for VRViewer
|
||||
*/
|
||||
export interface VRViewerConfig {
|
||||
/**
|
||||
* @description container id to contain the viewer
|
||||
*/
|
||||
containerId: string;
|
||||
autoRotateSpeed?: number;
|
||||
enableAxisGizmo?: boolean;
|
||||
enableToolbar?: boolean;
|
||||
enableBottomBar?: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
toolbarMenuConfig?: {
|
||||
[key in ToolbarMenuId]?: ToolbarMenuConfig<VRViewer>;
|
||||
};
|
||||
}
|
||||
/**
|
||||
* VR Viewpoint's hotpoint, which can be a user defined html element.
|
||||
* A hotpoint can be clicked, then caller can do their own operation,
|
||||
* e.g. open a description panel, jump to another viewpoint, etc.
|
||||
*/
|
||||
export interface Hotpoint {
|
||||
hotpointId: string;
|
||||
anchorPosition: number[];
|
||||
visible?: boolean;
|
||||
html: string;
|
||||
}
|
||||
/**
|
||||
* A VRViewpointPlan contains 1 or more panor
|
||||
* A viewpoint may contain more than one plans
|
||||
*/
|
||||
export interface Panorama {
|
||||
id: string;
|
||||
/**
|
||||
* 1, 6 or 24 image urls in order of right, left, up, down, front, back.
|
||||
* When there is 1 image, caller should also put it into array!
|
||||
*/
|
||||
images: string[];
|
||||
/**
|
||||
* 6 image urls in order of right, left, up, down, front, back
|
||||
*/
|
||||
thumbnails?: string[];
|
||||
}
|
||||
export interface VRViewpoint {
|
||||
/**
|
||||
* @deprecated moved to VRViewpointPlan
|
||||
*/
|
||||
imageOrImages?: string | string[];
|
||||
/**
|
||||
* @deprecated moved to VRViewpointPlan
|
||||
*/
|
||||
thumbnailImages?: string[];
|
||||
panoramas: Panorama[];
|
||||
id: string;
|
||||
name?: string;
|
||||
position?: number[];
|
||||
initialDirection?: number[];
|
||||
hotpoints?: Hotpoint[];
|
||||
}
|
||||
/**
|
||||
* A default BimViewerConfig as a template, which enables most plugins.
|
||||
* @internal
|
||||
*/
|
||||
export declare const DEFAULT_BIM_VIEWER_CONFIG: BimViewerConfig;
|
||||
/**
|
||||
* A simple BimViewerConfig as a template, which disables most plugins.
|
||||
* @internal
|
||||
*/
|
||||
export declare const SIMPLE_BIM_VIEWER_CONFIG: BimViewerConfig;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IsolateObjectsParam {
|
||||
id: string;
|
||||
modelId: string;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IsolateObjectsParams {
|
||||
familyInstanceIds: IsolateObjectsParam[];
|
||||
}
|
99
public/demo/libs/types/core/Constants.d.ts
vendored
99
public/demo/libs/types/core/Constants.d.ts
vendored
@ -1,99 +0,0 @@
|
||||
/**
|
||||
* To improve performance, we can set object.matrixAutoUpdate = false for static or rarely moving objects and
|
||||
* manually call object.updateMatrix() whenever their position/rotation/quaternion/scale are updated.
|
||||
* Add a constrant here, so developer can change it here easily for debugging.
|
||||
* @internal
|
||||
*/
|
||||
export declare const matrixAutoUpdate = false;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const sceneAutoUpdate = false;
|
||||
/**
|
||||
* These concept can be complex: hitable, snapable, selectable, visible
|
||||
* Mesh Y Y Y Y
|
||||
* text in DxfViewer Y N Y Y
|
||||
* ground plan Y N N Y
|
||||
* outline N N N Y
|
||||
*
|
||||
* So, we must handle them properly. We'll try to put them into different layers.
|
||||
*/
|
||||
/**
|
||||
* In some scenarios, we don't want some objects to be snap-able.
|
||||
* E.g. texts in DxfViewer.
|
||||
* We'll put them into this layer, so they are visible but not snap-able.
|
||||
* @internal
|
||||
*/
|
||||
export declare const layerForNonSnapableObjects = 10;
|
||||
/**
|
||||
* In some scenarios, we don't want some objects to be select-able.
|
||||
* E.g. outlines in BimViewer
|
||||
* We'll put them into this layer, so they are visible but not select-able.
|
||||
* @internal
|
||||
*/
|
||||
export declare const layerForUnselectableObjects = 11;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const ICON_FONT_CLASS = "gemini-viewer-icon";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const KEYDOWN_EVENT = "keydown";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const KEYUP_EVENT = "keyup";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const MOUSEMOVE_EVENT = "mousemove";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const MOUSEUP_EVENT = "mouseup";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const MOUSEDOWN_EVENT = "mousedown";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const ESC_KEY = "Escape";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const ENTER_KEY = "Enter";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const AXIS_SECTION_PLANE_ID = "axis-section-plane";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const AXIS_SECTION_PLANE_CONTROL_ID = "axis-section-plane-control";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const SECTION_PLANE_ID = "section-plane";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const SECTION_PLANE_CONTROL_ID = "section-plane-control";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const SECTION_BOX_ID = "section-box";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const SECTION_PLANE_NAME = "plane-section-boxface";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare const GROUND_PLANE_RENDER_ORDER = -1000;
|
||||
export declare enum SectionMode {
|
||||
ObjectsBoxSection = "ObjectsBoxSection",
|
||||
PickPlaneSection = "PickPlaneSection",
|
||||
AxisPlaneSection = "AxisPlaneSection"
|
||||
}
|
32
public/demo/libs/types/core/ProjectManager.d.ts
vendored
32
public/demo/libs/types/core/ProjectManager.d.ts
vendored
@ -1,32 +0,0 @@
|
||||
import { CameraConfig, ModelConfig } from "./Configs";
|
||||
export interface Project {
|
||||
id: string;
|
||||
name: string;
|
||||
thumbnail?: string;
|
||||
camera?: CameraConfig;
|
||||
models: ModelConfig[];
|
||||
}
|
||||
/**
|
||||
* Class for ProjectManager
|
||||
* There are two kind of projects:
|
||||
* 1) Demo project, which is defined in 'public/config/projects.json', and stored in 'public/three/projects'
|
||||
* 2) Common project, which is stored in back-end service (not implemented yet until today 2021.6)
|
||||
*/
|
||||
export declare class ProjectManager {
|
||||
static customProjects: Project[];
|
||||
/**
|
||||
* Gets demo projects
|
||||
*/
|
||||
static getSampleProjects(): Promise<Project[]>;
|
||||
/**
|
||||
* Gets online projects
|
||||
* TODO: handle pagging, filter, etc. when there are many projects
|
||||
*/
|
||||
static getCustomProjects(forceRefetch?: boolean): Promise<Project[]>;
|
||||
/**
|
||||
* Gets a project
|
||||
*/
|
||||
static getProject(id: string): Promise<Project>;
|
||||
static addCustomProject(project: Project): Project;
|
||||
static deleteCustomProject(projectId: string): void;
|
||||
}
|
16
public/demo/libs/types/core/Units.d.ts
vendored
16
public/demo/libs/types/core/Units.d.ts
vendored
@ -1,16 +0,0 @@
|
||||
/**
|
||||
* Units are defined the same order as to Dxf format
|
||||
*/
|
||||
export declare enum Units {
|
||||
Unitless = "Unitless",
|
||||
Inches = "Inches",
|
||||
Feet = "Feet",
|
||||
Millimeters = "Millimeters",
|
||||
Centimeters = "Centimeters",
|
||||
Meters = "Meters"
|
||||
}
|
||||
/**
|
||||
* Gets the unit scale when converting to meter
|
||||
*/
|
||||
export declare const unitScaleToMeter: (srcUnit: Units) => number;
|
||||
export declare const unitScaleConversion: (srcUnit: Units, destUnit: Units) => number;
|
@ -1,12 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
import { CSS2DObject } from "three/examples/jsm/renderers/CSS2DRenderer";
|
||||
export declare class CoordinateAxes extends THREE.Object3D {
|
||||
name: string;
|
||||
private readonly AXIS_LENGTH;
|
||||
private readonly AXIS_COLOR_X;
|
||||
private readonly AXIS_COLOR_Y;
|
||||
private readonly AXIS_COLOR_Z;
|
||||
constructor(addTexts?: boolean);
|
||||
addTexts(): void;
|
||||
createText(text: string, color: string, size?: number): CSS2DObject;
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
import { BimViewer } from "../viewers/BimViewer";
|
||||
import { CoordinateAxes } from "./CoordinateAxes";
|
||||
import { CSS2DRenderer } from "three/examples/jsm/renderers/CSS2DRenderer";
|
||||
import { DxfViewer } from "../viewers/DxfViewer";
|
||||
import { VRViewer } from "../viewers/VRViewer";
|
||||
/**
|
||||
* This renderer monitors the host renderer's camera, and keeps a coordinate axes
|
||||
* the same direction as host renderer's
|
||||
*/
|
||||
export declare class CoordinateAxesViewport {
|
||||
hostRenderer?: BimViewer | DxfViewer | VRViewer;
|
||||
container: HTMLDivElement;
|
||||
coordinateAxes?: CoordinateAxes;
|
||||
camera?: THREE.OrthographicCamera;
|
||||
scene?: THREE.Scene;
|
||||
renderer?: THREE.WebGLRenderer;
|
||||
css2dRenderer?: CSS2DRenderer;
|
||||
height: number;
|
||||
width: number;
|
||||
constructor(container: HTMLDivElement, hostRenderer: BimViewer | DxfViewer | VRViewer);
|
||||
init(): void;
|
||||
initRenderer(): void;
|
||||
initScene(): void;
|
||||
render(): void;
|
||||
animate(): void;
|
||||
update(): void;
|
||||
/**
|
||||
* Update axes according to camera direction.
|
||||
* Camera's direction is the only input factor for this class. It always look at the origin.
|
||||
* @param direction
|
||||
*/
|
||||
updateCameraDirection(direction: THREE.Vector3, up: THREE.Vector3): void;
|
||||
dispose(): void;
|
||||
}
|
2
public/demo/libs/types/core/axes/index.d.ts
vendored
2
public/demo/libs/types/core/axes/index.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
export * from "./CoordinateAxes";
|
||||
export * from "./CoordinateAxesViewport";
|
@ -1,42 +0,0 @@
|
||||
import { BimViewer, DxfViewer, VRViewer } from "../viewers";
|
||||
import { IconClass } from "../utils/CommonUtils";
|
||||
import { Tooltip } from "../../components/tool-tip/Tooltip";
|
||||
declare enum BottomBarItemId {
|
||||
statistics = "statistics",
|
||||
cameraInfo = "cameraInfo",
|
||||
stats = "stats",
|
||||
tips = "tips"
|
||||
}
|
||||
interface BottomBarItemConfig {
|
||||
icon: IconClass;
|
||||
mutexIds?: BottomBarItemId[];
|
||||
onActive?: (item: BottomBarItem) => void;
|
||||
onDeactive?: (item: BottomBarItem) => void;
|
||||
onClick?: (item: BottomBarItem) => void;
|
||||
onUpdate?: (item: BottomBarItem) => void;
|
||||
}
|
||||
export declare class BottomBar {
|
||||
protected readonly viewer: BimViewer | DxfViewer | VRViewer;
|
||||
private element;
|
||||
itemList: Map<string, BottomBarItem>;
|
||||
constructor(viewer: BimViewer | DxfViewer | VRViewer);
|
||||
update(): void;
|
||||
private init;
|
||||
private createItem;
|
||||
}
|
||||
declare class BottomBarItem {
|
||||
readonly viewer: BimViewer | DxfViewer | VRViewer;
|
||||
private readonly bottomBar;
|
||||
protected readonly menuId: string;
|
||||
protected cfg: BottomBarItemConfig;
|
||||
private eventBus;
|
||||
private itemconfig;
|
||||
tooltip: Tooltip;
|
||||
element: HTMLElement;
|
||||
active: boolean;
|
||||
constructor(viewer: BimViewer | DxfViewer | VRViewer, bottomBar: BottomBar, menuId: string, cfg: BottomBarItemConfig);
|
||||
private createButton;
|
||||
setActive(active: boolean): void;
|
||||
update(): void;
|
||||
}
|
||||
export {};
|
@ -1 +0,0 @@
|
||||
export * from "./BottomBar";
|
@ -1,2 +0,0 @@
|
||||
import { ContextMenuItem } from "../Configs";
|
||||
export declare const contextMenuItems: ContextMenuItem[][];
|
@ -1,31 +0,0 @@
|
||||
import { BimViewer } from "../viewers";
|
||||
import { Context as ContextFromConfigs, ContextMenuConfig as ContextMenuConfigFromConfigs, ContextMenuItem } from "../Configs";
|
||||
import { ObjectsBoxSection, ObjectsPlaneSection, AxisPlaneSection, PickPlaneSection } from "../section";
|
||||
import { Toolbar } from "../toolbar";
|
||||
export interface Context extends ContextFromConfigs {
|
||||
section?: ObjectsBoxSection | ObjectsPlaneSection | PickPlaneSection | AxisPlaneSection;
|
||||
toolbar?: Toolbar<BimViewer>;
|
||||
}
|
||||
export interface ContextMenuConfig extends ContextMenuConfigFromConfigs {
|
||||
context: Context;
|
||||
}
|
||||
export declare class ContextMenu {
|
||||
private id;
|
||||
private container;
|
||||
private element;
|
||||
private handleClick;
|
||||
context: Context;
|
||||
itemList: [ContextMenuItem, HTMLElement][];
|
||||
constructor(cfg: ContextMenuConfig);
|
||||
private isEnable;
|
||||
private isShown;
|
||||
private getTitle;
|
||||
private createMenuUI;
|
||||
private createMenuGroup;
|
||||
private createMenuItem;
|
||||
private updateMenuItems;
|
||||
private showMenuElement;
|
||||
show(pageX: number, pageY: number): void;
|
||||
hide(): void;
|
||||
destroy(): void;
|
||||
}
|
@ -1,2 +0,0 @@
|
||||
export * from "./ContextMenu";
|
||||
export * from "./ContextMenu.config";
|
131
public/demo/libs/types/core/controls/VRControls.d.ts
vendored
131
public/demo/libs/types/core/controls/VRControls.d.ts
vendored
@ -1,131 +0,0 @@
|
||||
import { EventDispatcher, PerspectiveCamera, Vector3 } from "three";
|
||||
import { ControlsHelper } from "../helpers/ControlsHelper";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare enum STATE {
|
||||
NONE = -1,
|
||||
ROTATE = 0,
|
||||
DOLLY = 1,
|
||||
PAN = 2,
|
||||
TOUCH_ROTATE = 3,
|
||||
TOUCH_DOLLY = 4
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare enum Keys {
|
||||
LEFT = "ArrowLeft",
|
||||
UP = "ArrowUp",
|
||||
RIGHT = "ArrowRight",
|
||||
BOTTOM = "ArrowDown"
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare class VRControls extends EventDispatcher {
|
||||
object: PerspectiveCamera;
|
||||
domElement: HTMLCanvasElement;
|
||||
isVRMode: boolean;
|
||||
enabled: boolean;
|
||||
target: Vector3;
|
||||
enableZoom: boolean;
|
||||
enablePan: boolean;
|
||||
enableRotate: boolean;
|
||||
state: STATE;
|
||||
rotateSpeed: number;
|
||||
zoomSpeed: number;
|
||||
panSpeed: number;
|
||||
scale: number;
|
||||
minZoom: number;
|
||||
maxZoom: number;
|
||||
screenSpacePanning: boolean;
|
||||
autoRotate: boolean;
|
||||
controlsHelper?: ControlsHelper;
|
||||
autoRotateSpeed: number;
|
||||
enableDamping: boolean;
|
||||
dampingFactor: number;
|
||||
minAzimuthAngle: number;
|
||||
maxAzimuthAngle: number;
|
||||
minPolarAngle: number;
|
||||
maxPolarAngle: number;
|
||||
minDistance: number;
|
||||
maxDistance: number;
|
||||
keyPanSpeed: number;
|
||||
minFov: number;
|
||||
maxFov: number;
|
||||
private zoomChanged;
|
||||
private panOffset;
|
||||
private pointerPositions;
|
||||
private rotateStart;
|
||||
private rotateEnd;
|
||||
private rotateDelta;
|
||||
private dollyStart;
|
||||
private dollyEnd;
|
||||
private dollyDelta;
|
||||
private panStart;
|
||||
private panEnd;
|
||||
private panDelta;
|
||||
private pointers;
|
||||
private spherical;
|
||||
private sphericalDelta;
|
||||
private domElementKeyEvents?;
|
||||
private quat;
|
||||
constructor(object: PerspectiveCamera, domElement: HTMLCanvasElement, isVRMode?: boolean);
|
||||
dispose(): void;
|
||||
update: () => boolean;
|
||||
private addPointer;
|
||||
private removePointer;
|
||||
private onContextMenu;
|
||||
/**
|
||||
*
|
||||
* Get the distance between two points
|
||||
* @param {number[]} p1
|
||||
* @param {number[]} p2
|
||||
* @return {*}
|
||||
* @memberof VRControls
|
||||
*/
|
||||
getDist(p1: number[], p2: number[]): number;
|
||||
private trackPointer;
|
||||
/**************************PointerDown Event*************************/
|
||||
private onTouchStart;
|
||||
private onMouseDown;
|
||||
private onPointerDown;
|
||||
/**************************PointerMove Event*************************/
|
||||
private onTouchMove;
|
||||
private onMouseMove;
|
||||
private onPointerMove;
|
||||
/**************************PointerUp Event*************************/
|
||||
handlerTouchEnd(event: PointerEvent): void;
|
||||
private onPointerUp;
|
||||
private onPointerCancel;
|
||||
handleMouseWheel(event: WheelEvent): void;
|
||||
private onMouseWheel;
|
||||
/**************************Ponter down event handling*************************/
|
||||
handleMouseDownRotate(event: PointerEvent): void;
|
||||
handleMouseDownDolly(event: PointerEvent): void;
|
||||
handleMouseDownPan(event: PointerEvent): void;
|
||||
handleTouchStartRotate(): void;
|
||||
handleTouchStartDolly(pointers: PointerEvent[]): void;
|
||||
/**************************Mouse move rotate event handling*************************/
|
||||
private updateRotate;
|
||||
handleMouseMoveRotate(event: PointerEvent): void;
|
||||
/**************************Mouse move zoom event handling*************************/
|
||||
private dollyOut;
|
||||
private dollyIn;
|
||||
handleMouseMoveDolly(event: PointerEvent): void;
|
||||
/**************************Mouse move pan event handling*************************/
|
||||
private pan;
|
||||
private panLeft;
|
||||
private panUp;
|
||||
handleMouseMovePan(event: PointerEvent): void;
|
||||
/**************************One-finger or Two-finger rotate event handling*************************/
|
||||
private getSecondPointerPosition;
|
||||
handleTouchMoveRotate(event: PointerEvent): void;
|
||||
/**************************Two-finger zoom event handling*************************/
|
||||
private updateFov;
|
||||
handleTouchMoveDolly(event: PointerEvent): void;
|
||||
private handleKeyDown;
|
||||
private onKeyDown;
|
||||
listenToKeyEvents(domElement: HTMLElement): void;
|
||||
}
|
@ -1 +0,0 @@
|
||||
export * from "./VRControls";
|
@ -1,8 +0,0 @@
|
||||
/**
|
||||
* AutoCad files sometimes use an indexed color value between 1 and 255 inclusive.
|
||||
* Each value corresponds to a color. index 1 is red, that is 16711680 or 0xFF0000.
|
||||
* index 0 and 256, while included in this array, are actually reserved for inheritance
|
||||
* values in AutoCad so they should not be used for index color lookups.
|
||||
*/
|
||||
declare const _default: number[];
|
||||
export default _default;
|
@ -1,12 +0,0 @@
|
||||
export interface IGroup {
|
||||
code: number;
|
||||
value: number | string | boolean;
|
||||
}
|
||||
export declare abstract class DxfBaseReader {
|
||||
protected pointer: number;
|
||||
protected eof: boolean;
|
||||
lastReadGroup: IGroup | undefined;
|
||||
abstract next(): IGroup;
|
||||
abstract hasNext(): boolean;
|
||||
abstract isEOF(): boolean;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "./DxfBaseReader";
|
||||
export default class DxfBinaryReader extends DxfBaseReader {
|
||||
private reader;
|
||||
private decoder;
|
||||
constructor(data: ArrayBuffer);
|
||||
next(): IGroup;
|
||||
hasNext(): boolean;
|
||||
isEOF(): boolean;
|
||||
private parseGroupValue;
|
||||
private readNullTerminatedString;
|
||||
private ReadBinaryData;
|
||||
}
|
@ -1,301 +0,0 @@
|
||||
/// <reference types="node" />
|
||||
import { Readable } from "stream";
|
||||
import IGeometry, { IEntity, IPoint } from "./entities/geomtry";
|
||||
import { IObject, IObjectParser } from "./objects/common";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare enum BlockTypeFlags {
|
||||
None = 0,
|
||||
AnonymousBlock = 1,
|
||||
NonConstantAttributeDefinitions = 2,
|
||||
XRef = 4,
|
||||
XRefOverlay = 8,
|
||||
ExternallyDependent = 16,
|
||||
ResolvedExternalReference = 32,
|
||||
DefinitionExternalReference = 64
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IBlock {
|
||||
entities: IEntity[];
|
||||
ownerHandle: string;
|
||||
xrefPath: string;
|
||||
name: string;
|
||||
name2: string;
|
||||
handle: string;
|
||||
layer: string;
|
||||
position: IPoint;
|
||||
paperSpace: boolean;
|
||||
blockType: BlockTypeFlags;
|
||||
description?: string;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IViewPort {
|
||||
name: string;
|
||||
lowerLeftCorner: IPoint;
|
||||
upperRightCorner: IPoint;
|
||||
center: IPoint;
|
||||
snapBasePoint: IPoint;
|
||||
snapSpacing: IPoint;
|
||||
gridSpacing: IPoint;
|
||||
viewDirectionFromTarget: IPoint;
|
||||
viewTarget: IPoint;
|
||||
aspectRatio: number;
|
||||
lensLength: number;
|
||||
frontClippingPlane: string | number | boolean;
|
||||
backClippingPlane: string | number | boolean;
|
||||
viewHeight: number;
|
||||
snapRotationAngle: number;
|
||||
viewTwistAngle: number;
|
||||
orthographicType: string;
|
||||
ucsOrigin: IPoint;
|
||||
ucsXAxis: IPoint;
|
||||
ucsYAxis: IPoint;
|
||||
renderMode: string;
|
||||
defaultLightingType: string;
|
||||
defaultLightingOn: string;
|
||||
ownerHandle: string;
|
||||
ambientColor: number;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IViewPortTableDefinition {
|
||||
tableRecordsProperty: "viewPorts";
|
||||
tableName: "viewPort";
|
||||
dxfSymbolName: "VPORT";
|
||||
parseTableRecords(): IViewPort[];
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ILineType {
|
||||
name: string;
|
||||
description: string;
|
||||
pattern: number[];
|
||||
patternLength: number;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ILineTypeTableDefinition {
|
||||
tableRecordsProperty: "lineTypes";
|
||||
tableName: "lineType";
|
||||
dxfSymbolName: "LTYPE";
|
||||
parseTableRecords(): Record<string, ILineType>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ILayer {
|
||||
name: string;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
handle: string;
|
||||
visible: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
colorIndex: number;
|
||||
/**
|
||||
* color in decimal
|
||||
*/
|
||||
color: number;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
frozen: boolean;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
flag: number;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
lineType: string;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
lineweight: 0 | 5 | 9 | 13 | 15 | 18 | 20 | 25 | 30 | 35 | 40 | 50 | 53 | 60 | 70 | 80 | 90 | 100 | 106 | 120 | 140 | 158 | 200 | 211 | -3 | -2 | -1;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ILayerTableDefinition {
|
||||
tableRecordsProperty: "layers";
|
||||
tableName: "layer";
|
||||
dxfSymbolName: "LAYER";
|
||||
parseTableRecords(): Record<string, ILayer>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IBlockRecord {
|
||||
handle: string;
|
||||
ownerHandle: string;
|
||||
blockName: string;
|
||||
layoutHandle: string;
|
||||
blockInsertUnits: number;
|
||||
blockExplodability: number;
|
||||
blockScalability: number;
|
||||
bitmap?: string;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IBlockRecordTableDefinition {
|
||||
tableRecordsProperty: "blockRecords";
|
||||
tableName: "blockRecord";
|
||||
dxfSymbolName: "BLOCK_RECORD";
|
||||
parseTableRecords(): Record<string, IBlockRecord>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IStyle {
|
||||
handle: string;
|
||||
ownerHandle: string;
|
||||
styleName: string;
|
||||
priorTextHeight: number;
|
||||
textHeight: number;
|
||||
xScale: number;
|
||||
rotation: number;
|
||||
textStyle: string;
|
||||
mirroreType: number;
|
||||
fontFile: string;
|
||||
bigFontFile: string;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IStyleTableDefinition {
|
||||
tableRecordsProperty: "styles";
|
||||
tableName: "style";
|
||||
dxfSymbolName: "STYLE";
|
||||
parseTableRecords(): Record<string, IStyle>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IDimStyle {
|
||||
styleName: string;
|
||||
DIMSCALE: number;
|
||||
DIMASZ: number;
|
||||
DIMEXO: string;
|
||||
DIMEXE: string;
|
||||
DIMSE1: string;
|
||||
DIMSE2: string;
|
||||
DIMTAD: string;
|
||||
DIMTXT: string;
|
||||
DIMGAP: number;
|
||||
DIMCLRD: number;
|
||||
DIMCLRT: number;
|
||||
DIMLFAC: number;
|
||||
DIMDEC: string;
|
||||
DIMLDRBLK: string;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IDimStyleTableDefinition {
|
||||
tableRecordsProperty: "dimStyles";
|
||||
tableName: "dimStyle";
|
||||
dxfSymbolName: "DIMSTYLE";
|
||||
parseTableRecords(): Record<string, IDimStyle>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ITableDefinitions {
|
||||
VPORT: IViewPortTableDefinition;
|
||||
LTYPE: ILineTypeTableDefinition;
|
||||
LAYER: ILayerTableDefinition;
|
||||
BLOCK_RECORD: IBlockRecordTableDefinition;
|
||||
STYLE: IStyleTableDefinition;
|
||||
DIMSTYLE: IDimStyleTableDefinition;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IBaseTable {
|
||||
handle: string;
|
||||
ownerHandle: string;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IViewPortTable extends IBaseTable {
|
||||
viewPorts: IViewPort[];
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ILayerTypesTable extends IBaseTable {
|
||||
lineTypes: Record<string, ILineType>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ILayersTable extends IBaseTable {
|
||||
layers: Record<string, ILayer>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IStylesTable extends IBaseTable {
|
||||
styles: Record<string, IStyle>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IDimStyleTable extends IBaseTable {
|
||||
dimStyles: Record<string, IDimStyle>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IBlockRecordsTable extends IBaseTable {
|
||||
blockRecords: Record<string, IBlockRecord>;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ITables {
|
||||
viewPort: IViewPortTable;
|
||||
lineType: ILayerTypesTable;
|
||||
layer: ILayersTable;
|
||||
blockRecord: IBlockRecordsTable;
|
||||
style: IStylesTable;
|
||||
dimStyle: IDimStyleTable;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare type ITable = IViewPortTable | ILayerTypesTable | ILayersTable | IBlockRecordsTable | IStylesTable | IDimStyleTable;
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IDxf {
|
||||
header: Record<string, IPoint | number>;
|
||||
entities: IEntity[];
|
||||
blocks: Record<string, IBlock>;
|
||||
tables: ITables;
|
||||
objects: Record<string, IObject[]>;
|
||||
}
|
||||
export default class DxfParser {
|
||||
private _entityHandlers;
|
||||
private _objectHandlers;
|
||||
private _layoutBlocks;
|
||||
constructor();
|
||||
parse(source: string | ArrayBuffer): IDxf;
|
||||
registerEntityHandler(handlerType: new () => IGeometry): void;
|
||||
registerObjectHandler(handlerType: new () => IObjectParser): void;
|
||||
parseSync(source: string | ArrayBuffer): IDxf;
|
||||
parseStream(stream: Readable): Promise<IDxf>;
|
||||
private _parse;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
import { IGroup, DxfBaseReader } from './DxfBaseReader';
|
||||
/**
|
||||
*
|
||||
* Based off the AutoCad 2012 DXF Reference
|
||||
* http://images.autodesk.com/adsk/files/autocad_2012_pdf_dxf-reference_enu.pdf
|
||||
*
|
||||
* Reads through an array representing lines of a dxf file. Takes an array and
|
||||
* provides an easy interface to extract group code and value pairs.
|
||||
* @param data - an array where each element represents a line in the dxf file
|
||||
* @constructor
|
||||
*/
|
||||
export default class DxfTextRender extends DxfBaseReader {
|
||||
private data;
|
||||
constructor(data: string[]);
|
||||
/**
|
||||
* Gets the next group (code, value) from the array. A group is two consecutive elements
|
||||
* in the array. The first is the code, the second is the value.
|
||||
* @returns {{code: Number}|*}
|
||||
*/
|
||||
next(): IGroup;
|
||||
/**
|
||||
* Returns true if there is another code/value pair (2 elements in the array).
|
||||
* @returns {boolean}
|
||||
*/
|
||||
hasNext(): boolean;
|
||||
/**
|
||||
* Returns true if the scanner is at the end of the array
|
||||
* @returns {boolean}
|
||||
*/
|
||||
isEOF(): boolean;
|
||||
}
|
@ -1,35 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "./DxfBaseReader";
|
||||
import { IEntity, IPoint } from "./entities/geomtry";
|
||||
import { IObject } from "./objects/common";
|
||||
/**
|
||||
* Returns the truecolor value of the given AutoCad color index value
|
||||
* @return {Number} truecolor value as a number
|
||||
*/
|
||||
export declare function getAcadColor(index: number): number;
|
||||
/**
|
||||
* Parses the 2D or 3D coordinate, vector, or point. When complete,
|
||||
* the scanner remains on the last group of the coordinate.
|
||||
* @param {*} scanner
|
||||
*/
|
||||
export declare function parsePoint(scanner: DxfBaseReader): IPoint;
|
||||
/**
|
||||
* Parses 16 numbers as an array. When complete,
|
||||
* the scanner remains on the last group of the value.
|
||||
* @param {*} scanner
|
||||
* @param {*} groupCode
|
||||
*/
|
||||
export declare function parseMatrix(scanner: DxfBaseReader, groupCode: number): number[];
|
||||
/**
|
||||
* Attempts to parse codes common to all entities. Returns true if the group
|
||||
* was handled by this function.
|
||||
* @param {*} entity - the entity currently being parsed
|
||||
* @param {*} curr - the current group being parsed
|
||||
*/
|
||||
export declare function checkCommonEntityProperties(entity: IEntity, curr: IGroup): boolean;
|
||||
/**
|
||||
* Attempts to parse codes common to all objects. Returns true if the group
|
||||
* was handled by this function.
|
||||
* @param {*} object - the object currently being parsed
|
||||
* @param {*} curr - the current group being parsed
|
||||
*/
|
||||
export declare function checkCommonObjectProperties(object: IObject, curr: IGroup): boolean;
|
@ -1,11 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface I3DfaceEntity extends IEntity {
|
||||
shape: boolean;
|
||||
hasContinuousLinetypePattern: boolean;
|
||||
vertices: IPoint[];
|
||||
}
|
||||
export default class ThreeDface implements IGeometry {
|
||||
ForEntityName: "3DFACE";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): I3DfaceEntity;
|
||||
}
|
@ -1,16 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IArcEntity extends IEntity {
|
||||
center: IPoint;
|
||||
radius: number;
|
||||
startAngle: number;
|
||||
endAngle: number;
|
||||
angleLength: number;
|
||||
extrusionDirectionX: number;
|
||||
extrusionDirectionY: number;
|
||||
extrusionDirectionZ: number;
|
||||
}
|
||||
export default class Arc implements IGeometry {
|
||||
ForEntityName: "ARC";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IArcEntity;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IAttdefEntity extends IEntity {
|
||||
xScale: number;
|
||||
textStyle: "STANDARD" | string;
|
||||
text: string;
|
||||
tag: string;
|
||||
prompt: string;
|
||||
startPoint: IPoint;
|
||||
endPoint: IPoint;
|
||||
thickness: number;
|
||||
textHeight: number;
|
||||
rotation: number;
|
||||
obliqueAngle: number;
|
||||
invisible: boolean;
|
||||
constant: boolean;
|
||||
verificationRequired: boolean;
|
||||
preset: boolean;
|
||||
backwards: boolean;
|
||||
mirrored: boolean;
|
||||
horizontalJustification: number;
|
||||
fieldLength: number;
|
||||
verticalJustification: number;
|
||||
extrusionDirectionX: number;
|
||||
extrusionDirectionY: number;
|
||||
extrusionDirectionZ: number;
|
||||
}
|
||||
export default class Attdef implements IGeometry {
|
||||
ForEntityName: "ATTDEF";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IAttdefEntity;
|
||||
}
|
@ -1,31 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IAttribEntity extends IEntity {
|
||||
xScale: number;
|
||||
textStyle: "STANDARD" | string;
|
||||
text: string;
|
||||
tag: string;
|
||||
prompt: string;
|
||||
startPoint: IPoint;
|
||||
endPoint: IPoint;
|
||||
thickness: number;
|
||||
textHeight: number;
|
||||
rotation: number;
|
||||
obliqueAngle: number;
|
||||
invisible: boolean;
|
||||
constant: boolean;
|
||||
verificationRequired: boolean;
|
||||
preset: boolean;
|
||||
backwards: boolean;
|
||||
mirrored: boolean;
|
||||
horizontalJustification: number;
|
||||
fieldLength: number;
|
||||
verticalJustification: number;
|
||||
extrusionDirectionX: number;
|
||||
extrusionDirectionY: number;
|
||||
extrusionDirectionZ: number;
|
||||
}
|
||||
export default class Attrib implements IGeometry {
|
||||
ForEntityName: "ATTRIB";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IAttribEntity;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ICircleEntity extends IEntity {
|
||||
center: IPoint;
|
||||
radius: number;
|
||||
startAngle: number;
|
||||
endAngle: number;
|
||||
angleLength: number;
|
||||
}
|
||||
export default class Circle implements IGeometry {
|
||||
ForEntityName: "CIRCLE";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): ICircleEntity;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IDimensionEntity extends IEntity {
|
||||
block: string;
|
||||
dimStyleName: string;
|
||||
anchorPoint: IPoint;
|
||||
middleOfText: IPoint;
|
||||
insertionPoint: IPoint;
|
||||
linearOrAngularPoint1: IPoint;
|
||||
linearOrAngularPoint2: IPoint;
|
||||
diameterOrRadiusPoint: IPoint;
|
||||
arcPoint: IPoint;
|
||||
dimensionType: number;
|
||||
attachmentPoint: number;
|
||||
actualMeasurement: number;
|
||||
text: string;
|
||||
angle: number;
|
||||
}
|
||||
export default class Dimension implements IGeometry {
|
||||
ForEntityName: "DIMENSION";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IDimensionEntity;
|
||||
}
|
@ -1,15 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IEllipseEntity extends IEntity {
|
||||
center: IPoint;
|
||||
majorAxisEndPoint: IPoint;
|
||||
axisRatio: number;
|
||||
startAngle: number;
|
||||
endAngle: number;
|
||||
name: string;
|
||||
extrusionDirection: IPoint;
|
||||
}
|
||||
export default class Ellipse implements IGeometry {
|
||||
ForEntityName: "ELLIPSE";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IEllipseEntity;
|
||||
}
|
@ -1,37 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface IPoint {
|
||||
x: number;
|
||||
y: number;
|
||||
z?: number;
|
||||
bulge?: number;
|
||||
}
|
||||
export interface IEntity {
|
||||
lineType: string;
|
||||
layer: string;
|
||||
lineTypeScale: number;
|
||||
visible: boolean;
|
||||
colorIndex: number;
|
||||
color: number;
|
||||
isTrueColor: boolean;
|
||||
inPaperSpace: boolean;
|
||||
layoutName: string;
|
||||
ownerHandle: string;
|
||||
materialObjectHandle: number;
|
||||
lineweight: 0 | 5 | 9 | 13 | 15 | 18 | 20 | 25 | 30 | 35 | 40 | 50 | 53 | 60 | 70 | 80 | 90 | 100 | 106 | 120 | 140 | 158 | 200 | 211 | -3 | -2 | -1;
|
||||
extendedData?: {
|
||||
customStrings?: string[];
|
||||
applicationName?: string;
|
||||
};
|
||||
type: string;
|
||||
handle: string;
|
||||
blockPosition?: IPoint;
|
||||
attributesFollow?: boolean;
|
||||
}
|
||||
export declare type EntityName = "POINT" | "3DFACE" | "ARC" | "ATTDEF" | "ATTRIB" | "CIRCLE" | "DIMENSION" | "MULTILEADER" | "ELLIPSE" | "HATCH" | "INSERT" | "LEADER" | "LINE" | "LWPOLYLINE" | "MTEXT" | "OLE2FRAME" | "POLYLINE" | "REGION" | "RAY" | "SEQEND" | "SOLID" | "SPLINE" | "TEXT" | "VERTEX" | "VIEWPORT" | "XLINE";
|
||||
export default interface IGeometry {
|
||||
ForEntityName: EntityName;
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IEntity;
|
||||
}
|
@ -1,105 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export declare enum HatchBoundaryPathTypeFlag {
|
||||
Default = 0,
|
||||
External = 1,
|
||||
Polyline = 2,
|
||||
Derived = 4,
|
||||
Textbox = 8,
|
||||
Outermost = 16,
|
||||
MaxFlags = 31
|
||||
}
|
||||
export declare enum HatchEdgeType {
|
||||
Polyline = 0,
|
||||
Line = 1,
|
||||
Arc = 2,
|
||||
Ellipse = 3,
|
||||
Spline = 4
|
||||
}
|
||||
export declare abstract class HatchEdge {
|
||||
readonly type: HatchEdgeType;
|
||||
constructor(type: HatchEdgeType);
|
||||
}
|
||||
export declare class HatchPolyline extends HatchEdge {
|
||||
points: IPoint[];
|
||||
isClosed: boolean;
|
||||
constructor();
|
||||
}
|
||||
export declare class HatchLine extends HatchEdge {
|
||||
startPoint: IPoint;
|
||||
endPoint: IPoint;
|
||||
constructor();
|
||||
}
|
||||
export declare class HatchArc extends HatchEdge {
|
||||
center: IPoint;
|
||||
radius: number;
|
||||
startAngle: number;
|
||||
endAngle: number;
|
||||
bCounterclockwise: boolean;
|
||||
constructor();
|
||||
}
|
||||
export declare class HatchEllipse extends HatchEdge {
|
||||
center: IPoint;
|
||||
majorAxisEndPoint: IPoint;
|
||||
minorRatio: number;
|
||||
startAngle: number;
|
||||
endAngle: number;
|
||||
bCounterclockwise: boolean;
|
||||
constructor();
|
||||
}
|
||||
export declare class HatchSpline extends HatchEdge {
|
||||
controlPoints: IPoint[];
|
||||
numControlPoints: number;
|
||||
knotValues: number[];
|
||||
numKnots: number;
|
||||
bPeriodic: boolean;
|
||||
bRational: boolean;
|
||||
degreeOfSplineCurve: number;
|
||||
constructor();
|
||||
}
|
||||
export interface IHatchBoundaryPath {
|
||||
edges: HatchEdge[];
|
||||
pathTypeFlag: HatchBoundaryPathTypeFlag;
|
||||
}
|
||||
export declare enum HatchStyle {
|
||||
Normal = 0,
|
||||
Outer = 1,
|
||||
Ignore = 2
|
||||
}
|
||||
export declare enum HatchType {
|
||||
UserDefined = 0,
|
||||
Predefined = 1,
|
||||
Custom = 2
|
||||
}
|
||||
export interface IHatchPatternLine {
|
||||
angle: number;
|
||||
origin: IPoint;
|
||||
delta: IPoint;
|
||||
dashPattern: number[];
|
||||
}
|
||||
export interface IHatchEntity extends IEntity {
|
||||
elevationX: number;
|
||||
elevationY: number;
|
||||
elevationZ: number;
|
||||
pixelSize: number;
|
||||
associativity: boolean;
|
||||
annotatedBoundary: boolean;
|
||||
boundaryPathsCount: number;
|
||||
boundaryPaths: IHatchBoundaryPath[];
|
||||
seedPointsCount: number;
|
||||
extrusionDirectionX: number;
|
||||
extrusionDirectionY: number;
|
||||
extrusionDirectionZ: number;
|
||||
patternName: string;
|
||||
solidFill: boolean;
|
||||
patternFillColor: number;
|
||||
style: HatchStyle;
|
||||
patternType: HatchType;
|
||||
patternAngle: number;
|
||||
patternScale: number;
|
||||
patternLines?: IHatchPatternLine[];
|
||||
}
|
||||
export default class Hatch implements IGeometry {
|
||||
readonly ForEntityName = "HATCH";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IHatchEntity;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IInsertEntity extends IEntity {
|
||||
block: string;
|
||||
attributesFollow: boolean;
|
||||
xScale: number;
|
||||
yScale: number;
|
||||
zScale: number;
|
||||
position: IPoint;
|
||||
rotation: number;
|
||||
columnCount: number;
|
||||
rowCount: number;
|
||||
columnSpacing: number;
|
||||
rowSpacing: number;
|
||||
extrusionDirection: IPoint;
|
||||
}
|
||||
export default class Insert implements IGeometry {
|
||||
ForEntityName: "INSERT";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IInsertEntity;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ILeaderEntity extends IEntity {
|
||||
dimensionStyle: string;
|
||||
position: IPoint;
|
||||
textHeight: number;
|
||||
textWidth: number;
|
||||
rotation: number;
|
||||
arrowFlag: number;
|
||||
pathType: number;
|
||||
arrowHeight: number;
|
||||
arrowHeadScale: number;
|
||||
creationFlag: number;
|
||||
direction: number;
|
||||
hasHookline: boolean;
|
||||
block: string;
|
||||
arrowHeadBlockHandle: string;
|
||||
vertices: IPoint[];
|
||||
}
|
||||
export default class Leader implements IGeometry {
|
||||
ForEntityName: "LEADER";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): ILeaderEntity;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from './geomtry';
|
||||
export interface ILineEntity extends IEntity {
|
||||
vertices: IPoint[];
|
||||
extrusionDirection: IPoint;
|
||||
}
|
||||
export default class Line implements IGeometry {
|
||||
ForEntityName: "LINE";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): ILineEntity;
|
||||
}
|
@ -1,21 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IVertex extends IPoint {
|
||||
startWidth?: number;
|
||||
endWidth?: number;
|
||||
}
|
||||
export interface ILwpolylineEntity extends IEntity {
|
||||
vertices: IVertex[];
|
||||
elevation?: number;
|
||||
thickness?: number;
|
||||
shape: boolean;
|
||||
hasContinuousLinetypePattern: boolean;
|
||||
constantWidth?: number;
|
||||
extrusionDirectionX?: number;
|
||||
extrusionDirectionY?: number;
|
||||
extrusionDirectionZ?: number;
|
||||
}
|
||||
export default class Lwpolyline implements IGeometry {
|
||||
ForEntityName: "LWPOLYLINE";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): ILwpolylineEntity;
|
||||
}
|
@ -1,101 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ILeaderEntity extends IEntity {
|
||||
leaderStyleId: number;
|
||||
leaderLineType: number;
|
||||
leaderLineColor: number;
|
||||
leaderLineTypeId: number;
|
||||
leaderLineWeight: number;
|
||||
enableLanding: boolean;
|
||||
enableDogLeg: boolean;
|
||||
doglegLength: number;
|
||||
arrowHeadId: number;
|
||||
arrowHeadSize: number;
|
||||
contentType: number;
|
||||
textStyleId: number;
|
||||
textLeftAttachmentType: number;
|
||||
textRightAttachmentType: number;
|
||||
textAngleType: number;
|
||||
textAlignmentType: number;
|
||||
textColor: number;
|
||||
enableFrameText: boolean;
|
||||
blockContentId: number;
|
||||
blockContentColor: number;
|
||||
blockContentScale: IPoint;
|
||||
blockContentRotation: number;
|
||||
blockContentConnectionType: number;
|
||||
enableAnotationScale: boolean;
|
||||
arrowHeadIndex: number;
|
||||
blockAttributeId: number;
|
||||
blockAttributeIndex: number;
|
||||
blockAttributeWidth: number;
|
||||
blockAttributeTextString: string;
|
||||
textDirectionNegative: boolean;
|
||||
textAlignInIPE: number;
|
||||
textAttachmentPoint: number;
|
||||
textAttachmentDirectionMText: number;
|
||||
textAttachmentDirectionBottom: number;
|
||||
textAttachmentDirectionTop: number;
|
||||
contextData: IMLeaderContextData;
|
||||
}
|
||||
export interface IMLeaderContextData {
|
||||
contentScale: number;
|
||||
contentBasePosition: IPoint;
|
||||
textHeight: number;
|
||||
arrowHeadSize: number;
|
||||
landingGap: number;
|
||||
hasMText: boolean;
|
||||
defaultTextContents: string;
|
||||
textNormalDirection: IPoint;
|
||||
textLocation: IPoint;
|
||||
textDirection: IPoint;
|
||||
textRotation: number;
|
||||
textWidth: number;
|
||||
textLineSpacingFactor: number;
|
||||
textLineSpacingStyle: number;
|
||||
textColor: number;
|
||||
textAttachment: number;
|
||||
textFlowDirection: number;
|
||||
textBackgroundColor: number;
|
||||
textBackgroundScaleFactor: number;
|
||||
textBackgroundTransparency: number;
|
||||
textBackgroundColorOn: boolean;
|
||||
textBackgroundFillOn: boolean;
|
||||
textColumnType: number;
|
||||
textUseAutoHeight: boolean;
|
||||
textColumnWidth: number;
|
||||
textColumnGutterWidth: number;
|
||||
textColumnFlowReversed: boolean;
|
||||
textColumnHeight: number;
|
||||
textUseWordBreak: boolean;
|
||||
hasBlock: boolean;
|
||||
blockContentId: number;
|
||||
blockContentNormalDirection: IPoint;
|
||||
blockContentPosition: IPoint;
|
||||
blockContentScale: number;
|
||||
blockContentRotation: number;
|
||||
blockContentColor: number;
|
||||
blockTransformationMatrix: number[];
|
||||
planeOriginPoint: IPoint;
|
||||
planeXAxisDirection: IPoint;
|
||||
planeYAxisDirection: IPoint;
|
||||
planeNormalReversed: boolean;
|
||||
leaders: IMLeaderLeader[];
|
||||
}
|
||||
export interface IMLeaderLeader {
|
||||
hasSetLastLeaderLinePoint: boolean;
|
||||
hasSetDoglegVector: boolean;
|
||||
lastLeaderLinePoint: IPoint;
|
||||
doglegVector: IPoint;
|
||||
leaderBranchIndex: number;
|
||||
doglegLength: number;
|
||||
leaderLines: IMLeaderLine[];
|
||||
}
|
||||
export interface IMLeaderLine {
|
||||
vertices: IPoint[][];
|
||||
leaderLineIndex: number;
|
||||
}
|
||||
export default class MLeader implements IGeometry {
|
||||
ForEntityName: "MULTILEADER";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): ILeaderEntity;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IMtextEntity extends IEntity {
|
||||
text: string;
|
||||
position: IPoint;
|
||||
directionVector: IPoint;
|
||||
height: number;
|
||||
width: number;
|
||||
rotation: number;
|
||||
attachmentPoint: number;
|
||||
drawingDirection: number;
|
||||
textStyle?: string;
|
||||
lineSpaceFactor?: number;
|
||||
}
|
||||
export default class Mtext implements IGeometry {
|
||||
ForEntityName: "MTEXT";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IMtextEntity;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity } from "./geomtry";
|
||||
export interface IOleEntity extends IEntity {
|
||||
documentType: string;
|
||||
version: number;
|
||||
leftUpX: number;
|
||||
leftUpY: number;
|
||||
leftUpZ: number;
|
||||
rightDownX: number;
|
||||
rightDownY: number;
|
||||
rightDownZ: number;
|
||||
type: string;
|
||||
tileModeDescriptor: number;
|
||||
binaryData: string;
|
||||
lengthOfBinaryData: number;
|
||||
}
|
||||
export default class Ole implements IGeometry {
|
||||
readonly ForEntityName = "OLE2FRAME";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IOleEntity;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from './geomtry';
|
||||
export interface IPointEntity extends IEntity {
|
||||
position: IPoint;
|
||||
thickness: number;
|
||||
extrusionDirection: IPoint;
|
||||
}
|
||||
export default class Point implements IGeometry {
|
||||
ForEntityName: "POINT";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IPointEntity;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
import { IVertexEntity } from "./vertex";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
export interface IPolylineEntity extends IEntity {
|
||||
vertices: IVertexEntity[];
|
||||
thickness: number;
|
||||
shape: boolean;
|
||||
includesCurveFitVertices: boolean;
|
||||
includesSplineFitVertices: boolean;
|
||||
is3dPolyline: boolean;
|
||||
is3dPolygonMesh: boolean;
|
||||
is3dPolygonMeshClosed: boolean;
|
||||
isPolyfaceMesh: boolean;
|
||||
hasContinuousLinetypePattern: boolean;
|
||||
extrusionDirection: IPoint;
|
||||
}
|
||||
export default class Polyline implements IGeometry {
|
||||
ForEntityName: "POLYLINE";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IPolylineEntity;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from './geomtry';
|
||||
export interface IRayEntity extends IEntity {
|
||||
vertices: IPoint[];
|
||||
directionVector: IPoint;
|
||||
}
|
||||
export default class Ray implements IGeometry {
|
||||
ForEntityName: "RAY";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IRayEntity;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity } from "./geomtry";
|
||||
export interface IRegionEntity extends IEntity {
|
||||
modelerVersion?: number;
|
||||
proprietaryData?: string;
|
||||
}
|
||||
export default class Region implements IGeometry {
|
||||
ForEntityName: "REGION";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IRegionEntity;
|
||||
}
|
@ -1,8 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity } from './geomtry';
|
||||
export interface ISeqendEntity extends IEntity {
|
||||
}
|
||||
export default class Seqend implements IGeometry {
|
||||
ForEntityName: "SEQEND";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): ISeqendEntity;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ISolidEntity extends IEntity {
|
||||
points: IPoint[];
|
||||
extrusionDirection: IPoint;
|
||||
}
|
||||
export default class Solid implements IGeometry {
|
||||
ForEntityName: "SOLID";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): ISolidEntity;
|
||||
}
|
@ -1,23 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ISplineEntity extends IEntity {
|
||||
controlPoints?: IPoint[];
|
||||
fitPoints?: IPoint[];
|
||||
startTangent: IPoint;
|
||||
endTangent: IPoint;
|
||||
knotValues: number[];
|
||||
closed: boolean;
|
||||
periodic: boolean;
|
||||
rational: boolean;
|
||||
planar: boolean;
|
||||
linear: boolean;
|
||||
degreeOfSplineCurve: number;
|
||||
numberOfKnots: number;
|
||||
numberOfControlPoints: number;
|
||||
numberOfFitPoints: number;
|
||||
normalVector: IPoint;
|
||||
}
|
||||
export default class Spline implements IGeometry {
|
||||
ForEntityName: "SPLINE";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): ISplineEntity;
|
||||
}
|
@ -1,18 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface ITextEntity extends IEntity {
|
||||
startPoint: IPoint;
|
||||
endPoint: IPoint;
|
||||
textHeight: number;
|
||||
xScale: number;
|
||||
rotation: number;
|
||||
text: string;
|
||||
textStyle: string;
|
||||
mirrored: number;
|
||||
halign: number;
|
||||
valign: number;
|
||||
}
|
||||
export default class Text implements IGeometry {
|
||||
ForEntityName: "TEXT";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): ITextEntity;
|
||||
}
|
@ -1,20 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from './geomtry';
|
||||
export interface IVertexEntity extends IEntity, IPoint {
|
||||
bulge: number;
|
||||
curveFittingVertex: boolean;
|
||||
curveFitTangent: boolean;
|
||||
splineVertex: boolean;
|
||||
splineControlPoint: boolean;
|
||||
threeDPolylineVertex: boolean;
|
||||
threeDPolylineMesh: boolean;
|
||||
polyfaceMeshVertex: boolean;
|
||||
faceA: number;
|
||||
faceB: number;
|
||||
faceC: number;
|
||||
faceD: number;
|
||||
}
|
||||
export default class Vertex implements IGeometry {
|
||||
ForEntityName: "VERTEX";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IVertexEntity;
|
||||
}
|
@ -1,46 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from "./geomtry";
|
||||
export interface IViewportEntity extends IEntity {
|
||||
centerPoint: IPoint;
|
||||
width_paperSpace: number;
|
||||
height_paperSpace: number;
|
||||
viewportStatus: number;
|
||||
viewportId: string;
|
||||
centerPoint_dcs: IPoint;
|
||||
snapBasePoint_dcs: IPoint;
|
||||
snapSpacing_dcs: IPoint;
|
||||
gridSpacing_dcs: IPoint;
|
||||
viewDirection: IPoint;
|
||||
viewTarget: IPoint;
|
||||
perspectiveLens: number;
|
||||
frontClippingPlaneZ: number;
|
||||
backClippingPlaneZ: number;
|
||||
viewHeight: number;
|
||||
snapAngle: number;
|
||||
viewTwistAngle: number;
|
||||
circleZoomPercent: number;
|
||||
frozenLayerHandles: string[];
|
||||
viewportStatusFlags: number;
|
||||
viewportClippingBoundaryhandleId: string;
|
||||
plotStyleSheetName: string;
|
||||
renderMode: number;
|
||||
viewportFlag_ucs: number;
|
||||
ucsIcon: string;
|
||||
ucsOrigin: IPoint;
|
||||
ucsXAxis: IPoint;
|
||||
ucsYAxis: IPoint;
|
||||
ucsTableRecordHandle: string;
|
||||
baseUcsTableRecordHandle: string;
|
||||
orthographicType: number;
|
||||
elevation: number;
|
||||
shadePlotMode: number;
|
||||
frequency: number;
|
||||
lightingFlag: number;
|
||||
lightingType: number;
|
||||
viewBrightness: number;
|
||||
viewContrast: number;
|
||||
}
|
||||
export default class Viewport implements IGeometry {
|
||||
ForEntityName: "VIEWPORT";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IViewportEntity;
|
||||
}
|
@ -1,10 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import IGeometry, { IEntity, IPoint } from './geomtry';
|
||||
export interface IXLineEntity extends IEntity {
|
||||
vertices: IPoint[];
|
||||
directionVector: IPoint;
|
||||
}
|
||||
export default class XLine implements IGeometry {
|
||||
ForEntityName: "XLINE";
|
||||
parseEntity(scanner: DxfBaseReader, curr: IGroup): IXLineEntity;
|
||||
}
|
@ -1,25 +0,0 @@
|
||||
export { default, default as DxfParser } from "./DxfParser";
|
||||
export type { IDxf, IBlock, ILayerTypesTable, ILayersTable, ITables, IViewPortTable, IBaseTable, ILayer, ILayerTableDefinition, ILineType, ILineTypeTableDefinition, ITable, ITableDefinitions, IViewPort, IViewPortTableDefinition, } from "./DxfParser";
|
||||
export type { IEntity, IPoint } from "./entities/geomtry";
|
||||
export type { I3DfaceEntity } from "./entities/3dface";
|
||||
export type { IArcEntity } from "./entities/arc";
|
||||
export type { IAttdefEntity } from "./entities/attdef";
|
||||
export type { ICircleEntity } from "./entities/circle";
|
||||
export type { IDimensionEntity } from "./entities/dimension";
|
||||
export type { ILeaderEntity } from "./entities/mleader";
|
||||
export type { IEllipseEntity } from "./entities/ellipse";
|
||||
export type { IHatchEntity } from "./entities/hatch";
|
||||
export type { IInsertEntity } from "./entities/insert";
|
||||
export type { ILineEntity } from "./entities/line";
|
||||
export type { ILwpolylineEntity } from "./entities/lwpolyline";
|
||||
export type { IMtextEntity } from "./entities/mtext";
|
||||
export type { IPointEntity } from "./entities/point";
|
||||
export type { IPolylineEntity } from "./entities/polyline";
|
||||
export type { ISolidEntity } from "./entities/solid";
|
||||
export type { ISplineEntity } from "./entities/spline";
|
||||
export type { ITextEntity } from "./entities/text";
|
||||
export type { IVertexEntity } from "./entities/vertex";
|
||||
export type { IViewportEntity } from "./entities/viewport";
|
||||
export type { IObject } from "./objects/common";
|
||||
export type { ILayoutObject } from "./objects/layout";
|
||||
export type { ISortEntsObject, ISortEntsTableObject } from "./objects/sortentstable";
|
@ -1,15 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
export interface IObject {
|
||||
type: string;
|
||||
handle: string;
|
||||
ownerHandle: string;
|
||||
extendedData?: {
|
||||
customStrings?: string[];
|
||||
applicationName?: string;
|
||||
};
|
||||
}
|
||||
export declare type ObjectName = "ACAD_PROXY_OBJECT" | "ACDBDICTIONARYWDFLT" | "ACDBPLACEHOLDER" | "DATATABLE" | "DICTIONARY" | "DICTIONARYVAR" | "DIMASSOC" | "FIELD" | "GEODATA" | "IDBUFFER" | "IMAGEDEF" | "IMAGEDEF_REACTOR" | "LAYER_INDEX" | "LAYER_FILTER" | "LAYOUT" | "LIGHTLIST" | "MATERIAL" | "MLINESTYLE" | "OBJECT_PTR" | "PLOTSETTINGS" | "RASTERVARIABLES" | "RENDER" | "SECTION" | "SPATIAL_INDEX" | "SPATIAL_FILTER" | "SORTENTSTABLE" | "TABLESTYLE" | "UNDERLAYDEFINITION" | "VISUALSTYLE" | "VBA_PROJECT" | "WIPEOUTVARIABLES" | "XRECORD";
|
||||
export interface IObjectParser {
|
||||
ForObjectName: ObjectName;
|
||||
parseObject(scanner: DxfBaseReader, curr: IGroup): IObject;
|
||||
}
|
@ -1,19 +0,0 @@
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
export declare enum DictionaryCloningFlags {
|
||||
NotApplicable = 0,
|
||||
KeepExisting = 1,
|
||||
UseClone = 2,
|
||||
XrefName = 3,
|
||||
Name = 4,
|
||||
UnmangleName = 5
|
||||
}
|
||||
export interface IDictionaryObject extends IObject {
|
||||
entries: Record<string, string>;
|
||||
isHardOwner: boolean;
|
||||
cloningFlag: DictionaryCloningFlags;
|
||||
}
|
||||
export declare class Dictionary implements IObjectParser {
|
||||
ForObjectName: "DICTIONARY";
|
||||
parseObject(scanner: DxfBaseReader, curr: IGroup): IDictionaryObject;
|
||||
}
|
@ -1,29 +0,0 @@
|
||||
import { IObject, IObjectParser } from './common';
|
||||
import { DxfBaseReader, IGroup } from '../DxfBaseReader';
|
||||
import { IPoint } from '../entities/geomtry';
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export interface ILayoutObject extends IObject {
|
||||
plotSettings?: object;
|
||||
layoutName: string;
|
||||
flag: number;
|
||||
tabOrder: number;
|
||||
minLimit: IPoint;
|
||||
maxLimit: IPoint;
|
||||
basePoint: IPoint;
|
||||
minExtent: IPoint;
|
||||
maxExtent: IPoint;
|
||||
elevation: number;
|
||||
origin: IPoint;
|
||||
XAxis: IPoint;
|
||||
YAxis: IPoint;
|
||||
orthographicType: number;
|
||||
blockTableHandle: string;
|
||||
viewportHandle: string;
|
||||
associatedBlockName: string;
|
||||
}
|
||||
export declare class Layout implements IObjectParser {
|
||||
ForObjectName: "LAYOUT";
|
||||
parseObject(scanner: DxfBaseReader, curr: IGroup): ILayoutObject;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
export interface ISortEntsObject extends IObject {
|
||||
entityHandles: string[][];
|
||||
}
|
||||
export interface ISortEntsTableObject extends IObject {
|
||||
sortEntsObject: ISortEntsObject;
|
||||
}
|
||||
export declare class SortEntsTable implements IObjectParser {
|
||||
ForObjectName: "SORTENTSTABLE";
|
||||
parseObject(scanner: DxfBaseReader, curr: IGroup): ISortEntsTableObject;
|
||||
}
|
@ -1,22 +0,0 @@
|
||||
import { IPoint } from "../entities/geomtry";
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
export interface ISpatialFilterObject extends IObject {
|
||||
origin: IPoint;
|
||||
numberOfPointsOnClipBoundary: number;
|
||||
vertices: IPoint[];
|
||||
extrusionDirectionX: number;
|
||||
extrusionDirectionY: number;
|
||||
extrusionDirectionZ: number;
|
||||
clipBoundaryVisible: boolean;
|
||||
frontClippingPlaneFlag: boolean;
|
||||
frontClippingPlaneDistance: number;
|
||||
backClippingPlaneFlag: boolean;
|
||||
backClippingPlaneDistance: number;
|
||||
matrix: number[];
|
||||
invertBlockMatrix: number[];
|
||||
}
|
||||
export declare class SpatialFilter implements IObjectParser {
|
||||
ForObjectName: "SPATIAL_FILTER";
|
||||
parseObject(scanner: DxfBaseReader, curr: IGroup): ISpatialFilterObject;
|
||||
}
|
@ -1,11 +0,0 @@
|
||||
import { DxfBaseReader, IGroup } from "../DxfBaseReader";
|
||||
import { IObject, IObjectParser } from "./common";
|
||||
import { DictionaryCloningFlags } from "./dictionary";
|
||||
export interface IXRecord extends IObject {
|
||||
binaryData: string | undefined;
|
||||
cloningFlag: DictionaryCloningFlags;
|
||||
}
|
||||
export declare class XRecord implements IObjectParser {
|
||||
ForObjectName: "XRECORD";
|
||||
parseObject(scanner: DxfBaseReader, curr: IGroup): IXRecord;
|
||||
}
|
@ -1,14 +0,0 @@
|
||||
/**
|
||||
* Constants used by dxf
|
||||
*/
|
||||
export declare const BYLAYER = "BYLAYER";
|
||||
export declare const BYBLOCK = "BYBLOCK";
|
||||
export declare enum DxfRenderOrder {
|
||||
Mesh = -1,
|
||||
MeshWithPattern = 0,
|
||||
LineWithWidth = 1,
|
||||
Line = 2,
|
||||
LineWithPattern = 3,
|
||||
Point = 4,
|
||||
Text = 5
|
||||
}
|
380
public/demo/libs/types/core/dxf/DXFLoader.d.ts
vendored
380
public/demo/libs/types/core/dxf/DXFLoader.d.ts
vendored
@ -1,380 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
import { IBlock, IDxf, IEntity, ILayer, IPoint, IViewPort, IViewportEntity } from "../dxf-parser";
|
||||
import { DxfChangeType, DxfChange } from "./DxfCompare";
|
||||
import { Units } from "../Units";
|
||||
import { ShxFont } from "../shx-parser/ShxFont";
|
||||
import { Font } from "three/examples/jsm/loaders/FontLoader";
|
||||
import { ISpatialFilterObject } from "../dxf-parser/objects/spatialfilter";
|
||||
import { IMLeaderContextData } from "../dxf-parser/entities/mleader";
|
||||
export interface DxfData extends IDxf {
|
||||
threejsObject: THREE.Group;
|
||||
layersAndThreejsObjects: Record<string, THREE.Object3D[]>;
|
||||
loadedEntityCount: number;
|
||||
layoutViewportsMap: Record<string, IViewportEntity[]>;
|
||||
}
|
||||
export interface DxfLayer extends ILayer {
|
||||
}
|
||||
export interface DxfEntity extends IEntity {
|
||||
threejsObject?: THREE.Object3D;
|
||||
dimStyleName: string;
|
||||
dimensionType?: number;
|
||||
anchorPoint?: THREE.Vector3;
|
||||
block?: string;
|
||||
majorAxisEndPoint?: THREE.Vector2 | THREE.Vector3;
|
||||
axisRatio?: number;
|
||||
center?: THREE.Vector3;
|
||||
startAngle?: number;
|
||||
endAngle?: number;
|
||||
style?: number;
|
||||
text?: string;
|
||||
height?: number;
|
||||
width?: number;
|
||||
position?: THREE.Vector3;
|
||||
blockPosition?: IPoint;
|
||||
rotation?: number;
|
||||
directionVector?: THREE.Vector3;
|
||||
attachmentPoint?: number;
|
||||
drawingDirection?: number;
|
||||
controlPoints?: THREE.Vector3[];
|
||||
degreeOfSplineCurve?: number;
|
||||
knotValues?: number[];
|
||||
vertices?: IPoint[];
|
||||
shape: boolean;
|
||||
isPolyfaceMesh: boolean;
|
||||
pathType: number;
|
||||
direction: number;
|
||||
hasHookline: boolean;
|
||||
textWidth: number;
|
||||
dimensionStyle: string;
|
||||
arrowFlag: number;
|
||||
arrowHeight: number;
|
||||
arrowHeadScale: number;
|
||||
arrowHeadBlockHandle: string;
|
||||
contextData?: IMLeaderContextData;
|
||||
enableDogLeg: boolean;
|
||||
leaderLineType: number;
|
||||
arrowHeadId: string;
|
||||
arrowHeadSize: number;
|
||||
radius?: number;
|
||||
points?: THREE.Vector3[];
|
||||
startPoint?: THREE.Vector3;
|
||||
endPoint?: THREE.Vector3;
|
||||
textHeight: number;
|
||||
halign?: number;
|
||||
valign?: number;
|
||||
mirrored?: number;
|
||||
textStyle?: string;
|
||||
lineSpaceFactor?: number;
|
||||
name?: string;
|
||||
xScale?: number;
|
||||
yScale?: number;
|
||||
zScale?: number;
|
||||
elevation?: number;
|
||||
extrusionDirectionX?: number;
|
||||
extrusionDirectionY?: number;
|
||||
extrusionDirectionZ?: number;
|
||||
extrusionDirection?: {
|
||||
z: number;
|
||||
};
|
||||
entities?: IEntity[];
|
||||
tag?: string;
|
||||
prompt?: string;
|
||||
scale?: number;
|
||||
preset: boolean;
|
||||
invisible: boolean;
|
||||
documentType?: string;
|
||||
version?: number;
|
||||
leftUpX?: number;
|
||||
leftUpY?: number;
|
||||
leftUpZ?: number;
|
||||
rightDownX?: number;
|
||||
rightDownY?: number;
|
||||
rightDownZ?: number;
|
||||
tileModeDescriptor?: number;
|
||||
binaryData?: string;
|
||||
lengthOfBinaryData?: number;
|
||||
image: string;
|
||||
psBBox?: THREE.Box3;
|
||||
msToPsMatrix?: THREE.Matrix4;
|
||||
viewportThreejsObject?: THREE.Object3D;
|
||||
associatedSpatialFilter?: DxfSpatialFilter;
|
||||
compareChangeType?: DxfChangeType;
|
||||
}
|
||||
export interface DxfBlock extends IBlock {
|
||||
threejsObject?: THREE.Object3D;
|
||||
}
|
||||
export interface DxfSpatialFilterClipPolyline {
|
||||
polyline: THREE.Vector3[];
|
||||
bConcave: boolean;
|
||||
bReversed: boolean;
|
||||
}
|
||||
export interface DxfSpatialFilter extends ISpatialFilterObject {
|
||||
threejsObject?: THREE.Object3D;
|
||||
localMatrix?: THREE.Matrix4;
|
||||
clipPolylines: DxfSpatialFilterClipPolyline[];
|
||||
}
|
||||
/**
|
||||
* THREE.Loader implementation for DXF files
|
||||
*
|
||||
* @param {*} manager THREE.LoadingManager
|
||||
*
|
||||
* @see https://threejs.org/docs/#api/en/loaders/Loader
|
||||
* @author Sourabh Soni / https://www.prolincur.com
|
||||
*/
|
||||
export declare class DXFLoader extends THREE.Loader {
|
||||
private readonly MODEL_LAYOUT_NAME;
|
||||
private timer;
|
||||
private ignorePaperSpace;
|
||||
font?: Font | ShxFont;
|
||||
angBase: number | IPoint;
|
||||
angDir: number | IPoint;
|
||||
private header;
|
||||
private pointsMaterials;
|
||||
private lineBasicMaterials;
|
||||
private lineShaderMaterials;
|
||||
private meshBasicMaterials;
|
||||
private hatchShaderMaterials;
|
||||
private entityCount;
|
||||
private curveCount;
|
||||
private averageCurveSize;
|
||||
private enableRenderOrder;
|
||||
private enableLocalCache;
|
||||
private enableReleaseData;
|
||||
private enableMerge;
|
||||
private enableSimplify;
|
||||
private enableRTC;
|
||||
private dxfDataId;
|
||||
/**
|
||||
* Use a context in order to easily know if it is compare mode,
|
||||
* and, get compare result from it.
|
||||
*/
|
||||
private compareContext?;
|
||||
private statsInfo;
|
||||
private blockReferenceCache;
|
||||
/**
|
||||
* Adds this data member just in order to improve the performence of getLayoutName.
|
||||
* Its key is blockrecord's handle, value is its layoutHandle.
|
||||
*/
|
||||
private blockRecordsCache;
|
||||
/**
|
||||
* Adds this data member just in order to improve the performence of getLayoutName.
|
||||
* Its key is entity's handle, value is itself.
|
||||
*/
|
||||
private entitiesCache;
|
||||
/**
|
||||
* Adds this in order to improve performance of findSpatialFilterByHandle.
|
||||
* Key is dictionaryObject's ownerHandle(entity's handle), value is spatial filter's ownerHandle
|
||||
*/
|
||||
private dictionaryOwnerHandleAndSpatialFilterHandlesCache;
|
||||
/**
|
||||
* Adds this in order to improve performance of findSpatialFilterByHandle.
|
||||
* Key is ISpatialFilterObject's ownerHandle, value is ISpatialFilterObject
|
||||
*/
|
||||
private spatialFiltersCache;
|
||||
/**
|
||||
* Adds this in order to improve performance of creating threejs object
|
||||
* Key is entity's handle, value is threejs object.
|
||||
*/
|
||||
private entityThreejsCache;
|
||||
static cameraZoomUniform: {
|
||||
value: number;
|
||||
};
|
||||
static viewportScaleUniform: {
|
||||
value: number;
|
||||
};
|
||||
static transformMatrixUniform: {
|
||||
value: THREE.Matrix4;
|
||||
};
|
||||
static resolutionUniform: {
|
||||
value: THREE.Vector2;
|
||||
};
|
||||
static maxFragmentUniforms: number;
|
||||
/**
|
||||
* @param ignorePaperSpace if true, only load model space
|
||||
*/
|
||||
constructor(ignorePaperSpace?: boolean);
|
||||
setFont(font: Font | ShxFont): this;
|
||||
/**
|
||||
* Downloads dxf file content
|
||||
*/
|
||||
private download;
|
||||
/**
|
||||
* Loads dxf asynchronously. It mainly contains 2 steps:
|
||||
* 1. parses file content
|
||||
* 2. generates/load threejs objects
|
||||
* @param url url of the dxf file
|
||||
* @param onProgress on progress callback
|
||||
*/
|
||||
loadAsync(url: string, onProgress?: (event: ProgressEvent) => void): Promise<DxfData>;
|
||||
/**
|
||||
* Parses dxf contents
|
||||
*/
|
||||
parse(url: string, onProgress?: (event: ProgressEvent) => void): Promise<IDxf>;
|
||||
parseHeader(header: Record<string, IPoint | number>): void;
|
||||
/**
|
||||
* Generates/load threejs objects according to dxf data.
|
||||
* @param data
|
||||
* @param onProgress
|
||||
* @returns
|
||||
* @describe load dxf entities
|
||||
*/
|
||||
loadEntities(data: IDxf, onProgress?: (event: ProgressEvent) => void): DxfData;
|
||||
/**
|
||||
* Loads entities from two dxf data for comparing.
|
||||
* It also creates markup for each change.
|
||||
*/
|
||||
loadEntitiesForCompare(data1: IDxf, data2: IDxf, changes: Record<string, DxfChange>, onProgress?: (event: ProgressEvent) => void): void;
|
||||
private setEntityCompareChangeType;
|
||||
private setBlockEntityCompareChangeType;
|
||||
private addObjectToChange;
|
||||
private createOrUpdateCompareMarkup;
|
||||
private releaseCachedData;
|
||||
/**
|
||||
* Releases memory-costy elements of an entity
|
||||
*/
|
||||
private releaseEntity;
|
||||
/**
|
||||
* Releases memory-costy elements of dxf data
|
||||
*/
|
||||
private releaseDxfData;
|
||||
/**
|
||||
* We'll need to pass in the blockEntity when drawEntity is called from a block.
|
||||
* So that, when an entity's color is ByLayer, and its layer is "0", it should use block's layer,
|
||||
* rather than the layer of the entity itself!
|
||||
* We don't know if there is other similar case in future, so pass in blockEntity here.
|
||||
*/
|
||||
drawEntity(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Object3D | undefined;
|
||||
drawEllipse(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Line | undefined;
|
||||
drawMText(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Object3D | undefined;
|
||||
private getMTextGroup;
|
||||
mtextContentAndFormattingToTextAndStyle(textAndControlChars: any, // eslint-disable-line
|
||||
entity: DxfEntity): {
|
||||
text: any[];
|
||||
lineLength: number;
|
||||
style: {
|
||||
horizontalAlignment: string;
|
||||
textHeight: number | undefined;
|
||||
};
|
||||
};
|
||||
private getTextLineNum;
|
||||
drawSpline(entity: DxfEntity, data: IDxf, 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: THREE.Vector3[], degree: number, knots: number[], interpolationsPerSplineSegment?: number, weights?: number[]): THREE.Vector2[];
|
||||
drawXLine(entity: DxfEntity): THREE.Line | undefined;
|
||||
drawRay(entity: DxfEntity): THREE.Line | undefined;
|
||||
drawLine(entity: DxfEntity): THREE.Line | undefined;
|
||||
drawLWPolyline(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Object3D | undefined;
|
||||
drawMLeader(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Object3D | undefined;
|
||||
drawLeader(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Object3D | undefined;
|
||||
private drawDefaultLeadArrow;
|
||||
private getBlockNameByHandle;
|
||||
static transformAngleByOcsMatrix(ocsMatrix: THREE.Matrix4, angle: number): number;
|
||||
static getArcAnglesByOcsMatrix(ocsMatrix: THREE.Matrix4, startAngle: number, endAngle: number): number[];
|
||||
drawArc(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Line | undefined;
|
||||
addTriangleFacingCamera(verts: THREE.Vector3[], p0: THREE.Vector3, p1: THREE.Vector3, p2: THREE.Vector3): void;
|
||||
drawSolid(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Mesh | undefined;
|
||||
private getDefaultTextStyle;
|
||||
private getDefaultDimensionStyle;
|
||||
private getTextEncoding;
|
||||
private getTextMesh;
|
||||
private transformTextMesh;
|
||||
drawText(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.LineSegments | THREE.Mesh | undefined;
|
||||
drawAttDef(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.LineSegments | THREE.Mesh | undefined;
|
||||
drawAttrib(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.LineSegments | THREE.Mesh | undefined;
|
||||
drawPoint(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Points | undefined;
|
||||
drawDimension(entity: DxfEntity, data: IDxf): THREE.Object3D | undefined;
|
||||
drawInsert(entity: DxfEntity, data: IDxf): THREE.Object3D | undefined;
|
||||
drawSpatialFilter(sfObject: ISpatialFilterObject): THREE.Object3D | undefined;
|
||||
drawLayout(block: IBlock, data: IDxf, layoutName: string, threejsObject: THREE.Object3D, layersAndThreejsObjects: Record<string, THREE.Object3D[]>, // the key is layer name
|
||||
layoutViewportsMap: Record<string, IViewportEntity[]>): void;
|
||||
private convertEdgeToPoints;
|
||||
drawHatch(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Group | undefined;
|
||||
drawOle2frame(entity: DxfEntity, data: IDxf): THREE.Object3D | undefined;
|
||||
static getOcsMatrix(extrusion: THREE.Vector3): THREE.Matrix4;
|
||||
static getDcs2WcsMatrix(viewportEntity: IViewportEntity | IViewPort, angDir: number): THREE.Matrix4;
|
||||
private getViewportMsToPsMatrix;
|
||||
drawViewport(entity: DxfEntity, data: IDxf, blockEntity?: IEntity): THREE.Object3D | undefined;
|
||||
private getColor;
|
||||
private getLineType;
|
||||
/**
|
||||
* Gets entity's layer name.
|
||||
* Note that, when entity is in layer "0", it tries to get its parent blockEntity's layer name.
|
||||
*/
|
||||
private getLayerName;
|
||||
private setMaterial;
|
||||
private setHatchMaterial;
|
||||
private setRenderOrderByObjectType;
|
||||
private getPointsMaterial;
|
||||
private getLineBasicMaterial;
|
||||
private getLineShaderMaterial;
|
||||
private getMeshBasicMaterial;
|
||||
/**
|
||||
* Gets shader material for drawing a hatch with pattern
|
||||
*/
|
||||
private getHatchShaderMaterial;
|
||||
/**
|
||||
* Gets a proper division for curve by entity count, entity size and theta angle, etc.
|
||||
* @param size may not be accurate, can be the radius, long size of bbox, etc.
|
||||
*/
|
||||
getDivision(startAngle: number, endAngle: number, size: number): number;
|
||||
/**
|
||||
* Gets proper simplify tolerance.
|
||||
* If tolerance is bigger, more points are simpified.
|
||||
*/
|
||||
getSimplifyTolerance(blockEntity?: IEntity): number;
|
||||
/**
|
||||
* Catches dxf data into indexedDb
|
||||
*/
|
||||
setDxfDataToIndexedDb(dxfDataId: string, dxf: IDxf): Promise<void>;
|
||||
/**
|
||||
* Gets dxf data into indexedDb
|
||||
*/
|
||||
getDxfDataFromIndexedDb(modelId: string): Promise<IDxf | undefined>;
|
||||
private buildContainHierarchyTree;
|
||||
private buildHatchGeometry;
|
||||
private findIntersectHole;
|
||||
/**
|
||||
* Checks if we should rebase points in case their values are big, and do rebase if necessary
|
||||
*/
|
||||
private checkAndRebasePolygonsOnRTC;
|
||||
/**
|
||||
* Adds "relativeToCenter" flag to indicate an object has been rebased
|
||||
*/
|
||||
private setRTCUserData;
|
||||
private IsfilteredByPathTypeFlag;
|
||||
/**
|
||||
* Finds spatial filter by entity handle.
|
||||
*/
|
||||
private findSpatialFilterByHandle;
|
||||
private entityHandlesWithRenderOrder;
|
||||
/**
|
||||
* Find out render order info from SortEntsTable.
|
||||
*/
|
||||
private initRenderOrderInfo;
|
||||
private findMatchedHatchShaderMaterial;
|
||||
private addViewport;
|
||||
/**
|
||||
* Gets the layout that entity belongs to.
|
||||
* Entities resident in two places:
|
||||
* 1) IDxf.entities
|
||||
* 2) IDxf.blocks[<blockName>].entities
|
||||
*/
|
||||
private getLayoutName;
|
||||
private getLayerVisible;
|
||||
private getLayerFrozen;
|
||||
private cloneMaterialsForSpatialFilter;
|
||||
private getLineTypeScales;
|
||||
static getDxfUnits(unitValue: number): Units;
|
||||
static computeLineDistance(line: THREE.Line): void;
|
||||
static computeLineDistances(object: THREE.Object3D): void;
|
||||
}
|
75
public/demo/libs/types/core/dxf/DxfCompare.d.ts
vendored
75
public/demo/libs/types/core/dxf/DxfCompare.d.ts
vendored
@ -1,75 +0,0 @@
|
||||
import { DxfEntity } from "./DXFLoader";
|
||||
import { IDxf } from "../dxf-parser";
|
||||
export declare enum DxfChangeType {
|
||||
Added = "Added",
|
||||
Removed = "Removed",
|
||||
Modified = "Modified",
|
||||
NoChange = "NoChange"
|
||||
}
|
||||
export interface DxfChange {
|
||||
type: DxfChangeType;
|
||||
handle: string;
|
||||
addedObject?: THREE.Object3D;
|
||||
removedObject?: THREE.Object3D;
|
||||
markup?: THREE.Object3D;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare class DxfCompare {
|
||||
static readonly ENTITY_COLOR_ADDED = 65280;
|
||||
static readonly ENTITY_COLOR_REMOVED = 16711680;
|
||||
static readonly ENTITY_COLOR_NO_CHANGE = 10066329;
|
||||
static readonly ENTITY_COLOR_MARKUP = 16744231;
|
||||
private dxf1;
|
||||
private dxf2;
|
||||
private changes;
|
||||
private comparedBlocks;
|
||||
constructor(dxf1: IDxf, dxf2: IDxf);
|
||||
/**
|
||||
* Compares model spaces of two dxf files.
|
||||
* Returns DxfChange map, the key is entity handle.
|
||||
*/
|
||||
compare(): Record<string, DxfChange>;
|
||||
compareInsertOrDemensionEntities(a: DxfEntity, b: DxfEntity): void;
|
||||
private compareEntities;
|
||||
private entitiesEqual;
|
||||
private baseEntitiesEqual;
|
||||
private arcsEqual;
|
||||
private linesEqual;
|
||||
private polylinesEqual;
|
||||
private textsEqual;
|
||||
private solidsEqual;
|
||||
private pointEntitiesEqual;
|
||||
private splinesEqual;
|
||||
private mtextsEqual;
|
||||
private ellipsesEqual;
|
||||
private attDefsEqual;
|
||||
private attribsEqual;
|
||||
private hatchesEqual;
|
||||
private viewportsEqual;
|
||||
private leadersEqual;
|
||||
private mleadersEqual;
|
||||
private ole2framesEqual;
|
||||
private insertsEqual;
|
||||
private dimensionsEqual;
|
||||
private regionsEqual;
|
||||
private vectorsEqual;
|
||||
private pointsEqual;
|
||||
private vertexEntityEqual;
|
||||
private numbersEqual;
|
||||
private vectorArraysEqual;
|
||||
private verticesEqual;
|
||||
private verticesArrayEqual;
|
||||
private vertexEntitiesEqual;
|
||||
private hatchEdgesEqual;
|
||||
private hatchEdgeArraysEqual;
|
||||
private hatchBoundaryPathsEqual;
|
||||
private hatchBoundaryPathArraysEqual;
|
||||
private mleaderLineEqual;
|
||||
private mleaderLinesEqual;
|
||||
private mleaderLeaderEqual;
|
||||
private mleaderLeadersEqual;
|
||||
private mleaderContextEqual;
|
||||
private compareHexStrings;
|
||||
}
|
@ -1,12 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
export interface PatternLine {
|
||||
origin: THREE.Vector2;
|
||||
delta: THREE.Vector2;
|
||||
angle: number;
|
||||
pattern: number[];
|
||||
patternSum: number[];
|
||||
patternLength: number;
|
||||
}
|
||||
export declare function createHatchPatternShaderMaterial(patternLines: PatternLine[], patternAngle: number, cameraZoomUniform: {
|
||||
value: number;
|
||||
}, color: THREE.Color): THREE.Material;
|
@ -1,12 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
export declare class LinePatternShaders {
|
||||
/**
|
||||
* Creates line shader by given pattern.
|
||||
* Note: remember to call line.computeLineDistances() in order to make it work!
|
||||
*/
|
||||
static createLineShaderMaterial(pattern: number[], color: number, scale: number, viewportScaleUniform: {
|
||||
value: number;
|
||||
}, cameraZoomUniform: {
|
||||
value: number;
|
||||
}): THREE.Material;
|
||||
}
|
8
public/demo/libs/types/core/dxf/bspline.d.ts
vendored
8
public/demo/libs/types/core/dxf/bspline.d.ts
vendored
@ -1,8 +0,0 @@
|
||||
declare const _default: (t: number, degree: number, points: number[][], knots: number[], weights?: number[] | undefined) => number[];
|
||||
/**
|
||||
* Copied and ported to code standard as the b-spline library is not maintained any longer.
|
||||
* Source:
|
||||
* https://github.com/thibauts/b-spline
|
||||
* Copyright (c) 2015 Thibaut Séguy <thibaut.seguy@gmail.com>
|
||||
*/
|
||||
export default _default;
|
35
public/demo/libs/types/core/dxf/dxfom-mtext.d.ts
vendored
35
public/demo/libs/types/core/dxf/dxfom-mtext.d.ts
vendored
@ -1,35 +0,0 @@
|
||||
export declare type DxfMTextContentElement = DxfMTextContentElement[] | string | {
|
||||
/** font family */
|
||||
f?: string;
|
||||
/** bold */
|
||||
b?: 0 | 1;
|
||||
/** italic */
|
||||
i?: 0 | 1;
|
||||
/** code page */
|
||||
c?: number;
|
||||
/** pitch */
|
||||
p?: number;
|
||||
/** angle in degrees */
|
||||
Q?: number;
|
||||
/** character height (with unit) */
|
||||
H?: [number, string];
|
||||
/** character width (with unit) */
|
||||
W?: [number, string];
|
||||
/** stacking */
|
||||
S?: [string, '^' | '/' | '#', string];
|
||||
/** alignment (0: bottom, 1: center, 2: top) */
|
||||
A?: 0 | 1 | 2;
|
||||
/** color index */
|
||||
C?: number;
|
||||
/** character spacing */
|
||||
T?: number;
|
||||
/** underscore */
|
||||
L?: 0 | 1;
|
||||
/** overscore */
|
||||
O?: 0 | 1;
|
||||
/** strike through */
|
||||
K?: 0 | 1;
|
||||
};
|
||||
export declare const parseDxfMTextContent: (s: string, options?: {
|
||||
readonly encoding?: string | TextDecoder | undefined;
|
||||
} | undefined) => DxfMTextContentElement[];
|
16
public/demo/libs/types/core/dxf/dxfom-text.d.ts
vendored
16
public/demo/libs/types/core/dxf/dxfom-text.d.ts
vendored
@ -1,16 +0,0 @@
|
||||
export interface DxfTextContentElement {
|
||||
/** text content */
|
||||
text: string;
|
||||
/** strike-through */
|
||||
k?: 1;
|
||||
/** overscore */
|
||||
o?: 1;
|
||||
/** underscore */
|
||||
u?: 1;
|
||||
}
|
||||
export declare const decodeDxfTextCharacterCodes: (text: string, mbcsEncoding?: string | TextDecoder | undefined) => string;
|
||||
export declare const decodeDxfTextUnicodeCodePoints: (text: string) => string;
|
||||
export declare const decodeDxfTextMbcsCharacterCodes: (text: string, encoding: string | TextDecoder) => string;
|
||||
export declare const parseDxfTextContent: (text: string, options?: {
|
||||
readonly encoding?: string | TextDecoder | undefined;
|
||||
} | undefined) => DxfTextContentElement[];
|
4
public/demo/libs/types/core/dxf/index.d.ts
vendored
4
public/demo/libs/types/core/dxf/index.d.ts
vendored
@ -1,4 +0,0 @@
|
||||
export * from "./DXFLoader";
|
||||
export * from "./bspline";
|
||||
export * from "./dxfom-mtext";
|
||||
export * from "./round10";
|
2
public/demo/libs/types/core/dxf/round10.d.ts
vendored
2
public/demo/libs/types/core/dxf/round10.d.ts
vendored
@ -1,2 +0,0 @@
|
||||
declare const _default: (value: any, exp: any) => number;
|
||||
export default _default;
|
@ -1,46 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
/**
|
||||
* Exploder class is used to explode an object
|
||||
* @internal
|
||||
*/
|
||||
export declare class Exploder {
|
||||
static DEFAULT_SCALE: number;
|
||||
private scene;
|
||||
private objectId;
|
||||
position: THREE.Vector3;
|
||||
private scale;
|
||||
private isExplodeUp;
|
||||
/**
|
||||
* Constructor of Explode
|
||||
* @param objectId target object id, that is going to be exploded
|
||||
* @param position if undefined, will explode object by its center
|
||||
* @param scale scale factor, 1 means 1 time farer away from exploder's position
|
||||
*/
|
||||
constructor(scene: THREE.Scene, objectId: number, position?: THREE.Vector3 | undefined, scale?: number);
|
||||
/**
|
||||
* Explode the object
|
||||
*/
|
||||
explode(): void;
|
||||
/**
|
||||
* Explodes a parent or leaf object
|
||||
*/
|
||||
private explodeObject;
|
||||
/**
|
||||
* Explodes a leaf object (that has geometry, and ususally no children)
|
||||
*/
|
||||
private explodeLeafObject;
|
||||
/**
|
||||
* Unexplode the object
|
||||
*/
|
||||
unexplode(): void;
|
||||
/**
|
||||
* Unexplodes a parent or leaf object
|
||||
*/
|
||||
private unexplodeObject;
|
||||
/**
|
||||
* Unexplodes a leaf object
|
||||
*/
|
||||
private unexplodeLeafObject;
|
||||
setOnlyExplodeUp(onlyExplodeUp: boolean): void;
|
||||
private getObjectCenter;
|
||||
}
|
@ -1 +0,0 @@
|
||||
export * from "./Exploder";
|
@ -1,24 +0,0 @@
|
||||
import JSBI from "jsbi";
|
||||
export declare class BinaryReader {
|
||||
private endian;
|
||||
private position;
|
||||
private data;
|
||||
private decoder;
|
||||
constructor(arraybuffer: ArrayBuffer, endian?: string);
|
||||
readAsciiString(length: number): string;
|
||||
readUtf8String(length: number): string;
|
||||
readBytes(length?: number): Uint8Array;
|
||||
readUint8(): number;
|
||||
readInt8(): number;
|
||||
readUint16(): number;
|
||||
readInt16(): number;
|
||||
readUint32(): number;
|
||||
readInt32(): number;
|
||||
readFloat32(): number;
|
||||
readFloat64(): number;
|
||||
readInt64(): JSBI;
|
||||
readUint64(): JSBI;
|
||||
getPosition(): number;
|
||||
setPosition(position: number): void;
|
||||
IsEnd(): boolean;
|
||||
}
|
@ -1,32 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
import { VRControls } from "../controls/VRControls";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare class ControlsHelper {
|
||||
camera: THREE.PerspectiveCamera | THREE.OrthographicCamera;
|
||||
controls: VRControls;
|
||||
flyDuration: number;
|
||||
autoRotateRemainingTime: number;
|
||||
automaticallyAdjustCameraPosition: boolean;
|
||||
private cameraUpdateInterval?;
|
||||
private rotateIntervalStartTime;
|
||||
private rotateInterval?;
|
||||
constructor(camera: THREE.PerspectiveCamera | THREE.OrthographicCamera, controls: VRControls);
|
||||
/**
|
||||
* Make camera fly to target position with given lookAt position
|
||||
* @param position camera's target position
|
||||
* @param lookAt camera's new lookAt position
|
||||
*/
|
||||
flyTo(position: THREE.Vector3, lookAt: THREE.Vector3, onCompleteCallback?: () => void): void;
|
||||
/**
|
||||
* Adjusts camera direction to look to a certain position. While,
|
||||
* it doesn't mean to set the target position as camera's target.
|
||||
*/
|
||||
lookTo(direction: THREE.Vector3): void;
|
||||
startAutoRotate(): void;
|
||||
delayAutoRotate(): void;
|
||||
startToRotate(e: KeyboardEvent): void;
|
||||
private rotateLeftOrRight;
|
||||
private rotateUpOrDown;
|
||||
}
|
@ -1,122 +0,0 @@
|
||||
import * as dat from "dat.gui";
|
||||
import { BimViewer } from "../viewers/BimViewer";
|
||||
import { DxfViewer } from "../viewers/DxfViewer";
|
||||
import { Exploder } from "../exploder/Exploder";
|
||||
import { VRViewer } from "..";
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare class DatGuiHelper {
|
||||
viewer: BimViewer | undefined;
|
||||
gui?: dat.GUI;
|
||||
exploderDict?: {
|
||||
[objId: number]: Exploder;
|
||||
};
|
||||
/**
|
||||
*
|
||||
* @param viewer pass in the Viewer3D, so we can reference its data members
|
||||
*/
|
||||
constructor(viewer: BimViewer);
|
||||
/**
|
||||
* Defined all controls here, which will be displyed in dat.GUI
|
||||
* Color should follow these formats:
|
||||
* '#ffffff', [0, 0, 0], [0, 0, 0, 0.5], \{ h: 100, s: 0.9, v: 0.3 \}
|
||||
*/
|
||||
readonly controls: {
|
||||
showGroundGrid: boolean;
|
||||
showGrassGround: boolean;
|
||||
skyMode: string[];
|
||||
environments: string[];
|
||||
homeView: () => void;
|
||||
views: string[];
|
||||
OrthographicCamera: boolean;
|
||||
viewpoints: boolean;
|
||||
annotations: boolean;
|
||||
takeSnapshot: () => void;
|
||||
fullScreen: () => void;
|
||||
webcam: boolean;
|
||||
uploadFile: () => void;
|
||||
showBimTree: boolean;
|
||||
showPropertyPanel: boolean;
|
||||
transparentMode: boolean;
|
||||
showVertexNormals: boolean;
|
||||
sectionMode: string[];
|
||||
alVisible: boolean;
|
||||
alColor: string;
|
||||
alIntensity: number;
|
||||
alCastShadow: boolean;
|
||||
dlVisible: boolean;
|
||||
dlColor: string;
|
||||
dlIntensity: number;
|
||||
dlCastShadow: boolean;
|
||||
hlVisible: boolean;
|
||||
hlIntensity: number;
|
||||
hlColor: number[];
|
||||
hlGroundColor: number[];
|
||||
fogEnabled: boolean;
|
||||
fogColor: number;
|
||||
fogNearDistance: number;
|
||||
fogFarDistance: number;
|
||||
composerEnabled: boolean;
|
||||
renderPassEnabled: boolean;
|
||||
fxaaEnabled: boolean;
|
||||
saoEnabled: boolean;
|
||||
ssaoEnabled: boolean;
|
||||
outlineEnabled: boolean;
|
||||
ssaaEnabled: boolean;
|
||||
bloomEnabled: boolean;
|
||||
unrealBloomEnabled: boolean;
|
||||
};
|
||||
/**
|
||||
* Init dat.GUI
|
||||
*/
|
||||
init(): void;
|
||||
private setExplodeMode;
|
||||
open(): void;
|
||||
close(): void;
|
||||
beforeDestroy(): void;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare class VRViewerDatGuiHelper {
|
||||
viewer: VRViewer | undefined;
|
||||
gui?: dat.GUI;
|
||||
constructor(viewer: VRViewer);
|
||||
/**
|
||||
* Defined all controls here, which will be displyed in dat.GUI
|
||||
* Color should follow these formats:
|
||||
* '#ffffff', [0, 0, 0], [0, 0, 0, 0.5], \{ h: 100, s: 0.9, v: 0.3 \}
|
||||
*/
|
||||
readonly controls: {
|
||||
fullScreen: () => void;
|
||||
};
|
||||
/**
|
||||
* Init dat.GUI
|
||||
*/
|
||||
init(): void;
|
||||
open(): void;
|
||||
close(): void;
|
||||
beforeDestroy(): void;
|
||||
}
|
||||
/**
|
||||
* @internal
|
||||
*/
|
||||
export declare class DxfViewerDatGuiHelper {
|
||||
viewer: DxfViewer | undefined;
|
||||
gui?: dat.GUI;
|
||||
constructor(viewer: DxfViewer);
|
||||
/**
|
||||
* Defined all controls here, which will be displyed in dat.GUI
|
||||
* Color should follow these formats:
|
||||
* '#ffffff', [0, 0, 0], [0, 0, 0, 0.5], \{ h: 100, s: 0.9, v: 0.3 \}
|
||||
*/
|
||||
controls: Record<string, any>;
|
||||
/**
|
||||
* Init dat.GUI
|
||||
*/
|
||||
init(): void;
|
||||
open(): void;
|
||||
close(): void;
|
||||
beforeDestroy(): void;
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
/**
|
||||
* InstantiateHelper class is used to instantiate child objects for a given object
|
||||
* @internal
|
||||
*/
|
||||
export declare class InstantiateHelper {
|
||||
object: THREE.Object3D;
|
||||
constructor(object: THREE.Object3D);
|
||||
/**
|
||||
* Instatiates child objects for given object.
|
||||
*/
|
||||
instantiate(): void;
|
||||
/**
|
||||
* Instatiates child objects of given object.
|
||||
* If objects' geometry and material are the same, they can be instanced.
|
||||
*/
|
||||
private instantiateInner;
|
||||
/**
|
||||
* Removes a number from array
|
||||
*/
|
||||
removeFromArray(arr: number[], toBeRemoved: number): void;
|
||||
/**
|
||||
* Checks if two geometries equal
|
||||
*/
|
||||
private geometryEquals;
|
||||
}
|
@ -1,41 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
import { DxfData } from "../dxf";
|
||||
import { ShxFont } from "../shx-parser/ShxFont";
|
||||
import { Font } from "three/examples/jsm/loaders/FontLoader";
|
||||
export declare class LoadingHelper {
|
||||
private gltfLoader?;
|
||||
private font?;
|
||||
/**
|
||||
* Loads a model from local
|
||||
* @param url Created by URL.createObjectURL(file)
|
||||
* @param src Source filename, used to find out format
|
||||
* @param onProgress On progress callback
|
||||
* @returns Loaded object
|
||||
*/
|
||||
loadLocalModel(url: string, src: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
loadModel(src: string, fileFormat?: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D | void>;
|
||||
loadGltf(url: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
parseGltf(data: ArrayBuffer | string, path: string, onLoad: (object: THREE.Object3D) => void, onError?: (event: ErrorEvent) => void): void;
|
||||
loadFbx(url: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
loadObj(url: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
loadStl(url: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
loadIfc(url: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
loadShp(url: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
loadDae(url: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
loadDxf(url: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
loadPly(url: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
/**
|
||||
* It is kind of tricky to load image into scene, but we'll do this by creating a sprite.
|
||||
*/
|
||||
loadImage(url: string, onProgress?: (event: ProgressEvent) => void): Promise<THREE.Object3D>;
|
||||
/**
|
||||
* Loads dxf data, including entities, tables(layers, blocks), etc.
|
||||
*/
|
||||
loadDxfDataAsync(url: string, onProgress?: (event: ProgressEvent) => void, onLoad?: () => void, ignorePaperSpace?: boolean): Promise<DxfData>;
|
||||
/**
|
||||
* Sets font.
|
||||
* Font is required for DxfViewer to view Chinese, etc.
|
||||
*/
|
||||
setFont(font: Font | ShxFont): void;
|
||||
private getGltfLoader;
|
||||
}
|
@ -1,39 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
import { SVGObject } from "../patches/SVGRenderer";
|
||||
export declare enum OSnapType {
|
||||
None = 0,
|
||||
StartPoint = 1,
|
||||
EndPoint = 2,
|
||||
MiddlePoint = 4,
|
||||
PointOnLine = 8,
|
||||
Intersection = 16,
|
||||
FootOfPerpendicular = 32
|
||||
}
|
||||
export declare class OSnapHelper {
|
||||
private scene;
|
||||
private camera;
|
||||
private markers;
|
||||
private activeOSnapType;
|
||||
constructor(scene: THREE.Scene, camera: THREE.Camera);
|
||||
private initOSnapMarkers;
|
||||
getMarker(type: OSnapType): SVGObject;
|
||||
deactivate(): void;
|
||||
destroy(): void;
|
||||
/**
|
||||
* Tries to find a proper snap point and display corresponding marker.
|
||||
* @param intersections
|
||||
* @returns Target snap point if any
|
||||
*/
|
||||
handleSnap(intersections: THREE.Intersection[], mouseDownPosition: THREE.Vector3, completed: boolean | undefined): THREE.Vector3 | undefined;
|
||||
private activateMarker;
|
||||
/**
|
||||
* Gets possible osnap info for an intersection
|
||||
*/
|
||||
private getOSnapInfo;
|
||||
/**
|
||||
* Gets start/end point of a line for an intersection
|
||||
*/
|
||||
private getStartAndEndPoints;
|
||||
private getFootOfPerpendicular;
|
||||
protected getSnapTolerance(): number;
|
||||
}
|
@ -1,13 +0,0 @@
|
||||
import * as THREE from "three";
|
||||
import { OrbitControls } from "three/examples/jsm/controls/OrbitControls";
|
||||
/**
|
||||
* Helper class to adjust object visual size
|
||||
*/
|
||||
export declare class ObjectPixelSizeHelper {
|
||||
private object;
|
||||
private camera;
|
||||
targetPixelHeight: number;
|
||||
canvasHeight: number;
|
||||
constructor(camera: THREE.Camera, controls: OrbitControls, object: THREE.Object3D, targetPixelHeight: number, canvasHeight: number);
|
||||
adjustSize(): void;
|
||||
}
|
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user