internal void ShowProfileOnMap()
        {
            var mapScale = View.ActiveView.FocusMap.MapScale;
            var profile  = GetProfileSessionFromSelectedNode();

            if (profile == null)
            {
                logger.ErrorEx("Cannot find Selected Profiles set");
                return;
            }

            var       profileLines = profile.ProfileLines.Select(line => line.Line as IGeometry);
            IEnvelope env          = new EnvelopeClass();

            foreach (var line in profileLines)
            {
                env.Union(line.Envelope);
            }

            EsriTools.PanToGeometry(View.ActiveView, env);

            if (profile.DefinitionType == ProfileSettingsTypeEnum.Primitives)
            {
                EsriTools.FlashGeometry(View.ActiveView.ScreenDisplay, profile.Segments.First().Polylines);
            }
            else
            {
                EsriTools.FlashGeometry(View.ActiveView.ScreenDisplay, profileLines);
            }
        }
示例#2
0
        public void FlashLineOnWorkingGraphics(int profileId, int lineId)
        {
            var       curList       = allGraphics[MilSpaceGraphicsTypeEnum.Session];
            IGeometry flashGeometry = null;

            if (lineId > 0)
            {
                int elementId = lineId;

                var graphic = curList.FirstOrDefault(g => g.ProfileId == profileId && g.ElementId == elementId);
                if (graphic != null)
                {
                    flashGeometry = graphic.Source;
                }
            }
            else
            {
                var graphics = curList.Where(g => g.ProfileId == profileId).Select(g => g.Source).ToList();
                IGeometryCollection theGeomColl = new GeometryBagClass();
                graphics.ForEach(pl => theGeomColl.AddGeometry(pl));

                ITopologicalOperator theTopoOp = new PolylineClass();
                theTopoOp.ConstructUnion((IEnumGeometry)theGeomColl);

                flashGeometry = theTopoOp as IGeometry;
            }

            if (flashGeometry != null)
            {
                EsriTools.FlashGeometry(activeView.ScreenDisplay, flashGeometry);
                activeView.Refresh();
            }
        }
        internal void FlashPoint(ProfileSettingsPointButtonEnum pointType)
        {
            EsriTools.PanToGeometry(View.ActiveView, pointsToShow[pointType]);

            EsriTools.FlashGeometry(View.ActiveView.ScreenDisplay, new IGeometry[] { pointsToShow[pointType] });
            //  View.ActiveView.Refresh();
        }
示例#4
0
        public static void FlashLine(IEnumerable <IPoint> points)
        {
            var activeView           = (ArcMap.Application.Document as IMxDocument)?.FocusMap as IActiveView;
            IGeometryBridge2 pGeoBrg = new GeometryEnvironment() as IGeometryBridge2;

            IPointCollection4 pPointColl = new PolylineClass();
            var aWKSPointBuffer          = new IPoint[points.Count()];

            var i = 0;

            foreach (var point in points)
            {
                aWKSPointBuffer[i] = point;
                i++;
            }
            pGeoBrg.SetPoints(pPointColl, ref aWKSPointBuffer);

            var polyline = pPointColl as IPolyline;

            IGeometryCollection theGeomColl = new GeometryBagClass();

            theGeomColl.AddGeometry(polyline);

            ITopologicalOperator theTopoOp = new PolylineClass();

            theTopoOp.ConstructUnion((IEnumGeometry)theGeomColl);

            IGeometry flashGeometry = theTopoOp as IGeometry;

            if (flashGeometry != null)
            {
                EsriTools.ZoomToGeometry(activeView, polyline);
                EsriTools.FlashGeometry(activeView.ScreenDisplay, new IGeometry[] { polyline });
            }
        }
