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 { ColorMaterial } from '../../Common/ColorPalette';
|
||||||
import { Axes } from './Axes';
|
import { Axes } from './Axes';
|
||||||
import { AxisType, CoorAxes } from './CoorAxes';
|
import { AxisType, CoorAxes } from './CoorAxes';
|
||||||
|
|
||||||
|
|
||||||
export class TranslateAxex extends CoorAxes
|
export class TranslateAxex extends CoorAxes
|
||||||
{
|
{
|
||||||
m_ActiveIndex: number = 0;
|
_ActiveIndex: number = 0;
|
||||||
private m_OriginFace: THREE.Mesh;
|
private _OriginFace: Mesh;
|
||||||
|
|
||||||
constructor()
|
constructor()
|
||||||
{
|
{
|
||||||
super();
|
super();
|
||||||
|
|
||||||
//原点面.
|
//原点面.
|
||||||
let orignGeo = new THREE.OctahedronGeometry(0.1, 0);
|
let orignGeo = new OctahedronGeometry(0.1, 0);
|
||||||
let originMat = new THREE.MeshBasicMaterial({
|
let originMat = new MeshBasicMaterial({
|
||||||
transparent: true,
|
transparent: true,
|
||||||
color: ColorMaterial.GetColor(2),
|
color: ColorMaterial.GetColor(2),
|
||||||
opacity: 0.1
|
opacity: 0.1
|
||||||
});
|
});
|
||||||
this.m_OriginFace = new THREE.Mesh(orignGeo, originMat);
|
this._OriginFace = new Mesh(orignGeo, originMat);
|
||||||
this.m_OriginFace.userData.Axis = AxisType.Origin;
|
this._OriginFace.userData.Axis = AxisType.Origin;
|
||||||
this.add(this.m_OriginFace);
|
this.add(this._OriginFace);
|
||||||
}
|
}
|
||||||
|
|
||||||
set AxtiveIndex(v: number)
|
set AxtiveIndex(v: number)
|
||||||
{
|
{
|
||||||
this.m_ActiveIndex = v;
|
this._ActiveIndex = v;
|
||||||
let cir = this.children[v - 1] as Axes;
|
let cir = this.children[v - 1] as Axes;
|
||||||
cir.Material = ColorMaterial.GetLineMaterial(2);
|
cir.Material = ColorMaterial.GetLineMaterial(2);
|
||||||
}
|
}
|
||||||
get AxtiveIndex()
|
get AxtiveIndex()
|
||||||
{
|
{
|
||||||
return this.m_ActiveIndex;
|
return this._ActiveIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
Rest()
|
Rest()
|
||||||
{
|
{
|
||||||
super.Rest();
|
super.Rest();
|
||||||
this.m_ActiveIndex = 0;
|
this._ActiveIndex = 0;
|
||||||
let mat = this.m_OriginFace.material as THREE.MeshBasicMaterial;
|
let mat = this._OriginFace.material as MeshBasicMaterial;
|
||||||
mat.transparent = true;
|
mat.transparent = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in new issue