|
|
|
@ -144,19 +144,27 @@ export class AlignedDimension extends Entity
|
|
|
|
|
let arrow1 = new Mesh(BufferGeometryUtils.ArrowGeometry(), colorMaterial);
|
|
|
|
|
let arrow2 = new Mesh(BufferGeometryUtils.ArrowGeometry(), colorMaterial);
|
|
|
|
|
|
|
|
|
|
this.RepairText();
|
|
|
|
|
|
|
|
|
|
obj.add(line, arrow1, arrow2, this._Text.DrawObject);
|
|
|
|
|
|
|
|
|
|
this.UpdateDrawObject(renderType, obj);
|
|
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* 由于绘制的对象挂载在本实体下面,导致实体Clone后,在Dispose,可能把Text.Object给销毁了
|
|
|
|
|
* 所以尝试还原它.
|
|
|
|
|
*/
|
|
|
|
|
private RepairText()
|
|
|
|
|
{
|
|
|
|
|
let tObj = this._Text.DrawObject;
|
|
|
|
|
if (tObj.children.length === 0)
|
|
|
|
|
{
|
|
|
|
|
this._Text.ClearDraw();
|
|
|
|
|
tObj.add(this._Text.GetDrawObjectFromRenderType());
|
|
|
|
|
|
|
|
|
|
obj.add(line, arrow1, arrow2, this._Text.DrawObject);
|
|
|
|
|
|
|
|
|
|
this.UpdateDrawObject(renderType, obj);
|
|
|
|
|
|
|
|
|
|
return obj;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
UpdateDrawObject(type: RenderType, obj: Object3D)
|
|
|
|
@ -190,6 +198,8 @@ export class AlignedDimension extends Entity
|
|
|
|
|
this._Text.TextString = FixedNotZero(this.m_ArmP1.distanceTo(this.m_ArmP2), 2);
|
|
|
|
|
this._Text.Position = midPoint(this.m_ArmP1, this.m_ArmP2);
|
|
|
|
|
this._Text.TextRotation = textRo;
|
|
|
|
|
|
|
|
|
|
this.RepairText();
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
GetObjectSnapPoints(
|
|
|
|
|