public class HKServices extends NanoHTTPD implements HKHumanInterface
| Modifier and Type | Field and Description |
|---|---|
java.util.ArrayList<HKModel> |
models
Models returned from calling getModels from the Content API
|
| Modifier and Type | Method and Description |
|---|---|
void |
download(java.util.ArrayList<java.lang.String> modelIds)
download a group of models in the background
|
void |
download(java.lang.String modelId)
download a modelsin the background
|
static HKServices |
getInstance()
get the HKServices singleton instance
|
void |
getModels()
Get Models from the Content API - requires API Secret
|
java.lang.Boolean |
modelDownloaded(java.lang.String uri)
Check if a model has already been downloaded
|
void |
onAnimationComplete()
Called when the current is done running
|
void |
onAnnotationCreated(java.lang.String annotationId)
Called when a new annotation is created in the scene
|
void |
onAnnotationDestroyed(java.lang.String annotationId)
Called when an annotation is destroyed in the scene
|
void |
onAnnotationsShown(java.lang.Boolean isShown)
Called when annotations are shown or hidden in the scene
|
void |
onAnnotationUpdated(HKAnnotation annotation)
Called when the annotations screen position has changed
|
void |
onCameraUpdated(HKCamera camera)
Called when the camera moves in the scene
|
void |
onChapterTransition(java.lang.String chapterId)
Called when a new chapter is loaded by the scene
|
void |
onModelLoaded(java.lang.String modelId)
Called when loading is 100% complete for a model
|
void |
onObjectColor(java.lang.String objectId,
HKColor color)
Called when an object's color is retrieved
|
void |
onObjectDeselected(java.lang.String objectId)
Called when an object is deselected in the scene
|
void |
onObjectPicked(java.lang.String objectId,
double[] position)
Called when an object is picked by the user
|
void |
onObjectSelected(java.lang.String objectId)
Called when an object is selected in the scene
|
void |
onObjectsShown(java.util.Map<java.lang.String,java.lang.Object> objects)
Called when a set of objects are shown or hidden in the scene
|
void |
onSceneCapture(java.lang.String captureString)
Called when a scene capture is complete
|
void |
onSceneInit(java.lang.String title)
Called when the scene is initialized and metadata is available
|
void |
onSceneRestore()
Called when the scene is restored
|
void |
onScreenshot(android.graphics.Bitmap image)
Called when a screenshot is returned from the SDK
|
void |
onTimelineUpdated(HKTimeline timeline)
Called when the timeline has been updated
|
void |
onXrayEnabled(java.lang.Boolean isEnabled)
Called when xray mode is enabled or disabled
|
Response |
serve(IHTTPSession session)
internal method for handling web requests
|
void |
setLanguage(HKLanguage language)
setLanguage - set the current language
|
void |
setup(android.content.Context c,
HKServicesInterface delegate)
setup the HKServices singleton and validate the SDK
|
public java.util.ArrayList<HKModel> models
public void onModelLoaded(java.lang.String modelId)
HKHumanInterfaceonModelLoaded in interface HKHumanInterfacemodelId - ID of the loaded modelpublic void onObjectSelected(java.lang.String objectId)
HKHumanInterfaceonObjectSelected in interface HKHumanInterfaceobjectId - String id of the selected objectpublic void onObjectDeselected(java.lang.String objectId)
HKHumanInterfaceonObjectDeselected in interface HKHumanInterfaceobjectId - String id of the selected objectpublic void onObjectsShown(java.util.Map<java.lang.String,java.lang.Object> objects)
HKHumanInterfaceonObjectsShown in interface HKHumanInterfaceobjects - a Map of object IDs and boolean values for shown/hiddenpublic void onChapterTransition(java.lang.String chapterId)
HKHumanInterfaceonChapterTransition in interface HKHumanInterfacechapterId - String id of the current chapterpublic void onAnimationComplete()
HKHumanInterfaceonAnimationComplete in interface HKHumanInterfacepublic void onScreenshot(android.graphics.Bitmap image)
HKHumanInterfaceonScreenshot in interface HKHumanInterfaceimage - Bitmap representation of the saved screenshotpublic void onSceneInit(java.lang.String title)
HKHumanInterfaceonSceneInit in interface HKHumanInterfacetitle - the scene titlepublic void onXrayEnabled(java.lang.Boolean isEnabled)
HKHumanInterfaceonXrayEnabled in interface HKHumanInterfaceisEnabled - true if enabledpublic void onSceneRestore()
HKHumanInterfaceonSceneRestore in interface HKHumanInterfacepublic void onTimelineUpdated(HKTimeline timeline)
HKHumanInterfaceonTimelineUpdated in interface HKHumanInterfacetimeline - the HKTimeline objectpublic void onAnnotationCreated(java.lang.String annotationId)
HKHumanInterfaceonAnnotationCreated in interface HKHumanInterfaceannotationId - the ID of the new HKAnnotation objectpublic void onAnnotationDestroyed(java.lang.String annotationId)
HKHumanInterfaceonAnnotationDestroyed in interface HKHumanInterfaceannotationId - the ID of the destroyed HKAnnotationpublic void onCameraUpdated(HKCamera camera)
HKHumanInterfaceonCameraUpdated in interface HKHumanInterfacecamera - the updated HKCamera objectpublic void onObjectPicked(java.lang.String objectId,
double[] position)
HKHumanInterfaceonObjectPicked in interface HKHumanInterfaceobjectId - the ID of the objectposition - the 3D position of the picked objectpublic void onAnnotationsShown(java.lang.Boolean isShown)
HKHumanInterfaceonAnnotationsShown in interface HKHumanInterfaceisShown - true if annotations are shownpublic void onAnnotationUpdated(HKAnnotation annotation)
HKHumanInterfaceonAnnotationUpdated in interface HKHumanInterfaceannotation - the updated HKAnnotation objectpublic void onObjectColor(java.lang.String objectId,
HKColor color)
HKHumanInterfaceonObjectColor in interface HKHumanInterfaceobjectId - the ID of the objectcolor - the HKColor of the objectpublic void onSceneCapture(java.lang.String captureString)
HKHumanInterfaceonSceneCapture in interface HKHumanInterfacecaptureString - the saved data as a Json String
the capture can also be retrieved as a Map object with HKScene.captureJsonpublic static HKServices getInstance()
public void setup(android.content.Context c,
HKServicesInterface delegate)
c - application context (required)delegate - HKServicesInterface (required)public void getModels()
public Response serve(IHTTPSession session)
session - http sessionpublic void download(java.lang.String modelId)
modelId - Model Identifierpublic void download(java.util.ArrayList<java.lang.String> modelIds)
modelIds - ArrayList of Model Identifierspublic java.lang.Boolean modelDownloaded(java.lang.String uri)
uri - the model idpublic void setLanguage(HKLanguage language)
language - an HKLanguage object to translate available text in the 3D scenes