Esempio n. 1
0
        /// <summary>
        ///
        /// </summary>
        public MetroDevice0()
        {
#if UNIT_TEST
            if (s_first)
            {
                s_first = false;

                RectangleIntersection.UnitTest();
            }
#endif

            _state = DeviceState.Init;
        }
        internal static void UnitTest()
        {
            Console.WriteLine("RectangleIntersection unit test");

            DisplayList dl = new DisplayList(8.5 * 96, 11 * 96);

            dl.Add(3, 8, 6, 36);
            dl.Add(25, 34, 34, 38);
            dl.Add(33, 37, 21, 36);
            dl.Add(21, 38, 23, 27);
            dl.Add(6, 26, 3, 8);
            dl.Add(31, 35, 15, 19);
            dl.Add(23, 38, 11, 14);

            dl.Add(16, 22, 3.5, 7.5);

            RectangleIntersection ri = new RectangleIntersection();

            ri.CalculateIntersections(dl);
        }
Esempio n. 3
0
        /// <summary>
        /// Find all primitive bounding box intersections
        /// </summary>
        /// <param name="count">Number of primitives need to be considered. The rest of primitives can be ignored as they are all opaque</param>
        public void CalculateIntersections(int count)
        {
            RectangleIntersection ri = new RectangleIntersection();

            ri.CalculateIntersections(this, count);
        }