示例#1
0
        /// <summary>
        /// Selects stuff within the current limit line. This makes a private selection
        /// over and above any previous selection.
        /// </summary>
        void SelectLimit()
        {
            // Nothing to do if there is no limit line.
            if (m_Limit == null)
            {
                return;
            }

            // Empty out the current limit selection.
            m_LimSel.Clear();

            // Nothing to do if there's only one position.
            if (m_Limit.Count <= 1)
            {
                return;
            }

            // If we have just 2 positions, select everything that
            // intersects the line. Otherwise select inside the shape.

            try
            {
                // Close the limit line.
                m_Limit.Add(m_Limit[0]);

                // Select only lines if the limit line consists of only 2 points (otherwise select
                // whatever is currently visible on the active display)
                SpatialType types = (m_Limit.Count == 2 ? SpatialType.Line : m_Controller.VisibleFeatureTypes);

                // Make the selection.
                ISpatialIndex         index = CadastralMapModel.Current.Index;
                List <ISpatialObject> res   = new FindOverlapsQuery(index, m_Limit.ToArray(), types).Result;
                m_LimSel.AddRange(res);
            }

            catch
            {
            }

            finally
            {
                // Remove the closing point.
                int lastIndex = m_Limit.Count - 1;
                m_Limit.RemoveAt(lastIndex);
            }
        }
示例#2
0
        /// <summary>
        /// Selects stuff within the current limit line. This makes a private selection
        /// over and above any previous selection.
        /// </summary>
        void SelectLimit()
        {
            // Nothing to do if there is no limit line.
            if (m_Limit==null)
                return;

            // Empty out the current limit selection.
            m_LimSel.Clear();

            // Nothing to do if there's only one position.
            if (m_Limit.Count<=1)
                return;

            // If we have just 2 positions, select everything that
            // intersects the line. Otherwise select inside the shape.

            try
            {
                // Close the limit line.
                m_Limit.Add(m_Limit[0]);

                // Select only lines if the limit line consists of only 2 points (otherwise select
                // whatever is currently visible on the active display)
                SpatialType types = (m_Limit.Count==2 ? SpatialType.Line : m_Controller.VisibleFeatureTypes);

                // Make the selection.
                ISpatialIndex index = CadastralMapModel.Current.Index;
                List<ISpatialObject> res = new FindOverlapsQuery(index, m_Limit.ToArray(), types).Result;
                m_LimSel.AddRange(res);
            }

            catch
            {
            }

            finally
            {
                // Remove the closing point.
                int lastIndex = m_Limit.Count-1;
                m_Limit.RemoveAt(lastIndex);
            }
        }