!1043 功能:带线框真实视图

pull/1043/MERGE
ZoeLeeFZ 4 years ago committed by ChenX
parent bcc9015739
commit 737bbc97b4

@ -25,3 +25,10 @@ export class CMD_Physical implements Command
userConfig.RenderType = RenderType.Physical;
}
}
export class CMD_Physical2 implements Command
{
exec()
{
userConfig.RenderType = RenderType.Physical2;
}
}

@ -327,7 +327,7 @@ export class ExtrudeHole extends Hole
{
return new LineSegments(this.EdgeGeometry, ColorMaterial.GetLineMaterial(this.ColorIndex));
}
else if (renderType === RenderType.Conceptual || renderType === RenderType.Physical)
else if (renderType === RenderType.Conceptual || renderType === RenderType.Physical || renderType === RenderType.Physical2)
{
return new Object3D().add(
new Mesh(this.MeshGeometry, ColorMaterial.GetConceptualMaterial(this.ColorIndex)),
@ -365,7 +365,7 @@ export class ExtrudeHole extends Hole
l.geometry = this.EdgeGeometry;
l.material = ColorMaterial.GetLineMaterial(this.ColorIndex);
}
else if (renderType === RenderType.Conceptual || renderType === RenderType.Physical)
else if (renderType === RenderType.Conceptual || renderType === RenderType.Physical || renderType === RenderType.Physical2)
{
return obj.add(
new Mesh(this.MeshGeometry, ColorMaterial.GetConceptualMaterial(this.ColorIndex)),

@ -176,6 +176,13 @@ export class SweepSolid extends Entity
{
return new Object3D().add(this._PathCurve.DrawObject);
}
else if (renderType === RenderType.Physical2)
{
return new Object3D().add(
new Mesh(this.MeshGeometry, this.MeshMaterial),
new LineSegments(this.EdgeGeometry, ColorMaterial.GetLineMaterial(7))
);
}
}
UpdateDrawGeometry()
@ -210,6 +217,13 @@ export class SweepSolid extends Entity
{
obj.add((this._PathCurve.DrawObject));
}
else if (renderType === RenderType.Physical2)
{
return obj.add(
new Mesh(this.MeshGeometry, this.MeshMaterial),
new LineSegments(this.EdgeGeometry, ColorMaterial.GetLineMaterial(7))
);
}
}
/**
@ -227,6 +241,11 @@ export class SweepSolid extends Entity
let mesh = obj.children[0] as Mesh;
mesh.material = ColorMaterial.GetConceptualMaterial(this.ColorIndex);
}
else if (type === RenderType.Physical2)
{
let mesh = obj.children[0] as Mesh;
mesh.material = this.MeshMaterial;
}
else
{
let mesh = obj as Mesh;

@ -1389,6 +1389,17 @@ export class ExtrudeSolid extends Entity
return new Object3D().add(line, mesh);
}
else if (renderType === RenderType.Physical2)
{
let mesh = new Mesh(this.MeshGeometry, this.MeshMaterial);
mesh.castShadow = true;
mesh.receiveShadow = true;
return new Object3D().add(
mesh,
new LineSegments(this.EdgeGeometry, ColorMaterial.GetLineMaterial(7))
);
}
}
get UCGenerator()
{
@ -1679,6 +1690,17 @@ export class ExtrudeSolid extends Entity
else if (renderType === RenderType.Print)
{
}
else if (renderType === RenderType.Physical2)
{
let mesh = new Mesh(this.MeshGeometry, this.MeshMaterial);
mesh.castShadow = true;
mesh.receiveShadow = true;
return obj.add(
mesh,
new LineSegments(this.EdgeGeometry, ColorMaterial.GetLineMaterial(7))
);
}
}
UpdateDrawObjectMaterial(renderType: RenderType, obj: Object3D)
@ -1693,6 +1715,11 @@ export class ExtrudeSolid extends Entity
let mesh = obj.children[0] as Mesh;
mesh.material = ColorMaterial.GetConceptualMaterial(this.ColorIndex);
}
else if (renderType === RenderType.Physical2)
{
let mesh = obj.children[0] as Mesh;
mesh.material = this.MeshMaterial;
}
else
{
let mesh = obj as Mesh;

@ -125,7 +125,7 @@ import { Command_ShowProcessingGroupModal2 } from "../Add-on/ShowProcessingGroup
import { Stretch } from "../Add-on/Stretch";
import { Sweep } from "../Add-on/Sweep";
import { Command_SwitchCamera } from "../Add-on/SwitchCamera";
import { CMD_Conceptual, CMD_Physical, CMD_Wireframe } from "../Add-on/SwitchVisualStyles";
import { CMD_Conceptual, CMD_Physical, CMD_Wireframe, CMD_Physical2 } from "../Add-on/SwitchVisualStyles";
import { Command_DisableSyncData, Command_EnableSyncData, Command_ToggleSyncData } from "../Add-on/SyncData";
import { DrawTangentLine } from "../Add-on/Tangent";
import { DrawVisualSpaceBox } from "../Add-on/Template/DrawVisualSpaceBox";
@ -412,6 +412,7 @@ export function registerCommand()
commandMachine.RegisterCommand("Wireframe", new CMD_Wireframe());
commandMachine.RegisterCommand("Conceptual", new CMD_Conceptual());
commandMachine.RegisterCommand("Physical", new CMD_Physical());
commandMachine.RegisterCommand("Physical2", new CMD_Physical2());
//导入导出配置
commandMachine.RegisterCommand("downloadconfig", new DownLoadDConfig());

@ -24,4 +24,6 @@ export enum RenderType
Jig = 4,
Print = 5,
/**物理带线框 */
Physical2 = 6,
}

@ -19,13 +19,8 @@ export const VisualStyleData: IVisualStyle[] = [
title: "真实",
type: RenderType.Physical
},
// {
// title: "隐藏",
// },
// {
// title: "带边缘着色",
// },
// {
// title: "X射线",
// },
{
title: "真实带线框",
type: RenderType.Physical2
},
];

@ -826,6 +826,16 @@ export const CommandList: ICommand[] = [
chName: "真实",
chDes: "切换视觉样式到真实模式",
},
{
icon: IconEnum.Reality,
typeId: "VisualStyle",
link: "#",
defaultCustom: "PHYSICAL2",
command: "PHYSICAL2",
type: "视觉样式",
chName: "真实带线框",
chDes: "切换视觉样式到真实模式",
},
//#endregion
//#region 其他命令

@ -126,6 +126,7 @@ export class TopToolBar extends React.Component<{}, {}>
{ svg: IconEnum.WireframeView, title: "二维线框", command: "WIREFRAME" },
{ svg: IconEnum.ConceptView, title: "概念", command: "CONCEPTUAL" },
{ svg: IconEnum.Reality, title: "真实", command: "PHYSICAL" },
{ svg: IconEnum.Reality, title: "真实带线框", command: "PHYSICAL2" },
];
store.iconList.render = [
{ svg: IconEnum.ExportView, title: "单柜效果图", command: "EXPORTVIEW" },

Loading…
Cancel
Save