Beispiel #1
0
        public void RasterizeCurrentTriangulation(PointSet raster, double defaultZ)
        {
            if (this.class15_0 == null | this.list_0 == null)
            {
                throw new InvalidOperationException("A valid triangulation does not exist. Compute the triangulation first!");
            }
            ConvexHull2d convexHull2d = new ConvexHull2d();

            convexHull2d.InitialPoints = this.pointSet_0;
            convexHull2d.ComputeHull();
            for (int i = 0; i < raster.Count; i++)
            {
                double zCoordinate = this.GetZCoordinate(raster[i]);
                if (!double.IsNaN(zCoordinate))
                {
                    raster[i].Z = zCoordinate;
                }
                else
                {
                    raster[i].Z = defaultZ;
                }
                if (!convexHull2d.Contains(raster[i]))
                {
                    raster[i].Z = defaultZ;
                }
            }
            this.pointSet_0 = raster;
            this.Triangulate();
        }
Beispiel #2
0
        public void RasterizeCurrentTriangulation(double xSpacing, double ySpacing)
        {
            if (this.class15_0 == null | this.list_0 == null)
            {
                throw new InvalidOperationException("A valid triangulation does not exist. Compute the triangulation first!");
            }
            PointSet     pointSet     = this.GenerateRaster(xSpacing, ySpacing);
            ConvexHull2d convexHull2d = new ConvexHull2d();

            convexHull2d.InitialPoints = this.pointSet_0;
            convexHull2d.ComputeHull();
            for (int i = pointSet.Count - 1; i >= 0; i--)
            {
                if (!convexHull2d.Contains(pointSet[i]))
                {
                    pointSet.RemoveAt(i);
                }
            }
            this.RasterizeCurrentTriangulation(pointSet, 0.0);
            double num = 1.001 * Math.Sqrt(xSpacing * xSpacing + ySpacing * ySpacing);

            for (int j = 0; j < this.list_0.Count; j++)
            {
                if (this.list_0[j].method_0() && this.list_0[j].method_12().method_10() > num)
                {
                    this.list_0[j].method_1(false);
                }
            }
        }