Exemplo n.º 1
0
        public SegmentProxy GetSegment(int partIndex, int segmentIndex)
        {
            PartProxy    partProxy    = _partProxies[partIndex];
            SegmentProxy segmentProxy = partProxy.GetSegment(segmentIndex);

            return(segmentProxy);
        }
Exemplo n.º 2
0
        private List <PartProxy> AddSinglePartProxy([NotNull] IPointCollection4 baseGeometry)
        {
            var result = new List <PartProxy>(1);

            var partProxy = new PartProxy(_boxTree, 0, baseGeometry);

            result.Add(partProxy);

            return(result);
        }
Exemplo n.º 3
0
        public IndexedPolycurve([NotNull] IPointCollection4 baseGeometry)
        {
            Assert.ArgumentNotNull(baseGeometry, nameof(baseGeometry));

            const bool @dynamic  = true;
            const int  dimension = 2;
            const int  maxElementCountPerTile = 4;            //  was: 64;

            _boxTree = new BoxTree <SegmentProxy>(dimension, maxElementCountPerTile, @dynamic);

            var geometry = (IGeometry)baseGeometry;

            _envelope = geometry.Envelope;
            double tolerance = GeometryUtils.GetXyTolerance(geometry);

            Box extent = QaGeometryUtils.CreateBox(_envelope);

            Expand(extent, tolerance);

            _boxTree.InitSize(new IGmtry[] { extent });

            var geometryCollection = baseGeometry as IGeometryCollection;

            if (geometryCollection != null)
            {
                int partCount = geometryCollection.GeometryCount;

                if (partCount > 1)
                {
                    // unpack and add individual parts
                    _partProxies = new List <PartProxy>(partCount);

                    for (int partIndex = 0; partIndex < partCount; partIndex++)
                    {
                        var part = (IPointCollection4)geometryCollection.Geometry[partIndex];

                        var partProxy = new PartProxy(_boxTree, partIndex, part);

                        _partProxies.Add(partProxy);

                        Marshal.ReleaseComObject(part);
                    }
                }
                else
                {
                    // single part in collection
                    _partProxies = AddSinglePartProxy(baseGeometry);
                }
            }
            else
            {
                // no geometry collection
                _partProxies = AddSinglePartProxy(baseGeometry);
            }
        }