Ejemplo n.º 1
0
        public static BoundingBox BuildBoundingBox(List <CylData> dataSetList)
        {
            var bblist = new List <BoundingBox>();

            foreach (CylData set in dataSetList)
            {
                bblist.Add(set.BoundingBox);
            }
            return(BoundingBoxBuilder.Union(bblist.ToArray()));
        }
Ejemplo n.º 2
0
        public void BoundingBoxB_union_returnsCorrectVals()
        {
            Vector3[] ptArray = new Vector3[3];
            ptArray[0] = new Vector3(-1, -2, -3);
            ptArray[1] = new Vector3(4, -4, 4);
            ptArray[2] = new Vector3(1, 2, 3);
            Vector3[] ptArray2 = new Vector3[3];
            ptArray2[0] = new Vector3(4, 5, -3);
            ptArray2[1] = new Vector3(4, -4, 6);
            ptArray2[2] = new Vector3(-8, 2, 3);
            BoundingBox ext1 = BoundingBoxBuilder.FromPtArray(ptArray);
            BoundingBox ext2 = BoundingBoxBuilder.FromPtArray(ptArray2);
            BoundingBox ext  = BoundingBoxBuilder.Union(ext1, ext2);

            Assert.AreEqual(-8d, ext.Min.X);
            Assert.AreEqual(4d, ext.Max.X);
            Assert.AreEqual(5d, ext.Max.Y);
        }
Ejemplo n.º 3
0
        BoundingBox getBoundingBox(List <DwgEntity> entities)
        {
            BoundingBox ext             = new BoundingBox();
            var         boundingBoxList = new List <BoundingBox>();

            foreach (DwgEntity entity in entities)
            {
                if (entity is Line)
                {
                    Line line = entity as Line;

                    boundingBoxList.Add(line.BoundingBox());
                }
                if (entity is Arc)
                {
                    Arc arc = entity as Arc;

                    boundingBoxList.Add(arc.BoundingBox());
                }
            }
            ext = BoundingBoxBuilder.Union(boundingBoxList.ToArray());
            return(ext);
        }
Ejemplo n.º 4
0
        private void getBoundingBox()
        {
            List <BoundingBox> extentList = new List <BoundingBox>();

            foreach (DwgEntity entity in entities)
            {
                if (entity is Line)
                {
                    Line line = entity as Line;
                    extentList.Add(line.BoundingBox());
                }
                if (entity is Arc)
                {
                    Arc arc = entity as Arc;
                    extentList.Add(arc.BoundingBox());
                }
                if (entity is Vector3)
                {
                    Vector3 pt = entity as Vector3;
                    extentList.Add(pt.BoundingBox());
                }
            }
            boundingBox = BoundingBoxBuilder.Union(extentList.ToArray());
        }
Ejemplo n.º 5
0
        public IBoundingBox BoundingBox()
        {
            var bbList = new List <IBoundingBox>();

            foreach (DwgEntity entity in Entities)
            {
                if (entity is Line3)
                {
                    Line3 line = entity as Line3;
                    bbList.Add(line.BoundingBox());
                }
                if (entity is Arc)
                {
                    Arc arc = entity as Arc;
                    bbList.Add(arc.BoundingBox());
                }
                if (entity is Vector3)
                {
                    Vector3 pt = entity as Vector3;
                    bbList.Add(pt.BoundingBox());
                }
            }
            return(BoundingBoxBuilder.Union(bbList));
        }