public void AddMarkerMedia(IVisualMarker marker, string mediaId, MediaElement mediaElement, Action onOpen = null, Action onSelect = null, Action onClose = null) { if (!CheckAdapter()) { return; } if (mediaElement == null || mediaElement.MediaUrl == null) { return; } var markerMedia = new MarkerMedia { Marker = marker, MediaType = mediaElement.MediaItem.MediaType, MediaUrl = mediaElement.MediaUrl, MediaLayout = mediaElement.Layout, Color = mediaElement.Color, ObjectId = mediaId, OnOpen = onOpen, OnSelect = onSelect, OnClose = onClose }; AddMarkerMedia(markerMedia); }
public void AddMarkerImage(ResourceActivationContext ctxt, IVisualMarker marker, string mediaId, string url, Layout layout = null, Action onOpen = null, Action onSelect = null) { if (!CheckAdapter()) { return; } if (DoesObjectExist(marker.GetIdentifier(), mediaId)) { return; } var markerMedia = new MarkerMedia { ActivationContext = ctxt, Marker = marker, MediaType = MediaType.Image, MediaUrl = url, MediaLayout = layout, ObjectId = mediaId, OnSelect = onSelect, OnOpen = onOpen }; AddMarkerMedia(markerMedia); }
public void Add3DAsset(ResourceActivationContext ctxt, IVisualMarker marker, string mediaId, AssetInstance assetInstance, string fallbackImageUrl = null, Layout layout = null, Action onOpen = null, Action onSelect = null) { if (!CheckAdapter()) { return; } if (DoesObjectExist(marker.GetIdentifier(), mediaId)) { return; } var markerAsset = new MarkerAsset { ActivationContext = ctxt, AssetInstance = assetInstance, Marker = marker, MediaType = MediaType.Image, MediaUrl = fallbackImageUrl, MediaLayout = layout, ObjectId = mediaId, OnSelect = onSelect, OnOpen = onOpen }; Add3DAsset(markerAsset); }
/// <summary> /// Checks if the given marker is tracking /// </summary> /// <param name="marker"></param> /// <returns></returns> public bool IsTracking(IVisualMarker marker) { if (!CheckAdapter()) { return(false); } m_logger.Debug("Is tracking {0}, IsActive={1}", marker.GetIdentifier(), IsActive); Adapter.RegisterMarker(marker); if (IsActive) { return(m_trackingMarkerObjects.GetCount(marker.GetIdentifier()) > 0); } return(false); }
public void Add3DAsset(IVisualMarker marker, string objectId, AssetInstance assetInstance, MediaElement fallbackImage) { if (!CheckAdapter()) { return; } var markerAsset = new MarkerAsset { AssetInstance = assetInstance, Marker = marker, ObjectId = objectId }; if (fallbackImage != null) { markerAsset.MediaUrl = fallbackImage.MediaUrl; markerAsset.MediaLayout = fallbackImage.Layout; } Add3DAsset(markerAsset); }
public virtual void RegisterMarker(IVisualMarker marker) { }