Esempio n. 1
0
        public void Draw(Graphics3D graphics, IEnumerable <BoxExplicitDir> boxes, bool selected, bool showOuterDimensions)
        {
            graphics.BackgroundColor = selected ? Color.LightBlue : Color.White;
            graphics.CameraPosition  = Graphics3D.Corner_0;
            // draw case (inside)
            Case crate = new Case(0, Dimensions, Dimensions, CrateColor);

            crate.DrawInside(graphics, Transform3D.Identity);

            var tree = new BSPTree();

            foreach (var box in boxes)
            {
                tree.InsertBox(box);
            }
            tree.Draw(graphics);

            crate.DrawEnd(graphics);
            if (showOuterDimensions)
            {
                graphics.AddDimensions(new DimensionCube(Dimensions));
            }

            graphics.Flush();
        }
Esempio n. 2
0
        public void Draw(Graphics3D graphics, IEnumerable <Box> boxes, bool selected, bool showOuterDimensions)
        {
            graphics.BackgroundColor = selected ? Color.LightBlue : Color.White;
            graphics.CameraPosition  = Graphics3D.Corner_0;
            // draw case (inside)
            Case crate = new Case(0, Dimensions, Dimensions, CrateColor);

            crate.DrawInside(graphics, Transform3D.Identity);

            var bbox = BBox3D.Initial;

            foreach (var b in boxes)
            {
                graphics.AddBox(b);
                bbox.Extend(b.BBox);
            }
            crate.DrawEnd(graphics);
            if (showOuterDimensions)
            {
                graphics.AddDimensions(new DimensionCube(Dimensions));
            }

            graphics.Flush();
        }