public void AddGizmoLength(Gizmo gizmo) { if (!(gizmo is GizmoLength)) { return; } GizmoLength gizmoLength = (GizmoLength)gizmo; GameObject gizmoObject = new GameObject("length"); gizmoObject.transform.SetParent(gizmoWrapper.transform); LengthBehaviour lengthBehaviour = gizmoObject.AddComponent <LengthBehaviour>(); lengthBehaviour.Init(geoCamera); EdgeRefer edge = gizmoLength.edge; Vector3 center = geometry.Center(); Vector3 vertex1 = geometry.UnitVector(edge.id1); Vector3 vertex2 = geometry.UnitVector(edge.id2); float length = geometry.EdgeLength(edge.id1, edge.id2); lengthBehaviour.SetData(center, vertex1, vertex2, length); gizmoMap.Add(gizmoLength, lengthBehaviour); }
public BottomLengthCondition(int id1, int id2, float length) : base(1) { this.edge = new EdgeRefer(id1, id2); this.length = length; GizmoLength gizmoLength = new GizmoLength(edge); gizmos = new Gizmo[] { gizmoLength }; }
private int EdgeOppositeIndex(EdgeRefer er) { if (er == new EdgeRefer(TriPyramid.BOTTOM_A, TriPyramid.BOTTOM_B)) { return(TriPyramid.BOTTOM_C); } else if (er == new EdgeRefer(TriPyramid.BOTTOM_A, TriPyramid.BOTTOM_C)) { return(TriPyramid.BOTTOM_B); } else if (er == new EdgeRefer(TriPyramid.BOTTOM_B, TriPyramid.BOTTOM_C)) { return(TriPyramid.BOTTOM_A); } return(-1); }
public void UpdateGizmoLength(Gizmo gizmo) { if (!(gizmo is GizmoLength)) { return; } GizmoLength gizmoLength = (GizmoLength)gizmo; LengthBehaviour lengthBehaviour = (LengthBehaviour)gizmoMap[gizmoLength]; EdgeRefer edge = gizmoLength.edge; Vector3 center = geometry.Center(); Vector3 vertex1 = geometry.UnitVector(edge.id1); Vector3 vertex2 = geometry.UnitVector(edge.id2); float length = geometry.EdgeLength(edge.id1, edge.id2); lengthBehaviour.SetData(center, vertex1, vertex2, length); }
public override FormInput Title() { EdgeRefer edge = measure.edge; FormElement formElement = new FormElement(2); formElement.fields[0] = geometry.VertexSign(edge.id1); formElement.fields[1] = geometry.VertexSign(edge.id2); float length = geometry.EdgeLength(edge.id1, edge.id2); FormNum formNum = new FormNum(length); formNum.format = UIConstants.LengthFormat; FormInput formInput = new FormInput(3); formInput.inputs[0] = formElement; formInput.inputs[1] = new FormText("="); formInput.inputs[2] = formNum; return(formInput); }
public LinePointAuxiliary(int id1, int id2, float ratio, string sign) : base() { edge = new EdgeRefer(id1, id2); this.ratio = ratio; this.sign = sign; }
public LineAuxiliary(int id1, int id2) : base() { edge = new EdgeRefer(id1, id2); }
public MidPointAuxiliary(int id1, int id2, string sign) : base() { edge = new EdgeRefer(id1, id2); this.sign = sign; }
public LineVerticalAuxiliary(int id1, int id2, int id3, string sign) : base() { vertex = new VertexRefer(id1); edge = new EdgeRefer(id2, id3); this.sign = sign; }
public GizmoLength(int id1, int id2) { name = "GizmoLength"; edge = new EdgeRefer(id1, id2); }
public GizmoLength(EdgeRefer edge) { name = "GizmoLength"; this.edge = edge; }
public LineLengthMeasure(int id1, int id2) : base() { edge = new EdgeRefer(id1, id2); }
private bool IsEdgeAdjacentCorner(EdgeRefer er, CornerRefer cr) { return(cr.id2 == er.id1 || cr.id2 == er.id2); }
private bool IsEdgeOppositeCorner(EdgeRefer er, CornerRefer cr) { return(cr.id2 != er.id1 && cr.id2 != er.id2); }
private float EdgeReferLength(EdgeRefer er) { return(EdgeIndexLength(er.id1, er.id2)); }