Beispiel #1
0
        private void StartAR()
        {
            if (authorized)
            {
                if (!architectView.IsRunning)
                {
                    architectView.Start((startupConfiguration) =>
                    {
                        // use startupConfiguration.CaptureDevicePosition = AVFoundation.AVCaptureDevicePosition.Front; to start the Wikitude SDK with an active front cam
                        startupConfiguration.CaptureDevicePosition   = AVFoundation.AVCaptureDevicePosition.Back;
                        startupConfiguration.CaptureDeviceResolution = WTCaptureDeviceResolution.WTCaptureDeviceResolution_AUTO;
                        startupConfiguration.TargetFrameRate         = CMTime.PositiveInfinity;                 // resolves to WTMakeTargetFrameRateAuto();
                    }, (bool isRunning, NSError startupError) => {
                        if (isRunning)
                        {
                            if (null == loadingArchitectWorldNavigation)
                            {
                                var path = NSBundle.MainBundle.BundleUrl.AbsoluteString + "1_ImageRecognition_1_ImageOnTarget/index.html";
                                loadingArchitectWorldNavigation = architectView.LoadArchitectWorldFromURL(NSUrl.FromString(path), Wikitude.Architect.WTFeatures.WTFeature_ImageTracking);
                            }
                        }
                        else
                        {
                            Console.WriteLine("Unable to start Wikitude SDK. Error (start ar): " + startupError.LocalizedDescription);
                        }
                    });
                }

                architectView.SetShouldRotateToInterfaceOrientation(true, UIApplication.SharedApplication.StatusBarOrientation);
            }
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.architectView          = new WTArchitectView();
            this.architectView.Delegate = architectViewDelegate;
            this.View.AddSubview(this.architectView);
            this.architectView.TranslatesAutoresizingMaskIntoConstraints = false;

            NSDictionary views = new NSDictionary(new NSString("architectView"), architectView);

            this.View.AddConstraints(NSLayoutConstraint.FromVisualFormat("|[architectView]|", 0, null, views));
            this.View.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|[architectView]|", 0, null, views));

            architectView.SetLicenseKey("NGBXvYi66YY4pT3CqeLvcv31N9xl4uasQSZwF5xPfJ5lcrI5leTkRrzzVihYTbEbRWRf9S9hWqkeCykxd1IgU/qbg5WJjwSK7dk9f/zHwlV1Qa/JYIB6l+sh2OjrdrXO7E9Q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Center.DefaultCenter.AddObserver(UIApplication.DidBecomeActiveNotification, (notification) =>
            {
                if (navigation.Interrupted)
                {
                    architectView.reloadArchitectWorld();
                }
                StartAR();
            });

            NSNotificationCenter.DefaultCenter.AddObserver(UIApplication.WillResignActiveNotification, (notification) =>
            {
                StopAR();
            });

            var path = NSBundle.MainBundle.BundleUrl.AbsoluteString + "SDK_Examples/" + worldId + "/index.html";

            navigation = architectView.LoadArchitectWorldFromURL(NSUrl.FromString(path), WTFeatures.Geo);
        }
Beispiel #3
0
 public void ArchitectWorldFinishedLoading(WTNavigation navigation)
 {
     if (loadingArExperienceNavigation.Equals(navigation))
     {
         loadedArExperienceNavigation = navigation;
     }
 }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();

            this.architectView          = new WTArchitectView();
            this.architectView.Delegate = architectViewDelegate;
            this.View.AddSubview(this.architectView);
            this.architectView.TranslatesAutoresizingMaskIntoConstraints = false;

            NSDictionary views = new NSDictionary(new NSString("architectView"), architectView);

            this.View.AddConstraints(NSLayoutConstraint.FromVisualFormat("|[architectView]|", 0, null, views));
            this.View.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|[architectView]|", 0, null, views));

            architectView.SetLicenseKey("yV/CuS7fMQAsiu/ZMgUghXHxQKuo+5vrUyyFDUIk5BTym1hTKn3hRpg9eHeGsiq1pVKY9IMzdFAEJWqRGILrrQmhlLd+pGg+eDF72aRUom90xl80UnO6vrSGMRkS/pmrnM6EjN1464bGMwNNxn+WnncBDtCb+ycfIJUQZEu8hkNTYWx0ZWRfXyhu76iZIxT/SWUY/J8HJjafZnIf7vSJdTo6hyM8wgfSbW72gf+3n8VAnIw4J8MIFbAS1xyTLmrmpvw/RoOMmKaZZAeAQkTZz7Gtv0Ja9glyWlMjcEH4OhM2CrjetjX2jC2pMbqQpshFEmP2dB8KdOq3t2KBZ3NPodklpdK/+g9NIl2P+tQzN0fZitpYCflfqfyopQ3iiZeEZMen3P9LUcgvBoTgo49jNM6wYy+06RoW8dymZmAPiiKb2PKbCNtXJ3AjJSyJm610SdikGG4XOs6j00X3ryg0TtIZHj6veAcprIQBChHUBBWxTY4KyyMD1caXrFUBBi3m348k631N57ogheBBJA7FEpvP5pAgjuLTiMz20At4w7sbCK+on8XpEPzp0jTvMcGwRtamYQhVXfG3ApH1i0awC7LpFx2mx0ropZuOw/YEB9DrdaLlrfHuJ6OuqDEfTie1NMjFIFG4kGGgcf3j6GYOPpdhWH1wATf0PhUBcGMWscqegOPvh+woG20sTf08uG1tF0jPB/vCxHOJ4XOByyGucG4OV5BqjupXi4Kp7CxIJl0=\n");
            NSNotificationCenter.DefaultCenter.AddObserver(UIApplication.DidBecomeActiveNotification, (notification) =>
            {
                if (navigation.Interrupted)
                {
                    architectView.reloadArchitectWorld();
                }
                StartAR();
            });

            NSNotificationCenter.DefaultCenter.AddObserver(UIApplication.WillResignActiveNotification, (notification) =>
            {
                StopAR();
            });

            var path = NSBundle.MainBundle.BundleUrl.AbsoluteString + "3DModel/index.html?id=" + worldId;

            navigation = architectView.LoadArchitectWorldFromURL(NSUrl.FromString(path), WTFeatures.Geo);
        }
