GUIGraphTicks.generated.cs 4.2 KB

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