ITrackableDataProvider.cs 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899
  1. /****************************************************************************
  2. * Copyright 2019 Nreal Techonology Limited. All rights reserved.
  3. *
  4. * This file is part of NRSDK.
  5. *
  6. * https://www.nreal.ai/
  7. *
  8. *****************************************************************************/
  9. namespace NRKernal
  10. {
  11. using System;
  12. using System.Collections.Generic;
  13. using UnityEngine;
  14. public interface ITrackableDataProvider
  15. {
  16. /// <summary>
  17. /// Updates trackable info.
  18. /// </summary>
  19. /// <param name="trackable_type"></param>
  20. /// <param name="trackables"></param>
  21. /// <returns></returns>
  22. bool UpdateTrackables(TrackableType trackable_type, List<UInt64> trackables);
  23. /// <summary> Gets an identify. </summary>
  24. /// <param name="trackable_handle"> Handle of the trackable.</param>
  25. /// <returns> The identify. </returns>
  26. UInt32 GetIdentify(UInt64 trackable_handle);
  27. /// <summary> Gets trackable type. </summary>
  28. /// <param name="trackable_handle"> Handle of the trackable.</param>
  29. /// <returns> The trackable type. </returns>
  30. TrackableType GetTrackableType(UInt64 trackable_handle);
  31. /// <summary> Gets tracking state. </summary>
  32. /// <param name="trackable_handle"> Handle of the trackable.</param>
  33. /// <returns> The tracking state. </returns>
  34. TrackingState GetTrackingState(UInt64 trackable_handle);
  35. }
  36. public interface ITrackableImageDataProvider
  37. {
  38. /// <summary> Creates data base. </summary>
  39. /// <returns> The new data base. </returns>
  40. UInt64 CreateDataBase();
  41. /// <summary> Destroys the data base described by database_handle. </summary>
  42. /// <param name="database_handle"> Handle of the database.</param>
  43. /// <returns> True if it succeeds, false if it fails. </returns>
  44. bool DestroyDataBase(UInt64 database_handle);
  45. /// <summary> Loads data base. </summary>
  46. /// <param name="database_handle"> Handle of the database.</param>
  47. /// <param name="path"> Full pathname of the file.</param>
  48. /// <returns> True if it succeeds, false if it fails. </returns>
  49. bool LoadDataBase(UInt64 database_handle, string path);
  50. /// <summary> Gets center pose. </summary>
  51. /// <param name="trackable_handle"> Handle of the trackable.</param>
  52. /// <returns> The center pose. </returns>
  53. Pose GetCenterPose(UInt64 trackable_handle);
  54. /// <summary> Gets a size. </summary>
  55. /// <param name="trackable_handle"> Handle of the trackable.</param>
  56. /// <returns> The size. </returns>
  57. Vector2 GetSize(UInt64 trackable_handle);
  58. }
  59. public interface ITrackablePlaneDataProvider
  60. {
  61. /// <summary> Gets plane type. </summary>
  62. /// <param name="trackable_handle"> Handle of the trackable.</param>
  63. /// <returns> The plane type. </returns>
  64. TrackablePlaneType GetPlaneType(UInt64 trackable_handle);
  65. /// <summary> Gets center pose. </summary>
  66. /// <param name="trackable_handle"> Handle of the trackble.</param>
  67. /// <returns> The center pose. </returns>
  68. Pose GetCenterPose(UInt64 trackable_handle);
  69. /// <summary> Gets extent x coordinate. </summary>
  70. /// <param name="trackable_handle"> Handle of the trackable.</param>
  71. /// <returns> The extent x coordinate. </returns>
  72. float GetExtentX(UInt64 trackable_handle);
  73. /// <summary> Gets extent z coordinate. </summary>
  74. /// <param name="trackable_handle"> Handle of the trackable.</param>
  75. /// <returns> The extent z coordinate. </returns>
  76. float GetExtentZ(UInt64 trackable_handle);
  77. /// <summary>
  78. /// Gets points of boundary polygon.
  79. /// </summary>
  80. /// <param name="trackable_handle"></param>
  81. /// <param name="polygonList"></param>
  82. void GetBoundaryPolygon(UInt64 trackable_handle, List<Vector3> polygonList);
  83. }
  84. }