AnsweredAssumed Answered

Displaying a circular arc with the Graphic Tracker

Question asked by Adjutant on Apr 2, 2012
Latest reply on Apr 2, 2012 by Adjutant
Hi,

This documentation : http://help.arcgis.com/en/sdk/10.0/arcobjects_net/conceptualhelp/index.html#/Using_a_GraphicTracker/0001000004tv000000/ provides some information about the graphic tracker.
It states that the tracker only supports IPoint, IPolyline, and IPolygon geometry.

Thanks to Neil's explanation (http://forums.arcgis.com/threads/54068-Extracting-elliptical-properties-from-TrackCircle%28%29-geometry) I understand how a polygon is several objects at once - it could represent a circular arc.
In other words, we are able to create a circular arc (which could be a complete circle), and add it to the graphics tracker - but I'm having trouble with this - nothing is displayed, even though the call to add the graphic succeeds :

           ISimpleFillSymbol fillSymbol = new SimpleFillSymbolClass();           RgbColorClass red = new RgbColorClass() { Red = 255, Green = 0, Blue = 0 };           fillSymbol.Color = red;           fillSymbol.Style = esriSimpleFillStyle.esriSFSSolid;           IGraphicTrackerSymbol graphicTrackerSymbol = graphicTracker.CreateSymbol(fillSymbol as ISymbol, null);            PointClass centroid = new PointClass();           PointClass fromPoint = new PointClass();           PointClass toPoint = new PointClass();           centroid.PutCoords(0, 0);           fromPoint.PutCoords(0, 10);           toPoint.PutCoords(10, 0);           CircularArcClass circularArc = new CircularArcClass();           circularArc.PutCoords(centroid, fromPoint, toPoint, esriArcOrientation.esriArcClockwise);            int graphicID = graphicTracker.Add(circularArc, graphicTrackerSymbol);            mapControl.Refresh(); 



However, when displaying something else, like a character marker symbol, it displays correctly :

           ICharacterMarkerSymbol charSymbol = new CharacterMarkerSymbolClass();           charSymbol.CharacterIndex = 122;           charSymbol.Color = new RgbColorClass() { Red = 15, Green = 255, Blue = 255 };           charSymbol.Font = tactFont;           charSymbol.Size = 36;           charSymbol.XOffset = 0;           charSymbol.YOffset = 0;            PointClass offset = new PointClass() { X = 0, Y = 0 };           IGraphicTrackerSymbol graphicTrackerSymbol = graphicTracker.CreateSymbol(charSymbol as ISymbol, null);           int graphicID = graphicTracker.Add(offset, graphicTrackerSymbol); 


Does the tracker only display objects that do not have an associated geometry (i.e. the graphics tracker accepts a separate geometry object only to position the symbol)?
I've found several references on the web which indicate that the first section of code (with the circular arc) should be working - can anyone explain what is wrong there?


(similarly with Cartographic Symbol - nothing is displayed) :
           CartographicLineSymbolClass cartoSymbol = new CartographicLineSymbolClass();           cartoSymbol.Color = new RgbColorClass() { Red = 0, Green = 0, Blue = 255 };           cartoSymbol.Cap = esriLineCapStyle.esriLCSButt;           cartoSymbol.Join = esriLineJoinStyle.esriLJSBevel;           cartoSymbol.Width = 2;            PointClass p1 = new PointClass() {X = 0, Y = 10};           PointClass p2 = new PointClass() {X = 10, Y = 0};           ILine line = new LineClass();           line.PutCoords(p1, p2);            IEnvelope env = new EnvelopeClass() { XMin = -10, XMax = 10, YMin = -10, YMax = 10 };           IGraphicTrackerSymbol graphicTrackerSymbol = graphicTracker.CreateSymbol(cartoSymbol as ISymbol, null);           int graphicID = graphicTracker.Add(env, graphicTrackerSymbol); 

Outcomes