!2878 看图王户型漫游

pull/2370/MERGE
cf-erp 3 months ago committed by ChenX
parent 19100e23e5
commit e4faeb31a6

@ -24,7 +24,7 @@
"testw": "jest --watchAll",
"postinstall": "ts-node ./utils/copy_type.ts",
"publish": "ts-node ./utils/publish.ts",
"dev:share": "webpack serve -c ./config/webpack.dev.ts --entry ./src/Add-on/ShareView/ShareViewEntry.tsx --port 7776"
"dev:share": "webpack serve -c ./config/webpack.dev.ts --entry-reset ./src/Add-on/ShareView/ShareViewEntry.tsx --port 7776"
},
"private": true,
"author": "",
@ -91,6 +91,7 @@
"url-loader": "^4.1.1",
"wallaby-webpack": "^3.9.16",
"webpack": "^5.89.0",
"webpack-bundle-analyzer": "^4.10.2",
"webpack-cli": "^5.1.4",
"webpack-dev-server": "^4.15.2",
"webpack-merge": "^5.10.0",

@ -40,7 +40,7 @@ export class Command_ShareView implements Command
UseSelect: true,
Filter: {
filterFunction: (obj, ent) =>
!(ent instanceof DirectionalLight || ent instanceof EntityRef || ent instanceof EntityFbx ||
!(ent instanceof DirectionalLight ||
(!store.m_Option.IsExportBoard && (ent instanceof Board)) || (!store.m_Option.IsExportHardware && (ent instanceof HardwareCompositeEntity || ent instanceof HardwareTopline)))//避免拷贝太阳光 太阳光只能有一个
},
});

@ -0,0 +1,8 @@
```shell
# 调试
yarn webpack serve -c src/Add-on/ShareView/webpack.dev.ts
# 编译
yarn webpack build -c src/Add-on/ShareView/webpack.prod.ts
# 查看打包分析
yarn webpack build -c src/Add-on/ShareView/webpack.prod.ts --analyze
```

@ -0,0 +1,143 @@
import { Vector3 } from "three";
import { clamp } from "../../Common/Utils";
import { CameraControls, CameraControlState } from "../../Editor/CameraControls";
import { Touch_Event } from "../../Editor/TouchEditor/VirtualMouseEditor";
import { userConfig } from "../../Editor/UserConfig";
import { equaln } from "../../Geometry/GeUtils";
import { CameraType } from "../../GraphicsSystem/CameraUpdate";
import { Viewer } from "../../GraphicsSystem/Viewer";
import { ShareViewStore } from "./ShareViewStore";
export class ShareViewCameraControl extends CameraControls
{
private shareViewStore: ShareViewStore = ShareViewStore.GetInstance();
private minFov: number = 45;
private maxFov: number = 120;
constructor(Viewer: Viewer)
{
super(Viewer);
}
private _TouchScaleCenterWCS2 = new Vector3;
private _TouchScaleCenterVCS2 = new Vector3;
// 重写基类方法使用targetTouches计算坐标
// targetTouches仅包含本次事件新增的触摸点这样不会影响移动端虚拟摇杆的操控
override onTouchStart = (event: Touch_Event) =>
{
this.Viewer.UpdateLockTarget();
this.StartTouchPoint.set(event.targetTouches[0].pageX, event.targetTouches[0].pageY, 0);
if (event.targetTouches.length < 4)
{
if (event.targetTouches.length == 2)
{
let dx = event.targetTouches[0].pageX - event.targetTouches[1].pageX;
let dy = event.targetTouches[0].pageY - event.targetTouches[1].pageY;
let distance = Math.sqrt(dx * dx + dy * dy);
this.DollyStart = distance;
let rect = (event.target as HTMLElement).getBoundingClientRect();
this._TouchScaleCenterVCS2.set((event.targetTouches[0].clientX + event.targetTouches[1].clientX) * 0.5, (event.targetTouches[0].clientY + event.targetTouches[1].clientY) * 0.5, 0);
this._TouchScaleCenterWCS2.set((event.targetTouches[0].clientX + event.targetTouches[1].clientX) * 0.5 - rect.left, (event.targetTouches[0].clientY + event.targetTouches[1].clientY) * 0.5 - rect.top, 0);
this.Viewer.ScreenToWorld(this._TouchScaleCenterWCS2);
}
this.State_Touch = this.TouchTypeList[event.targetTouches.length - 1];
if (!this.EnableTouchControl && event.targetTouches.length === 1)//在单手指模式下 如果有虚拟鼠标 则禁止旋转
this.State_Touch = CameraControlState.Null;
}
};
// 重写基类方法使用targetTouches计算坐标
// targetTouches仅包含本次事件新增的触摸点这样不会影响移动端虚拟摇杆的操控
override onTouchMove(event: Touch_Event)
{
event.preventDefault();
event.stopPropagation();
this.EndTouchPoint.set(event.targetTouches[0].pageX, event.targetTouches[0].pageY, 0);
let vec = this.EndTouchPoint.clone().sub(this.StartTouchPoint);
switch (this.State_Touch)
{
case CameraControlState.Pan:
{
this.Viewer.Pan(vec);
break;
}
case CameraControlState.Scale:
{
if (event.touches.length < 2)
break;
let dx = event.touches[0].pageX - event.touches[1].pageX;
let dy = event.touches[0].pageY - event.touches[1].pageY;
let distance = Math.sqrt(dx * dx + dy * dy);
if (!equaln(this.DollyStart / distance, 1, 0.05))//轻微防抖
{
// <-- ShareView缩放逻辑
const scale = this.DollyStart / distance;
if (this.Viewer.CameraControl.CameraType === CameraType.PerspectiveCamera)
{
// ShareView中用更改FOV的方式替换原有的透视相机缩放逻辑CameraControl难以重写
this.Viewer.CameraControl.Fov = clamp(this.Viewer.CameraControl.Fov * scale, this.minFov, this.maxFov);
if (screen.orientation.type.startsWith("portrait"))
{
this.shareViewStore.userFovPortrait = scale;
}
else if (screen.orientation.type.startsWith("landscape"))
{
this.shareViewStore.userFovLandscape = scale;
}
}
else
{
this.Viewer.Zoom(scale, this._TouchScaleCenterWCS2);
}
// -->
this.DollyStart = distance;
}
// <-- 透视相机不允许双指平移操作
if (this.Viewer.CameraControl.CameraType === CameraType.PerspectiveCamera)
break;
// -->
//move
let nowCenter = new Vector3((event.touches[0].clientX + event.touches[1].clientX) * 0.5, (event.touches[0].clientY + event.targetTouches[1].clientY) * 0.5, 0);
this._TouchScaleCenterVCS2.subVectors(nowCenter, this._TouchScaleCenterVCS2);
this.Viewer.Pan(this._TouchScaleCenterVCS2);
this._TouchScaleCenterVCS2.copy(nowCenter);
break;
}
case CameraControlState.Rotate:
{
this.Viewer.Rotate(vec.multiplyScalar(2));
break;
}
}
this.StartTouchPoint.copy(this.EndTouchPoint);
this.Viewer.UpdateRender();
};
override onMouseWheel(event: WheelEvent)
{
event.preventDefault();
event.stopPropagation();
if (this.shareViewStore.HouseRoamingMode) // 漫游模式禁用滚轮缩放
return;
let pt = new Vector3(event.offsetX, event.offsetY, 0);
this.Viewer.ScreenToWorld(pt, this.cameraNormal.setFromMatrixColumn(this.Viewer.Camera.matrixWorld, 2));
if (event.deltaY < 0)
this.Viewer.Zoom(userConfig.viewSize.zoomSpeed, pt);
else if (event.deltaY > 0)
this.Viewer.Zoom(2 - userConfig.viewSize.zoomSpeed, pt);
}
}

