Select to view content in your preferred language

IMovePolygonFeedback in Mousemove does not draw correctly

1193
1
12-03-2010 06:30 AM
by Anonymous User
Not applicable
Hi,

In the mousemove event I draw the selected feature so the user can see the dimensions of the feature he is moving. For point features this works well, providing the esriROPNotXOrPen setting is set to the ROP2 method of the Symbol object.
For some reason this does not work for polylines and polygons. The feature is not cleared during the move event, it is dragged around the screen.

Does have an idea why this happens?


Here's a portion of the code:

m_Symbol = featureRenderer.get_SymbolByFeature(m_SelectedFeature);
                    m_Symbol.ROP2 = ESRI.ArcGIS.Display.esriRasterOpCode.esriROPNotXOrPen; //make the first draw normal and the second erase

                    //create the appropiate displayfeedback object
                    if (m_SelectedFeature.Shape.GeometryType == esriGeometryType.esriGeometryPoint)
                    {
                        m_dispFeed = new MovePointFeedback();
                        m_dispFeed.Display = m_HookHelper.ActiveView.ScreenDisplay;
                        IMovePointFeedback mvPtFeed = m_dispFeed as IMovePointFeedback;
                        //Start the feedback using the input geometry at the current mouse location 
                        mvPtFeed.Symbol = m_Symbol;
                        mvPtFeed.Start(geomSelect as IPoint, pointMove);
                    }
                    else if (m_SelectedFeature.Shape.GeometryType==esriGeometryType.esriGeometryPolyline)
                    {
                        m_dispFeed = new MoveLineFeedbackClass();
                        m_dispFeed.Display = m_HookHelper.ActiveView.ScreenDisplay;
                        IMoveLineFeedback lineFeedback = m_dispFeed as IMoveLineFeedback;
                        lineFeedback.Symbol = m_Symbol;
                        lineFeedback.Start(geomSelect as IPolyline, pointMove);
                    }
                    else if (m_SelectedFeature.Shape.GeometryType == esriGeometryType.esriGeometryPolygon)
                    {
                        m_dispFeed = new MovePolygonFeedbackClass();
                        m_dispFeed.Display = m_HookHelper.ActiveView.ScreenDisplay;
                        IMovePolygonFeedback polygonFeedback = m_dispFeed as IMovePolygonFeedback;
                        polygonFeedback.Symbol = m_Symbol;
                        polygonFeedback.Start(geomSelect as IPolygon, pointMove);
                    }
0 Kudos
1 Reply
by Anonymous User
Not applicable
I figured it out.

For some reason passing the ISymbol of the feature to the feedback objects does not work for polylines and polygons. If I do not supply the symbol it works. That is, while drawing in the mouse move event the feedback object is refreshed correctly.
Setting the symbol property for point feedbacks does work, which is good in case of custom CharacterMarkerSymbols.
0 Kudos