Beispiel #1
0
 public TriPyramidGeometryState(Tool tool, Geometry geometry) : base(tool, geometry)
 {
     if (geometry is TriPyramid)
     {
         this.geometry = (TriPyramid)geometry;
     }
 }
Beispiel #2
0
    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);
    }
Beispiel #3
0
    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;
        }
    }
Beispiel #4
0
    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;
        }
    }
Beispiel #5
0
    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);
    }
Beispiel #6
0
    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);
    }
Beispiel #7
0
    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);
    }
Beispiel #8
0
    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);
    }
Beispiel #9
0
    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);
    }
Beispiel #10
0
    public void Id()
    {
        Geometry geometry = new TriPyramid();

        Debug.Log(geometry.SignId(id));
    }