Exemple #1
0
        /// <summary>
        /// Creates a new <c>Selection</c> that contains a single item (or nothing).
        /// </summary>
        /// <param name="so">The object to remember as part of this selection (if null, it
        /// will not be added to the selection)</param>
        /// <param name="searchPosition">A position associated with the selection (null
        /// if a specific position isn't relevant). This is used to determine whether a
        /// topological section is relevant when a line is selected.</param>
        public Selection(ISpatialObject so, IPosition searchPosition)
        {
            m_Items = new List<ISpatialObject>(1);
            if (so!=null)
                m_Items.Add(so);

            // If we're dealing with a single line that's been topologically sectioned,
            // determine which divider we're closest to.

            m_Section = null;

            if (searchPosition != null)
            {
                LineFeature line = (so as LineFeature);
                if (line != null && line.Topology is SectionTopologyList)
                {
                    SectionTopologyList sections = (line.Topology as SectionTopologyList);
                    IDivider d = sections.FindClosestSection(searchPosition);
                    if (d != null)
                        m_Section = new DividerObject(d);
                }
            }
        }
Exemple #2
0
 /// <summary>
 /// Creates a new <c>Selection</c> that consists of the items in the supplied list.
 /// </summary>
 /// <param name="items">The items defining the content of the new selection</param>
 internal Selection(IEnumerable<ISpatialObject> items)
 {
     m_Section = null;
     m_Items = new List<ISpatialObject>(items);
 }
Exemple #3
0
 /// <summary>
 /// Creates a new <c>Selection</c> that refers to nothing.
 /// </summary>
 internal Selection()
 {
     m_Section = null;
     m_Items = new List<ISpatialObject>();
 }