@ -0,0 +1,837 @@
import { Vector3 } from "three";
import { Command_FlipZMatrix } from "../../Common/CommandFlipZMatrix";
import { CommandNames } from "../../Common/CommandNames";
import { Command_SetLineOCS } from "../../Common/CommandSetLineOCS";
import { IsTest } from "../../Common/Deving";
import { TemplateArray, TemplateAttach, TemplateAttach2 } from "../../DatabaseServices/Template/TemplateTest";
import { commandMachine } from "../../Editor/CommandMachine";
import { Command_GizmoCSSwith, Command_SetGizmoMode } from "../../Editor/TranstrolControl/Command_SetGizmoMode";
import { TransMode } from "../../Editor/TranstrolControl/TransformServices";
import { userConfig } from "../../Editor/UserConfig";
import { RenderType } from "../../GraphicsSystem/RenderType";
import { Command_HeadCeilingContourManage } from "../../UI/Components/HeadCeiling/HeadCeilingContourManageCommand";
import { Command_HeadCeilingInfoConfigPanel, Command_HeadCeilingMaterialPanel } from "../../UI/Components/HeadCeiling/HeadCeilingInfoConfigPanelCommand";
import { EOptionTabId } from "../../UI/Components/Modal/OptionModal/ConfigDialog";
import { Align } from "../Align";
import { Command_DrawArcBoard } from "../ArcBoard/DrawArcBoard";
import { Command_Area } from "../Area";
import { Command_Array } from "../Array";
import { AutoHoleFaceSetting } from "../AutoHoleFaceSetting";
import { BackgroundSwitching } from "../BackgroundSwitching";
import { FindModeingKnifeRadius } from "../Batch/FindModeingKnifes";
import { CuttingByFace, CuttingByRectFace } from "../BoardCutting/CuttingByFace";
import { DeleteRelevance } from "../BoardCutting/DeleteRelevance";
import { Command_ChangeBoardColorByPBFace } from "../BoardEditor/ChangeBoardColorByPBFace";
import { Command_ClearBoard2DModeling } from "../BoardEditor/ClearBoard2DModeling";
import { SetBoardLines, SetComposingFace } from "../BoardEditor/SetBoardLines";
import { Command_TextModifyTool } from "../BoardEditor/TextModifyTool";
import { UpdateBoardInfos } from "../BoardEditor/UpdateBoardInfos";
import { OneClickInspection } from "../BoardInspection/OneClickInspection";
import { IntersectionOperation, SubsractOperation, UnionOperation } from "../BoolOperation";
import { Command_Break, Command_BreakAll } from "../Break";
import { Command_CameraSnapshootRestore, Command_CameraSnapshootSave, Command_CameraSnapshootSaveIndex } from "../CameraSnapshootCMD";
import { ChangeColorByMaterial } from "../ChangeColorByBoard/ChangeColorByMaterial";
import { ChangeColorByRoomCabinet } from "../ChangeColorByRoomOrCabinet/ChangeColorByRoomOrCabinet";
import { CheckHoles } from "../CheckHoles";
import { CheckModeling } from "../CheckModeling";
import { Cmd_Freeze, Cmd_UnFreeze } from "../Cmd_Freeze";
import { Cmd_UnVisibleInRender, Cmd_VisibleInRender } from "../Cmd_VisibleInRender";
import { CombinatAttributeBrush } from "../CombinatAttributeBrush";
import { Command_CombineEntity } from "../Command_CombineEntity";
import { Command_Options } from "../Command_Option";
import { Command_PickUp2DModelCsgs } from "../Command_PickUp2DModelCsgs";
import { Command_Purge } from "../Command_Purge";
import { Command_Conver2Polyline } from "../Conver2Polyline";
import { Command_Copy } from "../Copy";
import { CopyClip } from "../CopyClip";
import { Command_CopyPoint } from "../CopyPoint";
import { CustomUcs } from "../CostumUCS";
import { Command_CleanCustomNumber, Command_CustomNumber } from "../CustomNumber/Command_CustomNumber";
import { DeleteCurve } from "../DeleteCurve";
import { Command_Dist } from "../Dist";
import { CMD_Divide } from "../Divide";
import { DrawArc } from "../DrawArc";
import { DrawTemplateByImport } from "../DrawBoard/DrawTemplateByImport";
import { FindMaxOrMinSizeBoard } from "../DrawBoard/FindMaxSizeBoard";
import { FixIntersectSelfContour } from "../DrawBoard/FixIntersectSelfContour";
import { ParseHandle } from "../DrawBoard/ParseHandle";
import { ParseHinge } from "../DrawBoard/ParseHinge";
import { SetHoleNoneType } from "../DrawBoard/SetHoleType";
import { DrawCircle } from "../DrawCircle";
import { DrawCylineder } from "../DrawCylinder";
import { Command_DimContinue } from "../DrawDim/Command_DimContinue";
import { Command_DimStyle } from "../DrawDim/Command_DimStyle";
import { Command_DimArc } from "../DrawDim/DimArc";
import { Command_Draw2LineAngularDim } from "../DrawDim/Draw2LineAngularDim";
import { DrawAlignedDimension } from "../DrawDim/DrawAlignedDimension";
import { DrawDiameterDim } from "../DrawDim/DrawDiameterDim";
import { DrawLinearDimension } from "../DrawDim/DrawLinearDimension";
import { DrawRadiusDim } from "../DrawDim/DrawRadiusDim";
import { Command_HideDim, Command_ShowDim } from "../DrawDim/OneKeyHideOrShowDim";
import { CheckDrawHole } from "../DrawDrilling/CheckDrawHole";
import { CheckHasHoleBoard } from "../DrawDrilling/CheckHasHole";
import { AddAssocDrillLock } from "../DrawDrilling/DrillLock/AddAssocDrillLock";
import { AddAloneDrillLock } from "../DrawDrilling/DrillLock/AloneDrillLock";
import { RemoveAssocDrillLock } from "../DrawDrilling/DrillLock/RemoveAssocDrillLock";
import { RemoveDrillLock } from "../DrawDrilling/DrillLock/RemoveDrillLock";
import { ShowDrillingTemplate } from "../DrawDrilling/ShowDrillingTemplate";
import { ToggleDrillingReactor } from "../DrawDrilling/ToggleDrillingReactor";
import { DrawEllipse } from "../DrawEllipse";
import { DrawExtrude } from "../DrawExtrude";
import { DrawGripStretch } from "../DrawGripStretch";
import { BatchModifyLights } from "../DrawLight/BatchModifyLights";
import { DrawPointLight } from "../DrawLight/DrawPointLight";
import { DrawRectAreaLight } from "../DrawLight/DrawRectAreaLight";
import { DrawSpotLight, DrawSpotLight2 } from "../DrawLight/DrawSpotLight";
import { Command_DrawXLine, DrawLine } from "../DrawLine";
import { CMD_DrawPoint } from "../DrawPoint";
import { DrawPolygon } from "../DrawPolygon";
import { DrawPolyline } from "../DrawPolyline";
import { DrawRect } from "../DrawRect";
import { DrawRegion } from "../DrawRegion";
import { Command_DrawRevolve } from "../DrawRevolve";
import { DrawSky } from "../DrawSky";
import { DrawSphere } from "../DrawSphere";
import { DrawSpline } from "../DrawSpline";
import { DrawRegTest } from "../DrawTestReg";
import { DrawText } from "../DrawText";
import { Draw2Viewport, Draw3Viewport, Draw4Viewport, DrawViewport } from "../DrawViewport";
import { Polyline2Winerack } from "../DrawWineRack/Polyline2Winerack";
import { DrawCircle0 } from "../DrawZeroCircle";
import { Command_EndTempEditor } from "../EndTempEditor";
import { Command_EntitytMoveToZ0 } from "../EntityMoveToZ0";
import { Entsel } from "../Entsel";
import { Command_Erase } from "../Erase";
import { Command_EraseLineAndArc } from "../EraseLineAndArc";
import { Command_EraseNoSelect } from "../EraseNoSelect";
import { Command_Esc } from "../Esc";
import { Command_ExportSTL } from "../Exports/ExportSTL";
import { Command_Extend } from "../Extends";
import { Command_OpenHistory } from "../File/OpenHistory";
import { OperLogs } from "../File/OperLog";
import { CommandFillet } from "../Fillet";
import { Command_FindBoardModelingKnife } from "../FindBoardModelingKnife";
import { Command_Fix2DPath } from "../Fix/Fix2DPath";
import { Command_Group, Command_UnGroup } from "../Group";
import { Command_HideSelected, Command_HideUnselected, Command_ShowAll, Command_SwitchDoorOrDrawer, SelectAll, ShowHideSelectPanel } from "../HideSelected";
import { Command_HighlightNode, Command_HighlightNodeAndChilds } from "../HighlightNode";
import { Command_Insert } from "../Insert";
import { Command_Join } from "../Join";
import { EditorLattice } from "../LatticeDrawer/EditorLattice";
import { Command_Length } from "../Length";
import { Command_Lisp } from "../Lisp";
import { Command_MatchProp } from "../MatchProp";
import { Command_Move } from "../Move";
import { Command_Cmd_Down } from "../Move/Cmd_Down";
import { Command_M0, Command_PackageMove } from "../MoveToWCS0";
import { Command_ExportObj } from "../Obj/Command_ExportObj";
import { Command_ExportObjAndMtl } from "../Obj/Command_ExportObjMtl";
import { Command_DynOffset, Command_DynOffsetToolPath, Command_Offset } from "../Offset";
import { Open } from "../Open";
import { PasteClip } from "../PasteClip";
import { Pedit } from "../Pedit";
import { ReOpen } from "../ReOpen";
import { CMD_Renderer } from "../Renderer";
import { Command_ResetCustomCommand } from "../ResetCustomCommand";
import { Command_RestoreColor } from "../RestoreColor";
import { Command_Reverse } from "../Reverse";
import { Command_ParseRoomWall } from "../Room/ParseRoomWall";
import { Command_Rotate, Command_RotateRefer } from "../Rotate";
import { New } from "../Save";
import { Command_Scale } from "../Scale";
import { SetSmoothEdge } from "../SetSmoothEdge/SetSmoothEdge";
import { Command_Show2DPathLine } from "../Show2DPathLine/Show2DPathLine";
import { Command_Show2DPathObject } from "../Show2DPathLine/Show2DPathObject";
import { SwitchLines } from "../ShowLines";
import { ShowOpenDirLiens } from "../ShowOpenDirLiens";
import { Command_ShowProcessingGroupModal } from "../ShowProcessingGroupModal";
import { Stretch } from "../Stretch";
import { Command_SuperCopy } from "../SuperCopy";
import { Sweep } from "../Sweep";
import { Command_SwitchCamera } from "../SwitchCamera";
import { ChangeRenderType } from "../SwitchVisualStyles";
import { DrawTangentLine } from "../Tangent";
import { BoardReplaceTempate } from "../Template/BoardReplaceTemplate";
import { DrawVisualSpaceBox } from "../Template/DrawVisualSpaceBox";
import { ShowFrmae } from "../Template/ShowFrame";
import { Command_TemplateSearch } from "../TemplateSearch";
import { Command_TestPointPickParse } from "../TestPointPickParse";
import { Text2Curve } from "../Text2Curve";
import { Command_ToggleUI } from "../ToggleUI";
import { Command_Trim } from "../Trim";
import { Redo, Undo } from "../Undo";
import { ViewChange } from "../ViewChange";
import { Command_FixView } from "../ViewCtrl/FixView";
import { EditFrame } from "../ViewortConfig/EditFrame";
import { EditViewport } from "../ViewortConfig/EditViewport";
import { OneKeyLayout } from "../Viewport/OneKeyLayout";
import { OneKeyPrint } from "../Viewport/OneKeyPrint";
import { Command_Wblock } from "../Wblock";
import { Command_ZoomObject, ZoomE } from "../ZoomE";
import { Interfere } from "../interfere";
import { TestFillet } from "../testEntity/TestFilletCode";
import { Command_Curve2Polyline } from "../twoD2threeD/Command_Curve2Polyline";
import { Command_Curve2VSBox } from "../twoD2threeD/Command_Curve2VSBox";
import { Command_ParseBoardName } from "../twoD2threeD/ParseBoardName";
import { Polyline2Board } from "../twoD2threeD/Polyline2Board";
import { Rect2Board } from "../twoD2threeD/Rect2Board";
import { Command_OpenCabinet } from "../OpenCabinet/OpenCabinet";
import { DrawLeftRight } from "../DrawBoard/DrawLeftRightBoard";
import { DrawTopBottomBoard } from "../DrawBoard/DrawTopBottomBoard";
import { DrawBehindBoard } from "../DrawBoard/DrawBehindBoard";
import { DrawLayerBoard } from "../DrawBoard/DrawLayerBoard";
import { DrawVerticalBoard } from "../DrawBoard/DrawVerticalBoard";
import { DrawSingleBoard } from "../DrawBoard/DrawSingleBoard";
import { DrawClosingStrip } from "../DrawBoard/DrawClosingStrip";
import { DrawDoor } from "../DrawBoard/DrawDoor";
import { DrillConfig } from "../DrawDrilling/DrillConfig";
import { DrawDrilling } from "../DrawDrilling/DrawDrilling";
import { DrawSpecialShapedBoard } from "../DrawBoard/DrawSpecialShapedBoard";
import { DrawSpecialShapedBoardByContour } from "../DrawBoard/DrawSpecialShapedBoardByContour";
import { Command_ApplyModelToBoards } from "../DrawBoard/ApplyModelToBoards";
import { ApplyModel2ToBoard } from "../DrawBoard/ApplyModel2ToBoard";
import { LinearCutting, RectLinearCutting } from "../BoardCutting/LinearCutting";
import { NonAssociativeCutting } from "../BoardCutting/NonAssociativeCutting";
import { ReferenceCutting } from "../BoardCutting/ReferenceCutting";
import { AddPtOnBoard, DeletePtOnBoard } from "../AddPtOnBoard";
import { BoardFindModify } from "../BoardFindModify";
import { LookOverBoardInfos } from "../LookOverBoardInfos/LookOverBoardInfos";
import { BoardBatchCurtail } from "../BoardBatchCurtail";
import { BatchModifyPanel } from "../BatchModifyPanel";
import { Command_AutoDimBrs } from "../DrawDim/AutoDimBrs";
import { Command_BoardInfoDimTool } from "../DrawDim/BoardInfoDimTool";
import { Command_FastDimBrs } from "../DrawDim/FastDim/FastDim";
import { BreakDim } from "../DrawDim/BreakDim";
import { DeleteDim, DeleteMinDim } from "../DrawDim/DeleteDim";
import { RotateLayerBoard } from "../RotateLayerBoard";
import { DrawDrawrer } from "../DrawBoard/DrawDrawer";
import { DeleteDrill } from "../DrawDrilling/DeleteDrill";
import { ReverseDrillFace } from "../DrawDrilling/ReverseDrillFace";
import { Command_FZWL } from "../FZWL";
import { EditorBoardTemplate } from "../DrawBoard/EditorBoardTempate";
import { ActicityLayerBoard } from "../ActivityLayerBoard";
export function registerCommand()
{
commandMachine.RegisterCommand(CommandNames.Puge, new Command_Purge());
commandMachine.RegisterCommand("end", new Command_EndTempEditor());
//恢复板颜色
commandMachine.RegisterCommand(CommandNames.RestoreColor, new Command_RestoreColor());
//酷家乐
// commandMachine.RegisterCommand(CommandNames.KJLImport, new Command_KJLImport());
// commandMachine.RegisterCommand(CommandNames.KJLCongfig, new Command_KJLImportConfig("config"));
// commandMachine.RegisterCommand(CommandNames.KJLMaterialMap, new Command_KJLImportConfig("material"));
// commandMachine.RegisterCommand(CommandNames.KJLExport, new KjlExport());
// commandMachine.RegisterCommand(CommandNames.Clearkjltoken, new ClearKjlToken());
//嘉居
// commandMachine.RegisterCommand(CommandNames.JiaJuImport, new Command_JiaJuImport());
//晨丰导入
// commandMachine.RegisterCommand(CommandNames.CFImport, new ImportCFData());
//编组
commandMachine.RegisterCommand(CommandNames.Group, new Command_Group());
commandMachine.RegisterCommand(CommandNames.UnGroup, new Command_UnGroup());
//冻结
commandMachine.RegisterCommand(CommandNames.Freeze, new Cmd_Freeze());
commandMachine.RegisterCommand(CommandNames.UnFreeze, new Cmd_UnFreeze());
//渲染器隐藏/显示实体
commandMachine.RegisterCommand(CommandNames.VisibleInRender, new Cmd_VisibleInRender());
commandMachine.RegisterCommand(CommandNames.UnVisibleInRender, new Cmd_UnVisibleInRender());
//CAD图纸导入
// commandMachine.RegisterCommand(CommandNames.DXFImport, new Command_DWGDXFImport());
// commandMachine.RegisterCommand(CommandNames.DWGImport, new Command_DWGDXFImport());
// commandMachine.RegisterCommand(CommandNames.FBXImport, new Command_FBXImport());
//帮帮我 出错了
// commandMachine.RegisterCommand("999", new Command_999());
// 应用 放样曲线 生成 曲面板材
commandMachine.RegisterCommand(CommandNames.DrawArcBoard, new Command_DrawArcBoard());
// if (IsTest())
// {
// commandMachine.RegisterCommand("testload", new Command_TestLoadFbx());
// commandMachine.RegisterCommand("tt", new Test());
// commandMachine.RegisterCommand("gxl", new Command_UpdateLight());
// commandMachine.RegisterCommand("testVPath", new Command_TestVPath());
//
// commandMachine.RegisterCommand("testRegionParse", new Command_TestRegionParse());
// commandMachine.RegisterCommand("TestBoundaryBox", new Command_TestBoundaryBox());
// commandMachine.RegisterCommand("TestSweepMaxLength", new Command_TestSweepMaxLength());
//
// commandMachine.RegisterCommand("isrect", new Command_Test_IsRect());
// }
//插入图纸
commandMachine.RegisterCommand(CommandNames.Insert, new Command_Insert());
commandMachine.RegisterCommand(CommandNames.Line, new DrawLine());
commandMachine.RegisterCommand(CommandNames.XLine, new Command_DrawXLine());
commandMachine.RegisterCommand(CommandNames.Undo, new Undo());
commandMachine.RegisterCommand(CommandNames.Redo, new Redo());
commandMachine.RegisterCommand(CommandNames.Zoome, new ZoomE());
commandMachine.RegisterCommand(CommandNames.ZoomObject, new Command_ZoomObject());
commandMachine.RegisterCommand(CommandNames.RECTANG, new DrawRect());
commandMachine.RegisterCommand(CommandNames.Polygon, new DrawPolygon());
commandMachine.RegisterCommand(CommandNames.Circle, new DrawCircle());
commandMachine.RegisterCommand(CommandNames.Ellipse, new DrawEllipse());
commandMachine.RegisterCommand(CommandNames.Spline, new DrawSpline());
commandMachine.RegisterCommand(CommandNames.Polyline, new DrawPolyline());
commandMachine.RegisterCommand(CommandNames.Scale, new Command_Scale());
commandMachine.RegisterCommand(CommandNames.Convert2Polyline, new Command_Conver2Polyline());
commandMachine.RegisterCommand(CommandNames.Move, new Command_Move());
commandMachine.RegisterCommand(CommandNames.FlipZMatrix, new Command_FlipZMatrix());
commandMachine.RegisterCommand(CommandNames.SetLineOCS, new Command_SetLineOCS());
commandMachine.RegisterCommand(CommandNames.Z0, new Command_EntitytMoveToZ0());
commandMachine.RegisterCommand(CommandNames.M0, new Command_M0());
commandMachine.RegisterCommand(CommandNames.PackageGroupMove0, new Command_PackageMove());
commandMachine.RegisterCommand(CommandNames.Rotate, new Command_Rotate());
commandMachine.RegisterCommand(CommandNames.RotateRefer, new Command_RotateRefer());
commandMachine.RegisterCommand(CommandNames.Revolve, new Command_DrawRevolve());
commandMachine.RegisterCommand(CommandNames.Sphere, new DrawSphere());
commandMachine.RegisterCommand(CommandNames.SwitchCamera, new Command_SwitchCamera());
commandMachine.RegisterCommand(CommandNames.CameraSnapshootSave, new Command_CameraSnapshootSave());
//保存和读取相机状态
for (let i = 1; i <= 9; i++)
{
commandMachine.RegisterCommand(CommandNames.CameraSnapshootSaveIndex + "-" + i, new Command_CameraSnapshootSaveIndex(i));
commandMachine.RegisterCommand(CommandNames.CameraSnapshootRestore + "-" + i, new Command_CameraSnapshootRestore(i));
}
commandMachine.RegisterCommand(CommandNames.Erase, new Command_Erase());
commandMachine.RegisterCommand(CommandNames.DeleteCurve, new DeleteCurve());
commandMachine.RegisterCommand(CommandNames.EraseLineArc, new Command_EraseLineAndArc());
commandMachine.RegisterCommand("Circle0", new DrawCircle0());
commandMachine.RegisterCommand(CommandNames.Break, new Command_Break());
commandMachine.RegisterCommand(CommandNames.CustomNumber, new Command_CustomNumber());
commandMachine.RegisterCommand(CommandNames.CleanCustomNumber, new Command_CleanCustomNumber());
commandMachine.RegisterCommand(CommandNames.BreakAll, new Command_BreakAll());
if (IsTest())
commandMachine.RegisterCommand("testPointParse", new Command_TestPointPickParse());
commandMachine.RegisterCommand(CommandNames.Stretch, new Stretch());
commandMachine.RegisterCommand(CommandNames.SelectStretch, new Stretch(true));
commandMachine.RegisterCommand(CommandNames.FS, new ViewChange(new Vector3(0, 0, -1)));
commandMachine.RegisterCommand(CommandNames.QS, new ViewChange(new Vector3(0, 1)));
commandMachine.RegisterCommand(CommandNames.YS, new ViewChange(new Vector3(-1)));
commandMachine.RegisterCommand(CommandNames.ZS, new ViewChange(new Vector3(1)));
commandMachine.RegisterCommand(CommandNames.BackView, new ViewChange(new Vector3(0, -1)));
commandMachine.RegisterCommand(CommandNames.Swiso, new ViewChange(new Vector3(1, 1, -1), true));
commandMachine.RegisterCommand(CommandNames.BottomView, new ViewChange(new Vector3(0, 0, 1)));
commandMachine.RegisterCommand(CommandNames.FixView, new Command_FixView());
commandMachine.RegisterCommand("grip", new DrawGripStretch());
//暂时关闭这个fbx导入
// commandMachine.RegisterCommand("fbx", new Fbx());
commandMachine.RegisterCommand(CommandNames.HighlightNode, new Command_HighlightNode());
commandMachine.RegisterCommand(CommandNames.HighlightNodeAndChilds, new Command_HighlightNodeAndChilds());
commandMachine.RegisterCommand(CommandNames.HideSelect, new Command_HideSelected());
commandMachine.RegisterCommand(CommandNames.HideUnSelect, new Command_HideUnselected());
commandMachine.RegisterCommand(CommandNames.Show, new Command_ShowAll());
// commandMachine.RegisterCommand(CommandNames.Save, new Save());
// commandMachine.RegisterCommand(CommandNames.SaveAs, new SaveAs());
// commandMachine.RegisterCommand(CommandNames.SaveToLocal, new SaveToLocal());
// commandMachine.RegisterCommand(CommandNames.SaveToDxf, new SaveToDxf());
commandMachine.RegisterCommand(CommandNames.New, new New());
commandMachine.RegisterCommand(CommandNames.Open, new Open());
commandMachine.RegisterCommand(CommandNames.Reopen, new ReOpen());
commandMachine.RegisterCommand(CommandNames.OpenHistory, new OperLogs(false));
commandMachine.RegisterCommand(CommandNames.OpenHistory2, new Command_OpenHistory());
commandMachine.RegisterCommand(CommandNames.Arc, new DrawArc());
commandMachine.RegisterCommand("ent", new Entsel());
if (IsTest())
commandMachine.RegisterCommand("sky", new DrawSky());
commandMachine.RegisterCommand(CommandNames.Reg, new DrawRegion());
commandMachine.RegisterCommand(CommandNames.CustomUCS, new CustomUcs());
commandMachine.RegisterCommand("reg2", new DrawRegTest());
commandMachine.RegisterCommand(CommandNames.Copy, new Command_Copy());
//超级拷贝
commandMachine.RegisterCommand(CommandNames.SuperCopy, new Command_SuperCopy());
commandMachine.RegisterCommand("Wblock", new Command_Wblock());
commandMachine.RegisterCommand("lisp", new Command_Lisp());
commandMachine.RegisterCommand(CommandNames.Reverse, new Command_Reverse());
commandMachine.RegisterCommand(CommandNames.Extend, new Command_Extend());
commandMachine.RegisterCommand(CommandNames.Trim, new Command_Trim());
commandMachine.RegisterCommand(CommandNames.Fillet, new CommandFillet());
commandMachine.RegisterCommand("testFilletCode", new TestFillet());
commandMachine.RegisterCommand(CommandNames.Offset, new Command_Offset());
commandMachine.RegisterCommand("OT", new Command_DynOffset());
commandMachine.RegisterCommand("TO", new Command_DynOffsetToolPath());
commandMachine.RegisterCommand(CommandNames.Length, new Command_Length());
commandMachine.RegisterCommand(CommandNames.Area, new Command_Area());
//绘制灯
commandMachine.RegisterCommand(CommandNames.PointLight, new DrawPointLight());
commandMachine.RegisterCommand(CommandNames.SpotLight, new DrawSpotLight());
commandMachine.RegisterCommand(CommandNames.SpotLight2, new DrawSpotLight2());
commandMachine.RegisterCommand(CommandNames.RectLight, new DrawRectAreaLight());
commandMachine.RegisterCommand(CommandNames.BatchModifyLights, new BatchModifyLights());
commandMachine.RegisterCommand("ptcopy", new Command_CopyPoint());
commandMachine.RegisterCommand("tan", new DrawTangentLine());
commandMachine.RegisterCommand(CommandNames.Divide, new CMD_Divide());
commandMachine.RegisterCommand(CommandNames.Point, new CMD_DrawPoint());
commandMachine.RegisterCommand(CommandNames.AlignDim, new DrawAlignedDimension());
commandMachine.RegisterCommand(CommandNames.LinearDim, new DrawLinearDimension());
commandMachine.RegisterCommand(CommandNames.AngleDim, new Command_Draw2LineAngularDim());
commandMachine.RegisterCommand(CommandNames.DimContinue, new Command_DimContinue());
commandMachine.RegisterCommand(CommandNames.RadiusDim, new DrawRadiusDim());
commandMachine.RegisterCommand(CommandNames.DiaDim, new DrawDiameterDim());
commandMachine.RegisterCommand(CommandNames.DimArc, new Command_DimArc());
commandMachine.RegisterCommand(CommandNames.HideDim, new Command_HideDim());
commandMachine.RegisterCommand(CommandNames.ShowDim, new Command_ShowDim());
commandMachine.RegisterCommand(CommandNames.Text, new DrawText());
commandMachine.RegisterCommand(CommandNames.Intersect, new IntersectionOperation());
commandMachine.RegisterCommand(CommandNames.Union, new UnionOperation());
commandMachine.RegisterCommand(CommandNames.Substract, new SubsractOperation());
commandMachine.RegisterCommand(CommandNames.Pedit, new Pedit());
commandMachine.RegisterCommand(CommandNames.Join, new Command_Join());
commandMachine.RegisterCommand(CommandNames.Sweep, new Sweep());
commandMachine.RegisterCommand(CommandNames.Cylineder, new DrawCylineder());
//画板件命令 这一段在ShareView中有依赖不要移除
commandMachine.RegisterCommand(CommandNames.LRBoard, new DrawLeftRight());
commandMachine.RegisterCommand(CommandNames.TBBoard, new DrawTopBottomBoard());
commandMachine.RegisterCommand(CommandNames.BehindBoard, new DrawBehindBoard());
commandMachine.RegisterCommand(CommandNames.LayerBoard, new DrawLayerBoard());
commandMachine.RegisterCommand(CommandNames.VertialBoard, new DrawVerticalBoard());
commandMachine.RegisterCommand(CommandNames.SingleBoard, new DrawSingleBoard());
commandMachine.RegisterCommand(CommandNames.CloseStrip, new DrawClosingStrip());
commandMachine.RegisterCommand(CommandNames.Door, new DrawDoor());
commandMachine.RegisterCommand(CommandNames.DrillConfig, new DrillConfig());
commandMachine.RegisterCommand(CommandNames.Hole, new DrawDrilling());
commandMachine.RegisterCommand(CommandNames.YiXing, new DrawSpecialShapedBoard());
commandMachine.RegisterCommand(CommandNames.YXLK, new DrawSpecialShapedBoardByContour());
commandMachine.RegisterCommand(CommandNames.ZXLK, new Command_ApplyModelToBoards());
commandMachine.RegisterCommand(CommandNames.Model2Contour, new ApplyModel2ToBoard());
commandMachine.RegisterCommand(CommandNames.LinearCutting, new LinearCutting());
commandMachine.RegisterCommand(CommandNames.RectLinearCutting, new RectLinearCutting());
commandMachine.RegisterCommand(CommandNames.NonAssociativeCutting, new NonAssociativeCutting());
commandMachine.RegisterCommand(CommandNames.ReferenceCutting, new ReferenceCutting());
commandMachine.RegisterCommand(CommandNames.AddPtOnBoard, new AddPtOnBoard());
commandMachine.RegisterCommand(CommandNames.DeletePtOnBoard, new DeletePtOnBoard());
commandMachine.RegisterCommand(CommandNames.BoardFindModify, new BoardFindModify());
commandMachine.RegisterCommand(CommandNames.LookOverBoardInfos, new LookOverBoardInfos());
commandMachine.RegisterCommand(CommandNames.BoardBatchCurtail, new BoardBatchCurtail());
commandMachine.RegisterCommand(CommandNames.BatchModifyPanel, new BatchModifyPanel());
commandMachine.RegisterCommand(CommandNames.AutoDimBrs, new Command_AutoDimBrs());
commandMachine.RegisterCommand(CommandNames.BoardInfoDim, new Command_BoardInfoDimTool());
commandMachine.RegisterCommand(CommandNames.FastDimBrs, new Command_FastDimBrs());
commandMachine.RegisterCommand(CommandNames.BreakDim, new BreakDim());
commandMachine.RegisterCommand(CommandNames.DeleteDim, new DeleteDim());
commandMachine.RegisterCommand(CommandNames.DeleteMinDim, new DeleteMinDim());
commandMachine.RegisterCommand(CommandNames.DimStyle, new Command_DimStyle());
commandMachine.RegisterCommand(CommandNames.RotateLayerBoard, new RotateLayerBoard());
commandMachine.RegisterCommand(CommandNames.Drawer, new DrawDrawrer());
commandMachine.RegisterCommand(CommandNames.DeleteHole, new DeleteDrill());
commandMachine.RegisterCommand(CommandNames.ReverseDrillFace, new ReverseDrillFace());
commandMachine.RegisterCommand(CommandNames.FZWL, new Command_FZWL());
commandMachine.RegisterCommand(CommandNames.EditorboardTemplate, new EditorBoardTemplate());
commandMachine.RegisterCommand(CommandNames.ActicityLayerBoard, new ActicityLayerBoard());
//改板
// commandMachine.RegisterCommand(CommandNames.SetBRXAxis, new Command_SetBRXAxis());
// commandMachine.RegisterCommand(CommandNames.SelectThinBehindBoard, new SelectThinBehindBoard());
//修改颜色命令
// for (let i = 0; i <= 255; i++) commandMachine.RegisterCommand(i.toString(), new ChangeColor(i));
// commandMachine.RegisterCommand(CommandNames.TestM, new FeedingCommand()); //模拟走刀
// commandMachine.RegisterCommand(CommandNames.TestFb, new TestFb()); //模拟封边
// commandMachine.RegisterCommand(CommandNames.Mirror, new MirrorCommand());
//
// commandMachine.RegisterCommand(CommandNames.Topline, new ShowTopLine());
//酒格
// commandMachine.RegisterCommand(CommandNames.Winerack, new ConfigureWineRack());
// commandMachine.RegisterCommand(CommandNames.Drawwinerack, new DrawWineRack());
// commandMachine.RegisterCommand(CommandNames.Editorwinerack, new EditorWineRack());
//
// commandMachine.RegisterCommand(CommandNames.Explode, new Command_Explode());
// commandMachine.RegisterCommand(CommandNames.Explosion, new Command_ExplosionMap());
commandMachine.RegisterCommand(CommandNames.OpenCabinet, new Command_OpenCabinet());
//
// commandMachine.RegisterCommand(CommandNames.Lattice, new DrawLattice());
/*******test ↓↓↓*********/
// if (IsTest())
// {
// commandMachine.RegisterCommand("pltest", new Command_PLTest());
// commandMachine.RegisterCommand("tt2", new Command_INsTest());
// commandMachine.RegisterCommand("outcur", new TestTargeOnCurve());
// commandMachine.RegisterCommand("close", new Command_ClosePt());
//
// //多段线变碎点多段线
// commandMachine.RegisterCommand("TestPolyline2PointsPolyline", new Command_TestPolyline2PointsPolyline());
// commandMachine.RegisterCommand("TestParseEdgeSealDir", new Command_TestParseEdgeSealDir());
//
// commandMachine.RegisterCommand("oo", new OffsetX());
// commandMachine.RegisterCommand("testw", new Command_TestTape());
// //测试csg
// commandMachine.RegisterCommand("TestDrawEdgeGeometry", new Command_TestDrawEdgeGeometry());
// }
// commandMachine.RegisterCommand(CommandNames.SimplifyPolyline, new Command_SimplifyPolyline());
// commandMachine.RegisterCommand("RemovePolylineRepeatPos", new Command_RemovePolylineRepeatPos());
//用于测试包围盒
// if (IsTest())
// {
// commandMachine.RegisterCommand("box", new Command_TestBox());
// commandMachine.RegisterCommand("TestIntersect", new TestIntersect());
// commandMachine.RegisterCommand("collison", new TestCollision());
// }
//阵列
commandMachine.RegisterCommand(CommandNames.Array, new Command_Array());
commandMachine.RegisterCommand(CommandNames.CopyClip, new CopyClip());
commandMachine.RegisterCommand(CommandNames.CopyBase, new CopyClip(true));
commandMachine.RegisterCommand(CommandNames.PasteClip, new PasteClip());
//UI命令
// commandMachine.RegisterCommand(CommandNames.Comanp, new Command_CommandPanel());
// commandMachine.RegisterCommand(CommandNames.PropertiesBar, new Command_PropertiesBar());
// commandMachine.RegisterCommand(CommandNames.ModuleBar, new Command_ModuleBar());
// commandMachine.RegisterCommand(CommandNames.ChangeLayout, new Command_ChangeLayout());
// for (const key in RightTabCommandMap)
// {
// commandMachine.RegisterCommand(RightTabCommandMap[key], new Command_RightPanel(key));
// }
// commandMachine.RegisterCommand(CommandNames.SwitchServers, new Comman_SwitchServers());
//选项
commandMachine.RegisterCommand(CommandNames.Config, new Command_Options(EOptionTabId.Show));
commandMachine.RegisterCommand(CommandNames.DimStyle, new Command_DimStyle());
commandMachine.RegisterCommand(CommandNames.TextStyle, new Command_Options(EOptionTabId.TextStyle));
commandMachine.RegisterCommand("esc", new Command_Esc());
commandMachine.RegisterCommand(CommandNames.EraseNoSelect, new Command_EraseNoSelect());
// commandMachine.RegisterCommand("st", new SaveTarget())
// commandMachine.RegisterCommand("rt", new RevTarget())
//视觉样式
commandMachine.RegisterCommand(CommandNames.Wireframe, new ChangeRenderType(RenderType.Wireframe));
commandMachine.RegisterCommand(CommandNames.Conceptual, new ChangeRenderType(RenderType.Conceptual));
commandMachine.RegisterCommand(CommandNames.ConceptualTransparent, new ChangeRenderType(RenderType.Conceptual, 0.5));
commandMachine.RegisterCommand(CommandNames.Physical, new ChangeRenderType(RenderType.Physical));
commandMachine.RegisterCommand(CommandNames.Physical2, new ChangeRenderType(RenderType.Physical2));
commandMachine.RegisterCommand(CommandNames.PrintType, new ChangeRenderType(RenderType.Print));
commandMachine.RegisterCommand(CommandNames.CheckEdge, new ChangeRenderType(RenderType.Edge));
commandMachine.RegisterCommand(CommandNames.CheckPlaceFace, new ChangeRenderType(RenderType.PlaceFace));
commandMachine.RegisterCommand(CommandNames.BigHoleFace, new ChangeRenderType(RenderType.BigHoleFace));
commandMachine.RegisterCommand(CommandNames.VisualStyle_CustomNumber, new ChangeRenderType(RenderType.CustomNumber, 0.2));
commandMachine.RegisterCommand(CommandNames.ModelGroove, new ChangeRenderType(RenderType.ModelGroove, 0.2));
commandMachine.RegisterCommand(CommandNames.BackgroundSwitching, new BackgroundSwitching());
commandMachine.RegisterCommand(CommandNames.Renderer, new CMD_Renderer());
//导入导出配置
// commandMachine.RegisterCommand(CommandNames.DownloadConfig, new DownLoadDConfig());
// commandMachine.RegisterCommand(CommandNames.UploadConfig, new UpLoadConfig());
// commandMachine.RegisterCommand(CommandNames.DownloadHoleOption, new DownloadHoleOption());
// commandMachine.RegisterCommand(CommandNames.UploadHoleConfig, new UploadHoleOption());
// MES
// commandMachine.RegisterCommand(CommandNames.ChaiDan, new ChaiDan());
// commandMachine.RegisterCommand(CommandNames.ChaiDanJB, new ChaiDanJB());
// commandMachine.RegisterCommand(CommandNames.ShowYouhua, new ShoWYouHua());
// commandMachine.RegisterCommand(CommandNames.Decompose, new Decompose());
// commandMachine.RegisterCommand(CommandNames.ChaiDanExport, new ChaiDanExport());
// shareview
// commandMachine.RegisterCommand(CommandNames.ShareView, new Command_ShareView());
//批量修改封边排钻
// commandMachine.RegisterCommand(CommandNames.BatchModify, new BatchModify());
// commandMachine.RegisterCommand(CommandNames.EditDrilEdgeData, new Command_EditBoardDrilEdgeData());
// commandMachine.RegisterCommand(CommandNames.EditSealEdgeData, new Command_EditBoardSealEdgeData());
//自动设置孔面
commandMachine.RegisterCommand(CommandNames.AutoHoleFaceSetting, new AutoHoleFaceSetting());
//绘制复合实体
commandMachine.RegisterCommand(CommandNames.Combine, new Command_CombineEntity());
//Template
// commandMachine.RegisterCommand(CommandNames.Template, new ShowTemplate("Administration"));
// commandMachine.RegisterCommand(CommandNames.TemplateCollection, new ShowTemplate("Collection"));
// commandMachine.RegisterCommand(CommandNames.TemplateDesign, new ShowTemplateDesign());
// commandMachine.RegisterCommand(CommandNames.Modeling, new Command_Modeling());
// commandMachine.RegisterCommand(CommandNames.templateDelete, new Command_DeleteTemplate());
// commandMachine.RegisterCommand(CommandNames.TemplateCheck, new Command_TemplateSearch(true));
// commandMachine.RegisterCommand(CommandNames.TemplateGroup, new Command_TemplateGroup());
// commandMachine.RegisterCommand(CommandNames.SpliteTemplate, new Command_SplitTemplate());
// commandMachine.RegisterCommand("SplitTemplateX", new Command_SplitTemplateByDir(0));
// commandMachine.RegisterCommand(CommandNames.SplitTemplateY, new Command_SplitTemplateByDir(1));
// commandMachine.RegisterCommand("SplitTemplateZ", new Command_SplitTemplateByDir(2));
// commandMachine.RegisterCommand(CommandNames.RotateTemplateSpace, new Command_RotateTemplateSpace());
// commandMachine.RegisterCommand(CommandNames.RenderModulesState, new Command_RenderModulesState());
//优化算法
// if (IsTest())
// {
// commandMachine.RegisterCommand("DebugTemplateAssocCount", new Command_DebugTemplateAssocCount());
//
// commandMachine.RegisterCommand("testlir", new Command_TestLIR());
//
//
// commandMachine.RegisterCommand("testNFP", new Command_TestNFP());
// commandMachine.RegisterCommand("testSimply", new Command_TestSimply());
// commandMachine.RegisterCommand("testSimply2", new Command_TestPolylin2Points());
// commandMachine.RegisterCommand("testPlace", new Command_TestPlace());
// commandMachine.RegisterCommand("testYH", new Command_TestYHWorker());
// commandMachine.RegisterCommand("testYH2", new Command_TestYH2());
// commandMachine.RegisterCommand("testYHSingle", new Command_TestYHSingle());
// commandMachine.RegisterCommand("testYHDraw", new Command_TestDrawYHData());
// commandMachine.RegisterCommand("testYHDraw2", new Command_TestDrawYHData2());
// commandMachine.RegisterCommand("testYHSave", new Command_TestSaveYHData());
// commandMachine.RegisterCommand("testSum", new Command_TestSum());
// commandMachine.RegisterCommand("TestSimplyOddments", new Command_TestSimplyOddments());
// commandMachine.RegisterCommand("TestParseOddments", new Command_TestParseOddments()); //分析余料
// commandMachine.RegisterCommand("TestContainer", new Command_TestContainer()); //绘制Container
// }
commandMachine.RegisterCommand(CommandNames.EditorLattice, new EditorLattice());
// commandMachine.RegisterCommand(CommandNames.Print, new Print());
commandMachine.RegisterCommand(CommandNames.Extrude, new DrawExtrude());
commandMachine.RegisterCommand(CommandNames.HoleTemplate, new ShowDrillingTemplate());
commandMachine.RegisterCommand(CommandNames.CheckModeling, new CheckModeling());
//导出数据
// commandMachine.RegisterCommand(CommandNames.ExportData, new Command_ExportData());
// commandMachine.RegisterCommand(CommandNames.ExportView, new Command_ExportView());
// commandMachine.RegisterCommand(CommandNames.EnableSyncData, new Command_EnableSyncData());
// commandMachine.RegisterCommand(CommandNames.DisableSyncData, new Command_DisableSyncData());
// commandMachine.RegisterCommand(CommandNames.ToggleSyncData, new Command_ToggleSyncData());
// commandMachine.RegisterCommand(CommandNames.ToggleViewFollow, new Command_ToggleViewFollow());
//加工组
commandMachine.RegisterCommand(CommandNames.ShowProcessingGroupModal, new Command_ShowProcessingGroupModal());
//对纹组
// if (IsTest())
// commandMachine.RegisterCommand(CommandNames.AlignLineGroup, new Command_AlignLineGroup());
commandMachine.RegisterCommand(CommandNames.Text2Curve, new Text2Curve());
commandMachine.RegisterCommand(CommandNames.DrawVSBOX, new DrawVisualSpaceBox());
commandMachine.RegisterCommand(CommandNames.Align, new Align());
// commandMachine.RegisterCommand(CommandNames.BuyMaterial, new BuyMaterial());
commandMachine.RegisterCommand(CommandNames.Interfere, new Interfere());
// commandMachine.RegisterCommand(CommandNames.Knife, new ShowKinfeManageModal());
commandMachine.RegisterCommand(CommandNames.PickUp2DModelCsgs, new Command_PickUp2DModelCsgs());
// commandMachine.RegisterCommand(CommandNames.ModifyGroovesKnife, new Command_GroovesModify());
commandMachine.RegisterCommand(CommandNames.ShowDoor, new Command_SwitchDoorOrDrawer(true, true));
commandMachine.RegisterCommand(CommandNames.HideDoor, new Command_SwitchDoorOrDrawer(false, true));
commandMachine.RegisterCommand(CommandNames.ShowDrawer, new Command_SwitchDoorOrDrawer(true, false));
commandMachine.RegisterCommand(CommandNames.HideDrawer, new Command_SwitchDoorOrDrawer(false, false));
commandMachine.RegisterCommand(CommandNames.Show2DPathLine, new Command_Show2DPathLine(true));
commandMachine.RegisterCommand(CommandNames.Hide2DPathLine, new Command_Show2DPathLine(false));
commandMachine.RegisterCommand(CommandNames.Show2DPathObject, new Command_Show2DPathObject(true));
commandMachine.RegisterCommand(CommandNames.Hide2DPathObject, new Command_Show2DPathObject(false));
//线条变矩形
commandMachine.RegisterCommand(CommandNames.Curve2Rect, new Command_Curve2Polyline());
commandMachine.RegisterCommand(CommandNames.R2b, new Polyline2Board());
commandMachine.RegisterCommand(CommandNames.Curve2VSBox, new Command_Curve2VSBox());
commandMachine.RegisterCommand(CommandNames.SetSmoothEdge, new SetSmoothEdge());
commandMachine.RegisterCommand(CommandNames.ClearRef, new DeleteRelevance());
commandMachine.RegisterCommand(CommandNames.Clear2DModeling, new Command_ClearBoard2DModeling());
commandMachine.RegisterCommand(CommandNames.ExportobjMtl, new Command_ExportObjAndMtl());
commandMachine.RegisterCommand(CommandNames.ExportObj, new Command_ExportObj());
commandMachine.RegisterCommand(CommandNames.ExportSTL, new Command_ExportSTL());
commandMachine.RegisterCommand(CommandNames.UpdateBoardInfos, new UpdateBoardInfos());
commandMachine.RegisterCommand(CommandNames.ToggleUI, new Command_ToggleUI());
commandMachine.RegisterCommand(CommandNames.BoardReplaceTempate, new BoardReplaceTempate());
commandMachine.RegisterCommand(CommandNames.ResetCustomCommand, new Command_ResetCustomCommand());
commandMachine.RegisterCommand(CommandNames.Dist, new Command_Dist());
// commandMachine.RegisterCommand(CommandNames.RecyleBin, new ShowRecycleBin());
commandMachine.RegisterCommand(CommandNames.ChangeColorByMaterial, new ChangeColorByMaterial());
commandMachine.RegisterCommand(CommandNames.ChangeColorByRoomOrCabinet, new ChangeColorByRoomCabinet());
commandMachine.RegisterCommand(CommandNames.ChangeBoardColorByPBFace, new Command_ChangeBoardColorByPBFace());
commandMachine.RegisterCommand(CommandNames.TextModifyTool, new Command_TextModifyTool());
commandMachine.RegisterCommand(CommandNames.SelectAll, new SelectAll());
commandMachine.RegisterCommand(CommandNames.CheckHoles, new CheckHoles());
commandMachine.RegisterCommand(CommandNames.CombinatAttributeBrush, new CombinatAttributeBrush());
commandMachine.RegisterCommand(CommandNames.MatchProp, new Command_MatchProp());
commandMachine.RegisterCommand(CommandNames.Rect2Winerack, new Polyline2Winerack());
commandMachine.RegisterCommand(CommandNames.EditFrame, new EditFrame());
commandMachine.RegisterCommand(CommandNames.EditView, new EditViewport());
commandMachine.RegisterCommand(CommandNames.MView, new DrawViewport());
commandMachine.RegisterCommand(CommandNames.MView4, new Draw4Viewport());
commandMachine.RegisterCommand(CommandNames.ShowFrame, new ShowFrmae());
commandMachine.RegisterCommand(CommandNames.OneKeyLayout, new OneKeyLayout());
commandMachine.RegisterCommand(CommandNames.SwitchLines, new SwitchLines());
commandMachine.RegisterCommand(CommandNames.SwitchOpenDirLines, new ShowOpenDirLiens());
commandMachine.RegisterCommand(CommandNames.MView2, new Draw2Viewport());
commandMachine.RegisterCommand(CommandNames.MView3, new Draw3Viewport());
commandMachine.RegisterCommand(CommandNames.OneKeyPrint, new OneKeyPrint());
commandMachine.RegisterCommand(CommandNames.SetHoleNoneType, new SetHoleNoneType());
commandMachine.RegisterCommand(CommandNames.FindMaxSizeBoard, new FindMaxOrMinSizeBoard());
commandMachine.RegisterCommand(CommandNames.FindMinSizeBoard, new FindMaxOrMinSizeBoard(false));
commandMachine.RegisterCommand(CommandNames.FindBoardModelingKnife, new Command_FindBoardModelingKnife());
commandMachine.RegisterCommand(CommandNames.CheckNoHoleBoard, new CheckHasHoleBoard());
commandMachine.RegisterCommand(CommandNames.CheckDrawHole, new CheckDrawHole());
commandMachine.RegisterCommand(CommandNames.FindModelKnifeRadius, new FindModeingKnifeRadius());
// commandMachine.RegisterCommand(CommandNames.EditorBBS, new ShowEditorBBS());
commandMachine.RegisterCommand(CommandNames.ToggleDrillingReactor, new ToggleDrillingReactor());
commandMachine.RegisterCommand(CommandNames.OneClickInspection, new OneClickInspection());
commandMachine.RegisterCommand(CommandNames.AddAloneDrillLock, new AddAloneDrillLock(true));
commandMachine.RegisterCommand(CommandNames.RemoveAloneDrillLock, new AddAloneDrillLock(false));
commandMachine.RegisterCommand(CommandNames.AddAssocDrillLock, new AddAssocDrillLock());
commandMachine.RegisterCommand(CommandNames.RemoveAssocDrillLock, new RemoveAssocDrillLock());
commandMachine.RegisterCommand(CommandNames.RemoveDrillLock, new RemoveDrillLock());
commandMachine.RegisterCommand(CommandNames.CuttingFace, new CuttingByFace());
commandMachine.RegisterCommand(CommandNames.CuttingRectFace, new CuttingByRectFace());
commandMachine.RegisterCommand(CommandNames.DrawTempByImport, new DrawTemplateByImport());
commandMachine.RegisterCommand(CommandNames.R2B2, new Rect2Board());
commandMachine.RegisterCommand(CommandNames.FixIntSelfContour, new FixIntersectSelfContour());
commandMachine.RegisterCommand("fix2dpath", new Command_Fix2DPath());
commandMachine.RegisterCommand(CommandNames.ParseHinge, new ParseHinge());
commandMachine.RegisterCommand(CommandNames.ParseHandle, new ParseHandle());
commandMachine.RegisterCommand(CommandNames.ZhengWen, new SetBoardLines(0));
commandMachine.RegisterCommand(CommandNames.FanWen, new SetBoardLines(1));
commandMachine.RegisterCommand(CommandNames.KeFanZuan, new SetBoardLines(2));
commandMachine.RegisterCommand(CommandNames.ZhengMian, new SetComposingFace(0));
commandMachine.RegisterCommand(CommandNames.FanMian, new SetComposingFace(1));
commandMachine.RegisterCommand(CommandNames.SuiYiMian, new SetComposingFace(2));
commandMachine.RegisterCommand(CommandNames.ShowHSPanel, new ShowHideSelectPanel());
commandMachine.RegisterCommand(CommandNames.ParseBoardName, new Command_ParseBoardName());
commandMachine.RegisterCommand(CommandNames.Down, new Command_Cmd_Down());
//Gizmo
commandMachine.RegisterCommand(CommandNames.AxesDisable, new Command_SetGizmoMode(TransMode.OCS));
commandMachine.RegisterCommand(CommandNames.AxesTranslate, new Command_SetGizmoMode(TransMode.Move));
commandMachine.RegisterCommand(CommandNames.AxesRotate, new Command_SetGizmoMode(TransMode.Rotate));
commandMachine.RegisterCommand(CommandNames.AxesScale, new Command_SetGizmoMode(TransMode.Scale));
commandMachine.RegisterCommand(CommandNames.GizmoCSSwith, new Command_GizmoCSSwith());
//Room
// commandMachine.RegisterCommand(CommandNames.DrawWall, new Command_DrawWall());
// commandMachine.RegisterCommand(CommandNames.DrawWallInside, new Command_DrawWallInside());
// commandMachine.RegisterCommand(CommandNames.Curve2Wall, new Command_Curve2Wall());
// commandMachine.RegisterCommand(CommandNames.SetWallThick, new Command_SetWallThick());
// commandMachine.RegisterCommand(CommandNames.DrawRectWall, new Command_DrawRectWall());
//
// commandMachine.RegisterCommand(CommandNames.DrawIHole, new Command_DrawHole(DrawHoleType.I, IHoleType.Window));
// commandMachine.RegisterCommand(CommandNames.DrawDoorHole, new Command_DrawHole(DrawHoleType.I, IHoleType.Door));
// commandMachine.RegisterCommand(CommandNames.DrawLHole, new Command_DrawHole(DrawHoleType.L));
// commandMachine.RegisterCommand(CommandNames.DrawUHole, new Command_DrawHole(DrawHoleType.U));
// commandMachine.RegisterCommand(CommandNames.DrawIWindow, new Command_DrawRoomWindow(DrawHoleType.I, IHoleType.Window));
// commandMachine.RegisterCommand(CommandNames.DrawLWindow, new Command_DrawRoomWindow(DrawHoleType.L, IHoleType.Window));
// commandMachine.RegisterCommand(CommandNames.DrawUWindow, new Command_DrawRoomWindow(DrawHoleType.U, IHoleType.Window));
// commandMachine.RegisterCommand(CommandNames.DrawIDoor, new Command_DrawRoomDoor()); //门
// commandMachine.RegisterCommand(CommandNames.YZC, new Command_OneKeyDrawYZCWindow(DrawHoleType.I, IHoleType.Window, true)); //一字窗
// commandMachine.RegisterCommand(CommandNames.LDC, new Command_OneKeyDrawLDCWindow(DrawHoleType.I, IHoleType.Window, true)); //落地窗
// commandMachine.RegisterCommand(CommandNames.PC, new Command_OneKeyDrawPCWindow(DrawHoleType.I, IHoleType.Window, true)); //飘窗
// commandMachine.RegisterCommand(CommandNames.ZJC, new Command_OneKeyDrawZJCWindow(DrawHoleType.L, IHoleType.Window, true)); //转角窗
// commandMachine.RegisterCommand(CommandNames.ZJPC, new Command_OneKeyDrawZJPCWindow(DrawHoleType.L, IHoleType.Window, true)); //转角飘窗
//
// commandMachine.RegisterCommand(CommandNames.YJHM, new Command_OneKeyDrawYJHMWindow(true)); //一键画门
commandMachine.RegisterCommand(CommandNames.HeadCeilingContour, new Command_HeadCeilingContourManage()); //吊顶轮廓材质面板
commandMachine.RegisterCommand(CommandNames.HeadCeilingMaterialPanel, new Command_HeadCeilingMaterialPanel()); //吊顶轮廓材质面板
commandMachine.RegisterCommand(CommandNames.HeadCeilingInfoConfigPanel, new Command_HeadCeilingInfoConfigPanel()); //吊顶轮廓材质面板
//SelectEntity
// commandMachine.RegisterCommand(CommandNames.SelectBoard, new Command_SelectEntity(Board, "请选择板:"));
// commandMachine.RegisterCommand(CommandNames.SelectCurve, new Command_SelectEntity(Curve, "请选择曲线:"));
// commandMachine.RegisterCommand(CommandNames.SelectDim, new Command_SelectEntity(Dimension, "请选择尺寸:"));
// commandMachine.RegisterCommand(CommandNames.SelectText, new Command_SelectEntity(DbText, "请选择文字:"));
if (IsTest())
commandMachine.RegisterCommand("ParseWall", new Command_ParseRoomWall());
//画廊命令
// commandMachine.RegisterCommand(CommandNames.Gallery, new Command_Gallery());
//在线售后
// commandMachine.RegisterCommand(CommandNames.SendCADFileToKF, new Command_SendCADFileOnKf());
//修改注册位置
commandMachine.RegisterCommand(CommandNames.Attach, new TemplateAttach());
commandMachine.RegisterCommand(CommandNames.Attach2, new TemplateAttach2());
commandMachine.RegisterCommand(CommandNames.TemplateArray, new TemplateArray());
}
export async function LimitCommand()
{
if (userConfig.showShareModule)
commandMachine.RegisterCommand(CommandNames.TemplateSearch, new Command_TemplateSearch());
}

