|
|
|
@ -1,16 +1,15 @@
|
|
|
|
|
import { Observer, observer, Provider } from "mobx-react";
|
|
|
|
|
import React, { useEffect, useRef, useState } from "react";
|
|
|
|
|
import { CommandNames } from "../../../Common/CommandNames";
|
|
|
|
|
import { Hole } from "../../../DatabaseServices/3DSolid/Hole";
|
|
|
|
|
import { commandMachine } from "../../../Editor/CommandMachine";
|
|
|
|
|
import { userConfig } from "../../../Editor/UserConfig";
|
|
|
|
|
import { RenderType } from "../../../GraphicsSystem/RenderType";
|
|
|
|
|
import { IsDoor, IsDrawer, IsHandle } from "../../HideSelect/HideSelectUtils";
|
|
|
|
|
import { IsDoor, IsDrawer } from "../../HideSelect/HideSelectUtils";
|
|
|
|
|
import { ViewStyleTypes } from "../ShareViewRules";
|
|
|
|
|
import { shareViewApp } from "../ShareViewService";
|
|
|
|
|
import { ShareViewStore } from "../ShareViewStore";
|
|
|
|
|
import "../ShareViewStyle.less";
|
|
|
|
|
import { ChangeThemeColor, CreateBoxDim, DeleteBoxDim, ExplosionView, ForbiddenToaster, resetBoxView, SwitchDoorOrDrawer } from "../ShareViewUtil";
|
|
|
|
|
import { ChangeCylinderHoleVisible, ChangeThemeColor, CreateBoxDim, DeleteBoxDim, ExplosionView, ForbiddenToaster, resetBoxView, SwitchDoorOrDrawer } from "../ShareViewUtil";
|
|
|
|
|
import BoardMessageWidget from "./BoardMessageWidget";
|
|
|
|
|
import CabinetBottomSheet from "./CabinetBottomSheet";
|
|
|
|
|
import HideComponentsMenu from "./HideComponentsMenu";
|
|
|
|
@ -71,9 +70,7 @@ function ShareViewUI()
|
|
|
|
|
{
|
|
|
|
|
for (const el of shareViewStore.CurSelectCabinetIndexs)
|
|
|
|
|
{
|
|
|
|
|
let list = shareViewApp.BoxCtrl.GetCabinetEntities(el)
|
|
|
|
|
.filter((ent) => IsDrawer(ent) || IsDoor(ent) || IsHandle(ent) || (ent instanceof Hole && ent.ColorIndex !== 4));
|
|
|
|
|
list = list.filter(ent => (IsDoor(ent) && ent.Template) || (IsDrawer(ent)) || (ent instanceof Hole));
|
|
|
|
|
let list = shareViewApp.BoxCtrl.GetCabinetEntities(el).filter(ent => (IsDoor(ent) && ent.Template) || (IsDrawer(ent)));
|
|
|
|
|
if (list.length) return true;
|
|
|
|
|
}
|
|
|
|
|
return false;
|
|
|
|
@ -273,6 +270,7 @@ function ShareViewUI()
|
|
|
|
|
async function resetAll()
|
|
|
|
|
{
|
|
|
|
|
shareViewStore.SelectedBoard = null;
|
|
|
|
|
shareViewStore.operations.showCylinderHole = true;
|
|
|
|
|
if (shareViewStore.operations.showDimension)
|
|
|
|
|
{
|
|
|
|
|
await DeleteBoxDim();
|
|
|
|
@ -294,23 +292,23 @@ function ShareViewUI()
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/** 爆炸图 距离 */
|
|
|
|
|
const explosionDistance = 600;
|
|
|
|
|
const explosionDistance = 800;
|
|
|
|
|
/** 还原爆炸图 */
|
|
|
|
|
const resetExplosionView = async () =>
|
|
|
|
|
const resetExplosionView = () =>
|
|
|
|
|
{
|
|
|
|
|
if (shareViewStore.operations.showExplosion)
|
|
|
|
|
{
|
|
|
|
|
await changeExplosionView(explosionDistance);
|
|
|
|
|
changeExplosionView(explosionDistance);
|
|
|
|
|
shareViewStore.operations.showExplosion = !shareViewStore.operations.showExplosion;
|
|
|
|
|
}
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 打开/关闭 爆炸图 */
|
|
|
|
|
async function changeExplosionView(distance: number)
|
|
|
|
|
function changeExplosionView(distance: number)
|
|
|
|
|
{
|
|
|
|
|
for (const i of shareViewStore.CurSelectCabinetIndexs)
|
|
|
|
|
{
|
|
|
|
|
await ExplosionView(i, distance);
|
|
|
|
|
ExplosionView(i, distance);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
@ -321,15 +319,24 @@ function ShareViewUI()
|
|
|
|
|
await closeDoor();
|
|
|
|
|
if (shareViewStore.operations.showExplosion)
|
|
|
|
|
{
|
|
|
|
|
await changeExplosionView(explosionDistance);
|
|
|
|
|
changeExplosionView(explosionDistance);
|
|
|
|
|
} else
|
|
|
|
|
{
|
|
|
|
|
await changeExplosionView(-explosionDistance);
|
|
|
|
|
changeExplosionView(-explosionDistance);
|
|
|
|
|
}
|
|
|
|
|
shareViewStore.operations.showExplosion = !shareViewStore.operations.showExplosion;
|
|
|
|
|
setLoading(false);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
/** 显示/隐藏 排钻 */
|
|
|
|
|
function changeCylinderHoleVisible()
|
|
|
|
|
{
|
|
|
|
|
for (const i of shareViewStore.CurSelectCabinetIndexs)
|
|
|
|
|
ChangeCylinderHoleVisible(i, shareViewStore.operations.showCylinderHole);
|
|
|
|
|
shareViewApp.Editor.UpdateScreen();
|
|
|
|
|
shareViewStore.operations.showCylinderHole = !shareViewStore.operations.showCylinderHole;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|
<React.Fragment>
|
|
|
|
|
<Provider store={ShareViewStore}>
|
|
|
|
@ -365,6 +372,7 @@ function ShareViewUI()
|
|
|
|
|
<HideComponentsMenu
|
|
|
|
|
doorOrDrawerShowOrHide={doorOrDrawerShowOrHide}
|
|
|
|
|
changeExplosion={changeExplosion}
|
|
|
|
|
changeCylinderHoleVisible={changeCylinderHoleVisible}
|
|
|
|
|
/>
|
|
|
|
|
<div onClick={resetAll}>还原</div>
|
|
|
|
|
</div>
|
|
|
|
|