forked from RyugaRyuzaki/powerbi_openbim-components
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
RyugaRyuzaki
committed
Sep 20, 2023
0 parents
commit 62248ed
Showing
109 changed files
with
174,893 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
assets | ||
style | ||
dist | ||
node_modules | ||
.eslintrc.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
env: { | ||
"browser": true, | ||
"es6": true, | ||
"es2017": true | ||
}, | ||
root: true, | ||
parser: "@typescript-eslint/parser", | ||
parserOptions: { | ||
project: "tsconfig.json", | ||
tsconfigRootDir: ".", | ||
}, | ||
plugins: [ | ||
"powerbi-visuals" | ||
], | ||
extends: [ | ||
"plugin:powerbi-visuals/recommended" | ||
], | ||
rules: {} | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
node_modules | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
import powerbiVisualsApi from "powerbi-visuals-api"; | ||
import IVisualPlugin = powerbiVisualsApi.visuals.plugins.IVisualPlugin; | ||
declare var exampleD7B3346A52CC4CC7A469ED9D0938BF65: IVisualPlugin; | ||
export default exampleD7B3346A52CC4CC7A469ED9D0938BF65; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
import * as THREE from "three"; | ||
import { Context } from "./core"; | ||
import { MaterialManager } from "./material/MaterialManager"; | ||
import { IfcLoader } from "./model/ifc/IfcLoader"; | ||
export declare class BimModel { | ||
private container; | ||
private canvas; | ||
/** | ||
* | ||
*/ | ||
scene: THREE.Scene; | ||
material: MaterialManager; | ||
context: Context; | ||
ifcLoader: IfcLoader; | ||
constructor(container: HTMLDivElement, canvas: HTMLCanvasElement); | ||
loadModel(buffer: Uint8Array, btn: HTMLButtonElement): void; | ||
private loadFragment; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Simple event handler by | ||
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). | ||
* Keep in mind that: | ||
* - If you want to remove it later, you might want to declare the callback as | ||
* an object. | ||
* - If you want to maintain the reference to `this`, you will need to declare | ||
* the callback as an arrow function. | ||
*/ | ||
export declare class Event<T> { | ||
/** | ||
* Add a callback to this event instance. | ||
* @param handler - the callback to be added to this event. | ||
*/ | ||
on(handler: T extends void ? { | ||
(): void; | ||
} : { | ||
(data: T): void; | ||
}): void; | ||
/** | ||
* Removes a callback from this event instance. | ||
* @param handler - the callback to be removed from this event. | ||
*/ | ||
off(handler: T extends void ? { | ||
(): void; | ||
} : { | ||
(data: T): void; | ||
}): void; | ||
/** | ||
* Triggers all the callbacks assigned to this event. | ||
*/ | ||
trigger: T extends void ? { | ||
(): void; | ||
} : { | ||
(data?: T): void; | ||
}; | ||
/** | ||
* Gets rid of all the suscribed events. | ||
*/ | ||
reset(): void; | ||
private handlers; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,85 @@ | ||
import { BoxGeometry, EdgesGeometry, LineSegments, Mesh, Scene } from "three"; | ||
import { TextGeometry } from "three/examples/jsm/geometries/TextGeometry.js"; | ||
/** | ||
* @param {Object three JS} scene | ||
* @param {class or object} material => material manager | ||
*/ | ||
export declare class BoxCube { | ||
private _scene; | ||
private _material; | ||
private _loader; | ||
private _font; | ||
constructor(scene: Scene, material: any); | ||
/** | ||
* release memories | ||
*/ | ||
dispose(): void; | ||
private init; | ||
/** | ||
* | ||
* @param {*} item | ||
*/ | ||
static disposeItem(item: any): void; | ||
/** | ||
* | ||
* @param {*} name | ||
* @param {*} x0 | ||
* @param {*} y0 | ||
* @param {*} z0 | ||
* @param {*} x1 | ||
* @param {*} y1 | ||
* @param {*} z1 | ||
* @returns | ||
*/ | ||
private initItem; | ||
/** | ||
* | ||
* @returns | ||
*/ | ||
private initRing; | ||
/** | ||
* | ||
* @returns | ||
*/ | ||
initOutLine(): LineSegments<EdgesGeometry<BoxGeometry>, any>; | ||
/** | ||
* | ||
* @param {*} scene | ||
* @param {*} name | ||
* @param {*} x1 | ||
* @param {*} y1 | ||
* @param {*} z1 | ||
* @returns | ||
*/ | ||
initTextSide(name: any, x1: any, y1: any, z1: any): Mesh<TextGeometry, any, import("three").Object3DEventMap>; | ||
/** | ||
* | ||
* @param {*} scene | ||
* @param {*} name | ||
* @param {*} nameText | ||
* @param {*} x1 | ||
* @param {*} y1 | ||
* @param {*} z1 | ||
* @returns | ||
*/ | ||
initTextRing(name: any, x1: any, y1: any, z1: any): Mesh<TextGeometry, any, import("three").Object3DEventMap>; | ||
/** | ||
* | ||
* @param {*} name | ||
* @param {*} textCube | ||
*/ | ||
rotateRing(name: string, textCube: TextGeometry): void; | ||
/** | ||
* | ||
* @param {*} name | ||
* @param {*} textCube | ||
*/ | ||
rotateTextCube(name: any, textCube: any): void; | ||
} | ||
/** | ||
* | ||
* @param {*} view | ||
* @param {*} name | ||
* @returns | ||
*/ | ||
export declare function switchPick(contextCamera: any, name: any): void; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import * as THREE from "three"; | ||
import CameraControls from "camera-controls"; | ||
export declare class Camera { | ||
maxFar: number; | ||
minFar: number; | ||
radius: number; | ||
private _size; | ||
set size(size: THREE.Vector2); | ||
get size(): THREE.Vector2; | ||
private _protection; | ||
set projection(projection: boolean); | ||
get projection(): boolean; | ||
private static getSubsetOfThree; | ||
private setupCameraControls; | ||
private _domElement; | ||
private _OrthographicCamera; | ||
private _PerspectiveCamera; | ||
currentCamera: THREE.PerspectiveCamera | THREE.OrthographicCamera; | ||
controls: CameraControls; | ||
private initPerspectiveCamera; | ||
private initOrthographicCamera; | ||
/** | ||
* | ||
*/ | ||
constructor(domElement: HTMLDivElement | HTMLCanvasElement, size: THREE.Vector2); | ||
dispose(): void; | ||
update(delta?: number): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import * as THREE from "three"; | ||
import { Camera } from "./Camera"; | ||
import { Renderer } from "./Renderer"; | ||
import { RayCaster } from "./RayCaster"; | ||
import { Event } from "../Event"; | ||
import { ViewPoint } from "./ViewPoint"; | ||
export declare class Context { | ||
onInitialized: Event<Context>; | ||
private _clock; | ||
private _axes; | ||
private initAxes; | ||
private _ambientLight; | ||
private initAmbientLight; | ||
private _directionalLight; | ||
private initDirectionalLight; | ||
private _size; | ||
set size(size: THREE.Vector2); | ||
get size(): THREE.Vector2; | ||
set OrbitPoint(point: THREE.Vector3); | ||
private _viewSphere; | ||
set viewSphere(viewSphere: THREE.Sphere); | ||
get viewSphere(): THREE.Sphere; | ||
fitToModelLoaded(sphere: THREE.Sphere): void; | ||
fitToSphere(sphere: THREE.Sphere): void; | ||
renderer: Renderer; | ||
camera: Camera; | ||
RayCaster: RayCaster; | ||
private _scene; | ||
private _container; | ||
private _material; | ||
private _canvas; | ||
private _cubeView; | ||
private _postProduction; | ||
viewPoint: ViewPoint; | ||
constructor(scene: THREE.Scene, container: HTMLDivElement, canvas: HTMLCanvasElement, material: any); | ||
dispose(): void; | ||
/** | ||
* resize window | ||
*/ | ||
set resize(resize: boolean); | ||
set keyEvent(keyEvent: boolean); | ||
onResize: (e: any) => void; | ||
keyShift: boolean; | ||
onKeyDown: (e: any) => void; | ||
onKeyUp: (e: any) => void; | ||
render(): void; | ||
private update; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
import { AmbientLight, DirectionalLight, PerspectiveCamera, OrthographicCamera, Raycaster, Scene, Vector2, WebGLRenderer } from "three"; | ||
import { BoxCube } from "./BoxCube"; | ||
import { Camera } from "."; | ||
/** | ||
* Cube View Class | ||
*/ | ||
export declare class CubeView { | ||
radius: number; | ||
scene: Scene; | ||
private canvas; | ||
private initCanvas; | ||
container: HTMLDivElement; | ||
private initContainer; | ||
_size: Vector2; | ||
set size(size: Vector2); | ||
get size(): Vector2; | ||
_boxCube: BoxCube; | ||
renderer: WebGLRenderer; | ||
/** | ||
*initialize renderer | ||
*/ | ||
private initRenderer; | ||
/** | ||
* | ||
*/ | ||
_PerspectiveCamera: PerspectiveCamera; | ||
private initPerspectiveCamera; | ||
_OrthographicCamera: OrthographicCamera; | ||
private initOrthographicCamera; | ||
camera: PerspectiveCamera | OrthographicCamera; | ||
private initCamera; | ||
_contextContainer: HTMLDivElement; | ||
_contextCamera: Camera; | ||
_material: any; | ||
constructor(contextContainer: HTMLDivElement, contextCamera: Camera, material: any); | ||
/** | ||
* release memories | ||
*/ | ||
dispose(): void; | ||
/** | ||
* initialize light | ||
*/ | ||
_AmbientLight: AmbientLight; | ||
_DirectionalLight: DirectionalLight; | ||
private initLight; | ||
/** | ||
*initialize raycaster | ||
*/ | ||
mouse: Vector2; | ||
rayCaster: Raycaster; | ||
initRayCaster(): void; | ||
/** | ||
* | ||
* @param {Event} event | ||
* @returns {object} object to wanna cast | ||
*/ | ||
cast(event: any): import("three").Intersection<import("three").Object3D<import("three").Object3DEventMap>>[]; | ||
/** | ||
*event when hover on Box | ||
*/ | ||
set event(event: boolean); | ||
mousemove: (event: any) => void; | ||
mouseout: (event: any) => void; | ||
onClick: (event: any) => void; | ||
_found: any | null; | ||
set found(event: any); | ||
get found(): any; | ||
/** | ||
* reset material with only object is children of scene has userData.Element=true or not null | ||
*/ | ||
resetMaterial(): void; | ||
/** | ||
* | ||
* @param {boolean} visible toggle visibility | ||
*/ | ||
onVisibility(visible: any): void; | ||
/** | ||
* must be called this function will | ||
*/ | ||
update(): void; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
/** | ||
* Simple event handler by | ||
* [Jason Kleban](https://gist.github.com/JasonKleban/50cee44960c225ac1993c922563aa540). | ||
* Keep in mind that: | ||
* - If you want to remove it later, you might want to declare the callback as | ||
* an object. | ||
* - If you want to maintain the reference to `this`, you will need to declare | ||
* the callback as an arrow function. | ||
*/ | ||
export declare class Event<T> { | ||
/** | ||
* Add a callback to this event instance. | ||
* @param handler - the callback to be added to this event. | ||
*/ | ||
on(handler: T extends void ? { | ||
(): void; | ||
} : { | ||
(data: T): void; | ||
}): void; | ||
/** | ||
* Removes a callback from this event instance. | ||
* @param handler - the callback to be removed from this event. | ||
*/ | ||
off(handler: T extends void ? { | ||
(): void; | ||
} : { | ||
(data: T): void; | ||
}): void; | ||
/** | ||
* Triggers all the callbacks assigned to this event. | ||
*/ | ||
trigger: T extends void ? { | ||
(): void; | ||
} : { | ||
(data?: T): void; | ||
}; | ||
/** | ||
* Gets rid of all the suscribed events. | ||
*/ | ||
reset(): void; | ||
private handlers; | ||
} |
Oops, something went wrong.