@ -278,7 +278,7 @@ async function LoadData(): Promise<{ cadFile: CADFiler; urlSearch: URLSearchPara
const data = JSON.parse(await res.text());
if (data.err_code === RequestStatus.Ok)
{
// userConfig.uese = data.fileInfo.uese;
userConfig.uese = data.fileInfo.uese;
const file = JSON.parse(inflateBase64(data.fileInfo.file));
document.title = data.fileInfo.name;
if (data.fileInfo.props && Object.prototype.toString.call(data.fileInfo.props) === '[object Object]')

@ -10,13 +10,13 @@ import { isHasTouch } from '../../Common/Utils';
import { ZINDEX } from '../../Common/ZIndex';
import { Entity } from '../../DatabaseServices/Entity/Entity';
import { commandMachine } from '../../Editor/CommandMachine';
import { registerCommand } from '../../Editor/CommandRegister';
import { MouseUI } from '../../Editor/TouchEditor/MouseUIComp';
import { VirtualKeys } from '../../Editor/TouchEditor/VirtualKeysComp';
import { CameraControlBtn } from '../../UI/Components/CameraControlButton/CameraControlBtn';
import { ShowLinesToaster, __AppToasterShowEntityMsg } from '../../UI/Components/Toaster';
import ShareViewUI from './components/ShareViewUI';
import { registerCommand } from './ShareViewCommandRegister';
import { ShareViewService } from './ShareViewService';
import ShareViewUI from './components/ShareViewUI';
// export let appUi: ShareViewLayout;

@ -42,6 +42,29 @@ export const ViewAngleTypes = [
];
//仅在分享图纸shareView使用
export function getViewStyleTypes(mode: string)
{
if (mode == "HouseRoaming")
{
return [
{
title: "概念",
renderType: RenderType.Conceptual,
},
{
title: "真实",
renderType: RenderType.Physical,
},
{
title: "真实带线框",
renderType: RenderType.Physical2,
},
];
}
return ViewStyleTypes;
}
export const ViewStyleTypes = [
{
title: "二维线框",

@ -4,6 +4,7 @@ import { begin, end } from "xaop";
import { ApplicationService, app } from "../../ApplicationServices/Application";
import { HostApplicationServices } from "../../ApplicationServices/HostApplicationServices";
import { EBoardKeyList } from "../../Common/BoardKeyList";
import { MouseKey } from "../../Common/KeyEnum";
import { DuplicateRecordCloning } from "../../Common/Status";
import { Hole } from "../../DatabaseServices/3DSolid/Hole";
import { BoardLinesReactor } from "../../DatabaseServices/BoardLinesReactor";
@ -11,6 +12,7 @@ import { CADFiler } from "../../DatabaseServices/CADFiler";
import { Database } from "../../DatabaseServices/Database";
import { Board } from "../../DatabaseServices/Entity/Board";
import { Entity } from "../../DatabaseServices/Entity/Entity";
import { EntityRef } from "../../DatabaseServices/Entity/EntityRef";
import { HardwareCompositeEntity } from "../../DatabaseServices/Hardware/HardwareCompositeEntity";
import { HardwareTopline } from "../../DatabaseServices/Hardware/HardwareTopline";
import { IdMaping } from "../../DatabaseServices/IdMaping";
@ -21,6 +23,7 @@ import { WblockCloneFiler2 } from "../../DatabaseServices/WblockCloneFiler";
import { AutoSaveServer } from "../../Editor/AutoSave";
import { BoardMoveTool } from "../../Editor/BoardMoveTool";
import { CameraControls } from "../../Editor/CameraControls";
import { CommandState } from "../../Editor/CommandState";
import { ContextMenuServices } from "../../Editor/ContextMenu";
import { DbClickManager } from "../../Editor/DbClick/DbClick";
import { Editor } from "../../Editor/Editor";
@ -44,8 +47,10 @@ import { DownPanelStore } from "../../UI/Store/DownPanelStore";
import { HardwareCuttingReactor } from "../BoardCutting/HardwareCuttingReactor";
import { DrillingReactor } from "../DrawDrilling/DrillingReactor";
import { Purge } from "../Purge";
import { ShareViewStore } from "./ShareViewStore";
import { ShareViewCameraControl } from "./ShareViewCameraControl";
import { RoamingSwitches, ShareViewStore } from "./ShareViewStore";
import { MaterialDetailScrollTo } from "./ShareViewUtil";
import { ShareViewViewer } from "./ShareViewViewer";
import { SimpleBoard } from "./SimpleBoard";
import { SetSelectedBoardChange } from "./StoreEvent";
export let shareViewApp: ShareViewService;
@ -55,6 +60,9 @@ export class ShareViewService extends ApplicationService
// WebSocket: WebSocketClientServer = null;
BoxCtrl: ShareService;
override Viewer: Viewer;
override CameraControls: CameraControls;
constructor()
{
super();
@ -101,6 +109,14 @@ export class ShareViewService extends ApplicationService
ShareViewStore.GetInstance().SelectedBoard = null;
}
});
// 假装执行命令以屏蔽右键菜单,可能会有副作用
document.addEventListener('pointerdown', e =>
{
if (e.button === MouseKey.Right || e.pointerType === 'touch') // 右键,或是按住触屏时
CommandState.CommandIng = true;
});
SetSelectedBoardChange(null, () =>
{
originUpdateSelectEvent.call(this.Editor.SelectCtrl); // 单选显示标注
@ -132,7 +148,7 @@ export class ShareViewService extends ApplicationService
let container = document.getElementById("Webgl");
//渲染器
this.Viewer = new Viewer(container);
this.Viewer = new ShareViewViewer(container);
this.Viewer.RenderDatabase(this.Database);
@ -177,9 +193,11 @@ export class ShareViewService extends ApplicationService
});
//性能测试
// new RenderPerformanceStatus(this.Viewer);
// const rps = new RenderPerformanceStatus(this.Viewer);
// rps.m_Stats.dom.style.top = '8vh';
//相机控制
this.CameraControls = new CameraControls(this.Viewer);
this.CameraControls = new ShareViewCameraControl(this.Viewer);
this.Editor = new Editor(this);
this.Gesture = new Gesture(this.Editor);
@ -273,12 +291,12 @@ export class ShareViewService extends ApplicationService
this.MoveTool = new BoardMoveTool();
this.LayoutTool = new LayoutTool();
new CameraUpdateForIos(this.Viewer.CameraControl);
new CameraUpdateForIos(this.Viewer.CameraControl); //-> 会导致摄像机位置受限
}
override CreateDocument(name?: string): void { }
override SendCameraPosToRenderer: () => void;
override SendCameraPosToRenderer() { }
// 新增方法
async LoadFile(f: CADFiler)
@ -384,6 +402,107 @@ export class ShareViewService extends ApplicationService
}
}
}
// private materialEnvMap: Record<string, Texture>;
/**
*
*/
ResetViewState: () => Promise<void>;
CheckHouseRoamingSwitches(switches: RoamingSwitches)
{
const shareViewStore = ShareViewStore.GetInstance();
return (shareViewStore.HouseRoamingSwitches & switches) > 0;
}
ApplyHouseRoamingSwitches(changeSwitches?: RoamingSwitches, needUpdate: boolean = false)
{
const shareViewStore = ShareViewStore.GetInstance();
if (changeSwitches)
{
shareViewStore.HouseRoamingSwitches ^= changeSwitches;
}
// 初始化
// if (!this.materialEnvMap)
// {
// this.materialEnvMap = {};
// for (const [key, value] of this.Database.MaterialTable.Materials)
// {
// this.materialEnvMap[key] = value.Material.envMap;
// }
// }
// 切换柜体显示
if (this.CheckHouseRoamingSwitches(RoamingSwitches.Decoration))
{
for (let e of this.Database.ModelSpace.Entitys)
{
if (e instanceof EntityRef)
{
e.Visible = true;
}
}
} else
{
for (let e of this.Database.ModelSpace.Entitys)
{
if (e instanceof EntityRef)
{
e.Visible = false;
}
}
}
// for (const [key, value] of this.Database.MaterialTable.Materials)
// {
// if (value.type === "金属" && value.Material.metalness > 0.9)
// {
// value.type = "玻璃";
// // value.color = "#ffffff";
// value.Update();
// // value.Material.color = new Color(255, 255, 255);
// }
// // 使用ue材质的
// if (value.ref?.length > 0)
// {
// if (value.ref.indexOf('/玻璃/') == 0 && value.type != "玻璃")
// {
// value.type = "玻璃";
// value.Update();
// }
// // console.log('material-ref', value);
// }
// }
if (this.CheckHouseRoamingSwitches(RoamingSwitches.EnvMap))
{
this.Database.AmbientLight.Intensity = 0.7;
this.Database.HemisphereLight.Intensity = 0.7;
for (const [key, value] of this.Database.MaterialTable.Materials)
{
// value.Material.envMap = this.materialEnvMap[key];
value.Material.envMapIntensity = 1;
}
} else
{
// intensity 0 1.7 1.7
this.Database.AmbientLight.Intensity = 1.5;
this.Database.HemisphereLight.Intensity = 1.5;
for (const [key, value] of this.Database.MaterialTable.Materials)
{
// 禁用环境贴图
// value.Material.envMap = null;
value.Material.envMapIntensity = 0.4;
}
}
if (needUpdate)
{
this.Editor.UpdateScreen();
}
}
}
class IgnoreAutoSave extends AutoSaveServer
{

@ -4,6 +4,8 @@ import { Singleton } from "../../Common/Singleton";
import { safeEval } from "../../Common/eval";
import { Board } from "../../DatabaseServices/Entity/Board";
import { DefaultShareBoardInfConfigurationOption } from "../../Editor/DefaultConfig";
import { CameraType } from "../../GraphicsSystem/CameraUpdate";
import { RenderType } from "../../GraphicsSystem/RenderType";
import { IConfigOption } from "../../UI/Components/Board/UserConfigComponent";
import { IConfigStore } from '../../UI/Store/BoardStore';
import { ShareBoardInfConfigurationOption } from "../../UI/Store/OptionInterface/IOptionInterface";
@ -14,6 +16,7 @@ interface IProps
showBom?: boolean | null;
}
interface IOperations
{
showDoor: boolean;
@ -25,6 +28,21 @@ interface IOperations
showCylinderHole: boolean;
}
/**
* ,
*/
export enum RoamingSwitches
{
Default = 0,
/**
*
*/
Decoration = 1 << 0,
// 环境贴图
EnvMap = 2 << 1,
}
export class ShareViewStore extends Singleton implements IConfigStore
{
//当前选中柜子的索引列表
@ -36,14 +54,35 @@ export class ShareViewStore extends Singleton implements IConfigStore
@observable ViewIDErrorMsg: string = '';
/** 相机类型 */
@observable CameraType: CameraType = CameraType.OrthographicCamera;
// 主题 画布颜色
@observable Theme: 'light' | 'dark' | string = 'light';
// 纪录上一次
@observable ThemeLog: 'light' | 'dark' | string = '';
/** 是否处于户型漫游模式 */
@observable HouseRoamingMode: boolean = false;
/**
*
*/
@observable HouseRoamingSwitches: RoamingSwitches = RoamingSwitches.Default;
/**
*
*/
@observable HouseRoamingRenderType: RenderType = RenderType.Physical2;
/** 用户调整的横屏视野 */
@observable userFovLandscape: number = 90;
/** 用户调整的竖屏视野 */
@observable userFovPortrait: number = 60;
// 后台配置数据
@observable Props: IProps = {};
@observable m_Option: ShareBoardInfConfigurationOption = DefaultShareBoardInfConfigurationOption;
@observable viewUploadProps: ShareBoardInfConfigurationOption = DefaultShareBoardInfConfigurationOption;

@ -76,6 +76,10 @@ canvas {
// bottom: calc(50px + constant(safe-area-inset-bottom));
// bottom: calc(50px + env(safe-area-inset-bottom));
top: 4px;
display: flex;
flex-direction: column;
max-height: 80vh;
flex-wrap: wrap-reverse;
>div,
.sp-view-angle-icon,
@ -102,12 +106,12 @@ canvas {
.sp-qrcode-icon,
.sp-view-angle-icon {
margin-top: 8px;
margin: 4px;
}
.sp-board-hide-icon {
color: #1890ff;
margin-top: 12px;
margin: 4px;
}
}
@ -617,6 +621,115 @@ canvas {
}
}
// 防止长按复制
body {
-webkit-touch-callout: none;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.sp-mobile-control {
position: fixed;
left: 0;
top: 0;
width: 100%;
height: 100%;
pointer-events: none; // 仅作父级,防止遮挡
// nipple js 用
// 摇杆判定区
.sp-mobile-control-joystick {
position: absolute;
display: flex;
// 区分横竖屏
@media (orientation: landscape) {
width: 50%;
height: 100%;
left: 0;
top: 0;
}
@media (orientation: portrait) {
width: 100%;
height: 35vh;
left: 0;
bottom: calc(44px + env(safe-area-inset-bottom)); // 防止遮挡底部按钮
}
}
// 移动端方向键
.sp-mobile-control-joystick-simple {
position: absolute;
width: 140px;
height: 140px;
background-color: rgba(0, 0, 0, 0.2);
border-radius: 50%;
left: 6%;
bottom: 5vh;
pointer-events: fill;
.sp-m-joystick {
position: absolute;
height: 55px;
width: 55px;
cursor: pointer;
}
.sp-m-joystick-left {
.sp-m-joystick();
transform: translate(0, -50%);
left: 0;
top: 50%;
}
.sp-m-joystick-right {
.sp-m-joystick();
transform: translate(0, -50%);
right: 0;
top: 50%;
}
.sp-m-joystick-forward {
.sp-m-joystick();
transform: translate(-50%, 0);
left: 50%;
top: 0;
}
.sp-m-joystick-back {
.sp-m-joystick();
transform: translate(-50%, 0);
left: 50%;
bottom: 0;
}
}
// 镜头升降按钮
.sp-mobile-control-btns {
position: absolute;
right: 12%;
bottom: 10vh;
display: flex;
background-color: rgba(0, 0, 0, 0.2);
border-radius: 16px;
button {
padding: 0;
margin: 5px;
border: none;
background: transparent;
width: 50px;
height: 50px;
pointer-events: auto;
}
}
}
@media screen and (min-width: 768px) {
.sp-select-ul li:hover,

@ -461,6 +461,10 @@ export function GetBlockNo(index)
{
return shareViewApp.BoxCtrl.BlockNoDict[index]?.blockNo ?? '';
}
export function GetCustomBlockNo(idx)
{
return shareViewApp
}
//获取板颜色
export function GetBlockColor(item)
{

@ -0,0 +1,65 @@
import hotkeys from "hotkeys-js-ext";
import { CalcSunShadowCameraExtents } from "../../Common/LightUtils";
import { Database } from "../../DatabaseServices/Database";
import { RoomFlatBase } from "../../DatabaseServices/Room/Entity/Flat/RoomFlatBase";
import { RoomHoleBase } from "../../DatabaseServices/Room/Entity/Wall/Hole/RoomHoleBase";
import { RoomWallBase } from "../../DatabaseServices/Room/Entity/Wall/RoomWallBase";
import { IsPhysical, RenderType } from "../../GraphicsSystem/RenderType";
import { Viewer } from "../../GraphicsSystem/Viewer";
import { shareViewApp } from "./ShareViewService";
export class ShareViewViewer extends Viewer
{
constructor(canvasContainer: HTMLElement)
{
super(canvasContainer);
this.RegisterKeyEvent();
}
// TODO: Error: hotkeys-js-ext的事件监听似乎有问题可能是被Webpack优化了
RegisterKeyEvent = () =>
{
document.addEventListener('keydown', function (e)
{
hotkeys.dispatch(e);
});
window.addEventListener('focus', hotkeys.clearDownKeys); // hack 在丢失焦点的时候也清理快捷键
window.addEventListener('blur', hotkeys.clearDownKeys);
document.addEventListener('keyup', function (e)
{
hotkeys.dispatch(e);
hotkeys.clearModifier(e);
});
};
Update = () =>
{
this.StartRender();
};
async UpdateRenderType(db: Database, type: RenderType)
{
for (let index = 0; index < db.ModelSpace.Entitys.length; index++)
{
let en = db.ModelSpace.Entitys[index];
if (en.Visible)
{
if (type == RenderType.Physical2 && (en instanceof RoomWallBase || en instanceof RoomFlatBase || en instanceof RoomHoleBase))
{
en.UpdateRenderType(RenderType.Physical);
} else
{
en.UpdateRenderType(type);
}
}
}
if (IsPhysical(type))
CalcSunShadowCameraExtents(shareViewApp.Database.SunLight);
this.UpdateRender();
}
}

@ -0,0 +1,25 @@
import React from "react";
import { shareViewApp } from "../ShareViewService";
import { ShareViewStore } from "../ShareViewStore";
function CameraSwitchButton()
{
const SwitchCamera = () => {
shareViewApp.Viewer.CameraControl.SwitchCamera();
ShareViewStore.GetInstance().CameraType = shareViewApp.Viewer.CameraControl.CameraType;
// shareViewApp.Viewer.UpdateRender();
}
return (
<div className="sp-view-angle-icon" onClick={SwitchCamera} title="切换相机模式" >{
<svg fill="#1890ff" height="20" width="20" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" strokeWidth="0"></g>
<g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path
d="M18 11c0-.959-.68-1.761-1.581-1.954C16.779 8.445 17 7.75 17 7c0-2.206-1.794-4-4-4-1.516 0-2.822.857-3.5 2.104C8.822 3.857 7.516 3 6 3 3.794 3 2 4.794 2 7c0 .902.312 1.726.817 2.396A1.993 1.993 0 0 0 2 11v8c0 1.103.897 2 2 2h12c1.103 0 2-.897 2-2v-2.637l4 2v-7l-4 2V11zm-5-6c1.103 0 2 .897 2 2s-.897 2-2 2-2-.897-2-2 .897-2 2-2zM6 5c1.103 0 2 .897 2 2s-.897 2-2 2-2-.897-2-2 .897-2 2-2z"></path>
</g>
</svg>
}</div>
)
}
export default CameraSwitchButton;

@ -0,0 +1,159 @@
import React, { useEffect, useState } from "react";
import { end } from "xaop";
import { app } from "../../../ApplicationServices/Application";
import { CommandNames } from "../../../Common/CommandNames";
import { Entity } from "../../../DatabaseServices/Entity/Entity";
import { EntityRef } from "../../../DatabaseServices/Entity/EntityRef";
import { Light } from "../../../DatabaseServices/Lights/Light";
import { RoomFlatBase } from "../../../DatabaseServices/Room/Entity/Flat/RoomFlatBase";
import { RoomRegion } from "../../../DatabaseServices/Room/Entity/Region/RoomRegion";
import { RoomWallBase } from "../../../DatabaseServices/Room/Entity/Wall/RoomWallBase";
import { commandMachine } from "../../../Editor/CommandMachine";
import { VisualSpaceBox } from "../../../Editor/VisualSpaceBox";
import { CameraType } from "../../../GraphicsSystem/CameraUpdate";
import { shareViewApp } from "../ShareViewService";
import { ShareViewStore } from "../ShareViewStore";
import { resetBoxView } from "../ShareViewUtil";
const defaultFovLandscape = 60;
const defaultFovPortrait = 100;
// TBD: 漫游切换逻辑可以提取到相机控制类
function HouseRoamingButton()
{
let [roaming, SetRoaming] = useState(false);
const shareViewStore = ShareViewStore.GetInstance();
useEffect(() =>
{
shareViewStore.HouseRoamingMode = roaming;
}, [roaming]);
const lazyLoadEntities: Entity[] = [];
const roomEntities: Entity[] = [];
for (let e of app.Database.ModelSpace.Entitys)
{
if (e.IsErase) continue;
if (e instanceof EntityRef) continue;
if (e instanceof RoomRegion) continue;
if (e instanceof VisualSpaceBox) continue;
if (e instanceof RoomWallBase || e instanceof RoomFlatBase)
{
roomEntities.push(e);
} else
{
lazyLoadEntities.push(e);
}
}
/**
*
*/
async function EnterHouseRoamingMode()
{
await shareViewApp.ResetViewState();
SetRoaming(true);
// 禁用左键选择
end(shareViewApp.Editor.SelectCtrl, shareViewApp.Editor.SelectCtrl.LeftClick, () => shareViewApp.Editor.SelectCtrl.Cancel());
// 切换为透视相机
shareViewApp.Viewer.CameraControl.CameraType = CameraType.PerspectiveCamera;
shareViewStore.CameraType = CameraType.PerspectiveCamera;
// 设置摄像机视野
shareViewStore.userFovPortrait = defaultFovPortrait;
shareViewStore.userFovLandscape = defaultFovLandscape;
function initFov()
{
if (screen.orientation.type.startsWith("portrait"))
shareViewApp.Viewer.CameraCtrl.Fov = shareViewStore.userFovPortrait;
else if (screen.orientation.type.startsWith("landscape"))
shareViewApp.Viewer.CameraCtrl.Fov = shareViewStore.userFovLandscape;
}
window.addEventListener('orientationchange', () => initFov());
initFov();
for (const e of app.Database.Lights.Entitys)
{
if (e instanceof Light)
{
e.ShowHelper = false;
}
}
// 隐藏其他实体
for (let e of lazyLoadEntities)
{
e.Visible = false;
}
// 加载户型
for (let e of roomEntities)
{
e.Visible = true;
}
shareViewApp.ApplyHouseRoamingSwitches(); // 切换基础显示
// 重置视图
resetBoxView();
// 初始化完成,耗时操作在下面处理
// 加载其他模型
for (let e of lazyLoadEntities)
{
e.Visible = true;
}
setTimeout(() =>
{
shareViewApp.Viewer.UpdateRenderType(shareViewApp.Database, shareViewStore.HouseRoamingRenderType);
}, 300);
// shareViewApp.ApplyHouseRoamingSwitches(RoamingSwitches.EnvMap, true);
}
function LeaveHouseRoamingMode()
{
shareViewStore.HouseRoamingMode = false;
// 重置场景物体
for (let e of app.Database.ModelSpace.Entitys)
if (!e.IsErase)
e.Visible = false;
shareViewStore.CurSelectCabinetIndexs.forEach(el =>
{
shareViewApp.BoxCtrl.SetCabinetVisible(el, true);
});
// 重置相机位置
resetBoxView();
// 还原为概念渲染
commandMachine.ExecCommand(CommandNames.Conceptual);
// 切换为正交相机
shareViewApp.Viewer.CameraControl.CameraType = CameraType.OrthographicCamera;
shareViewStore.CameraType = CameraType.OrthographicCamera;
// 切换视角
commandMachine.ExecCommand(CommandNames.Swiso);
SetRoaming(false);
// 更新渲染
shareViewApp.Editor.UpdateScreen();
}
if (roomEntities.length == 0) return null; // 没有户型不显示户型漫游
return (
roaming ? (
<div className="sp-view-angle-icon" onClick={LeaveHouseRoamingMode} title={"离开户型漫游"} >
<svg height="20" width="20" viewBox="0 0 24 24" version="1.1" xmlns="http://www.w3.org/2000/svgfill"><g id="SVGRepo_bgCarrier" strokeWidth="0"></g><g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g><g id="SVGRepo_iconCarrier"> <title>entrance_line</title> <g id="页面-1" stroke="none" strokeWidth="1" fill="none" fillRule="evenodd"> <g id="System" transform="translate(-672.000000, -96.000000)" fillRule="nonzero"> <g id="entrance_line" transform="translate(672.000000, 96.000000)"> <path d="M24,0 L24,24 L0,24 L0,0 L24,0 Z M12.5934901,23.257841 L12.5819402,23.2595131 L12.5108777,23.2950439 L12.4918791,23.2987469 L12.4918791,23.2987469 L12.4767152,23.2950439 L12.4056548,23.2595131 C12.3958229,23.2563662 12.3870493,23.2590235 12.3821421,23.2649074 L12.3780323,23.275831 L12.360941,23.7031097 L12.3658947,23.7234994 L12.3769048,23.7357139 L12.4804777,23.8096931 L12.4953491,23.8136134 L12.4953491,23.8136134 L12.5071152,23.8096931 L12.6106902,23.7357139 L12.6232938,23.7196733 L12.6232938,23.7196733 L12.6266527,23.7031097 L12.609561,23.275831 C12.6075724,23.2657013 12.6010112,23.2592993 12.5934901,23.257841 L12.5934901,23.257841 Z M12.8583906,23.1452862 L12.8445485,23.1473072 L12.6598443,23.2396597 L12.6498822,23.2499052 L12.6498822,23.2499052 L12.6471943,23.2611114 L12.6650943,23.6906389 L12.6699349,23.7034178 L12.6699349,23.7034178 L12.678386,23.7104931 L12.8793402,23.8032389 C12.8914285,23.8068999 12.9022333,23.8029875 12.9078286,23.7952264 L12.9118235,23.7811639 L12.8776777,23.1665331 C12.8752882,23.1545897 12.8674102,23.1470016 12.8583906,23.1452862 L12.8583906,23.1452862 Z M12.1430473,23.1473072 C12.1332178,23.1423925 12.1221763,23.1452606 12.1156365,23.1525954 L12.1099173,23.1665331 L12.0757714,23.7811639 C12.0751323,23.7926639 12.0828099,23.8018602 12.0926481,23.8045676 L12.108256,23.8032389 L12.3092106,23.7104931 L12.3186497,23.7024347 L12.3186497,23.7024347 L12.3225043,23.6906389 L12.340401,23.2611114 L12.337245,23.2485176 L12.337245,23.2485176 L12.3277531,23.2396597 L12.1430473,23.1473072 Z" id="MingCute" fillRule="nonzero"> </path> <path d="M12,3 C12.5523,3 13,3.44772 13,4 C13,4.51283143 12.613973,4.93550653 12.1166239,4.9932722 L12,5 L7,5 C6.48716857,5 6.06449347,5.38604429 6.0067278,5.88337975 L6,6 L6,18 C6,18.51285 6.38604429,18.9355092 6.88337975,18.9932725 L7,19 L11.5,19 C12.0523,19 12.5,19.4477 12.5,20 C12.5,20.51285 12.113973,20.9355092 11.6166239,20.9932725 L11.5,21 L7,21 C5.40232321,21 4.09633941,19.7511226 4.00509271,18.1762773 L4,18 L4,6 C4,4.40232321 5.24892392,3.09633941 6.82372764,3.00509271 L7,3 L12,3 Z M17.707,8.46447 L20.5355,11.2929 C20.926,11.6834 20.926,12.3166 20.5355,12.7071 L17.707,15.5355 C17.3165,15.9261 16.6834,15.9261 16.2928,15.5355 C15.9023,15.145 15.9023,14.5118 16.2928,14.1213 L17.4142,13 L12,13 C11.4477,13 11,12.5523 11,12 C11,11.4477 11.4477,11 12,11 L17.4142,11 L16.2928,9.87868 C15.9023,9.48816 15.9023,8.85499 16.2928,8.46447 C16.6834,8.07394 17.3165,8.07394 17.707,8.46447 Z" id="形状" fill="#1890ff"> </path> </g> </g> </g> </g></svg>
</div>
) : (
<div className="sp-view-angle-icon" onClick={EnterHouseRoamingMode} title={"进入户型漫游"} >
<svg height="20" width="20" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><g id="SVGRepo_bgCarrier" strokeWidth="0"></g><g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g><g id="SVGRepo_iconCarrier"> <path d="M20.9808 3.02084C20.1108 2.15084 18.8808 1.81084 17.6908 2.11084L7.89084 4.56084C6.24084 4.97084 4.97084 6.25084 4.56084 7.89084L2.11084 17.7008C1.81084 18.8908 2.15084 20.1208 3.02084 20.9908C3.68084 21.6408 4.55084 22.0008 5.45084 22.0008C5.73084 22.0008 6.02084 21.9708 6.30084 21.8908L16.1108 19.4408C17.7508 19.0308 19.0308 17.7608 19.4408 16.1108L21.8908 6.30084C22.1908 5.11084 21.8508 3.88084 20.9808 3.02084ZM12.0008 15.8808C9.86084 15.8808 8.12084 14.1408 8.12084 12.0008C8.12084 9.86084 9.86084 8.12084 12.0008 8.12084C14.1408 8.12084 15.8808 9.86084 15.8808 12.0008C15.8808 14.1408 14.1408 15.8808 12.0008 15.8808Z" fill="#1890ff"></path> </g></svg>
</div>
)
);
}
export default HouseRoamingButton;

@ -206,6 +206,7 @@ const MaterialBottomSheet: React.FC<IProps> = forwardRef((props, ref) =>
<th style={{ width: 44 }}></th>
<th></th>
{!view_id && <th className="st-td-number"></th>}
<th className="st-td-number"></th>
<th className="st-td-number"></th>
<th className="st-td-number"></th>
<th style={{ width: 50 }} className="st-td-number"></th>
@ -224,6 +225,7 @@ const MaterialBottomSheet: React.FC<IProps> = forwardRef((props, ref) =>
{
const size = SPGetSpiteSize(item);
const blockNo = GetBlockNo(item.Id.Index);
const customBlockNo = item.CustomNumber ?? '';
const color = GetBlockColor(item);
return (
<tr
@ -243,6 +245,7 @@ const MaterialBottomSheet: React.FC<IProps> = forwardRef((props, ref) =>
<td>{i + 1}</td>
<td>{item.Name}</td>
{!view_id && <td className="st-td-number">{blockNo}</td>}
<td className="st-td-number">{customBlockNo}</td>
<td className="st-td-number">{size.height}</td>
<td className="st-td-number">{size.width}</td>
<td className="st-td-number">{size.thickness}</td>

@ -0,0 +1,265 @@
import React, { useRef } from "react";
import { Clock, Vector3 } from "three";
import { clamp } from "../../../Common/Utils";
import { Viewer } from "../../../GraphicsSystem/Viewer";
import { shareViewApp } from "../ShareViewService";
function translateCamera(viewer: Viewer, movement: Vector3)
{
viewer.UpdateRender();
viewer.Camera.position.add(movement);
viewer.CameraControl.Target.add(movement);
viewer.CameraControl.UpdateCameraMatrix();
}
const forwardIcon = <svg viewBox="-0.5 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" strokeWidth="0"></g>
<g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path
d="M12 22.4199C17.5228 22.4199 22 17.9428 22 12.4199C22 6.89707 17.5228 2.41992 12 2.41992C6.47715 2.41992 2 6.89707 2 12.4199C2 17.9428 6.47715 22.4199 12 22.4199Z"
stroke="#000000" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path>
<path
d="M8 13.8599L10.87 10.8C11.0125 10.6416 11.1868 10.5149 11.3815 10.4282C11.5761 10.3415 11.7869 10.2966 12 10.2966C12.2131 10.2966 12.4239 10.3415 12.6185 10.4282C12.8132 10.5149 12.9875 10.6416 13.13 10.8L16 13.8599"
stroke="#000000" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path>
</g>
</svg>;
const backIcon = <svg viewBox="-0.5 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" strokeWidth="0"></g>
<g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path
d="M12 22.4199C17.5228 22.4199 22 17.9428 22 12.4199C22 6.89707 17.5228 2.41992 12 2.41992C6.47715 2.41992 2 6.89707 2 12.4199C2 17.9428 6.47715 22.4199 12 22.4199Z"
stroke="#000000" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path>
<path
d="M16 10.99L13.13 14.05C12.9858 14.2058 12.811 14.3298 12.6166 14.4148C12.4221 14.4998 12.2122 14.5437 12 14.5437C11.7878 14.5437 11.5779 14.4998 11.3834 14.4148C11.189 14.3298 11.0142 14.2058 10.87 14.05L8 10.99"
stroke="#000000" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path>
</g>
</svg>;
const leftIcon = <svg viewBox="-0.5 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" strokeWidth="0"></g>
<g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path
d="M12 22.4199C17.5228 22.4199 22 17.9428 22 12.4199C22 6.89707 17.5228 2.41992 12 2.41992C6.47715 2.41992 2 6.89707 2 12.4199C2 17.9428 6.47715 22.4199 12 22.4199Z"
stroke="#000000" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path>
<path
d="M13.4102 16.4199L10.3502 13.55C10.1944 13.4059 10.0702 13.2311 9.98526 13.0366C9.9003 12.8422 9.85645 12.6321 9.85645 12.4199C9.85645 12.2077 9.9003 11.9979 9.98526 11.8035C10.0702 11.609 10.1944 11.4342 10.3502 11.29L13.4102 8.41992"
stroke="#000000" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path>
</g>
</svg>;
const upIcon = <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" strokeWidth="0"></g>
<g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path d="M17 18L12 13L7 18M17 11L12 6L7 11" stroke="#000000" strokeWidth="2" strokeLinecap="round"
strokeLinejoin="round"></path>
</g>
</svg>;
const downIcon = <svg viewBox="0 0 24 24" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" strokeWidth="0"></g>
<g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path d="M7 13L12 18L17 13M7 6L12 11L17 6" stroke="#000000" strokeWidth="2" strokeLinecap="round"
strokeLinejoin="round"></path>
</g>
</svg>;
const rightIcon = <svg viewBox="-0.5 0 25 25" fill="none" xmlns="http://www.w3.org/2000/svg">
<g id="SVGRepo_bgCarrier" strokeWidth="0"></g>
<g id="SVGRepo_tracerCarrier" strokeLinecap="round" strokeLinejoin="round"></g>
<g id="SVGRepo_iconCarrier">
<path
d="M12 22.4199C17.5228 22.4199 22 17.9428 22 12.4199C22 6.89707 17.5228 2.41992 12 2.41992C6.47715 2.41992 2 6.89707 2 12.4199C2 17.9428 6.47715 22.4199 12 22.4199Z"
stroke="#000000" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path>
<path
d="M10.5596 8.41992L13.6196 11.29C13.778 11.4326 13.9047 11.6068 13.9914 11.8015C14.0781 11.9962 14.123 12.2068 14.123 12.4199C14.123 12.633 14.0781 12.8439 13.9914 13.0386C13.9047 13.2332 13.778 13.4075 13.6196 13.55L10.5596 16.4199"
stroke="#000000" strokeWidth="1.5" strokeLinecap="round" strokeLinejoin="round"></path>
</g>
</svg>;
let accelerate = false;
function cameraHeightControl()
{
let moveSpeed: number = 1000;
let movement: number;
let canMove = false;
const viewer = shareViewApp.Viewer;
const clock = new Clock();
const wrapper = useRef<HTMLDivElement>();
const update = () =>
{ // viewer.Pan会覆盖原位置
requestAnimationFrame(update);
let deltaTime = clock.getDelta();
if (canMove)
{
translateCamera(viewer, new Vector3(0, 0, movement * deltaTime));
// console.log(movement);
}
};
update();
function SetMovement(value: number)
{
movement = value;
canMove = true;
}
function stopMove()
{
canMove = false;
}
return (
<div className="sp-mobile-control-btns" ref={wrapper}>
<button onTouchStart={() => SetMovement(moveSpeed)} onTouchEnd={stopMove} >{upIcon}</button>
<button onTouchStart={() => SetMovement(-moveSpeed)} onTouchEnd={stopMove}>{downIcon}</button>
</div>
);
}
/* NippleJs
function virtualJoystick() {
const viewer = shareViewApp.Viewer;
const clock = new Clock();
const zoneRef = React.useRef<HTMLDivElement>();
const moveSpeed = 100;
let movement: { x: number, y: number } = { x: 0, y: 0 };
let canMove = false;
useEffect(() => {
const options: nipplejs.JoystickManagerOptions = {
zone: zoneRef.current,
color: "#0c0c0c",
mode: "semi",
catchDistance: 100,
// position: { left: '20%', top: '25%' },
};
const manager = nipplejs.create(options);
manager.on("start", () => {
canMove = true;
});
manager.on("move", (e, data) => {
movement = data.vector;
});
manager.on("end", () => {
canMove = false;
});
}, []);
const update = () => {
requestAnimationFrame(update);
if (canMove) {
const deltaTime = 1;
const move = new Vector3(movement.x * deltaTime * moveSpeed, 0, -movement.y * deltaTime * moveSpeed);
move.applyQuaternion(viewer.Camera.quaternion);
translateCamera(viewer, move);
// console.log(move);
}
}
update();
return (
<div className="sp-mobile-control-joystick"
ref={zoneRef}></div>
);
}
*/
function virtualJoystickSimple()
{
const viewer = shareViewApp.Viewer;
const clock = new Clock();
const moveSpeed = 1000;
let movement = { x: 0, y: 0 };
let canMove = false;
const divWrapper = useRef<HTMLDivElement>();
let root: HTMLElement;
const update = () =>
{
requestAnimationFrame(update);
let deltaTime = clock.getDelta();
if (canMove)
{
const move = new Vector3(movement.x, 0, -movement.y).normalize().multiplyScalar(deltaTime * moveSpeed);
move.applyQuaternion(viewer.Camera.quaternion);
translateCamera(viewer, move);
}
};
update();
const stop = () =>
{
canMove = false;
};
// 0-1
function setMovement(x: number, y: number)
{
movement = { x: clamp(x, -1, 1), y: clamp(y, -1, 1) };
canMove = true;
}
function move(e: React.TouchEvent<HTMLDivElement>)
{
const radius = divWrapper.current.offsetWidth / 2;
const originX = divWrapper.current.offsetLeft + radius;
const originY = divWrapper.current.offsetTop + radius;
const touch = e.targetTouches[0];
// calculate offset
const offsetX = touch.pageX - originX;
// offsetTop与PageY相反
const offsetY = originY - touch.pageY;
const x = offsetX / radius;
const y = offsetY / radius;
// console.log(x,y);
setMovement(x, y);
}
return (
<div className="sp-mobile-control-joystick-simple" ref={divWrapper} onTouchEnd={stop} onTouchCancel={stop} onTouchMove={move} onTouchStart={move}>
<div className="sp-m-joystick-left">
{leftIcon}
</div>
<div className="sp-m-joystick-right">
{rightIcon}
</div>
<div className="sp-m-joystick-forward">
{forwardIcon}
</div>
<div className="sp-m-joystick-back">
{backIcon}
</div>
</div>
);
}
export default () =>
{
return (
<div className="sp-mobile-control">
{virtualJoystickSimple()}
{cameraHeightControl()}
</div>);
};

@ -0,0 +1,20 @@
import React from "react";
import { resetBoxView } from "../ShareViewUtil";
import { Icon } from "@blueprintjs/core";
import { shareViewApp } from "../ShareViewService";
import { app } from "../../../ApplicationServices/Application";
function ResetView() {
resetBoxView();
shareViewApp.Editor.UpdateScreen();
}
function ResetBoxViewButton() {
return (
<div className="sp-view-angle-icon" onClick={ResetView} title="重置相机位置">
<Icon icon="mobile-video"/>
</div>
)
}
export default ResetBoxViewButton

@ -3,17 +3,19 @@ import React, { useEffect, useRef, useState } from "react";
import { CommandNames } from "../../../Common/CommandNames";
import { commandMachine } from "../../../Editor/CommandMachine";
import { userConfig } from "../../../Editor/UserConfig";
import { CameraType } from "../../../GraphicsSystem/CameraUpdate";
import { RenderType } from "../../../GraphicsSystem/RenderType";
import { IsDoor, IsDrawer } from "../../HideSelect/HideSelectUtils";
import { ViewStyleTypes } from "../ShareViewRules";
import { shareViewApp } from "../ShareViewService";
import { ShareViewStore } from "../ShareViewStore";
import { RoamingSwitches, ShareViewStore } from "../ShareViewStore";
import "../ShareViewStyle.less";
import { ChangeCylinderHoleVisible, ChangeThemeColor, CreateBoxDim, DeleteBoxDim, ExplosionView, ForbiddenToaster, resetBoxView, show2DPathLine, SwitchDoorOrDrawer } from "../ShareViewUtil";
import BoardMessageWidget from "./BoardMessageWidget";
import CabinetBottomSheet from "./CabinetBottomSheet";
import HideComponentsMenu from "./HideComponentsMenu";
import MaterialBottomSheet from "./MaterialBottomSheet";
import MobileRoamingControl from "./MobileRoamingControl";
import SideBar from "./SideBar";
import { SPToaster } from "./SPToater";
import ViewAngle from "./ViewAngle";
@ -349,12 +351,19 @@ function ShareViewUI()
await show2DPathLine(i);
shareViewApp.Editor.UpdateScreen();
};
shareViewApp.ResetViewState = resetAll;
return (
<React.Fragment>
<Observer>
{
() => (
<Provider store={ShareViewStore}>
<ViewIDErrorWidget />
<div className={`sp-loading-mask ${loading ? 'open' : ''}`}></div>
{
/* 底部按钮组 */
shareViewStore.HouseRoamingMode == true ? null : (
<div className="sp-bottom-container">
<div
// className={`${selectCabinet ? 'active' : ''}`}
@ -363,9 +372,7 @@ function ShareViewUI()
cabinetBottomSheetRef.current.show();
}}
></div>
<Observer>
{() => (
<>
{shareViewStore.Props.showBom == false ? null : (
<div
// className={`${selectMaterial ? 'active' : ''}`}
@ -379,9 +386,7 @@ function ShareViewUI()
onClick={doorOpenOrClose}
className={`${shareViewStore.operations.isDoorOpen ? 'active' : ''}`}>
{shareViewStore.operations.isDoorOpen ? '关门' : '开门'}</div>
</>
)}
</Observer>
<HideComponentsMenu
doorOrDrawerShowOrHide={doorOrDrawerShowOrHide}
changeExplosion={changeExplosion}
@ -390,16 +395,38 @@ function ShareViewUI()
/>
<div onClick={resetAll}></div>
</div>
)
}
{/* 侧边栏 */}
<SideBar />
{/* 选中的板信息 */}
<BoardMessageWidget />
{/* 顶部栏 */}
<div className="sp-top-container">
{
/* 顶部栏 */
shareViewStore.HouseRoamingMode ? (
<>
<div
className={`sp-top-btn`} onClick={() => shareViewApp.ApplyHouseRoamingSwitches(RoamingSwitches.Decoration, true)}
>[{shareViewApp.CheckHouseRoamingSwitches(RoamingSwitches.Decoration) ? '有' : '无'}]
</div>
<ViewStyle
mode="HouseRoaming"
reset={async (renderType) =>
{
shareViewStore.HouseRoamingRenderType = renderType;
}}
currentRenderType={shareViewStore.HouseRoamingRenderType}
/>
</>
) : (
<>
<ViewAngle
closeDoor={closeDoor}
currentViewDirection={shareViewStore.viewUploadProps.Viewport} />
<ViewStyle
mode="Box"
reset={async (renderType) =>
{
await closeDoor();
@ -409,19 +436,17 @@ function ShareViewUI()
}}
currentRenderType={shareViewStore.viewUploadProps.VisualStyle}
/>
<Observer>
{() => (
<>
<div
className={`sp-top-btn ${shareViewStore.operations.showDimension ? 'active' : ''}`}
onClick={dimBrsShowOrHide}></div>
<div
className={`sp-top-btn ${shareViewStore.operations.showCustomNumber ? 'active' : ''}`}
onClick={customNumberShowOrHide}></div>
</>
)}
</Observer>
</>)
}
</div>
<CabinetBottomSheet
reset={async () =>
{
@ -438,7 +463,23 @@ function ShareViewUI()
ref={cabinetBottomSheetRef}
/>
<MaterialBottomSheet ref={materialBottomSheetRef} />
<Observer>
{/* 移动端的虚拟按键和摇杆 */}
{
() => (
// 只有在设备有触摸点且相机为透视视角时开启虚拟摇杆
navigator.maxTouchPoints > 0 &&
shareViewStore.CameraType === CameraType.PerspectiveCamera ?
<MobileRoamingControl /> :
<></>
)
}
</Observer>
</Provider>
)
}
</Observer>
</React.Fragment>
);
}

@ -1,13 +1,17 @@
import { Observer } from "mobx-react";
import React from 'react';
import { CommandNames } from '../../../Common/CommandNames';
import { commandMachine } from '../../../Editor/CommandMachine';
import { shareViewApp } from '../ShareViewService';
import { resetBoxView } from '../ShareViewUtil';
import { ShareViewStore } from "../ShareViewStore";
import BoardHideIcon from './BoardHideIcon';
import HouseRoamingButton from './HouseRoamingButton';
import ResetBoxViewButton from "./ResetBoxViewButton";
import ShareWidget from './ShareWidget';
import ThemeButton from './ThemeButton';
const search = new URLSearchParams(location.search);
const view_id = search.get('view_id');
const shareviewStore = ShareViewStore.GetInstance();
const SideBar = () =>
{
return (
@ -42,7 +46,6 @@ const SideBar = () =>
{
commandMachine.ExecCommand(item.command);
shareViewApp.Viewer.UpdateRender();
resetBoxView();
}}
>
{item.name}
@ -50,6 +53,12 @@ const SideBar = () =>
);
})
}
<Observer>
{
() => shareviewStore.HouseRoamingMode ? <ResetBoxViewButton /> : <></>
}
</Observer>
<HouseRoamingButton />
<BoardHideIcon />
</div>
);

@ -2,17 +2,20 @@ import React, { forwardRef, useEffect, useRef, useState } from "react";
import { CommandNames } from "../../../Common/CommandNames";
import { commandMachine } from "../../../Editor/CommandMachine";
import { RenderType } from "../../../GraphicsSystem/RenderType";
import { ViewStyleTypes } from "../ShareViewRules";
import { getViewStyleTypes } from "../ShareViewRules";
import { shareViewApp } from "../ShareViewService";
import { ForbiddenToaster } from "../ShareViewUtil";
interface IProps
{
reset: (renderType: RenderType) => Promise<void>;
currentRenderType: RenderType;
mode: string;
}
const ViewStyle: React.FC<IProps> = forwardRef((props) =>
{
const styleTypes = getViewStyleTypes(props.mode);
const [visible, setVisible] = useState<boolean>(false);
const [selected, setSelected] = useState<string>('概念');
const selectDivRef = useRef<HTMLDivElement>();
@ -27,7 +30,7 @@ const ViewStyle: React.FC<IProps> = forwardRef((props) =>
function checkRenderType(renderType: RenderType): number
{
const viewStyleIndex = ViewStyleTypes.findIndex(v => v.renderType === renderType);
const viewStyleIndex = styleTypes.findIndex(v => v.renderType === renderType);
if (viewStyleIndex > -1) return viewStyleIndex;
return 0;
}
@ -49,7 +52,7 @@ const ViewStyle: React.FC<IProps> = forwardRef((props) =>
useEffect(() =>
{
if (props.currentRenderType)
setSelected(ViewStyleTypes[checkRenderType(props.currentRenderType)].title);
setSelected(styleTypes[checkRenderType(props.currentRenderType)].title);
return () => { setSelected(""); };
}, [props.currentRenderType]);
@ -72,7 +75,7 @@ const ViewStyle: React.FC<IProps> = forwardRef((props) =>
onMouseDown={stopPropagation}
onClick={stopPropagation}
>
{ViewStyleTypes.map((item) =>
{styleTypes.map((item) =>
{
return (
<li key={item.title} className={selected == item.title ? 'sp-selected' : ''}
@ -81,14 +84,22 @@ const ViewStyle: React.FC<IProps> = forwardRef((props) =>
await props.reset(item.renderType);
e.stopPropagation();
ForbiddenToaster(async () =>
{
if (item.cmd)
{
await commandMachine.ExecCommand(item.cmd);
} else
{
await shareViewApp.Viewer.UpdateRenderType(shareViewApp.Database, item.renderType);
}
});
setSelected(item.title);
}}
>{item.title}</li>
);
})}
{
() => props.mode == "HouseRoaming" ? <></> :
<li
className={selectLines ? 'sp-selected' : ''}
onClick={async (e) =>
@ -101,6 +112,8 @@ const ViewStyle: React.FC<IProps> = forwardRef((props) =>
});
}}
></li>
}
</ul>
</div>
);

@ -0,0 +1,35 @@
<!DOCTYPE html>
<html lang="zh-cmn-Hans">
<head>
<meta charset="UTF-8" />
<meta name="viewport"
content="width=device-width, initial-scale=1.0, maximum-scale=1.0, minimum-scale=1.0, user-scalable=no" />
<meta http-equiv="X-UA-Compatible" content="ie=edge, chrome=1" />
<!--设置全屏显示(先关闭,ios全屏显示好像也会导致cookie丢失无法登入)-->
<meta name="apple-mobile-web-app-capable" content="yes" />
<!-- 指定标题 -->
<meta name="apple-mobile-web-app-title" content="晨丰看图王" />
<!--设置主屏幕图标-->
<link rel="apple-touch-icon" href="https://cdn.qicad.com/webcadapp.png" />
<script>
let process = 20;
setTimeout(() => {
let el = document.getElementById("load_title");
if (el) el.innerText = "加载超时,请按Shift+F5重新载入!";
}, 40 * 1000);
</script>
<title>WebCAD</title>
<meta itemprop="description" content="晨丰看图王" />
</head>
<body>
<div id="loader-wrapper">
<div id="loader"></div>
<div class="loader-section section-left"></div>
<div class="loader-section section-right"></div>
<div id="load_title">正在加载中,请稍候...</div>
</div>
</body>
</html>

@ -0,0 +1,222 @@
import AddAssetHtmlPlugin from "add-asset-html-webpack-plugin";
import CleanTerminalPlugin from "clean-terminal-webpack-plugin";
import { CleanWebpackPlugin } from "clean-webpack-plugin";
import HtmlWebPackPlugin from "html-webpack-plugin";
import * as path from 'path';
import * as webpack from 'webpack';
import WebpackBar from 'webpackbar';
export const buildVersion = new Date().toLocaleString();
function resolve(fileName: string)
{
return path.resolve(__dirname, fileName);
}
const DIST_DIR = resolve('../../../dist/shareview');
const TS_LOADER = [
{ loader: 'cache-loader', options: { cacheDirectory: "node_modules/.shareview_cache" } },
{
loader: 'ts-loader',
options: {
transpileOnly: true,
experimentalWatchApi: true,
},
}
];
export default {
cache: {
type: 'filesystem',
},
entry: {
main: resolve("ShareViewEntry"),
},
output: {
filename: "[contenthash].[name].js",
path: resolve(DIST_DIR),//虽然不需要提供 但是如果不提供CleanWebpackPlugin就坏了
publicPath: "",
globalObject: "this"
},
resolve: {
// alias: {
// "dat.gui": resolve('../node_modules/dat.gui/build/dat.gui.js'),
// },
extensions: [".ts", ".tsx", ".js", "json"]
},
module: {
rules: [
{
test: /\.worker\.ts$/,
exclude: /node_modules/,
use: [
{ loader: 'worker-loader', },
...TS_LOADER
]
},
{
test: /\.tsx?$/,
exclude: /node_modules/,
use: TS_LOADER,
},
{
test: /\.[(png)|(obj)|(json)]$/,
loader: "file-loader"
},
//样式加载 css
{
test: /\.css$/,
use: ['style-loader', 'css-loader']
},
//样式加载 less
{
test: /\.less$/,
use: [
{ loader: "style-loader" },
{ loader: 'css-loader', options: { sourceMap: false } },
{
loader: "less-loader",
options: {
lessOptions: {
strictMath: true,
noIeCompat: true
}
}
}
]
},
//字体加载 blueprint
{
test: /\.(ttf|eot|svg|FBX)$/,
use: {
loader: 'file-loader',
options: { name: 'fonts/[contenthash].[ext]' }
}
},
//字体加载 blueprint
{
test: /\.(woff|woff2|jpg|png)$/,
use: {
loader: 'url-loader',
options: {
name: 'fonts/[contenthash].[ext]',
limit: 5000,
mimetype: 'application/font-woff'
}
}
},
{
test: /\.(glsl|vs|fs)$/,
loader: 'shader-loader'
}
]
},
externals: [
function ({ context, request }, callback)
{
if (/\/Components\/MainContent/.test(request))
{
callback(null, '{}');
return;
}
if (/Editor\/CommandRegister/.test(request))
{
callback(null, '{}');
return;
}
if (/\/Add-on\/KJL/.test(request))
{
callback(null, '{}');
return;
}
if (/@epicgames-ps/.test(request))
{
callback(null, '{}');
return;
}
if (/dwg2dxf/.test(request))
{
callback(null, '{}');
return;
}
// if (/@blueprintjs\/icons/.test(request))
// {
// callback(null, '{}');
// return;
// }
callback();
}
],
optimization: {
splitChunks: {
chunks: 'async',
minSize: 20000,
minRemainingSize: 0,
minChunks: 1,
maxAsyncRequests: 30,
maxInitialRequests: 30,
enforceSizeThreshold: 50000,
cacheGroups: {
defaultVendors: {
test: /[\\/]node_modules[\\/]/,
name: 'vendor',
priority: -10,
reuseExistingChunk: true,
chunks: 'initial',
},
default: {
name: 'common',
minChunks: 2,
priority: -20,
reuseExistingChunk: true,
chunks: 'initial',
},
},
},
},
plugins: [
new HtmlWebPackPlugin({
title: "shareview",
template: resolve('index.html'),
filename: 'index.html',
chunks: ['main']
}),
new AddAssetHtmlPlugin(
[
{
filepath: "./src/loading.css",
typeOfAsset: "css",
},
{
filepath: "./node_modules/normalize.css/normalize.css",
typeOfAsset: "css",
},
{
filepath: "./node_modules/@blueprintjs/core/lib/css/blueprint.css",
typeOfAsset: "css",
includeRelatedFiles: false
},
// { glob: "./dist/*.dll.js", },
]
),
new webpack.ProvidePlugin({
ReactDOM: 'react-dom',
React: 'react',
THREE: "three"
}),
new webpack.DefinePlugin({ 'process': "globalThis", version: JSON.stringify(buildVersion) }),
new CleanTerminalPlugin(),
new WebpackBar(),
// new HardSourceWebpackPlugin(),
// new ForkTsCheckerWebpackPlugin({ checkSyntacticErrors: true }),
new CleanWebpackPlugin({
cleanOnceBeforeBuildPatterns: ["*"]
}),
],
node: { global: true },
} as webpack.Configuration;

@ -0,0 +1,63 @@
import { Configuration } from "webpack";
import { merge } from 'webpack-merge';
import common from './webpack.common';
//hmr
import ReactRefreshWebpackPlugin from '@pmmmwh/react-refresh-webpack-plugin';
export default merge(common, {
mode: "development",
output: { pathinfo: false },
/**
* eval-source-map src\UI\Components\Board\BoardOptionModal.tsx:37:42
* https://github.com/microsoft/vscode/issues/194988
*/
devtool: "source-map",
//https://www.webpackjs.com/configuration/stats/
stats: "errors-only" || {
assets: false,
timings: false,
builtAt: false,
cachedAssets: false,
hash: false,
modules: false,
performance: false,
entrypoints: false,
// 添加 children 信息
children: false,
// 添加 chunk 信息(设置为 `false` 能允许较少的冗长输出)
chunks: false,
// 将构建模块信息添加到 chunk 信息
chunkModules: false,
// 添加 chunk 和 chunk merge 来源的信息
chunkOrigins: false,
reasons: false,
source: false
},
devServer: {
static: false,
port: 7776,
host: "0.0.0.0",
hot: true,
proxy: {
"/api": {
target: "https://cad.leye.site",
pathRewrite: { '^/api': '' },
secure: false,
headers: {
Host: 'cfcad.cn',
Origin: "https://cfcad.cn"
}
}
}
},
optimization: {
moduleIds: "named",
},
//hmr
plugins: [
new ReactRefreshWebpackPlugin()
],
} as Configuration);

@ -0,0 +1,20 @@
import TerserPlugin from "terser-webpack-plugin";
import { merge } from 'webpack-merge';
import common from './webpack.common';
export default merge(common, {
mode: "production",
devtool: false,
optimization: {
minimizer: [
new TerserPlugin({
parallel: true,
terserOptions: {
ecma: 2020,
sourceMap: false,
keep_classnames: true,
}
}),
]
}
});

@ -86,10 +86,10 @@ export class CameraControls
this.domElement.addEventListener("mouseup", this.onMouseUp, false);
window.addEventListener("keydown", this.onKeyDown, false);
window.addEventListener("keyup", this.onKeyUp, false);
this.domElement.addEventListener("wheel", this.onMouseWheel, { passive: false });
this.domElement.addEventListener("wheel", (e) => this.onMouseWheel(e), { passive: false });
this.domElement.addEventListener("touchstart", this.onTouchStart, { passive: false });
this.domElement.addEventListener("touchend", this.onTouchEnd, false);
this.domElement.addEventListener("touchstart", (e) => this.onTouchStart(e), { passive: false });
this.domElement.addEventListener("touchend", (e) => this.onTouchEnd(e), false);
this.domElement.addEventListener("touchmove", e =>
{
if (!this.EnableTouchControl && e.touches.length === 1) return;
@ -147,7 +147,7 @@ export class CameraControls
{
this.State = CameraControlState.Null;
};
onTouchMove = (event: Touch_Event) =>
onTouchMove(event: Touch_Event)
{
event.preventDefault();
event.stopPropagation();
@ -335,7 +335,7 @@ export class CameraControls
*
*/
cameraNormal = new Vector3;
onMouseWheel = (event: WheelEvent) =>
onMouseWheel(event: WheelEvent)
{
event.preventDefault();
event.stopPropagation();

@ -61,6 +61,6 @@ export class CameraUpdateForIos
camera.Target.copy(this._iPoint);
camera.Camera.near = 0.1;
camera.Camera.far = this.boundingSphere.radius * 2;
camera.Camera.far = this.boundingSphere.radius * 10;
}
}

Loading…
Cancel
Save