PageRenderTime 51ms CodeModel.GetById 21ms RepoModel.GetById 1ms app.codeStats 0ms

/GPX.Firemap.Desktop/GPX.Firemap.Desktop.Add-ins/GraticuleCustomLayers.esriaddin/CustomLayers/GDA94GraticuleCustomLayer.cs

https://bitbucket.org/shope/dfu
C# | 589 lines | 373 code | 73 blank | 143 comment | 42 complexity | 277ea77fc342127ce8821f2f553d5cc6 MD5 | raw file
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using ESRI.ArcGIS.ADF;
  5. using ESRI.ArcGIS.ArcMapUI;
  6. using ESRI.ArcGIS.Carto;
  7. using ESRI.ArcGIS.Display;
  8. using ESRI.ArcGIS.esriSystem;
  9. using ESRI.ArcGIS.Geometry;
  10. namespace GraticuleCustomLayers.esriaddin
  11. {
  12. public class GDA94GraticuleCustomLayer : ILayer
  13. {
  14. #region Module Level Variables and Constants
  15. // Temporary constants (TODO: Will be replaced with values extracted from config)
  16. // These are DD intervals: private const string GraticuleIntervals = "100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2,1,0.9,0.8,0.7,0.6,0.5,0.4,0.3,0.2,0.1,0.09,0.08,0.07,0.06,0.05,0.04,0.03,0.02,0.01,0.009,0.008,0.007,0.006,0.005,0.004,0.003,0.002,0.001,0.0009,0.0008,0.0007,0.0006,0.0005,0.0004,0.0003,0.0002,0.0001,0.00009,0.00008,0.00007,0.00006,0.00005,0.00004,0.00003,0.00002,0.00001";
  17. // The following intervals are whole degree, minute and seconds values (converted to DD).
  18. // Whole DMS values must be used to ensure the graticule line coordinates and labels match.
  19. private const string GraticuleIntervals = "100,90,80,70,60,50,40,30,20,10,9,8,7,6,5,4,3,2," +
  20. "1,0.833333333,0.666666667,0.5,0.333333333,0.166666667,0.133333333,0.1,0.066666667,0.033333333,0.016666667," +
  21. "0.013888889,0.011111111,0.008333333,0.005555556,0.002777778,0.002222222,0.001666667,0.001111111,0.000555556,0.000277778";
  22. private const int DensifySegmentCount = 50;
  23. /// <summary>
  24. /// Unique COM identifier for this class, to facilitate IPersistVariant (if persistence is implemented)
  25. /// </summary>
  26. private const string ClassGuid = "7e964821-34c2-47f7-b53b-0b2e48486886";
  27. /// <summary>
  28. /// Name of the layer
  29. /// </summary>
  30. public static readonly string LayerName = "Graticule";
  31. /// <summary>
  32. /// The MxDocument holding the map the is showing this custom layer
  33. /// </summary>
  34. private IMxDocument m_mxDocument = null;
  35. /// <summary>
  36. /// Indicates if the layer needs its own display cache.
  37. /// </summary>
  38. private bool m_isCached = false;
  39. /// <summary>
  40. /// Indicates if the layer is currently visible.
  41. /// </summary>
  42. private bool m_visible = true;
  43. /// <summary>
  44. /// Describes the area of interest of the layer.
  45. /// </summary>
  46. private IEnvelope m_areaOfInterest = default(IEnvelope);
  47. #endregion
  48. #region Constructors
  49. /// <summary>
  50. /// Initializes a new instance of the <see cref="GraticuleCustomLayer"/> class.
  51. /// </summary>
  52. /// <param name="mxDocument">The ArcMap document this layer is associated with.</param>
  53. public GDA94GraticuleCustomLayer(IMxDocument mxDocument)
  54. {
  55. m_mxDocument = mxDocument;
  56. }
  57. #endregion
  58. #region ILayer Members
  59. /// <summary>
  60. /// The default area of interest for the layer.
  61. /// </summary>
  62. public IEnvelope AreaOfInterest
  63. {
  64. get
  65. {
  66. return m_areaOfInterest;
  67. }
  68. }
  69. /// <summary>
  70. /// Indicates if the layer needs its own display cache.
  71. /// </summary>
  72. public bool Cached
  73. {
  74. get
  75. {
  76. return m_isCached;
  77. }
  78. set
  79. {
  80. m_isCached = value;
  81. }
  82. }
  83. /// <summary>
  84. /// Draws the layer to the specified display for the given draw phase.
  85. /// </summary>
  86. /// <param name="DrawPhase"></param>
  87. /// <param name="Display"></param>
  88. /// <param name="TrackCancel"></param>
  89. public void Draw(esriDrawPhase DrawPhase, IDisplay Display, ITrackCancel TrackCancel)
  90. {
  91. System.Diagnostics.Debug.WriteLine("GraticuleDrawEvent");
  92. using (ComReleaser comReleaser = new ComReleaser())
  93. {
  94. // Make sure we can proceed, if not exit
  95. if (!Valid || !Visible) { return; }
  96. // Get the display transformation and spatial references
  97. IDisplayTransformation displayTranformation = Display.DisplayTransformation;
  98. ISpatialReference displaySpatialReference = displayTranformation.SpatialReference;
  99. comReleaser.ManageLifetime(displaySpatialReference);
  100. if (SpatialReferenceStore.IsUnknownSpatialReference(displaySpatialReference)) { return; }
  101. ISpatialReference graticuleSpatialReference = displayTranformation.SpatialReference;
  102. comReleaser.ManageLifetime(graticuleSpatialReference);
  103. if ((displaySpatialReference as IProjectedCoordinateSystem) != null)
  104. {
  105. graticuleSpatialReference = (ISpatialReference)((IProjectedCoordinateSystem)displaySpatialReference).GeographicCoordinateSystem;
  106. comReleaser.ManageLifetime(graticuleSpatialReference);
  107. }
  108. // Get the bounds of the map.
  109. // This must be fitted bounds when drawing in data view, or printing in data view or layout view.
  110. // When drawing in layout view this must be the bounds of the matching map frame (IDisplays match)
  111. m_areaOfInterest = displayTranformation.FittedBounds;
  112. if ((m_mxDocument.ActiveView as IPageLayout) != null)
  113. {
  114. IMapFrame[] mapFrames = LayoutMethods.GetMapFrames((IPageLayout)m_mxDocument.ActiveView);
  115. foreach (IMapFrame mapFrame in mapFrames)
  116. {
  117. if (((IActiveView)mapFrame.Map).ScreenDisplay.Equals(Display))
  118. {
  119. m_areaOfInterest = mapFrame.MapBounds;
  120. }
  121. }
  122. }
  123. // Get the list of lines and label points to be displayed (calculated in graticule coords, returned in display coords)
  124. List<GraticuleLine> graticuleLines = CalculateGraticuleLines(m_areaOfInterest, displaySpatialReference, graticuleSpatialReference);
  125. // Draw the lines
  126. Display.SetSymbol((ISymbol)OsraGraphics.GraticuleLineSymbol);
  127. foreach (GraticuleLine graticuleLine in graticuleLines)
  128. {
  129. Display.DrawPolyline((IGeometry)graticuleLine.Line);
  130. }
  131. // Draw the labels
  132. ITextSymbol textSymbol = OsraGraphics.GraticuleTextSymbol;
  133. foreach (GraticuleLine graticuleLine in graticuleLines)
  134. {
  135. foreach (GraticuleLabelPoint graticuleLabelPoint in graticuleLine.LabelPoints)
  136. {
  137. // Set the properties of the text symbol based on the properties of the label point
  138. textSymbol.HorizontalAlignment = graticuleLabelPoint.HorizontalAlignment;
  139. textSymbol.VerticalAlignment = graticuleLabelPoint.VerticalAlignment;
  140. textSymbol.Text = graticuleLabelPoint.Text;
  141. // Work out the extent of the label to be drawn
  142. IEnvelope boundsEnv = new EnvelopeClass();
  143. comReleaser.ManageLifetime(boundsEnv);
  144. ((IQueryGeometry)textSymbol).QueryEnvelope(Display.hDC, (ITransformation)displayTranformation, (IGeometry)graticuleLabelPoint.AnchorPoint, boundsEnv);
  145. // Do some calcs to make sure we only draw lables that not too close to the corners of the display.
  146. bool draw = false;
  147. if (textSymbol.VerticalAlignment == esriTextVerticalAlignment.esriTVATop ||
  148. textSymbol.VerticalAlignment == esriTextVerticalAlignment.esriTVABottom) // Longiture labels
  149. {
  150. if (boundsEnv.XMin > m_areaOfInterest.XMin && boundsEnv.XMax < m_areaOfInterest.XMax)
  151. {
  152. draw = true;
  153. }
  154. }
  155. else // Latitude labels
  156. {
  157. if ((m_areaOfInterest.YMax - boundsEnv.YMax) > boundsEnv.Height &&
  158. (boundsEnv.YMin - m_areaOfInterest.YMin) > boundsEnv.Height)
  159. {
  160. draw = true;
  161. }
  162. }
  163. // If the label is to be drawn, the draw it
  164. if (draw)
  165. {
  166. Display.SetSymbol((ISymbol)textSymbol);
  167. Display.DrawText((IGeometry)graticuleLabelPoint.AnchorPoint, graticuleLabelPoint.Text);
  168. }
  169. ComReleaser.ReleaseCOMObject(graticuleLabelPoint.AnchorPoint);
  170. }
  171. ComReleaser.ReleaseCOMObject(graticuleLine.Line);
  172. }
  173. }
  174. }
  175. /// <summary>
  176. /// Maximum scale (representative fraction) at which the layer will display.
  177. /// </summary>
  178. public double MaximumScale
  179. {
  180. get
  181. {
  182. return default(double);
  183. }
  184. set
  185. {
  186. // Setting MaximumScale does nothing
  187. }
  188. }
  189. /// <summary>
  190. /// Minimum scale (representative fraction) at which the layer will display.
  191. /// </summary>
  192. public double MinimumScale
  193. {
  194. get
  195. {
  196. return default(double);
  197. }
  198. set
  199. {
  200. // Setting MinimumScale does nothing
  201. }
  202. }
  203. /// <summary>
  204. /// Layer name.
  205. /// </summary>
  206. public string Name
  207. {
  208. get
  209. {
  210. return LayerName;
  211. }
  212. set
  213. {
  214. // Setting Name does nothing
  215. }
  216. }
  217. /// <summary>
  218. /// Indicates if the layer shows map tips.
  219. /// </summary>
  220. public bool ShowTips
  221. {
  222. get
  223. {
  224. return default(bool);
  225. }
  226. set
  227. {
  228. // Setting ShowTips does nothing
  229. }
  230. }
  231. /// <summary>
  232. /// Spatial reference for the layer.
  233. /// </summary>
  234. public ISpatialReference SpatialReference
  235. {
  236. set
  237. {
  238. // Setting SpatialReference does nothing
  239. }
  240. }
  241. /// <summary>
  242. /// Supported draw phases.
  243. /// </summary>
  244. public int SupportedDrawPhases
  245. {
  246. get
  247. {
  248. return (int)esriDrawPhase.esriDPGeography;
  249. }
  250. }
  251. /// <summary>
  252. /// Indicates if the layer is currently valid.
  253. /// </summary>
  254. public bool Valid
  255. {
  256. get
  257. {
  258. return true;
  259. }
  260. }
  261. /// <summary>
  262. /// Indicates if the layer is currently visible.
  263. /// </summary>
  264. public bool Visible
  265. {
  266. get
  267. {
  268. return m_visible;
  269. }
  270. set
  271. {
  272. m_visible = value;
  273. }
  274. }
  275. /// <summary>
  276. /// Get_s the tip text.
  277. /// </summary>
  278. /// <param name="x">The x.</param>
  279. /// <param name="y">The y.</param>
  280. /// <param name="Tolerance">The tolerance.</param>
  281. public string get_TipText(double x, double y, double Tolerance)
  282. {
  283. return default(string);
  284. }
  285. #endregion
  286. #region Static Helper Methods
  287. /// <summary>
  288. /// Calculates the graticule lines.
  289. /// </summary>
  290. /// <param name="displayBounds">The display bounds.</param>
  291. /// <param name="displaySpatialReference">The display spatial reference.</param>
  292. /// <param name="graticuleSpatialReference">The graticule spatial reference.</param>
  293. /// <returns>A list of GraticuleLine DTOs</returns>
  294. private static List<GraticuleLine> CalculateGraticuleLines(IEnvelope displayBounds, ISpatialReference displaySpatialReference, ISpatialReference graticuleSpatialReference)
  295. {
  296. using (ComReleaser comReleaser = new ComReleaser())
  297. {
  298. // Project the display bounds and slightly expanded display bounds into graticule coordinates
  299. IEnvelope graticuleBounds = (IEnvelope)ProjectionMethods.ProjectCopy(displayBounds, graticuleSpatialReference);
  300. comReleaser.ManageLifetime(graticuleBounds);
  301. IEnvelope graticuleBoundsExpanded = (IEnvelope)ProjectionMethods.ProjectCopy(displayBounds, graticuleSpatialReference);
  302. comReleaser.ManageLifetime(graticuleBoundsExpanded);
  303. graticuleBoundsExpanded.Expand(1.25, 1.25, true);
  304. // Get the edges of the display bounds in display coordinates
  305. object missing = Type.Missing;
  306. IPointCollection displayBoundsTopEdge = new PolylineClass();
  307. comReleaser.ManageLifetime(displayBoundsTopEdge);
  308. ((IPolyline)displayBoundsTopEdge).SpatialReference = displaySpatialReference;
  309. displayBoundsTopEdge.AddPoint(displayBounds.UpperLeft, ref missing, ref missing);
  310. displayBoundsTopEdge.AddPoint(displayBounds.UpperRight, ref missing, ref missing);
  311. IPointCollection displayBoundsBottomEdge = new PolylineClass();
  312. comReleaser.ManageLifetime(displayBoundsBottomEdge);
  313. ((IPolyline)displayBoundsBottomEdge).SpatialReference = displaySpatialReference;
  314. displayBoundsBottomEdge.AddPoint(displayBounds.LowerLeft, ref missing, ref missing);
  315. displayBoundsBottomEdge.AddPoint(displayBounds.LowerRight, ref missing, ref missing);
  316. IPointCollection displayBoundsLeftEdge = new PolylineClass();
  317. comReleaser.ManageLifetime(displayBoundsLeftEdge);
  318. ((IPolyline)displayBoundsLeftEdge).SpatialReference = displaySpatialReference;
  319. displayBoundsLeftEdge.AddPoint(displayBounds.LowerLeft, ref missing, ref missing);
  320. displayBoundsLeftEdge.AddPoint(displayBounds.UpperLeft, ref missing, ref missing);
  321. IPointCollection displayBoundsRightEdge = new PolylineClass();
  322. comReleaser.ManageLifetime(displayBoundsRightEdge);
  323. ((IPolyline)displayBoundsRightEdge).SpatialReference = displaySpatialReference;
  324. displayBoundsRightEdge.AddPoint(displayBounds.LowerRight, ref missing, ref missing);
  325. displayBoundsRightEdge.AddPoint(displayBounds.UpperRight, ref missing, ref missing);
  326. // Work out the display intervals of the graticule lines in graticule coordinates
  327. double[] intervals = System.Array.ConvertAll<string, double>(GDA94GraticuleCustomLayer.GraticuleIntervals.Split(Convert.ToChar(",")),
  328. delegate(string str) { return double.Parse(str); });
  329. //double longitudeActualInterval = (graticuleBounds.Width / Convert.ToDouble(UserSettings.Instance.DefaultMaxNumberOfGraticuleLines));
  330. //double latitudeActualInterval = (graticuleBounds.Height / Convert.ToDouble(UserSettings.Instance.DefaultMaxNumberOfGraticuleLines));
  331. double longitudeActualInterval = (graticuleBounds.Width / Convert.ToDouble(4));
  332. double latitudeActualInterval = (graticuleBounds.Height / Convert.ToDouble(4));
  333. double longitudeDisplayInterval = intervals.OrderBy(n => Math.Abs(longitudeActualInterval - n)).ElementAt(0); // Finds closest value in the interval array
  334. double latitudeDisplayInterval = intervals.OrderBy(n => Math.Abs(latitudeActualInterval - n)).ElementAt(0); // Finds closest value in the interval array
  335. // Work out the start positions of the graticule lines in graticule coordinates
  336. double longitudeLeft = (Math.Ceiling(graticuleBounds.XMin / longitudeDisplayInterval) * longitudeDisplayInterval);
  337. double latitudeBottom = (Math.Ceiling(graticuleBounds.YMin / latitudeDisplayInterval) * latitudeDisplayInterval);
  338. // Create the graticule lines (extend to expanded bounds), project back to the display coordinates and calculate label points
  339. List<GraticuleLine> graticuleLines = new List<GraticuleLine>();
  340. for (double i = longitudeLeft; i <= graticuleBounds.XMax; i += longitudeDisplayInterval)
  341. {
  342. if (i >= -180D && i <= 180D && graticuleBounds.YMin <= 90D && graticuleBounds.YMax >= -90D)
  343. {
  344. IPoint longitudeLineStart = new PointClass();
  345. comReleaser.ManageLifetime(longitudeLineStart);
  346. IPoint longitudeLineEnd = new PointClass();
  347. comReleaser.ManageLifetime(longitudeLineEnd);
  348. longitudeLineStart.PutCoords(i, graticuleBoundsExpanded.YMin);
  349. longitudeLineEnd.PutCoords(i, graticuleBoundsExpanded.YMax);
  350. IPolyline longitudeLine = new PolylineClass();
  351. longitudeLine.SpatialReference = graticuleSpatialReference;
  352. longitudeLine.FromPoint = longitudeLineStart;
  353. longitudeLine.ToPoint = longitudeLineEnd;
  354. ((IPolycurve)longitudeLine).Densify(longitudeLine.Length / Convert.ToDouble(GDA94GraticuleCustomLayer.DensifySegmentCount), 0);
  355. longitudeLine = (IPolyline)ProjectionMethods.Project((IGeometry)longitudeLine, displaySpatialReference);
  356. // Intersect the lines with the display bounds (top and bottom)
  357. List<GraticuleLabelPoint> graticuleLabelPoints = new List<GraticuleLabelPoint>();
  358. IGeometry topLabelPoint = ((ITopologicalOperator)longitudeLine).Intersect((IGeometry)displayBoundsTopEdge, esriGeometryDimension.esriGeometry0Dimension);
  359. if ((topLabelPoint as IMultipoint) != null && ((IPointCollection)topLabelPoint).PointCount == 1)
  360. {
  361. graticuleLabelPoints.Add(new GraticuleLabelPoint(((IPointCollection)topLabelPoint).get_Point(0),
  362. esriTextHorizontalAlignment.esriTHACenter, esriTextVerticalAlignment.esriTVATop, LatLongCoordinateFormatter.ConvertLongitudeDDtoDMS(i)));
  363. }
  364. IGeometry bottomLabelPoint = ((ITopologicalOperator)longitudeLine).Intersect((IGeometry)displayBoundsBottomEdge, esriGeometryDimension.esriGeometry0Dimension);
  365. if ((bottomLabelPoint as IMultipoint) != null && ((IPointCollection)bottomLabelPoint).PointCount == 1)
  366. {
  367. graticuleLabelPoints.Add(new GraticuleLabelPoint(((IPointCollection)bottomLabelPoint).get_Point(0),
  368. esriTextHorizontalAlignment.esriTHACenter, esriTextVerticalAlignment.esriTVABottom, LatLongCoordinateFormatter.ConvertLongitudeDDtoDMS(i)));
  369. }
  370. graticuleLines.Add(new GraticuleLine(longitudeLine, graticuleLabelPoints));
  371. }
  372. }
  373. for (double i = latitudeBottom; i <= graticuleBounds.YMax; i += latitudeDisplayInterval)
  374. {
  375. if (i >= -90D && i <= 90D && graticuleBounds.XMin <= 180D && graticuleBounds.XMax >= -180D)
  376. {
  377. IPoint latitudeLineStart = new PointClass();
  378. comReleaser.ManageLifetime(latitudeLineStart);
  379. IPoint latitudeLineEnd = new PointClass();
  380. comReleaser.ManageLifetime(latitudeLineEnd);
  381. latitudeLineStart.PutCoords(graticuleBoundsExpanded.XMin, i);
  382. latitudeLineEnd.PutCoords(graticuleBoundsExpanded.XMax, i);
  383. IPolyline latitudeLine = new PolylineClass();
  384. latitudeLine.SpatialReference = graticuleSpatialReference;
  385. latitudeLine.FromPoint = latitudeLineStart;
  386. latitudeLine.ToPoint = latitudeLineEnd;
  387. ((IPolycurve)latitudeLine).Densify(latitudeLine.Length / Convert.ToDouble(GDA94GraticuleCustomLayer.DensifySegmentCount), 0);
  388. latitudeLine = (IPolyline)ProjectionMethods.Project((IGeometry)latitudeLine, displaySpatialReference);
  389. // Intersect the lines with the display bounds (top and bottom)
  390. List<GraticuleLabelPoint> graticuleLabelPoints = new List<GraticuleLabelPoint>();
  391. IGeometry leftLabelPoint = ((ITopologicalOperator)latitudeLine).Intersect((IGeometry)displayBoundsLeftEdge, esriGeometryDimension.esriGeometry0Dimension);
  392. if ((leftLabelPoint as IMultipoint) != null && ((IPointCollection)leftLabelPoint).PointCount == 1)
  393. {
  394. graticuleLabelPoints.Add(new GraticuleLabelPoint(((IPointCollection)leftLabelPoint).get_Point(0),
  395. esriTextHorizontalAlignment.esriTHALeft, esriTextVerticalAlignment.esriTVACenter, LatLongCoordinateFormatter.ConvertLatitudeDDtoDMS(i)));
  396. }
  397. IGeometry rightLabelPoint = ((ITopologicalOperator)latitudeLine).Intersect((IGeometry)displayBoundsRightEdge, esriGeometryDimension.esriGeometry0Dimension);
  398. if ((rightLabelPoint as IMultipoint) != null && ((IPointCollection)rightLabelPoint).PointCount == 1)
  399. {
  400. graticuleLabelPoints.Add(new GraticuleLabelPoint(((IPointCollection)rightLabelPoint).get_Point(0),
  401. esriTextHorizontalAlignment.esriTHARight, esriTextVerticalAlignment.esriTVACenter, LatLongCoordinateFormatter.ConvertLatitudeDDtoDMS(i)));
  402. }
  403. graticuleLines.Add(new GraticuleLine(latitudeLine, graticuleLabelPoints));
  404. }
  405. }
  406. return graticuleLines;
  407. }
  408. }
  409. #endregion
  410. #region Data Transfer Objects
  411. /// <summary>
  412. /// Class to hold details of a graticule line
  413. /// </summary>
  414. private class GraticuleLine
  415. {
  416. #region Module Level Variables
  417. private IPolyline _line;
  418. private List<GraticuleLabelPoint> _labelPoints;
  419. #endregion
  420. #region Constructors
  421. /// <summary>
  422. /// Initializes a new instance of the <see cref="GraticuleLine"/> class.
  423. /// </summary>
  424. /// <param name="line">The line.</param>
  425. /// <param name="labelPoints">The label points.</param>
  426. public GraticuleLine(IPolyline line, List<GraticuleLabelPoint> labelPoints)
  427. {
  428. _line = line;
  429. _labelPoints = labelPoints;
  430. }
  431. #endregion
  432. #region Properties
  433. /// <summary>
  434. /// Gets the line.
  435. /// </summary>
  436. /// <value>The line.</value>
  437. public IPolyline Line
  438. {
  439. get { return _line; }
  440. }
  441. /// <summary>
  442. /// Gets the label points.
  443. /// </summary>
  444. /// <value>The label points.</value>
  445. public List<GraticuleLabelPoint> LabelPoints
  446. {
  447. get { return _labelPoints; }
  448. }
  449. #endregion
  450. }
  451. /// <summary>
  452. /// Class to hold details of a graticule label point
  453. /// </summary>
  454. private class GraticuleLabelPoint
  455. {
  456. #region Module Level Variables
  457. private IPoint _anchorPoint;
  458. private esriTextHorizontalAlignment _horizontalAlignment;
  459. private esriTextVerticalAlignment _verticalAlignment;
  460. private string _text;
  461. #endregion
  462. #region Constructors
  463. /// <summary>
  464. /// Initializes a new instance of the <see cref="GraticuleLabelPoint"/> class.
  465. /// </summary>
  466. /// <param name="anchorPoint">The anchor point.</param>
  467. /// <param name="horizontalAlignment">The horizontal alignment.</param>
  468. /// <param name="verticalAlignment">The vertical alignment.</param>
  469. /// <param name="text">The text.</param>
  470. public GraticuleLabelPoint(IPoint anchorPoint, esriTextHorizontalAlignment horizontalAlignment,
  471. esriTextVerticalAlignment verticalAlignment, string text)
  472. {
  473. _anchorPoint = anchorPoint;
  474. _horizontalAlignment = horizontalAlignment;
  475. _verticalAlignment = verticalAlignment;
  476. _text = text;
  477. }
  478. #endregion
  479. #region Properties
  480. /// <summary>
  481. /// Gets the anchor point.
  482. /// </summary>
  483. /// <value>The anchor point.</value>
  484. public IPoint AnchorPoint
  485. {
  486. get { return _anchorPoint; }
  487. }
  488. /// <summary>
  489. /// Gets the horizontal alignment.
  490. /// </summary>
  491. /// <value>The horizontal alignment.</value>
  492. public esriTextHorizontalAlignment HorizontalAlignment
  493. {
  494. get { return _horizontalAlignment; }
  495. }
  496. /// <summary>
  497. /// Gets the vertical alignment.
  498. /// </summary>
  499. /// <value>The vertical alignment.</value>
  500. public esriTextVerticalAlignment VerticalAlignment
  501. {
  502. get { return _verticalAlignment; }
  503. }
  504. /// <summary>
  505. /// Gets the text.
  506. /// </summary>
  507. /// <value>The text.</value>
  508. public string Text
  509. {
  510. get { return _text; }
  511. }
  512. #endregion
  513. }
  514. #endregion
  515. }
  516. }