Esempio n. 1
0
        public IPointCloudBinarySource CreateSparseSegment(PointCloudBinarySourceEnumeratorSparseRegion regions)
        {
            var regionSegments = new List <IPointCloudBinarySource>();

            foreach (var region in regions)
            {
                long pointIndex = (long)regions.PointsPerChunk * region.ChunkStart;
                long pointCount = (long)regions.PointsPerChunk * region.ChunkCount;

                if (pointIndex + pointCount > Count)
                {
                    long diff = pointIndex + pointCount - Count;
                    if (diff < regions.PointsPerChunk)
                    {
                        pointCount -= diff;
                    }
                    else
                    {
                        throw new Exception("right off the end");
                    }
                }

                var regionSegment = CreateSegment(pointIndex, pointCount);
                regionSegments.Add(regionSegment);
            }

            var sparseComposite = new PointCloudBinarySourceComposite(FileHandler, Extent, regionSegments.ToArray());

            return(sparseComposite);
        }
        public IPointCloudBinarySource CreateSegment(long pointIndex, long pointCount)
        {
            var subset = CreateSegmentSources(pointIndex, pointCount);

            // this will break extents, etc.
            //if (subset.Count == 1)
            //    return subset[0];

            var composite = new PointCloudBinarySourceComposite(FileHandler, Extent, subset.ToArray());

            return(composite);
        }
Esempio n. 3
0
        public override IPointCloudBinarySource GenerateBinarySource(ProgressManager progressManager)
        {
            var sources = new List <IPointCloudBinarySource>();

            foreach (var file in m_files)
            {
                sources.Add(file.GenerateBinarySource(progressManager));
            }

            var extent = sources.Select(s => s.Extent).Union3D();
            var source = new PointCloudBinarySourceComposite(this, extent, sources.ToArray());

            return(source);
        }
        public IPointCloudBinarySource CreateSparseSegment(PointCloudBinarySourceEnumeratorSparseRegion regions)
        {
            // break into segments that do not span files
            var regionSegments = new List <IPointCloudBinarySource>();

            foreach (var region in regions)
            {
                long pointIndex           = regions.PointsPerChunk * region.ChunkStart;
                long pointCount           = regions.PointsPerChunk * region.ChunkCount;
                var  regionSegmentSources = CreateSegmentSources(pointIndex, pointCount);
                regionSegments.AddRange(regionSegmentSources);
            }

            var sparseComposite = new PointCloudBinarySourceComposite(FileHandler, Extent, regionSegments.ToArray());

            return(sparseComposite);
        }
Esempio n. 5
0
        public override IPointCloudBinarySource GenerateBinarySource(ProgressManager progressManager)
        {
            var sources = new List<IPointCloudBinarySource>();
            foreach (var file in m_files)
                sources.Add(file.GenerateBinarySource(progressManager));

            var extent = sources.Select(s => s.Extent).Union3D();
            var source = new PointCloudBinarySourceComposite(this, extent, sources.ToArray());
            return source;
        }
        public IPointCloudBinarySource CreateSparseSegment(PointCloudBinarySourceEnumeratorSparseRegion regions)
        {
            // break into segments that do not span files
            var regionSegments = new List<IPointCloudBinarySource>();
            foreach (var region in regions)
            {
                long pointIndex = regions.PointsPerChunk * region.ChunkStart;
                long pointCount = regions.PointsPerChunk * region.ChunkCount;
                var regionSegmentSources = CreateSegmentSources(pointIndex, pointCount);
                regionSegments.AddRange(regionSegmentSources);
            }

            var sparseComposite = new PointCloudBinarySourceComposite(FileHandler, Extent, regionSegments.ToArray());

            return sparseComposite;
        }
        public IPointCloudBinarySource CreateSegment(long pointIndex, long pointCount)
        {
            var subset = CreateSegmentSources(pointIndex, pointCount);

            // this will break extents, etc.
            //if (subset.Count == 1)
            //    return subset[0];

            var composite = new PointCloudBinarySourceComposite(FileHandler, Extent, subset.ToArray());
            return composite;
        }
Esempio n. 8
0
        public IPointCloudBinarySource CreateSparseSegment(PointCloudBinarySourceEnumeratorSparseRegion regions)
        {
            var regionSegments = new List<IPointCloudBinarySource>();
            foreach (var region in regions)
            {
                long pointIndex = (long)regions.PointsPerChunk * region.ChunkStart;
                long pointCount = (long)regions.PointsPerChunk * region.ChunkCount;

                if (pointIndex + pointCount > Count)
                {
                    long diff = pointIndex + pointCount - Count;
                    if (diff < regions.PointsPerChunk)
                        pointCount -= diff;
                    else
                        throw new Exception("right off the end");
                }

                var regionSegment = CreateSegment(pointIndex, pointCount);
                regionSegments.Add(regionSegment);
            }

            var sparseComposite = new PointCloudBinarySourceComposite(FileHandler, Extent, regionSegments.ToArray());

            return sparseComposite;
        }