|
|
@ -1,11 +1,12 @@
|
|
|
|
|
|
|
|
import hotkeys from 'hotkeys-js';
|
|
|
|
import { Vector2, Vector3 } from 'three';
|
|
|
|
import { Vector2, Vector3 } from 'three';
|
|
|
|
import { app } from '../ApplicationServices/Application';
|
|
|
|
import { app } from '../ApplicationServices/Application';
|
|
|
|
import { getCirAngleByChordAndTangent } from '../Common/CurveUtils';
|
|
|
|
import { getCirAngleByChordAndTangent } from '../Common/CurveUtils';
|
|
|
|
import { GetPointPrompt } from "../Editor/PromptOptions";
|
|
|
|
|
|
|
|
import { Polyline } from '../DatabaseServices/Entity/Polyline';
|
|
|
|
import { Polyline } from '../DatabaseServices/Entity/Polyline';
|
|
|
|
import { PromptStatus } from '../Editor/PromptResult';
|
|
|
|
|
|
|
|
import { JigUtils } from '../Editor/JigUtils';
|
|
|
|
import { JigUtils } from '../Editor/JigUtils';
|
|
|
|
import { equalv3, AsVector2, AsVector3, ZeroVec } from '../Geometry/GeUtils';
|
|
|
|
import { GetPointPrompt } from "../Editor/PromptOptions";
|
|
|
|
|
|
|
|
import { PromptStatus } from '../Editor/PromptResult';
|
|
|
|
|
|
|
|
import { AsVector2, AsVector3, equalv3, ZeroVec } from '../Geometry/GeUtils';
|
|
|
|
|
|
|
|
|
|
|
|
enum PolylineModel
|
|
|
|
enum PolylineModel
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -34,6 +35,15 @@ export class DrawPolyline
|
|
|
|
let keywords2 = keywords.concat([{ msg: "闭合", key: "C" }]);
|
|
|
|
let keywords2 = keywords.concat([{ msg: "闭合", key: "C" }]);
|
|
|
|
let nextOps: GetPointPrompt = { Msg: "请点击下一个点或", Callback, AllowNone: true };
|
|
|
|
let nextOps: GetPointPrompt = { Msg: "请点击下一个点或", Callback, AllowNone: true };
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
const TempUndo = () =>
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if (app.Editor.GetPointServices.IsReady)
|
|
|
|
|
|
|
|
app.Editor.GetPointServices.ReturnKeyword("U");//放弃
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
hotkeys("Control+Z", hotkeys.getScope(), TempUndo);
|
|
|
|
|
|
|
|
|
|
|
|
while (true)
|
|
|
|
while (true)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
let ops: GetPointPrompt;
|
|
|
|
let ops: GetPointPrompt;
|
|
|
@ -101,7 +111,9 @@ export class DrawPolyline
|
|
|
|
else
|
|
|
|
else
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
JigUtils.End();
|
|
|
|
|
|
|
|
|
|
|
|
hotkeys.unbind("Control+Z", hotkeys.getScope(), TempUndo);
|
|
|
|
|
|
|
|
|
|
|
|
if (pl.NumberOfVertices < 2)
|
|
|
|
if (pl.NumberOfVertices < 2)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
app.LayoutTool.RemoveDatabaseSpace(pl);
|
|
|
|
app.LayoutTool.RemoveDatabaseSpace(pl);
|
|
|
|