Exemplo n.º 1
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);
        }
Exemplo n.º 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);
        }
Exemplo n.º 3
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);
        }