|
|
@ -1,6 +1,6 @@
|
|
|
|
import * as THREE from 'three';
|
|
|
|
import * as THREE from 'three';
|
|
|
|
|
|
|
|
|
|
|
|
import { GetColorFormIndex, GetColorIndex } from '../Common/ColorPalette';
|
|
|
|
import { ColorMaterial } from '../Common/ColorPalette';
|
|
|
|
import { SetMaterial } from '../Common/SetMaterial';
|
|
|
|
import { SetMaterial } from '../Common/SetMaterial';
|
|
|
|
import { CameraControls } from '../Editor/CameraControls';
|
|
|
|
import { CameraControls } from '../Editor/CameraControls';
|
|
|
|
import { Viewer } from '../GraphicsSystem/Viewer';
|
|
|
|
import { Viewer } from '../GraphicsSystem/Viewer';
|
|
|
@ -61,7 +61,7 @@ export class WebCADView
|
|
|
|
|
|
|
|
|
|
|
|
// edge.applyMatrix(move)
|
|
|
|
// edge.applyMatrix(move)
|
|
|
|
if (!color) color = 7;
|
|
|
|
if (!color) color = 7;
|
|
|
|
var line = new THREE.LineSegments(edge, new THREE.LineBasicMaterial({ color: GetColorFormIndex(color) }));
|
|
|
|
var line = new THREE.LineSegments(edge, ColorMaterial.GetLineMaterial(color));
|
|
|
|
line.userData = color;
|
|
|
|
line.userData = color;
|
|
|
|
this.m_Viewer.m_Scene.add(line);
|
|
|
|
this.m_Viewer.m_Scene.add(line);
|
|
|
|
|
|
|
|
|
|
|
@ -89,7 +89,7 @@ export class WebCADView
|
|
|
|
let fbxObj = await loadFBX(pathUrl + element.fileName);
|
|
|
|
let fbxObj = await loadFBX(pathUrl + element.fileName);
|
|
|
|
if (fbxObj.State)
|
|
|
|
if (fbxObj.State)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let Material = GetColorIndex(element.Color);
|
|
|
|
let Material = ColorMaterial.GetLineMaterial(element.Color);
|
|
|
|
SetMaterial(fbxObj.object, Material);
|
|
|
|
SetMaterial(fbxObj.object, Material);
|
|
|
|
this.m_Viewer.m_Scene.add(fbxObj.object);
|
|
|
|
this.m_Viewer.m_Scene.add(fbxObj.object);
|
|
|
|
|
|
|
|
|
|
|
@ -173,7 +173,7 @@ export class WebCADView
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (let e of this.m_EdgeEntitytList)
|
|
|
|
for (let e of this.m_EdgeEntitytList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
(<THREE.LineBasicMaterial>e.material).color = GetColorFormIndex(7);
|
|
|
|
(<THREE.LineBasicMaterial>e.material).color = ColorMaterial.GetColor(7);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
EdgeShow()
|
|
|
|
EdgeShow()
|
|
|
@ -184,7 +184,7 @@ export class WebCADView
|
|
|
|
}
|
|
|
|
}
|
|
|
|
for (let e of this.m_EdgeEntitytList)
|
|
|
|
for (let e of this.m_EdgeEntitytList)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
(<THREE.LineBasicMaterial>e.material).color = GetColorFormIndex(e.userData);
|
|
|
|
(<THREE.LineBasicMaterial>e.material).color = ColorMaterial.GetColor(e.userData);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|