|
|
|
@ -6,7 +6,6 @@ import { OrthographicCamera, Vector3 } from "three";
|
|
|
|
|
import { begin, end } from "xaop";
|
|
|
|
|
import { app } from "../../../ApplicationServices/Application";
|
|
|
|
|
import { CommandNames } from "../../../Common/CommandNames";
|
|
|
|
|
import { KeyBoard } from "../../../Common/KeyEnum";
|
|
|
|
|
import { Singleton } from "../../../Common/Singleton";
|
|
|
|
|
import { commandMachine } from "../../../Editor/CommandMachine";
|
|
|
|
|
import { equalv3 } from "../../../Geometry/GeUtils";
|
|
|
|
@ -122,6 +121,10 @@ export class CameraControlBtnStore extends Singleton
|
|
|
|
|
@observer
|
|
|
|
|
export class CameraControlBtn extends React.Component<{ store: CameraControlBtnStore; }, {}>
|
|
|
|
|
{
|
|
|
|
|
public state = {
|
|
|
|
|
isOpenToolbar: false,
|
|
|
|
|
isOpenViewMenu: false,
|
|
|
|
|
};
|
|
|
|
|
render()
|
|
|
|
|
{
|
|
|
|
|
const { m_isMenuShow, m_ViewMenuTitle } = this.props.store;
|
|
|
|
@ -139,43 +142,31 @@ export class CameraControlBtn extends React.Component<{ store: CameraControlBtnS
|
|
|
|
|
return (
|
|
|
|
|
<div>
|
|
|
|
|
<Popover
|
|
|
|
|
isOpen={m_isMenuShow === MenuType.ControlsMenu}
|
|
|
|
|
isOpen={this.state.isOpenToolbar === true ? true : undefined}
|
|
|
|
|
modifiers={{ arrow: { enabled: false } }}
|
|
|
|
|
content={this.RenderControlsMenu()}
|
|
|
|
|
>
|
|
|
|
|
<Button
|
|
|
|
|
style={btnStyle}
|
|
|
|
|
minimal={true}
|
|
|
|
|
text="[-]"
|
|
|
|
|
onContextMenu={() => this.ShowMenu(MenuType.ControlsMenu)}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
if (m_isMenuShow === MenuType.ControlsMenu)
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
else
|
|
|
|
|
this.ShowMenu(MenuType.ControlsMenu);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
{
|
|
|
|
|
this.RenderControlsMenu()
|
|
|
|
|
}
|
|
|
|
|
</Popover >
|
|
|
|
|
|
|
|
|
|
<Popover
|
|
|
|
|
isOpen={m_isMenuShow === MenuType.ViewMenu}
|
|
|
|
|
isOpen={this.state.isOpenViewMenu === true ? true : undefined}
|
|
|
|
|
modifiers={{ arrow: { enabled: false } }}
|
|
|
|
|
content={this.RenderViewMenu()}
|
|
|
|
|
>
|
|
|
|
|
<Button
|
|
|
|
|
style={btnStyle}
|
|
|
|
|
minimal={true}
|
|
|
|
|
text={`[${m_ViewMenuTitle}]`}
|
|
|
|
|
onContextMenu={() => this.ShowMenu(MenuType.ViewMenu)}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
if (m_isMenuShow === MenuType.ViewMenu)
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
else
|
|
|
|
|
this.ShowMenu(MenuType.ViewMenu);
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
{
|
|
|
|
|
this.RenderViewMenu()
|
|
|
|
|
}
|
|
|
|
|
</Popover >
|
|
|
|
|
{
|
|
|
|
|
VisualStyleData.map(
|
|
|
|
@ -231,47 +222,31 @@ export class CameraControlBtn extends React.Component<{ store: CameraControlBtnS
|
|
|
|
|
className="controlsMenu-fixed"
|
|
|
|
|
style={{ minWidth: "120px" }}
|
|
|
|
|
tabIndex={-1}
|
|
|
|
|
onKeyDown={(e) =>
|
|
|
|
|
{
|
|
|
|
|
if (e.keyCode === KeyBoard.Escape)
|
|
|
|
|
{
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
onBlur={this.HideMenu}
|
|
|
|
|
>
|
|
|
|
|
{
|
|
|
|
|
<>
|
|
|
|
|
<MenuItem
|
|
|
|
|
text="顶部工具栏"
|
|
|
|
|
icon={downStore.isTopToolBarShow ? "tick" : "blank"}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
downStore.toggleTopToolBarShow();
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
text="左侧工具栏"
|
|
|
|
|
icon={downStore.isLeftToolBarShow ? "tick" : "blank"}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
downStore.toggleLeftToolBarShow();
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
text="底部工具栏"
|
|
|
|
|
icon={downStore.isBottomToolBarShow ? "tick" : "blank"}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
downStore.toggleBottomToolBarShow();
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</>
|
|
|
|
|
}
|
|
|
|
|
<MenuItem
|
|
|
|
|
text="顶部工具栏"
|
|
|
|
|
icon={downStore.isTopToolBarShow ? "tick" : "blank"}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
downStore.toggleTopToolBarShow();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
text="左侧工具栏"
|
|
|
|
|
icon={downStore.isLeftToolBarShow ? "tick" : "blank"}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
downStore.toggleLeftToolBarShow();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
<MenuItem
|
|
|
|
|
text="底部工具栏"
|
|
|
|
|
icon={downStore.isBottomToolBarShow ? "tick" : "blank"}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
downStore.toggleBottomToolBarShow();
|
|
|
|
|
}}
|
|
|
|
|
/>
|
|
|
|
|
</Menu>
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
@ -284,18 +259,6 @@ export class CameraControlBtn extends React.Component<{ store: CameraControlBtnS
|
|
|
|
|
className="viewMenu-fixed"
|
|
|
|
|
style={{ minWidth: "120px" }}
|
|
|
|
|
tabIndex={-1}
|
|
|
|
|
onKeyDown={(e) =>
|
|
|
|
|
{
|
|
|
|
|
if (e.keyCode === KeyBoard.Escape)
|
|
|
|
|
{
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
e.stopPropagation();
|
|
|
|
|
}
|
|
|
|
|
}}
|
|
|
|
|
onBlur={() =>
|
|
|
|
|
{
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
}}
|
|
|
|
|
>
|
|
|
|
|
{
|
|
|
|
|
viewData.map(
|
|
|
|
@ -306,7 +269,6 @@ export class CameraControlBtn extends React.Component<{ store: CameraControlBtnS
|
|
|
|
|
icon={data.name === m_ViewMenuTitle ? "tick" : "blank"}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
m_ViewMenuTitle = data.name;
|
|
|
|
|
commandMachine.ExecCommand(data.command);
|
|
|
|
|
}}
|
|
|
|
@ -319,7 +281,6 @@ export class CameraControlBtn extends React.Component<{ store: CameraControlBtnS
|
|
|
|
|
icon={m_CameraType === "正交" ? "tick" : "blank"}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
if (m_CameraType !== "正交")
|
|
|
|
|
app.Viewer.CameraCtrl.SwitchCamera();
|
|
|
|
|
}}
|
|
|
|
@ -329,7 +290,6 @@ export class CameraControlBtn extends React.Component<{ store: CameraControlBtnS
|
|
|
|
|
icon={m_CameraType === "透视" ? "tick" : "blank"}
|
|
|
|
|
onClick={() =>
|
|
|
|
|
{
|
|
|
|
|
this.HideMenu();
|
|
|
|
|
if (m_CameraType !== "透视")
|
|
|
|
|
app.Viewer.CameraCtrl.SwitchCamera();
|
|
|
|
|
}}
|
|
|
|
@ -338,15 +298,4 @@ export class CameraControlBtn extends React.Component<{ store: CameraControlBtnS
|
|
|
|
|
);
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
ShowMenu = (menuType: MenuType) =>
|
|
|
|
|
{
|
|
|
|
|
this.props.store.m_isMenuShow = menuType;
|
|
|
|
|
app.Editor.MaskManage.ShowMask();
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
HideMenu = () =>
|
|
|
|
|
{
|
|
|
|
|
this.props.store.m_isMenuShow = -1;
|
|
|
|
|
app.Editor.MaskManage.Clear();
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|