示例#5
0
        /// <summary>
        /// Adds a graphic element to the map graphics container
        /// Returns GUID
        /// </summary>
        /// <param name="geom">IGeometry</param>
        ///


        public static void FlashGeometry(
            ESRI.ArcGIS.Geometry.IGeometry geometry,
            System.Int32 delay)
        {
            if (!EsriTools.IsPointOnExtent(ArcMap.Document.ActivatedView.Extent, geometry as IPoint))
            {
                EsriTools.PanToGeometry(ArcMap.Document.ActiveView, geometry, true);
            }
            EsriTools.FlashGeometry(geometry, delay, ArcMap.Application);
        }
        internal void FlashPoint(ProfileSettingsPointButtonEnum pointType)
        {
            IEnvelope env = new EnvelopeClass();

            env = View.ActiveView.Extent;
            env.CenterAt(pointsToShow[pointType]);
            View.ActiveView.Extent = env;
            View.ActiveView.Refresh();
            EsriTools.FlashGeometry(View.ActiveView.ScreenDisplay, pointsToShow[pointType]);
            View.ActiveView.Refresh();
        }
        internal void ShowProfileOnMap(int profileId = -1, ProfileLine line = null)
        {
            var            mapScale = View.ActiveView.FocusMap.MapScale;
            ProfileSession profile;

            if (profileId == -1)
            {
                profile = GetProfileSessionFromSelectedNode();
            }
            else
            {
                profile = GetProfileSessionById(profileId);
            }

            if (profile == null)
            {
                logger.ErrorEx("Cannot find Selected Profiles set");
                return;
            }

            IEnumerable <IGeometry> profileLines;

            if (line == null)
            {
                profileLines = profile.ProfileLines.Select(profileLine => profileLine.Line as IGeometry);
            }
            else
            {
                profileLines = new List <IGeometry> {
                    line.Line
                };
            }

            IEnvelope env = new EnvelopeClass();

            foreach (var profileLine in profileLines)
            {
                env.Union(profileLine.Envelope);
            }

            EsriTools.PanToGeometry(View.ActiveView, env);

            if (profile.DefinitionType == ProfileSettingsTypeEnum.Primitives)
            {
                EsriTools.FlashGeometry(View.ActiveView.ScreenDisplay, profile.Segments.First().Polylines);
            }
            else
            {
                logger.InfoEx("Flashing geomerty");
                EsriTools.FlashGeometry(View.ActiveView.ScreenDisplay, profileLines);
                logger.InfoEx("Geomerty flashed");
            }
        }
        private void OnProfileGraphClicked(GraphProfileClickedArgs e)
        {
            IPoint point = new Point()
            {
                X = e.ProfilePoint.X, Y = e.ProfilePoint.Y, SpatialReference = e.ProfilePoint.SpatialReference
            };
            IEnvelope env = new EnvelopeClass();
            var       av  = ArcMap.Document.ActivatedView;

            point.Project(av.FocusMap.SpatialReference);

            EsriTools.PanToGeometry(ArcMap.Document.ActivatedView, point);
            EsriTools.FlashGeometry(av.ScreenDisplay, new IGeometry[] { point });
        }
        private void OnProfileGraphClicked(GraphProfileClickedArgs e)
        {
            IPoint point = new Point()
            {
                X = e.ProfilePoint.X, Y = e.ProfilePoint.Y, SpatialReference = e.ProfilePoint.SpatialReference
            };
            IEnvelope env = new EnvelopeClass();
            var       av  = ArcMap.Document.ActivatedView;

            point.Project(av.FocusMap.SpatialReference);

            if (!EsriTools.IsPointOnExtent(ArcMap.Document.ActivatedView.Extent, point))
            {
                EsriTools.PanToGeometry(View.ActiveView, point);
            }

            EsriTools.FlashGeometry(point, 500, ArcMap.Application);
        }
示例#10
0
        public void FlashLineOnWorkingGraphics(IEnumerable <IGeometry> flashingGeometry)
        {
            var       curList       = allGraphics[MilSpaceGraphicsTypeEnum.Session];
            IGeometry flashGeometry = null;

            IGeometryCollection theGeomColl = new GeometryBagClass();

            flashingGeometry.ToList().ForEach(pl => theGeomColl.AddGeometry(pl));

            ITopologicalOperator theTopoOp = new PolylineClass();

            theTopoOp.ConstructUnion((IEnumGeometry)theGeomColl);

            flashGeometry = theTopoOp as IGeometry;

            if (flashGeometry != null)
            {
                EsriTools.FlashGeometry(activeView.ScreenDisplay, flashingGeometry);
            }
        }
        private void OnProfileGraphClicked(GraphProfileClickedArgs e)
        {
            IPoint point = new Point()
            {
                X = e.ProfilePoint.X, Y = e.ProfilePoint.Y, SpatialReference = e.ProfilePoint.SpatialReference
            };

            IEnvelope env = new EnvelopeClass();

            var av = ArcMap.Document.ActivatedView;

            point.Project(av.FocusMap.SpatialReference);

            env = av.Extent;
            env.CenterAt(point);
            av.Extent = env;
            av.Refresh();
            EsriTools.FlashGeometry(av.ScreenDisplay, point);
            av.Refresh();
        }