GUIGraphTicks.generated.cs 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394
  1. using System;
  2. using System.Runtime.CompilerServices;
  3. using System.Runtime.InteropServices;
  4. using BansheeEngine;
  5. namespace BansheeEditor
  6. {
  7. /** @addtogroup GUIEditor
  8. * @{
  9. */
  10. /// <summary>
  11. /// Generates a set of locations that can be used for rendering ticks on a graph. As input the class takes valid range,
  12. /// size of the area the ticks will be displayed on, type of ticks and minimum/maximum spacing and outputs a set of
  13. /// coordinates along which ticks should be positioned. Ticks are reported as multiple separate levels with different
  14. /// strengths, depending on how close their distribution is to the upper valid range.
  15. /// </summary>
  16. public partial class GUIGraphTicks : ScriptObject
  17. {
  18. private GUIGraphTicks(bool __dummy0) { }
  19. protected GUIGraphTicks() { }
  20. /// <summary>Contructs a new tick generating object.</summary>
  21. /// <param name="stepType">Determines how will ticks be distributed.</param>
  22. public GUIGraphTicks(GUITickStepType stepType = GUITickStepType.Generic)
  23. {
  24. Internal_GUIGraphTicks(this, stepType);
  25. }
  26. /// <summary>Number of tick levels that will be generated.</summary>
  27. public uint NumLevels
  28. {
  29. get { return Internal_getNumLevels(mCachedPtr); }
  30. }
  31. /// <summary>
  32. /// Sets the range which ticks are to be displayed for, and the range along which the ticks will be displayed.
  33. /// </summary>
  34. /// <param name="valueRangeStart">Start of the range the ticks are to display.</param>
  35. /// <param name="valueRangeEnd">End of the range the ticks are to display.</param>
  36. /// <param name="pixelRange">Width or height on which the ticks will be rendered. In pixels.</param>
  37. public void SetRange(float valueRangeStart, float valueRangeEnd, uint pixelRange)
  38. {
  39. Internal_setRange(mCachedPtr, valueRangeStart, valueRangeEnd, pixelRange);
  40. }
  41. /// <summary>
  42. /// Sets valid spacing between two ticks. Tick strength will be determined by how far away are they from either end of
  43. /// this range.
  44. /// </summary>
  45. /// <param name="minPx">Minimum spacing between two ticks, in pixels.</param>
  46. /// <param name="maxPx">Maximum spacing between two ticks, in pixels.</param>
  47. public void SetTickSpacing(int minPx, int maxPx)
  48. {
  49. Internal_setTickSpacing(mCachedPtr, minPx, maxPx);
  50. }
  51. /// <summary>
  52. /// Returns the strength of a particular tick level. Levels are ordered in descending order of strength (level 0 is the
  53. /// strongest).
  54. /// </summary>
  55. /// <param name="level">Level for which to retrieve the strength. Must not be larger than getNumLevels() - 1.</param>
  56. /// <returns>Strength of the ticks at this level, in range [0, 1].</returns>
  57. public float GetLevelStrength(uint level)
  58. {
  59. return Internal_getLevelStrength(mCachedPtr, level);
  60. }
  61. /// <summary>
  62. /// Returns positions of all ticks of the provided level. The ticks will be within the range provided to setRange().
  63. /// </summary>
  64. /// <param name="level">Level for which to retrieve the positions. Must not be larger than getNumLevels() - 1.</param>
  65. /// <returns>Positions of all ticks of the provided level.</returns>
  66. public float[] GetTicks(uint level)
  67. {
  68. return Internal_getTicks(mCachedPtr, level);
  69. }
  70. [MethodImpl(MethodImplOptions.InternalCall)]
  71. private static extern void Internal_GUIGraphTicks(GUIGraphTicks managedInstance, GUITickStepType stepType);
  72. [MethodImpl(MethodImplOptions.InternalCall)]
  73. private static extern uint Internal_getNumLevels(IntPtr thisPtr);
  74. [MethodImpl(MethodImplOptions.InternalCall)]
  75. private static extern void Internal_setRange(IntPtr thisPtr, float valueRangeStart, float valueRangeEnd, uint pixelRange);
  76. [MethodImpl(MethodImplOptions.InternalCall)]
  77. private static extern void Internal_setTickSpacing(IntPtr thisPtr, int minPx, int maxPx);
  78. [MethodImpl(MethodImplOptions.InternalCall)]
  79. private static extern float Internal_getLevelStrength(IntPtr thisPtr, uint level);
  80. [MethodImpl(MethodImplOptions.InternalCall)]
  81. private static extern float[] Internal_getTicks(IntPtr thisPtr, uint level);
  82. }
  83. /** @} */
  84. }