mirror of https://gitee.com/cf-fz/WebCAD.git
parent
9c98cdd38f
commit
253d16794c
@ -1,46 +1,46 @@
|
||||
import * as THREE from 'three';
|
||||
|
||||
import { Mesh, MeshBasicMaterial, OctahedronGeometry } from 'three';
|
||||
import { ColorMaterial } from '../../Common/ColorPalette';
|
||||
import { Axes } from './Axes';
|
||||
import { AxisType, CoorAxes } from './CoorAxes';
|
||||
|
||||
|
||||
export class TranslateAxex extends CoorAxes
|
||||
{
|
||||
m_ActiveIndex: number = 0;
|
||||
private m_OriginFace: THREE.Mesh;
|
||||
_ActiveIndex: number = 0;
|
||||
private _OriginFace: Mesh;
|
||||
|
||||
constructor()
|
||||
{
|
||||
super();
|
||||
|
||||
//原点面.
|
||||
let orignGeo = new THREE.OctahedronGeometry(0.1, 0);
|
||||
let originMat = new THREE.MeshBasicMaterial({
|
||||
let orignGeo = new OctahedronGeometry(0.1, 0);
|
||||
let originMat = new MeshBasicMaterial({
|
||||
transparent: true,
|
||||
color: ColorMaterial.GetColor(2),
|
||||
opacity: 0.1
|
||||
});
|
||||
this.m_OriginFace = new THREE.Mesh(orignGeo, originMat);
|
||||
this.m_OriginFace.userData.Axis = AxisType.Origin;
|
||||
this.add(this.m_OriginFace);
|
||||
this._OriginFace = new Mesh(orignGeo, originMat);
|
||||
this._OriginFace.userData.Axis = AxisType.Origin;
|
||||
this.add(this._OriginFace);
|
||||
}
|
||||
|
||||
set AxtiveIndex(v: number)
|
||||
{
|
||||
this.m_ActiveIndex = v;
|
||||
this._ActiveIndex = v;
|
||||
let cir = this.children[v - 1] as Axes;
|
||||
cir.Material = ColorMaterial.GetLineMaterial(2);
|
||||
}
|
||||
get AxtiveIndex()
|
||||
{
|
||||
return this.m_ActiveIndex;
|
||||
return this._ActiveIndex;
|
||||
}
|
||||
|
||||
Rest()
|
||||
{
|
||||
super.Rest();
|
||||
this.m_ActiveIndex = 0;
|
||||
let mat = this.m_OriginFace.material as THREE.MeshBasicMaterial;
|
||||
this._ActiveIndex = 0;
|
||||
let mat = this._OriginFace.material as MeshBasicMaterial;
|
||||
mat.transparent = true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in new issue