public TriPyramidGeometryState(Tool tool, Geometry geometry) : base(tool, geometry) { if (geometry is TriPyramid) { this.geometry = (TriPyramid)geometry; } }
public override Geometry GenerateGeometry() { TriPyramid triPyramid = new TriPyramid(); triPyramid.Constructor = new TriPyramidConstructor(triPyramid); triPyramid.Assistor = new Assistor(triPyramid); triPyramid.Implement = new Implement(triPyramid); triPyramid.Init(); return(triPyramid); }
public BottomAngleConditionState(Tool tool, Condition condition, Geometry geometry) : base(tool, condition) { if (condition is BottomAngleCondition) { this.condition = (BottomAngleCondition)condition; } if (geometry is TriPyramid) { this.geometry = (TriPyramid)geometry; } }
public TopTRightConditionState(Tool tool, Condition condition, Geometry geometry) : base(tool, condition) { if (condition is TopTRightCondition) { this.condition = (TopTRightCondition)condition; } if (geometry is TriPyramid) { this.geometry = (TriPyramid)geometry; } }
protected bool IsTopEdge(TriPyramid triPyramid, FormElement formElement) { if (!formElement.IsFull()) { return(false); } if (formElement.count != 2) { return(false); } string[] fields = formElement.fields; bool result = (triPyramid.IsSignTop(fields[0]) && triPyramid.IsSignBottom(fields[1])) || (triPyramid.IsSignTop(fields[1]) && triPyramid.IsSignBottom(fields[0])); return(result); }
protected bool IsTopTCorner(TriPyramid triPyramid, FormElement formElement) { if (!formElement.IsFull()) { return(false); } if (formElement.count != 3) { return(false); } string[] fields = formElement.fields; bool result = triPyramid.IsSignTop(fields[1]) && triPyramid.IsSignBottom(fields[0]) && triPyramid.IsSignBottom(fields[2]); result = result && (fields[0] != fields[1]) && (fields[0] != fields[2]) && (fields[1] != fields[2]); return(result); }
public override bool ValidateInput(Geometry geometry, FormInput formInput) { if (!(geometry is TriPyramid)) { return(false); } TriPyramid triPyramid = (TriPyramid)geometry; FormElement formElement1 = (FormElement)formInput.inputs[0]; FormElement formElement2 = (FormElement)formInput.inputs[2]; FormElement formElement = EdgesToCorner(formElement1, formElement2); if (!IsTopTCorner(triPyramid, formElement)) { return(false); } return(true); }
public override bool ValidateInput(Geometry geometry, FormInput formInput) { if (!(geometry is TriPyramid)) { return(false); } TriPyramid triPyramid = (TriPyramid)geometry; FormElement formElement = (FormElement)formInput.inputs[1]; if (!IsBottomCorner(triPyramid, formElement)) { return(false); } FormNum formNum = (FormNum)formInput.inputs[3]; if (!IsValidAngle(formNum)) { return(false); } return(true); }
public override bool ValidateInput(Geometry geometry, FormInput formInput) { if (!(geometry is TriPyramid)) { return(false); } TriPyramid triPyramid = (TriPyramid)geometry; FormElement formElement = (FormElement)formInput.inputs[0]; if (!IsBottomEdge(triPyramid, formElement)) { return(false); } FormNum formNum = (FormNum)formInput.inputs[2]; if (!IsValidLength(formNum)) { return(false); } return(true); }
public void Id() { Geometry geometry = new TriPyramid(); Debug.Log(geometry.SignId(id)); }