Ejemplo n.º 1
0
        public int GetIndex(TetrahedronEdge edge, bool isFrom)
        {
            switch (edge)
            {
            case TetrahedronEdge.Edge_01:
                if (isFrom)
                {
                    return(this.Index0);
                }
                else
                {
                    return(this.Index1);
                }

            case TetrahedronEdge.Edge_02:
                if (isFrom)
                {
                    return(this.Index0);
                }
                else
                {
                    return(this.Index2);
                }

            case TetrahedronEdge.Edge_03:
                if (isFrom)
                {
                    return(this.Index0);
                }
                else
                {
                    return(this.Index3);
                }

            case TetrahedronEdge.Edge_12:
                if (isFrom)
                {
                    return(this.Index1);
                }
                else
                {
                    return(this.Index2);
                }

            case TetrahedronEdge.Edge_13:
                if (isFrom)
                {
                    return(this.Index1);
                }
                else
                {
                    return(this.Index3);
                }

            case TetrahedronEdge.Edge_23:
                if (isFrom)
                {
                    return(this.Index2);
                }
                else
                {
                    return(this.Index3);
                }

            default:
                throw new ApplicationException("Unknown TetrahedronEdge: " + edge.ToString());
            }
        }
Ejemplo n.º 2
0
        public Point3D GetPoint(TetrahedronEdge edge, bool isFrom)
        {
            switch (edge)
            {
            case TetrahedronEdge.Edge_01:
                if (isFrom)
                {
                    return(this.AllPoints[this.Index0]);
                }
                else
                {
                    return(this.AllPoints[this.Index1]);
                }

            case TetrahedronEdge.Edge_02:
                if (isFrom)
                {
                    return(this.AllPoints[this.Index0]);
                }
                else
                {
                    return(this.AllPoints[this.Index2]);
                }

            case TetrahedronEdge.Edge_03:
                if (isFrom)
                {
                    return(this.AllPoints[this.Index0]);
                }
                else
                {
                    return(this.AllPoints[this.Index3]);
                }

            case TetrahedronEdge.Edge_12:
                if (isFrom)
                {
                    return(this.AllPoints[this.Index1]);
                }
                else
                {
                    return(this.AllPoints[this.Index2]);
                }

            case TetrahedronEdge.Edge_13:
                if (isFrom)
                {
                    return(this.AllPoints[this.Index1]);
                }
                else
                {
                    return(this.AllPoints[this.Index3]);
                }

            case TetrahedronEdge.Edge_23:
                if (isFrom)
                {
                    return(this.AllPoints[this.Index2]);
                }
                else
                {
                    return(this.AllPoints[this.Index3]);
                }

            default:
                throw new ApplicationException("Unknown TetrahedronEdge: " + edge.ToString());
            }
        }