public static string toString(LLRELATION relation)
    {
        switch (relation)
        {
        case LLRELATION.VERTICAL:
            return("vertical");

        case LLRELATION.VERANDINT:
            return("vertical and intersect");

        case LLRELATION.PARALLEL:
            return("parallel");

        case LLRELATION.NONE:
            return("none");

        case LLRELATION.INTERSECT:
            return("intersect");

        case LLRELATION.ERROR:
            return("error");

        default:
            return("error");
        }
    }
Exemple #2
0
    public void selectRelation()
    {
        //operationMenu.SetActive(false);
        //cancelButton.SetActive(false);
        //infoMenu.SetActive(true);
        int linecnt  = GlobalData.selectedLine.Count;
        int planecnt = GlobalData.selectedPlane.Count;

        if (linecnt == 2 && planecnt == 0)
        {
            Vector3[]  line1    = GlobalData.selectedLine[0];
            Vector3[]  line2    = GlobalData.selectedLine[1];
            LLRELATION relation = MathCalculate.llRelation(line1, line2);
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Relation of the two selected lines is : " + MathCalculate.toString(relation) + ".";
            character.GetComponentInChildren <charEvent>().speakSomething("线线间几何关系为\n" + MathCalculate.toString(relation));
        }
        else if (linecnt == 1 && planecnt == 1)
        {
            Vector3[]  line     = GlobalData.selectedLine[0];
            Vector3[]  plane    = GlobalData.selectedPlane[0];
            LPRELATION relation = MathCalculate.lpRelation(line, plane);
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Relation of selected line and plane is : " + MathCalculate.toString(relation) + ".";
            character.GetComponentInChildren <charEvent>().speakSomething("线面间几何关系为\n" + MathCalculate.toString(relation));
        }
        else if (linecnt == 0 && planecnt == 2)
        {
            Vector3[]  plane1   = GlobalData.selectedPlane[0];
            Vector3[]  plane2   = GlobalData.selectedPlane[1];
            PPRELATION relation = MathCalculate.ppRelation(plane1, plane2);
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Relation of two selected planes is : " + MathCalculate.toString(relation) + ".";
            character.GetComponentInChildren <charEvent>().speakSomething("面面间几何关系为\n" + MathCalculate.toString(relation));
        }
        else
        {
            //GameObject.Find("Canvas/InfoMenu/InfoText").GetComponent<Text>().text = "Selection is not correct.";
            character.GetComponentInChildren <charEvent>().speakSomething("选择存在错误");
        }
    }