Example #1
0
 public Quadrangle(Point vertice1, Point vertice2, Point vertice3, Point vertice4,
                   FaceType faceStyle, FaceID faceID, Material material = null, int materialNumber = 0)
     : this(vertice1, vertice2, vertice3, vertice4)
 {
     this.faceStyle      = faceStyle;
     this.faceID         = faceID;
     this.material       = material;
     this.materialNumber = materialNumber;
 }
Example #2
0
 /// <summary>
 /// 判断两个编号是否相同
 /// </summary>
 public bool IsSameID(FaceID ohterID)
 {
     if (this.firstID == ohterID.FirstID && this.secondID == ohterID.SecondID && this.thirdID == ohterID.ThirdID)
     {
         return(true);
     }
     else
     {
         return(false);
     }
 }
Example #3
0
 public Rectangle(Point leftBottomPoint, Point rightBottomPoint, Point leftTopPoint, Point rightTopPoint, FaceID planarID = null)
 {
     this.leftBottomPoint  = leftBottomPoint;
     this.rightBottomPoint = rightBottomPoint;
     this.leftTopPoint     = leftTopPoint;
     this.rightTopPoint    = rightTopPoint;
     this.rectID           = planarID;
     this.triangleOne      = new Triangle(leftBottomPoint, rightBottomPoint, rightTopPoint);
     this.triangleTwo      = new Triangle(this.leftBottomPoint, this.leftTopPoint, this.rightTopPoint);
     this.GetRectangleLines();
 }
Example #4
0
        /// <summary>
        /// 判断两个编号是否相邻
        /// </summary>
        public bool IsAdjacent(FaceType faceType, FaceID otherID)
        {
            if (faceType == FaceType.Terrian)
            {
            }
            else if (faceType == FaceType.Building)
            {
            }
            bool leftAdjacent  = this.firstID == otherID.firstID - 1 && this.secondID == otherID.secondID;
            bool rightAdjacent = this.firstID == otherID.firstID + 1 && this.secondID == otherID.secondID;
            bool topAdjacent   = this.firstID == otherID.firstID && this.secondID == otherID.secondID - 1;
            bool downAdjacent  = this.firstID == otherID.firstID && this.secondID == otherID.secondID + 1;

            return(false);
        }
Example #5
0
        /// <summary>
        /// 判断两个编号是否相邻
        /// </summary>
        public bool IsAdjacent(FaceID otherID)
        {
            bool leftAdjacent  = this.firstID == otherID.firstID - 1 && this.secondID == otherID.secondID;
            bool rightAdjacent = this.firstID == otherID.firstID + 1 && this.secondID == otherID.secondID;
            bool topAdjacent   = this.firstID == otherID.firstID && this.secondID == otherID.secondID - 1;
            bool downAdjacent  = this.firstID == otherID.firstID && this.secondID == otherID.secondID + 1;

            if (leftAdjacent || rightAdjacent || topAdjacent || downAdjacent)
            {
                return(true);
            }
            else
            {
                return(false);
            }
        }
Example #6
0
 public Rectangle(Triangle tri1, Triangle tri2)
 {
     if (JudgeIfIsTheFirstTer(tri1))//判断哪个三角面是右下角的三角面
     {
         tri1.FaceID.ThirdID = 1;
         this.triangleOne    = tri1;
         tri2.FaceID.ThirdID = 2;
         this.triangleTwo    = tri2;
     }
     else
     {
         tri2.FaceID.ThirdID = 1;
         this.triangleOne    = tri2;
         tri1.FaceID.ThirdID = 2;
         this.triangleTwo    = tri1;
     }
     GetLeftBottomPoint(tri1);
     GetRightBottomPoint(tri1);
     GetLeftTopPoint(tri2);
     GetRgihtTopPoint(tri2);
     this.rectID         = (FaceID)tri1.FaceID.Clone();
     this.rectID.ThirdID = 0;
     this.GetRectangleLines();
 }
Example #7
0
 public Triangle(Point vertex1, Point vertex2, Point vertex3, FaceType faceStyle, FaceID faceID, Material material, int materialNumber)
     : this(vertex1, vertex2, vertex3)
 {
     this.faceStyle      = faceStyle;
     this.faceID         = faceID;
     this.material       = material;
     this.materialNumber = materialNumber;
 }
Example #8
0
 public SpaceFace(Point facePoint, SpectVector normalVector, FaceType faceStyle, FaceID faceID, Material material, int materialNumber)
     : this(facePoint, normalVector)
 {
     this.faceStyle      = faceStyle;
     this.faceID         = faceID;
     this.material       = material;
     this.materialNumber = materialNumber;
 }