示例#1
0
        public int GetNeighbour(QuasiEdge commonEdge)
        {
            if (!HasTheEdge(commonEdge))
            {
                throw new NotImplementedException();
            }

            if (this.first == commonEdge.First)
            {
                if (this.second == commonEdge.Second)
                {
                    return(this.FirstSecondNeighbour);
                }
                else if (this.third == commonEdge.Second)
                {
                    return(this.ThirdFirstNeighbour);
                }
            }
            else if (this.second == commonEdge.First)
            {
                if (this.first == commonEdge.Second)
                {
                    return(this.FirstSecondNeighbour);
                }
                else if (this.third == commonEdge.Second)
                {
                    return(this.SecondThirdNeighbour);
                }
            }
            else if (this.third == commonEdge.First)
            {
                if (this.first == commonEdge.Second)
                {
                    return(this.ThirdFirstNeighbour);
                }
                else if (this.second == commonEdge.Second)
                {
                    return(this.SecondThirdNeighbour);
                }
            }

            throw new NotImplementedException();
        }
示例#2
0
        public int GetThirdPoint(QuasiEdge edge)
        {
            if (!HasTheEdge(edge))
            {
                throw new NotImplementedException();
            }

            if (this.first != edge.First && this.first != edge.Second)
            {
                return(this.first);
            }
            else if (this.Second != edge.First && this.Second != edge.Second)
            {
                return(this.Second);
            }
            else if (this.third != edge.First && this.third != edge.Second)
            {
                return(this.third);
            }
            else
            {
                throw new NotImplementedException();
            }
        }
示例#3
0
 public bool HasTheEdge(QuasiEdge edge)
 {
     return(this.HasThePoint(edge.First) && this.HasThePoint(edge.Second));
 }