示例#1
0
        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);
        }
示例#2
0
        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);
        }
示例#3
0
        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);
        }
示例#4
0
        /// <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);
        }
示例#5
0
        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);
        }
示例#6
0
 public virtual void RegisterMarker(IVisualMarker marker)
 {
 }