Esempio n. 1
0
File: DT.cs Progetto: adiel2012/jdt
        /**
         * creates a Delaunay Triangulation from all the points. Note: duplicated
         * points are ignored.
         */
        public Delaunay_Triangulation(Point_dt[] ps)
        {
            _modCount = 0;
            _modCount2 = 0;
            _bb_min = null;
            _bb_max = null;
            this._vertices = new TreeSet<Point_dt>(Point_dt.getComparator());
            _triangles = new List<Triangle_dt>();
            allCollinear = true;
            for (int i = 0; ps != null && i < ps.Length && ps[i] != null; i++)
            {
                this.insertPoint(ps[i]);
            }

            // build grid points to make find faster
            gridPoints = new PointsGridDT(5, this);
        }
Esempio n. 2
0
        /**
         * creates a Delaunay Triangulation from all the points. Note: duplicated
         * points are ignored.
         */
        public Delaunay_Triangulation(Point_dt[] ps)
        {
            _modCount      = 0;
            _modCount2     = 0;
            _bb_min        = null;
            _bb_max        = null;
            this._vertices = new TreeSet <Point_dt>(Point_dt.getComparator());
            _triangles     = new List <Triangle_dt>();
            allCollinear   = true;
            for (int i = 0; ps != null && i < ps.Length && ps[i] != null; i++)
            {
                this.insertPoint(ps[i]);
            }

            // build grid points to make find faster
            gridPoints = new PointsGridDT(5, this);
        }