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)
HKHumanInterface
onModelLoaded
in interface HKHumanInterface
modelId
- ID of the loaded modelpublic void onObjectSelected(java.lang.String objectId)
HKHumanInterface
onObjectSelected
in interface HKHumanInterface
objectId
- String id of the selected objectpublic void onObjectDeselected(java.lang.String objectId)
HKHumanInterface
onObjectDeselected
in interface HKHumanInterface
objectId
- String id of the selected objectpublic void onObjectsShown(java.util.Map<java.lang.String,java.lang.Object> objects)
HKHumanInterface
onObjectsShown
in interface HKHumanInterface
objects
- a Map of object IDs and boolean values for shown/hiddenpublic void onChapterTransition(java.lang.String chapterId)
HKHumanInterface
onChapterTransition
in interface HKHumanInterface
chapterId
- String id of the current chapterpublic void onAnimationComplete()
HKHumanInterface
onAnimationComplete
in interface HKHumanInterface
public void onScreenshot(android.graphics.Bitmap image)
HKHumanInterface
onScreenshot
in interface HKHumanInterface
image
- Bitmap representation of the saved screenshotpublic void onSceneInit(java.lang.String title)
HKHumanInterface
onSceneInit
in interface HKHumanInterface
title
- the scene titlepublic void onXrayEnabled(java.lang.Boolean isEnabled)
HKHumanInterface
onXrayEnabled
in interface HKHumanInterface
isEnabled
- true if enabledpublic void onSceneRestore()
HKHumanInterface
onSceneRestore
in interface HKHumanInterface
public void onTimelineUpdated(HKTimeline timeline)
HKHumanInterface
onTimelineUpdated
in interface HKHumanInterface
timeline
- the HKTimeline objectpublic void onAnnotationCreated(java.lang.String annotationId)
HKHumanInterface
onAnnotationCreated
in interface HKHumanInterface
annotationId
- the ID of the new HKAnnotation objectpublic void onAnnotationDestroyed(java.lang.String annotationId)
HKHumanInterface
onAnnotationDestroyed
in interface HKHumanInterface
annotationId
- the ID of the destroyed HKAnnotationpublic void onCameraUpdated(HKCamera camera)
HKHumanInterface
onCameraUpdated
in interface HKHumanInterface
camera
- the updated HKCamera objectpublic void onObjectPicked(java.lang.String objectId, double[] position)
HKHumanInterface
onObjectPicked
in interface HKHumanInterface
objectId
- the ID of the objectposition
- the 3D position of the picked objectpublic void onAnnotationsShown(java.lang.Boolean isShown)
HKHumanInterface
onAnnotationsShown
in interface HKHumanInterface
isShown
- true if annotations are shownpublic void onAnnotationUpdated(HKAnnotation annotation)
HKHumanInterface
onAnnotationUpdated
in interface HKHumanInterface
annotation
- the updated HKAnnotation objectpublic void onObjectColor(java.lang.String objectId, HKColor color)
HKHumanInterface
onObjectColor
in interface HKHumanInterface
objectId
- the ID of the objectcolor
- the HKColor of the objectpublic void onSceneCapture(java.lang.String captureString)
HKHumanInterface
onSceneCapture
in interface HKHumanInterface
captureString
- 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