GUIGraphTicks.generated.cs 4.2 KB

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