示例#1
0
        private List <Border> getAngularEndpoints(BorderCollection inputList)
        {
            List <Border> rawList = new List <Border>();

            foreach (Border b in inputList)
            {
                foreach (BorderNumberPair bnp in b.Endpoints)
                {
                    if (bnp.coordinate2 == null)
                    {
                        rawList.Add(b);
                    }
                }
            }


            List <Border> retVal = new List <Border>();

            foreach (Border b in rawList)
            {
                if (b.Endpoints.Count == 1)
                {
                    inputList.Remove(b);
                    retVal.Add(b);
                }
                else
                {
                    //creating new border with endpoint which don't have null values
                    Border nb = b.GetNewBorder(true);
                    inputList.Remove(b);
                    inputList.Add(nb);

                    //getting the border with only the endpoint that have a null value
                    nb = b.GetNewBorder(false);
                    retVal.Add(nb);
                }
            }


            return(retVal);
        }
示例#2
0
        public BorderVerifier(List <ColoBox> staticBoxes, ColoEngine.Model.LocationStatemachine.Machine machine)
        {
            //string ser = staticBoxes[0].SerializePoints();
            this.boundingBox     = machine.boundingBox;
            this.locationMachine = machine;
            verticalX            = new BorderCollection(boundingBox, machine);
            horizontalY          = new YBorderCollection(boundingBox, machine);
            tilted = new TiltedBorderCollection(boundingBox, machine);

            loadBorderCollections(staticBoxes);



            //if tilted has values and verticalX and horizontalY are empty, rotate the drawing
            if (tilted.Count > 0 && horizontalY.Count == 0 && verticalX.Count == 0)
            {
                machine.IsRotated = true;
                rotateDrawing();

                //recalculate the borders after the rotation
                //loadBorderCollections(staticBoxes, true);
            }
        }