Exemple #1
0
 public NodeDistance(int name1, int name2, int size, bool inCon, bool inFixed)
 {
     names     = new PairInt(name1, name2);
     distance  = size;
     connected = inCon;
     isFixed   = inFixed;
 }
Exemple #2
0
        public int type;        //string type;

        /*public Segment(int inX, int inY, int inWidth, int inHeight)
         * {
         *      X = inX;
         *      Y = inY;
         *      width = inWidth;
         *      height = inHeight;
         * }*/

        public LineStruct(PairInt firstPoint, ContactSimple secPoint)
        {
            first = new PairInt(firstPoint);
            type  = secPoint.layer;
            if (firstPoint.y == secPoint.y)
            {
                X = firstPoint.x;
                if (firstPoint.x > secPoint.x)
                {
                    X = secPoint.x;
                }
                Y      = firstPoint.y;
                width  = Math.Abs(firstPoint.x - secPoint.x);
                height = 0;
            }
            else
            {
                X = firstPoint.x;
                Y = firstPoint.y;
                if (firstPoint.y > secPoint.y)
                {
                    Y = secPoint.y;
                }
                width  = 0;
                height = Math.Abs(firstPoint.y - secPoint.y);
            }
        }
Exemple #3
0
 public LineStruct(PairInt firstPoint, PairInt secPoint, int inType)
 {
     first = new PairInt(firstPoint);
     type  = inType;
     if (firstPoint.y == secPoint.y)
     {
         X = firstPoint.x;
         if (firstPoint.x > secPoint.x)
         {
             X = secPoint.x;
         }
         Y      = firstPoint.y;
         width  = Math.Abs(firstPoint.x - secPoint.x);
         height = 0;
     }
     else
     {
         X = firstPoint.x;
         Y = firstPoint.y;
         if (firstPoint.y > secPoint.y)
         {
             Y = secPoint.y;
         }
         width  = 0;
         height = Math.Abs(firstPoint.y - secPoint.y);
     }
 }
Exemple #4
0
 static public bool IsDiffusArea(PairInt inCont)
 {
     if (Math.Abs(inCont.y - lineN) <= 3)
     {
         return(true);
     }
     if (Math.Abs(inCont.y - lineP) <= 3)
     {
         return(true);
     }
     return(false);
 }
Exemple #5
0
 static public bool CoverDiffus(PairInt inCont)
 {
     if (Math.Abs(inCont.y - lineN) <= 1)
     {
         return(true);
     }
     if (Math.Abs(inCont.y - lineP) <= 1)
     {
         return(true);
     }
     return(false);
 }
Exemple #6
0
 // Compares by x positions
 public static int CompareByX(PairInt in1, PairInt in2)
 {
     if (in1.x > in2.x)
     {
         return(-1);
     }
     else if (in1.x == in2.x)
     {
         return(0);
     }
     return(1);
 }
Exemple #7
0
 public bool IsPointNear(PairInt inCnt)
 {
     if ((Math.Abs(inCnt.x - x) == 1) && (inCnt.y == y))
     {
         return(true);
     }
     if ((Math.Abs(inCnt.y - y) == 1) && (inCnt.x == x))
     {
         return(true);
     }
     if ((inCnt.x == x) && (inCnt.y == y))
     {
         return(true);
     }
     return(false);
 }
Exemple #8
0
 public ContactSimple(PairInt inPosition, int inLayer) : base(inPosition)
 {
     layer = inLayer;
     inOut = false;
 }
Exemple #9
0
 public PairInt(PairInt inPair)
 {
     x = inPair.x;
     y = inPair.y;
 }
Exemple #10
0
 static public int Distance(PairInt point1, PairInt point2)
 {
     return((int)(Math.Sqrt(((point1.x - point2.x) * (point1.x - point2.x)) +
                            ((point1.y - point2.y) * (point1.y - point2.y)))));
 }