Beispiel #5
0
 private void LoadArExperience()
 {
     ArExperienceAuthorizationController.AuthorizeRestricedAPIAccess(authorizationRequestManager, WTFeatures.Geo, () => {
         NSUrl fullArExperienceURL     = NSBundle.MainBundle.GetUrlForResource("index", "html", "Milan");
         loadingArExperienceNavigation = architectView.LoadArchitectWorldFromURL(fullArExperienceURL);
     }, (UIAlertController alertController) => {
         PresentViewController(alertController, true, null);
     });
 }
Beispiel #6
0
        private void LoadArExperienceIfRequired()
        {
            NSUrl fullArExperienceURL = NSBundle.MainBundle.GetUrlForResource("index", "html", "ARPages/ARPage");

            if (loadedArExperienceNavigation == null || (loadedArExperienceNavigation != null && !loadedArExperienceNavigation.OriginalURL.Equals(fullArExperienceURL)))
            {
                loadingArExperienceNavigation = architectView.LoadArchitectWorldFromURL(fullArExperienceURL);
            }
        }
Beispiel #7
0
        public override void ViewDidLoad()
        {
            string WikiKey = "e9T8QNdR9to8mZXsh+NKsVpVyAIEfz58yOlPVEnQlRCCih4BQ0BetTTTmltJmgRWKfTdV2PiizecU4WjlpCLMApw23i17QELh4yElciFJZboITsYR6+OFIJjQSj6UOKDcLNM8MMfjaFeKplove23iz4EJxsGspNWKQRPHH+rCppTYWx0ZWRfX/ONUYPBt83/xwHZD6gZ+euFDQaOXUxYrWXCkuvtwIloIDBOCORD0eom6K4GCGj7ryLbX3Hdl6lG/8Oz2RsuE8N2/iQwHPnpJ5oWECtb/vTcuLEHyZinL6lJvU6I/ORraJuomTek6eyYnWxEdFDRFGimFHJKhGXoV8czzuzDwbDjZ16vrFJMjYj5QI+PX4t1MaCr0nTWUG6X2Kro17Vtm8j6+AMwj1IKDWGtiF+C3p2cf6UpBkjm9l83HasySxoWYwwPHdZpcOiSbS3179B6Wwh8eONtQSYh0uRgc51RjapRo1uydY9obUq1qPitdPCHgP+D5JlYfwh5ZqUDKU+dtet3tlX/l0zmEWLVlmYUtkBJ94N9bCKg6t4pxVX2qJHtgBW4eSUoHqkSLCXEt7RubDRg5dJ/e+PJ7SM1vYU8f/lMZY1XEtfyh8f+WgYSIlOBOTKFqX3VqZPhJLWA+dIpgWxd5P1/5R598lw0F+98HcmrVpXhxVOM4T8=";

            base.ViewDidLoad();

            this.architectView          = new WTArchitectView();
            this.architectView.Delegate = architectViewDelegate;
            this.View.AddSubview(this.architectView);
            this.architectView.TranslatesAutoresizingMaskIntoConstraints = false;

            NSDictionary views = new NSDictionary(new NSString("architectView"), architectView);

            this.View.AddConstraints(NSLayoutConstraint.FromVisualFormat("|[architectView]|", 0, null, views));
            this.View.AddConstraints(NSLayoutConstraint.FromVisualFormat("V:|[architectView]|", 0, null, views));

            //architectView.SetLicenseKey("NGBXvYi66YY4pT3CqeLvcv31N9xl4uasQSZwF5xPfJ5lcrI5leTkRrzzVihYTbEbRWRf9S9hWqkeCykxd1IgU/qbg5WJjwSK7dk9f/zHwlV1Qa/JYIB6l+sh2OjrdrXO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ectView.SetLicenseKey(WikiKey);

            NSNotificationCenter.DefaultCenter.AddObserver(UIApplication.DidBecomeActiveNotification, (notification) =>
            {
                if (navigation.Interrupted)
                {
                    architectView.reloadArchitectWorld();
                }
                StartAR();
            });

            NSNotificationCenter.DefaultCenter.AddObserver(UIApplication.WillResignActiveNotification, (notification) =>
            {
                StopAR();
            });

            var path = NSBundle.MainBundle.BundleUrl.AbsoluteString + "Wikitude/" + worldId + "/index.html";

            navigation = architectView.LoadArchitectWorldFromURL(NSUrl.FromString(path), WTFeatures.Geo);


            // Steve .. Test

            //architectView.
        }
        public override void ViewDidLoad()
        {
            base.ViewDidLoad();
            NSError error;

            if (WTArchitectView.IsDeviceSupportedForRequiredFeatures(WTFeatures.WTFeature_2DTracking | WTFeatures.Geo, out error))
            {
                arView       = new WTArchitectView();
                arView.Frame = UIScreen.MainScreen.Bounds;

                // ライセンスキーについては、SecrecKey.csに定義されていますが、Githubでは、公開されていません。別途定義してください。
                //public class SecretKey{
                //	public static string WT_LICENSE_KEY = "XXXXXXXXXX";
                //}
                arView.SetLicenseKey(SecretKey.WT_LICENSE_KEY);

                var url = NSBundle.MainBundle.BundleUrl.AbsoluteString + "ARchitectWorld/index.html";
                architectWorldNavigation = arView.LoadArchitectWorldFromURL(new NSUrl(url), WTFeatures.WTFeature_2DTracking | WTFeatures.Geo);

                View.AddSubview(arView);
            }
        }
