|
|
|
@ -13,6 +13,7 @@ export interface IKnifeInfo2
|
|
|
|
|
|
|
|
|
|
export interface IVModelingInfo
|
|
|
|
|
{
|
|
|
|
|
id: string;
|
|
|
|
|
offset: number;
|
|
|
|
|
depth: number;
|
|
|
|
|
knife: IKnifeInfo2;
|
|
|
|
@ -39,10 +40,15 @@ export class Modeling2Store implements IConfigStore
|
|
|
|
|
@observable modelingItems: IModeling2Item[] = [];
|
|
|
|
|
@observable uiModeingItems: IUiVModeing[] = [];
|
|
|
|
|
isUpdate = true;
|
|
|
|
|
private _ModelingItemId = 0;
|
|
|
|
|
constructor()
|
|
|
|
|
{
|
|
|
|
|
this.InitModelingItems();
|
|
|
|
|
}
|
|
|
|
|
get Id()
|
|
|
|
|
{
|
|
|
|
|
return `${Date.now()}-${this._ModelingItemId++}`;
|
|
|
|
|
}
|
|
|
|
|
@action
|
|
|
|
|
InitModelingItems()
|
|
|
|
|
{
|
|
|
|
@ -57,6 +63,7 @@ export class Modeling2Store implements IConfigStore
|
|
|
|
|
dir: FaceDirection.Front,
|
|
|
|
|
items: [
|
|
|
|
|
{
|
|
|
|
|
id: this.Id,
|
|
|
|
|
offset: 0,
|
|
|
|
|
depth: 0,
|
|
|
|
|
knife: { id: "", name: "", props: { radius: 3, angle: 45 } }
|
|
|
|
@ -96,10 +103,12 @@ export class Modeling2Store implements IConfigStore
|
|
|
|
|
{
|
|
|
|
|
const items = this.modelingItems[index].items;
|
|
|
|
|
|
|
|
|
|
items.push({
|
|
|
|
|
const newItem = {
|
|
|
|
|
...items[0],
|
|
|
|
|
knife: { ...items[0].knife, props: { ...items[0].knife.props } }
|
|
|
|
|
});
|
|
|
|
|
};
|
|
|
|
|
newItem.id = this.Id;
|
|
|
|
|
items.push(newItem);
|
|
|
|
|
this.uiModeingItems[index].items.push({
|
|
|
|
|
offset: "0",
|
|
|
|
|
depth: "0",
|
|
|
|
@ -114,6 +123,7 @@ export class Modeling2Store implements IConfigStore
|
|
|
|
|
ChangeModelingValue(index: number, data: I2DModeling)
|
|
|
|
|
{
|
|
|
|
|
let newItems: IVModelingInfo[] = data.items.map(item => ({
|
|
|
|
|
id: this.Id,
|
|
|
|
|
offset: item.offset,
|
|
|
|
|
depth: item.depth,
|
|
|
|
|
knife: {
|
|
|
|
@ -133,6 +143,7 @@ export class Modeling2Store implements IConfigStore
|
|
|
|
|
ChangeModelingValue3D(index: number, item: { knife: IKnifeInfo, dir: FaceDirection; })
|
|
|
|
|
{
|
|
|
|
|
let newItem = {
|
|
|
|
|
id: this.Id,
|
|
|
|
|
dir: item.dir,
|
|
|
|
|
offset: 0,
|
|
|
|
|
depth: 0,
|
|
|
|
@ -170,6 +181,8 @@ export class Modeling2Store implements IConfigStore
|
|
|
|
|
uiItems.length = items.length;
|
|
|
|
|
for (let j = 0; j < items.length; j++)
|
|
|
|
|
{
|
|
|
|
|
if (!items[j].id)
|
|
|
|
|
items[j].id = this.Id;
|
|
|
|
|
if (uiItems[j])
|
|
|
|
|
{
|
|
|
|
|
uiItems[j].depth = items[j].depth.toString();
|
|
|
|
|