Exemplo n.º 1
0
        public AnnotationOverlapCheckResult(PolygonIntersect intersect)
            : base(ActionType.AnnotationOverlap, new ObjectId[0])
        {
            using (var transaction = intersect.SourceId.Database.TransactionManager.StartTransaction())
            {
                var polyline = transaction.GetObject(intersect.SourceId, OpenMode.ForRead) as AcadPolyline;
                if (polyline != null)
                {
                    _intersectionPaths.Add((AcadPolyline)polyline.Clone());
                }
                polyline = transaction.GetObject(intersect.TargetId, OpenMode.ForRead) as AcadPolyline;
                if (polyline != null)
                {
                    _intersectionPaths.Add((AcadPolyline)polyline.Clone());
                }
            }

            _extents = _intersectionPaths[0].GeometricExtents;
            for (int i = 1; i < _intersectionPaths.Count; i++)
            {
                _extents.AddExtents(_intersectionPaths[i].GeometricExtents);
            }

            _position       = _extents.MinPoint + (_extents.MaxPoint - _extents.MinPoint) / 2;
            HighlightEntity = false;
        }
Exemplo n.º 2
0
        public IntersectPolygonCheckResult(PolygonIntersect intersect)
            : base(ActionType.IntersectPolygon, new ObjectId[] { intersect.SourceId, intersect.TargetId })
        {
            _intersectionPaths = intersect.Intersections;

            Extents3d extents = _intersectionPaths[0].GeometricExtents;

            for (int i = 1; i < _intersectionPaths.Count; i++)
            {
                extents.AddExtents(_intersectionPaths[i].GeometricExtents);
            }

            _position       = extents.MinPoint + (extents.MaxPoint - extents.MinPoint) / 2;
            _basesize       = (extents.MaxPoint - extents.MinPoint).Length;
            HighlightEntity = false;
        }