Advertisement
Guest User

Untitled

a guest
May 10th, 2013
252
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //
  2. //  WikitudeArchitectSDK.h
  3. //  WikitudeArchitectSDK
  4. //
  5. //  Copyright (c) 2012 Wikitude. All rights reserved.
  6. //
  7.  
  8. #import <UIKit/UIKit.h>
  9.  
  10. @class CMMotionManager;
  11. @class WTArchitectView;
  12.  
  13. typedef NS_ENUM(NSUInteger, WTARMode){
  14.     WTARMode_Geo,
  15.     WTARMode_IR
  16. };
  17.  
  18.  
  19. /**
  20.  * WTArchitectViewDelegate
  21.  *
  22.  * The ArchitectUrlListener offers the native app the possibility to react on events that are triggered inside the ARchitect World. To initiate such an event, the ARchitect World simply has to make an request for an url with the "architectsdk" as protocol. E.g.: architectsdk://opendetails?id=123.
  23.  *
  24.  * An registered WTArchitectViewDelegate receives all requested "architectsdk://" urls and must therefore be able to parse the url and parameters to react accordingly.
  25.  *
  26.  */
  27. @protocol WTArchitectViewDelegate <NSObject>
  28.  
  29. @required
  30. /**
  31. * Supplied URL was called and should be opened. URL starts with architectsdk:// protocol prefix and is otherwise custom to the ARchitect World that requests it.
  32. *
  33. * @param url The url which was called in javascript.
  34. */
  35. - (void)urlWasInvoked:(NSString*)url;
  36.  
  37.  
  38. @optional
  39.  
  40. /**
  41.  * This method gets called when the provided architect world url failed to load.
  42.  *
  43.  * @param architectView The ArchitectView which failed to load the url.
  44.  *
  45.  * @param error An NSError object containing more informations why the load did fail.
  46. */
  47. - (void)architectView:(WTArchitectView *)architectView didFailLoadWithError:(NSError *)error;
  48.  
  49. @end
  50.  
  51.  
  52. /**
  53.  * WTArchitectView class
  54.  *
  55.  *This class allows you to load and display the content from ARchitect Worlds.
  56.  *It is the "Entry Point" to the SDK which exposes all SDK functionality. Instantiating and adding this Component to the UI should be sufficient to use ARchitect in any application.
  57.  *
  58.  */
  59. @interface WTArchitectView : UIView
  60. {
  61.     __unsafe_unretained id<WTArchitectViewDelegate>                                     delegate;
  62. }
  63.  
  64. /** @name Managing the Delegate */
  65. /**
  66. * The object that acts as the delegate of the receiving WTArchitectView
  67. *
  68. */
  69. @property (nonatomic, unsafe_unretained) id<WTArchitectViewDelegate>                    delegate;
  70. @property (nonatomic, assign) BOOL                                                      shouldWebViewRotate;
  71. @property (nonatomic, readonly) BOOL                                                    isRunning;
  72.  
  73. /** @name Initializing a WTArchitectView Object */
  74. /**
  75. * Initializes the ARchitect view with the specified license key and motion manager that will be shared by the Wikitude SDK and the third party application.
  76. * If a motion manager instance is passed, it will be set to Wikitudes preferred settings (update intervals etc.)
  77. * The motion manager argument may be nil in which case Wikitude creates and manages its own motion manager instance.
  78. *
  79. *  -
  80. *
  81. * @param key Your developer key, provided with your licence information.
  82. * @param motionManager The CMMotionManager instance which should be used from the SDK.
  83. */
  84. - (void)initializeWithKey:(NSString*)key motionManager:(CMMotionManager*)motionManager;
  85.  
  86.  
  87. /** @name Accessing Device Compatibility */
  88. /**
  89.  * Returns true if the device supports the requested ARMode, false otherwise.
  90.  *
  91.  * @param supportedARMode Enum value which describes the required ARMode.
  92.  *
  93.  * @return true if the requested ARMode is supported for the current device, false otherwise.
  94.  *
  95.  * @discussion If the device supports ARMode_Geo, also ARMode_IR is supported.
  96.  */
  97. + (BOOL)isDeviceSupportedForARMode:(WTARMode)supportedARMode;
  98.  
  99.  
  100. /** @name Loading Architect Worlds */
  101. /**
  102. * Replaces the existing content of the ArchitectView with the one from the supplied URL.
  103. *  @param architectWorldUrl The url that points to the Architect world. This can be eather a local .html file or a url, pointing to a file on a server or to your dropbox.
  104. */
  105. - (void)loadArchitectWorldFromUrl:(NSString*)architectWorldUrl;
  106.  
  107.  
  108. /** @name Interacting with Architect Worlds */
  109. /**
  110. * Executes the passed JavaScript string in the context of the currently loaded ARchitect World. This can be used to pass data to the ARchitect World or to notify it of external events.
  111. * @param javaScript A string, representing the javascript code which should be executed.
  112. */
  113. - (void)callJavaScript:(NSString*)javaScript;
  114.  
  115.  
  116. /** @name Injecting Locations */
  117. /**
  118.  * Injects the supplied location information. To use the injected location setUseInjectedLocation(true) has to be called.
  119.  * @param latitude The latitude that has to be simulated.
  120.  * @param longitude The longitude that has to be simulated.
  121.  * @param altitude The to altitude that has to be simulated.
  122.  * @param accuracy The accuracy of the simulated location.
  123.  */
  124. - (void)injectLocationWithLatitude:(float)latitude longitude:(float)longitude altitude:(float)altitude accuracy:(float)accuracy;
  125.  
  126.  
  127. /**
  128. * Injects the supplied location information. To use the injected location setUseInjectedLocation(true) has to be called.
  129.  * @param latitude The latitude that has to be simulated.
  130.  * @param longitude The longitude that has to be simulated.
  131.  * @param accuracy The accuracy of the simulated location.
  132. */
  133. - (void)injectLocationWithLatitude:(float)latitude longitude:(float)longitude accuracy:(float)accuracy;
  134.  
  135.  
  136. /**
  137. * If true is supplied the injected location will be used. If false is supplied the default location provider will be used.
  138. * @param useInjectedLocation The location simulation status
  139. */
  140. - (void)setUseInjectedLocation:(BOOL)useInjectedLocation;
  141.  
  142.  
  143. /**
  144. * True if an injected location is currently used. false if default location provider is used.
  145. * @return Indicates, if the location provider is simulating the injected location.
  146. */
  147. - (BOOL)isUsingInjectedLocation;
  148.  
  149.  
  150. /** @name Manipulating Object Visibility */
  151. /**
  152.  * Sets the culling distance in meters. Objects in AR that are further away won’t be visible. The default value is 50000 meters (= 50 km).
  153.  * @param cullingDistance The culling distance that has to be applied to your AR objects.
  154.  */
  155. - (void)setCullingDistance:(float)cullingDistance;
  156.  
  157.  
  158. /**
  159.  * Retrieves the current culling distance in meters.
  160.  * @return The current culling distance, used by the SDK.
  161.  */
  162. - (float)cullingDistance;
  163.  
  164.  
  165. /** @name Accessing ARchitect settings */
  166. /**
  167.  * Use this method to get the current ARchitect version number
  168.  *
  169.  * @return The current available ARchitect verison within the SDK.
  170.  */
  171. - (NSString *)versionNumber;
  172.  
  173.  
  174. /**
  175.  * Use this method to clear all cached data and requests.
  176.  *
  177.  * This method clears the internal SDK cache, as well as the cache used by the webView.
  178.  *
  179.  */
  180. - (void)clearCache;
  181.  
  182.  
  183. /** @name Managing the WTArchitectView rotation behavior */
  184. /**
  185.  * Use this method to set the auto rotation behavior for the WTArchitectview.
  186.  *
  187.  * You should pass YES if you wan't your WTArchitectView to autoamtically change rotation to the new interface orientation.
  188.  *
  189.  * @param shouldAutoRotate Should your SDK view change orientation automatically
  190.  * @param interfaceOrientation The interface orientation the device is going to take on
  191.  */
  192. - (void)setShouldRotate:(BOOL)shouldAutoRotate toInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation;
  193.  
  194.  
  195. /**
  196.  * Retrieves the current auto rotate behavior.
  197.  *
  198.  * @return The current auto rotation option, used by the SDK.
  199.  */
  200. - (BOOL)isRotatingToInterfaceOrientation;
  201.  
  202.  
  203. /** @name Managing the WTArchitectView updates */
  204. /**
  205. * Stops all activity of the ARchitect view (suspends UI updates of background camera, AR objects etc).
  206. */
  207. - (void)stop;
  208.  
  209.  
  210. /**
  211. * Starts activity of the ARchitect view (starts UI updates of background camera, AR objects etc).
  212. */
  213. - (void)start;
  214.  
  215.  
  216. /** @name Interacting with Device Motion */
  217. /**
  218. * Returns the motion manager used by the Wikitude SDK.
  219. * @return  The CMMotionManager instance, provided in the method "InitializeWithKey:motionManager", otherwise nil;
  220. */
  221. - (CMMotionManager*)motionManager;
  222.  
  223.  
  224. - (void)persistObjectsToDisk;
  225. - (void)setSDKOrigin:(NSString *)origin;
  226.  
  227. - (void)setPresentingViewController:(UIViewController *)thePresentingViewController;
  228.  
  229. @end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement