统一使用Oblique来标识斜,(eg:斜酒格)

pull/457/MERGE
ChenX 5 years ago
parent 2e8e52fa9e
commit 9c1ada0086

@ -1,5 +1,5 @@
import { Vector3 } from "three";
import { DrawBlisWineRackTool } from "../../src/Add-on/DrawWineRack/DrawBlisWineRackTool";
import { DrawObliqueWineRackTool } from "../../src/Add-on/DrawWineRack/DrawObliqueWineRackTool";
import { DrawUprightWineRackTool } from "../../src/Add-on/DrawWineRack/DrawUprightWineRackTool";
import { Board } from "../../src/DatabaseServices/Entity/Board";
import { Box3Ext } from "../../src/Geometry/Box";
@ -7,10 +7,10 @@ import { ISpaceParse } from "../../src/Geometry/SpaceParse/ISpaceParse";
import { EFullDir, EFullType, EWineRackType, EWRackArrayType, IWineRackOption } from "../../src/UI/Store/WineRackInterface";
import { LoadEntityFromFileData } from "../Utils/LoadEntity.util";
const UprightTool = DrawUprightWineRackTool.GetInstance() as DrawUprightWineRackTool;
const blisTool = DrawBlisWineRackTool.GetInstance() as DrawBlisWineRackTool;
const ObliqueTool = DrawObliqueWineRackTool.GetInstance() as DrawObliqueWineRackTool;
const option: IWineRackOption = {
type: EWineRackType.Bias,
type: EWineRackType.Oblique,
arrayType: EWRackArrayType.ByWidth,
fullType: EFullType.ByWidth,
isFull: false,
@ -50,8 +50,8 @@ describe("酒格功能测试", () =>
spaceParse.SpaceBox = new Box3Ext(new Vector3(), new Vector3(1200, 600, 2000));
spaceParse.Parse();
UprightTool.Parse(spaceParse, option);
blisTool.Parse(spaceParse, option);
ObliqueTool.Parse(spaceParse, option);
expect(UprightTool.boardlist.length).toMatchSnapshot();
expect(blisTool.boardlist.length).toMatchSnapshot();
expect(ObliqueTool.boardlist.length).toMatchSnapshot();
})
})

@ -26,7 +26,11 @@ export interface IParsePlRes
basePt?: Vector3;
}
export class DrawBlisWineRackTool extends DrawWineRackTool
/**
*
*/
export class DrawObliqueWineRackTool extends DrawWineRackTool
{
Parse(space: ISpaceParse, config: IWineRackOption)
{

@ -5,6 +5,10 @@ import { MoveMatrix, AsVector2 } from "../../Geometry/GeUtils";
import { ISpaceParse } from "../../Geometry/SpaceParse/ISpaceParse";
import { EWRackArrayType, IWineRackOption } from "../../UI/Store/WineRackInterface";
import { DrawWineRackTool } from "./DrawWinRackTool";
/**
*
*/
export class DrawUprightWineRackTool extends DrawWineRackTool
{
Parse(space: ISpaceParse, config: IWineRackOption)

@ -1,6 +1,6 @@
import { Command } from "../../Editor/CommandMachine";
import { PointSelectSpaceClamp } from "../../Geometry/SpaceParse/PointSelectSpaceClamp";
import { DrawBlisWineRackTool } from "./DrawBlisWineRackTool";
import { DrawObliqueWineRackTool } from "./DrawObliqueWineRackTool";
import { DrawUprightWineRackTool } from "./DrawUprightWineRackTool";
import { app } from "../../ApplicationServices/Application";
import { userConfig } from "../../Editor/UserConfig";
@ -34,7 +34,7 @@ export class DrawWineRack2 implements Command
if (!userConfig.winerackConfig)
await userConfigStore.InitWinerackConfig();
let space = selectSpace.SpaceParse;
const tool = DrawBlisWineRackTool.GetInstance() as DrawBlisWineRackTool;
const tool = DrawObliqueWineRackTool.GetInstance() as DrawObliqueWineRackTool;
tool.Parse(space, userConfig.winerackConfig);
tool.boardlist.forEach(b => app.Database.ModelSpace.Append(b));
}

@ -1,5 +1,5 @@
import { Vector3 } from "three";
import { DrawBlisWineRackTool } from "../../Add-on/DrawWineRack/DrawBlisWineRackTool";
import { DrawObliqueWineRackTool } from "../../Add-on/DrawWineRack/DrawObliqueWineRackTool";
import { app } from "../../ApplicationServices/Application";
import { Box3Ext } from "../../Geometry/Box";
import { ISpaceParse } from "../../Geometry/SpaceParse/ISpaceParse";
@ -23,7 +23,7 @@ export class TemplateWineRackRecord extends TemplateRecord
{
super.InitBaseParams();
this.option = {
type: EWineRackType.Bias,
type: EWineRackType.Oblique,
arrayType: EWRackArrayType.ByWidth,
fullType: EFullType.ByWidth,
isFull: false,
@ -58,7 +58,7 @@ export class TemplateWineRackRecord extends TemplateRecord
{
await super.Update();
let wineRack = DrawBlisWineRackTool.GetInstance() as DrawBlisWineRackTool;
let wineRack = DrawObliqueWineRackTool.GetInstance() as DrawObliqueWineRackTool;
let brs: Board[] = [];
if (this.Positioning && this.Positioning instanceof PositioningClampSpace)

@ -90,8 +90,8 @@ export class SnapServices
this.InitDynPrompt();
this.InitCrossCursor();
this.InitSquareCursor();
this.InitBiasCrossCursor();
this.InitBiasOutline();
this.InitObliqueCrossCursor();
this.InitObliqueOutline();
this.InitSupportExtLine();
if (prompt.BasePoint)
@ -167,8 +167,8 @@ export class SnapServices
{
this.UpdateSquareCursor();
this.UpdateCrossCursor();
this.UpdateBiasCrossCursor();
this.UpdateBiasOutline();
this.UpdateObliqueCrossCursor();
this.UpdateObliqueOutline();
this.UpdateDynPrompt();
this.UpdateSupportExtLine();
@ -788,7 +788,7 @@ export class SnapServices
pts = PointShapeUtils.PerPts(this.SnapSize);
break;
case ObjectSnapMode.Int:
pts = PointShapeUtils.BiasCrossLinePts(this.SnapSize);
pts = PointShapeUtils.ObliqueCrossLinePts(this.SnapSize);
break;
default:
break;
@ -801,34 +801,34 @@ export class SnapServices
}
}
private m_BiasCrossCursor: Line;
private m_ObliqueCrossCursor: Line;
//×光标,用于捕捉轴线
private InitBiasCrossCursor()
private InitObliqueCrossCursor()
{
if (!this.m_BiasCrossCursor)
if (!this.m_ObliqueCrossCursor)
{
this.m_BiasCrossCursor = app.Viewer.PreViewer.Draw(
DrawMode.BaisCross,
this.m_ObliqueCrossCursor = app.Viewer.PreViewer.Draw(
DrawMode.ObliqueCross,
8,
new Vector3(),
ColorMaterial.GetLineMaterial(7)
);
}
}
private UpdateBiasCrossCursor()
private UpdateObliqueCrossCursor()
{
this.UpdateObjectPosition(
this.m_BiasCrossCursor,
this.m_ObliqueCrossCursor,
this.m_SupportExtLinePts.length > 0
);
}
private m_BiasOutline: Line;
private m_ObliqueOutline: Line;
//初始化X光标外包围框(虚线),用户显示光标交叉
private InitBiasOutline()
private InitObliqueOutline()
{
if (!this.m_BiasOutline)
this.m_BiasOutline = app.Viewer.PreViewer.Draw(
if (!this.m_ObliqueOutline)
this.m_ObliqueOutline = app.Viewer.PreViewer.Draw(
DrawMode.Square,
this.SnapSize,
new Vector3(),
@ -836,10 +836,10 @@ export class SnapServices
);
}
private UpdateBiasOutline()
private UpdateObliqueOutline()
{
this.UpdateObjectPosition(
this.m_BiasOutline,
this.m_ObliqueOutline,
this.m_SupportExtLinePts.length > 2
);
}

@ -74,11 +74,11 @@ export class PointShapeUtils
return pts;
}
static BiasCrossPts(size)
static ObliqueCrossPts(size: number)
{
return [new Vector3(-size, size), new Vector3(size, -size), new Vector3(-size, -size), new Vector3(size, size)];
}
static BiasCrossLinePts(size)
static ObliqueCrossLinePts(size: number)
{
return [new Vector3(-size, size), new Vector3(size, -size), new Vector3(), new Vector3(-size, -size), new Vector3(size, size)];
}

@ -10,7 +10,7 @@ export enum DrawMode
{
Square = 0,
Cross = 1,
BaisCross = 2,
ObliqueCross = 2,
}
@ -160,8 +160,8 @@ export class PreViewer
PF = PointShapeUtils.CrossLinePts;
DrawType = LineSegments;
break;
case DrawMode.BaisCross:
PF = PointShapeUtils.BiasCrossPts;
case DrawMode.ObliqueCross:
PF = PointShapeUtils.ObliqueCrossPts;
DrawType = LineSegments;
break;
default:

@ -239,7 +239,7 @@ export class WineRackModal extends React.Component<{ store?: WineRackStore }, {}
store.m_Option.type = parseInt(e.currentTarget.value);
}}
>
<Radio label="斜酒格" value={EWineRackType.Bias} />
<Radio label="斜酒格" value={EWineRackType.Oblique} />
<Radio label="正酒格" value={EWineRackType.Upright} />
</RadioGroup>
<H5></H5>

@ -1,6 +1,6 @@
export enum EWineRackType
{
Bias = 0,
Oblique = 0,
Upright = 1,
}

@ -8,7 +8,7 @@ import { CheckoutValid, CheckObjectType } from "../../Common/CheckoutVaildValue"
export class WineRackStore extends BoardStore
{
@observable m_Option: IWineRackOption = {
type: EWineRackType.Bias,
type: EWineRackType.Oblique,
arrayType: EWRackArrayType.ByWidth,
fullType: EFullType.ByWidth,
isFull: false,

Loading…
Cancel
Save