diff --git a/src/DatabaseServices/MaterialDictionary.ts b/src/DatabaseServices/MaterialDictionary.ts index d75234673..5fb77f797 100644 --- a/src/DatabaseServices/MaterialDictionary.ts +++ b/src/DatabaseServices/MaterialDictionary.ts @@ -1,5 +1,4 @@ -import * as THREE from 'three'; - +import { Material, MeshPhysicalMaterial } from "three"; export const MaterialNeedUpdateKey = "needUpdateImg"; @@ -9,17 +8,17 @@ export const MaterialNeedUpdateKey = "needUpdateImg"; export class MaterialDictionary { - MaterialDict: Map; + MaterialDict: Map; MaterialCallback: Map; private _cout = 0;//Id 分配器. constructor() { - this.MaterialDict = new Map(); + this.MaterialDict = new Map(); this.MaterialCallback = new Map(); } //添加材质.. - addMaterial(mat: THREE.Material) + addMaterial(mat: Material) { this.extendObservable(mat, this._cout); this.MaterialDict.set(this._cout, mat); @@ -27,11 +26,11 @@ export class MaterialDictionary } createMaterial() { - let mat = new THREE.MeshPhysicalMaterial({ roughness: 0.2, metalness: 0.2, bumpScale: 0.0005 }); + let mat = new MeshPhysicalMaterial({ roughness: 0.2, metalness: 0.2, bumpScale: 0.0005 }); mat.name = "材质" + this._cout; this.addMaterial(mat); } - extendObservable(mat: THREE.Material, id: number) + extendObservable(mat: Material, id: number) { // let mobxData: Object = {}; @@ -41,7 +40,7 @@ export class MaterialDictionary // for (let key of colorList) // { // let newKey = "mobx_" + key; - // mobxData[newKey] = "#" + (mat[key] as THREE.Color).getHexString(); + // mobxData[newKey] = "#" + (mat[key] as Color).getHexString(); // } // for (let d of ["name", "transparent", "roughness", "metalness", "opacity", "depthTest", "map", "bumpMap", "bumpScale", "roughnessMap"]) // { @@ -56,14 +55,14 @@ export class MaterialDictionary // { // for (let key of colorList) // { - // (mat[key] as THREE.Color).set(mat["mobx_" + key]) + // (mat[key] as Color).set(mat["mobx_" + key]) // } // }) // this.MaterialCallback.set(id, mobxRemove); } - getMaterial(id: number): THREE.Material + getMaterial(id: number): Material { return this.MaterialDict.get(Number(id)); } @@ -74,4 +73,4 @@ export class MaterialDictionary if (callback) callback(); this.MaterialCallback.delete(id); } -} \ No newline at end of file +} diff --git a/src/DatabaseServices/MaterialTable.ts b/src/DatabaseServices/MaterialTable.ts index 3746a4fdf..5da6cdb7c 100644 --- a/src/DatabaseServices/MaterialTable.ts +++ b/src/DatabaseServices/MaterialTable.ts @@ -1,6 +1,5 @@ import { SymbolTable } from "./SymbolTable"; import { PhysicalMaterialRecord } from "./PhysicalMaterialRecord"; -import { Status } from "../Common/Status"; export class MaterialTable extends SymbolTable { diff --git a/src/DatabaseServices/PointInPolyline.ts b/src/DatabaseServices/PointInPolyline.ts index 4da7e1d68..463dc8aa3 100644 --- a/src/DatabaseServices/PointInPolyline.ts +++ b/src/DatabaseServices/PointInPolyline.ts @@ -9,9 +9,9 @@ import { Polyline } from './Entity/Polyline'; * 点在扇形内部,提供一个简单实现的版本. * 优化版本请参照:http://www.cnblogs.com/miloyip/archive/2013/04/19/3029852.html * - * @param {Arc} arc 二维圆弧 - * @param {Vector3} pt - * @returns {boolean} 点在扇形内部. + * @param arc 二维圆弧 + * @param pt + * @returns 点在扇形内部. */ function IsPointInCircularSector(arc: Arc, pt: Vector3): boolean { @@ -26,10 +26,10 @@ function IsPointInCircularSector(arc: Arc, pt: Vector3): boolean /** * 点在弓型内部 * - * @param {Arc} arc 二维圆弧 - * @param {Vector3} pt 点 - * @param {boolean} isInChrodIsTrue 当点在弦上也认为在弓形内部 - * @returns {boolean} 点在内部 + * @param arc 二维圆弧 + * @param pt 点 + * @param isInChrodIsTrue 当点在弦上也认为在弓形内部 + * @returns 点在内部 */ export function IsPointInBowArc(arc: Arc, pt: Vector3, isInChrodIsTrue = false): boolean { @@ -56,11 +56,9 @@ export function IsPointInBowArc(arc: Arc, pt: Vector3, isInChrodIsTrue = false): /** * 判断点在多段线内外 - * - * @export - * @param {Polyline} pl 多段线 - * @param {Vector3} pt 点 - * @returns {boolean} 点在多段线内部 + * @param pl 多段线 + * @param pt 点 + * @returns 点在多段线内部 */ export function IsPointInPolyLine(pl: Polyline, pt: Vector3): boolean { @@ -160,8 +158,8 @@ export function IsPointInPolyLine(pl: Polyline, pt: Vector3): boolean /** * 点在区域内部 * - * @param {Vector3} pt - * @param {Vector2[]} pts + * @param pt + * @param pts * @returns */ function IsPointInPolygon(pt: Vector3, pts: Vector2[])