Beispiel #9
0
        private void LoadArExperienceIfRequired()
        {
            NSUrl experienceURLValidator(string URL)
            {
                if (URL.Contains("https"))
                {
                    return(NSUrl.FromString(URL));
                }
                else
                {
                    NSUrl  relativeArExperienceURL = NSUrl.FromString(currentArExperience.Path);
                    string bundleSubdirectory      = "ARchitectExamples/" + relativeArExperienceURL.RemoveLastPathComponent().AbsoluteString;
                    NSUrl  bundleArExperienceURL   = NSBundle.MainBundle.GetUrlForResource("index", "html", bundleSubdirectory);
                    return(bundleArExperienceURL);
                }
            }

            NSUrl fullArExperienceURL = experienceURLValidator(currentArExperience.Path);

            if (loadedArExperienceNavigation == null || (loadedArExperienceNavigation != null && !loadedArExperienceNavigation.OriginalURL.Equals(fullArExperienceURL)))
            {
                loadingArExperienceNavigation = architectView.LoadArchitectWorldFromURL(fullArExperienceURL);
            }
        }
 public override void DidFailToLoadNavigation(WTArchitectView architectView, WTNavigation navigation, NSError error)
 {
     Console.WriteLine("architect view failed to load navigation. " + error.LocalizedDescription);
 }
 public override void DidFinishLoadNavigation(WTArchitectView architectView, WTNavigation navigation)
 {
     Console.WriteLine("architect view loaded navigation: " + navigation.OriginalURL);
 }
Beispiel #12
0
            public override void DidFailToLoadNavigation(WTArchitectView architectView, WTNavigation navigation, NSError error)
            {
                string            errorMessage = error.LocalizedDescription + " ('" + navigation.OriginalURL + "')";
                UIAlertController failedToLoadArchitectWorldAlertController = UIAlertController.Create("Failed to load Architect World", errorMessage, UIAlertControllerStyle.Alert);

                failedToLoadArchitectWorldAlertController.AddAction(UIAlertAction.Create("OK", UIAlertActionStyle.Default, null));

                arExperienceViewController.PresentViewController(failedToLoadArchitectWorldAlertController, true, null);
            }
Beispiel #13
0
 public override void DidFinishLoadNavigation(WTArchitectView architectView, WTNavigation navigation)
 {
     Console.WriteLine("Finished loading Architect World");
     arExperienceViewController.ArchitectWorldFinishedLoading(navigation);
 }