Esempio n. 1
0
        private void listBox_SelectedValueChanged(object sender, EventArgs e)
        {
            // If we previously had a selected circle, erase it.
            ISpatialDisplay display = EditingController.Current.ActiveDisplay;

            if (m_Select != null)
            {
                display.PaintNow();
            }

            /*
             * // If we previously had a selected circle, erase it. Then
             * // redraw any attached curved (erasing the highlighting
             * // may have left attached curves looking in poor shape).
             *
             * if ( m_pSelect ) {
             *  m_pSelect->Erase();
             *  CeLayerList curlayer;
             *  m_pSelect->DrawCurves(curlayer);
             * }
             */

            // Get the new selection.
            m_Select = GetSel();
            if (m_Select == null)
            {
                return;
            }

            // ... and highlight it.
            DottedStyle style = new DottedStyle();

            m_Select.Render(display, style);
        }
Esempio n. 2
0
        /// <summary>
        /// FormClosing event handler that's called when inverse calculator dialog
        /// is closed.
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        void InverseFormClosing(object sender, FormClosingEventArgs e)
        {
            m_Inverse = null;

            ISpatialDisplay display = EditingController.Current.ActiveDisplay;

            display.RestoreLastDraw();
            display.PaintNow();
        }
Esempio n. 3
0
        /// <summary>
        /// Delegate that's called whenever the index finds an object with an extent that
        /// overlaps the query window.
        /// </summary>
        /// <param name="item">The item to process</param>
        /// <returns>True (always), meaning the query should continue.</returns>
        bool OnQueryHit(ISpatialObject item)
        {
            if (m_DoPaint)
            {
                m_DoPaint = false;
                m_Display.PaintNow();
            }

            item.Render(m_Display, m_Style);
            return(true);
        }
Esempio n. 4
0
 /// <summary>
 /// Creates a new <c>DrawQuery</c> that refers to the specified feature type(s),
 /// drawing the results of the spatial query to the specified display.
 /// </summary>
 /// <param name="index">The index to query</param>
 /// <param name="display">The display to draw to</param>
 /// <param name="style">The drawing style</param>
 /// <param name="types">The type(s) of spatial feature to draw</param>
 public DrawQuery(ISpatialIndex index, ISpatialDisplay display, IDrawStyle style, SpatialType types)
 {
     m_Display = display;
     m_Style = style;
     m_DoPaint = false;
     Timer t = new Timer(500);
     t.Elapsed += new ElapsedEventHandler(Timer_Elapsed);
     t.Start();
     index.QueryWindow(m_Display.Extent, types, OnQueryHit);
     t.Close();
     display.PaintNow();
 }
Esempio n. 5
0
        /// <summary>
        /// Creates a new <c>DrawQuery</c> that refers to the specified feature type(s),
        /// drawing the results of the spatial query to the specified display.
        /// </summary>
        /// <param name="index">The index to query</param>
        /// <param name="display">The display to draw to</param>
        /// <param name="style">The drawing style</param>
        /// <param name="types">The type(s) of spatial feature to draw</param>
        public DrawQuery(ISpatialIndex index, ISpatialDisplay display, IDrawStyle style, SpatialType types)
        {
            m_Display = display;
            m_Style   = style;
            m_DoPaint = false;
            Timer t = new Timer(500);

            t.Elapsed += new ElapsedEventHandler(Timer_Elapsed);
            t.Start();
            index.QueryWindow(m_Display.Extent, types, OnQueryHit);
            t.Close();
            display.PaintNow();
        }
Esempio n. 6
0
        /// <summary>
        /// Application idle handler gives editing commands the opportunity to re-paint
        /// any command-specific stuff.
        /// </summary>
        internal void OnIdle()
        {
            bool            repaint = false;
            ISpatialDisplay display = ActiveDisplay;

            if (m_Inverse != null)
            {
                m_Inverse.Draw();
                repaint = true;
            }

            if (m_Check != null)
            {
                m_Check.Render(display, DrawStyle);
                repaint = true;
            }

            if (m_Sel != null)
            {
                m_Sel.Render(display);
                repaint = true;
            }

            if (m_Sel != null || m_HasSelectionChanged)
            {
                SpatialSelection.Render(display, HighlightStyle);
                repaint = true;
                m_HasSelectionChanged = false;
            }

            if (m_Command != null && m_Command.PerformsPainting)
            {
                // Restoring the last draw here can cause flickering of the command-specific
                // stuff, so make it the responsibility of the command to call erase stuff.
                // (the main thing to ensure is that the call to RestoreLastDraw is made
                // only when the user has really made some sort of change).
                // m_Command.ActiveDisplay.RestoreLastDraw();

                m_Command.Paint(null);
                repaint = true;
            }

            if (repaint)
            {
                display.PaintNow();
            }
        }