NRTrackableAccessor.cs 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  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.NREditor
  10. {
  11. /// <summary> A nr trackable accessor. </summary>
  12. internal abstract class NRTrackableAccessor
  13. {
  14. /// <summary> Target for the. </summary>
  15. protected NRTrackableBehaviour m_Target;
  16. /// <summary> Applies the data properties. </summary>
  17. public abstract void ApplyDataProperties();
  18. /// <summary> Applies the data appearance. </summary>
  19. public abstract void ApplyDataAppearance();
  20. }
  21. /// <summary> A nr accessor factory. </summary>
  22. internal class NRAccessorFactory
  23. {
  24. /// <summary> Creates a new NRTrackableAccessor. </summary>
  25. /// <param name="target"> Target for the.</param>
  26. /// <returns> A NRTrackableAccessor. </returns>
  27. public static NRTrackableAccessor Create(NRTrackableBehaviour target)
  28. {
  29. if (target is NRTrackableImageBehaviour)
  30. {
  31. return new NRImageTargetAccessor((NRTrackableImageBehaviour)target);
  32. }
  33. NRDebugger.Error(target.GetType().ToString() + "is not derived from NRTrackableImageBehaviour");
  34. return null;
  35. }
  36. }
  37. }