GUIGraphTicks.generated.cs 4.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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. [ShowInInspector]
  17. public partial class GUIGraphTicks : ScriptObject
  18. {
  19. private GUIGraphTicks(bool __dummy0) { }
  20. protected GUIGraphTicks() { }
  21. /// <summary>Contructs a new tick generating object.</summary>
  22. /// <param name="stepType">Determines how will ticks be distributed.</param>
  23. public GUIGraphTicks(GUITickStepType stepType = GUITickStepType.Generic)
  24. {
  25. Internal_GUIGraphTicks(this, stepType);
  26. }
  27. /// <summary>Number of tick levels that will be generated.</summary>
  28. [ShowInInspector]
  29. [NativeWrapper]
  30. public uint NumLevels
  31. {
  32. get { return Internal_getNumLevels(mCachedPtr); }
  33. }
  34. /// <summary>
  35. /// Sets the range which ticks are to be displayed for, and the range along which the ticks will be displayed.
  36. /// </summary>
  37. /// <param name="valueRangeStart">Start of the range the ticks are to display.</param>
  38. /// <param name="valueRangeEnd">End of the range the ticks are to display.</param>
  39. /// <param name="pixelRange">Width or height on which the ticks will be rendered. In pixels.</param>
  40. public void SetRange(float valueRangeStart, float valueRangeEnd, uint pixelRange)
  41. {
  42. Internal_setRange(mCachedPtr, valueRangeStart, valueRangeEnd, pixelRange);
  43. }
  44. /// <summary>
  45. /// Sets valid spacing between two ticks. Tick strength will be determined by how far away are they from either end of
  46. /// this range.
  47. /// </summary>
  48. /// <param name="minPx">Minimum spacing between two ticks, in pixels.</param>
  49. /// <param name="maxPx">Maximum spacing between two ticks, in pixels.</param>
  50. public void SetTickSpacing(int minPx, int maxPx)
  51. {
  52. Internal_setTickSpacing(mCachedPtr, minPx, maxPx);
  53. }
  54. /// <summary>
  55. /// Returns the strength of a particular tick level. Levels are ordered in descending order of strength (level 0 is the
  56. /// strongest).
  57. /// </summary>
  58. /// <param name="level">Level for which to retrieve the strength. Must not be larger than getNumLevels() - 1.</param>
  59. /// <returns>Strength of the ticks at this level, in range [0, 1].</returns>
  60. public float GetLevelStrength(uint level)
  61. {
  62. return Internal_getLevelStrength(mCachedPtr, level);
  63. }
  64. /// <summary>
  65. /// Returns positions of all ticks of the provided level. The ticks will be within the range provided to setRange().
  66. /// </summary>
  67. /// <param name="level">Level for which to retrieve the positions. Must not be larger than getNumLevels() - 1.</param>
  68. /// <returns>Positions of all ticks of the provided level.</returns>
  69. public float[] GetTicks(uint level)
  70. {
  71. return Internal_getTicks(mCachedPtr, level);
  72. }
  73. [MethodImpl(MethodImplOptions.InternalCall)]
  74. private static extern void Internal_GUIGraphTicks(GUIGraphTicks managedInstance, GUITickStepType stepType);
  75. [MethodImpl(MethodImplOptions.InternalCall)]
  76. private static extern uint Internal_getNumLevels(IntPtr thisPtr);
  77. [MethodImpl(MethodImplOptions.InternalCall)]
  78. private static extern void Internal_setRange(IntPtr thisPtr, float valueRangeStart, float valueRangeEnd, uint pixelRange);
  79. [MethodImpl(MethodImplOptions.InternalCall)]
  80. private static extern void Internal_setTickSpacing(IntPtr thisPtr, int minPx, int maxPx);
  81. [MethodImpl(MethodImplOptions.InternalCall)]
  82. private static extern float Internal_getLevelStrength(IntPtr thisPtr, uint level);
  83. [MethodImpl(MethodImplOptions.InternalCall)]
  84. private static extern float[] Internal_getTicks(IntPtr thisPtr, uint level);
  85. }
  86. /** @} */
  87. }