Package com.biodigital.humansdk
Class HKScene
java.lang.Object
com.biodigital.humansdk.HKScene
public class HKScene
extends java.lang.Object
Scene object - for interacting with objects and scene data
-
Field Summary
Fields Modifier and Type Field Description java.util.Map<java.lang.String,java.lang.Object>
captureJson
JSON describing a scene capture as an Map objectjava.lang.String
captureString
JSON describing a scene capture as a Stringjava.util.ArrayList<java.lang.String>
objectIds
A flat list of visible objects by IDjava.util.HashMap<java.lang.String,java.lang.String>
objects
A map of objectID Strings to Display Namesjava.lang.String
text
The description of the current loaded scene.java.lang.String
title
The title of the current loaded scene. -
Constructor Summary
Constructors Constructor Description HKScene()
-
Method Summary
Modifier and Type Method Description void
capture()
Capture the current state of the scenevoid
color(java.lang.String objectId, HKColor color)
Paint an objectvoid
disableHighlight()
Turn off highlighting the selected objectvoid
disablePicking()
Disable object selectionvoid
dissect(boolean enabled)
Turn dissect mode ON or OFF in the current scenevoid
enableHighlight()
Turn on highlighting the selected objectvoid
enablePicking()
Enable object selectionvoid
getColor(java.lang.String objectId)
Query the color of an object, calls onObjectColor with the color valuevoid
hide(java.util.ArrayList<java.lang.String> hideIds)
Hide a group of obejcts by object ID Groups of objects can be hidden by passing more than one objectID or by passing a "group node" IDvoid
highlight(java.util.ArrayList<java.lang.String> highlightIds)
Highlight an object even if highlight is disabled for the uservoid
isolate(boolean enabled)
Turn isolate mode ON or OFF in the current scenevoid
isolate(java.util.ArrayList<java.lang.String> isolateIds)
Isolate a group of objects by object ID Groups of objects can be shown by passing more than one object ID or by passing a "group node" IDvoid
pivot(java.lang.String objectId, double[] pivot)
Pivot an object in 3D spacevoid
reset()
Reset the objects to their original state PLEASE NOTE: This does not reset the camera, use HKCamera.reset()void
resetHighlightColor()
Change the object highlight color back to the original yellow colorvoid
restore()
Restore the scene from the last capture Calls human(_:sceneRestored:) on successvoid
restore(java.lang.String restoreString)
Restore the scene from a previous capture Calls human(_:sceneRestored:) on successvoid
rotate(java.lang.String objectId, double[] rotate)
Rotate an object in 3D spacevoid
scale(java.lang.String objectId, double[] scale)
Scale an object in 3D spacevoid
screenshot()
Calls the onScreenshot interface method with the generated screenshotvoid
select(java.util.ArrayList<java.lang.String> selectIds)
Select a group of objects programmaticallyvoid
selectObject(java.lang.String objectId)
Deprecated.use select(ArrayList objectIds) insteadvoid
setHighlightColor(float[] highlight)
Change the object highlight colorvoid
setHighlightColor(int color)
Change the object highlight colorvoid
share()
Brings up the built-in Android share UI with the current contents of the viewvoid
show(java.util.ArrayList<java.lang.String> showIds)
Show a group of objects by object ID Groups of objects can be shown by passing more than one objectID or by passing a "group node" IDvoid
transform(java.lang.String objectId, double[] translate, double[] rotate, double[] scale, double[] pivot)
Move an object in 3D spacevoid
translate(java.lang.String objectId, double[] translate)
Move an object in 3D spacevoid
uncolor(java.lang.String objectId)
Unpaint an object - set it back to it's original colorvoid
undo()
Undo the last dissectvoid
undoSelections()
Deselect all objects in the scenevoid
unhighlight(java.lang.String objectId)
Unhighlight an objectvoid
xray(boolean enabled)
Turn xray mode ON or OFF in the current scene
-
Field Details
-
title
public java.lang.String titleThe title of the current loaded scene. -
text
public java.lang.String textThe description of the current loaded scene. -
objectIds
public java.util.ArrayList<java.lang.String> objectIdsA flat list of visible objects by ID -
objects
public java.util.HashMap<java.lang.String,java.lang.String> objectsA map of objectID Strings to Display Names -
captureString
public java.lang.String captureStringJSON describing a scene capture as a String -
captureJson
public java.util.Map<java.lang.String,java.lang.Object> captureJsonJSON describing a scene capture as an Map object
-
-
Constructor Details
-
HKScene
public HKScene()
-
-
Method Details
-
share
public void share()Brings up the built-in Android share UI with the current contents of the view -
screenshot
public void screenshot()Calls the onScreenshot interface method with the generated screenshot -
reset
public void reset()Reset the objects to their original state PLEASE NOTE: This does not reset the camera, use HKCamera.reset()- Since:
- SDK 2.0
-
hide
public void hide(java.util.ArrayList<java.lang.String> hideIds)Hide a group of obejcts by object ID Groups of objects can be hidden by passing more than one objectID or by passing a "group node" ID- Parameters:
hideIds
- : An array of object IDs to hide- Since:
- SDK 2.0
-
show
public void show(java.util.ArrayList<java.lang.String> showIds)Show a group of objects by object ID Groups of objects can be shown by passing more than one objectID or by passing a "group node" ID- Parameters:
showIds
- : An array of object IDs to show- Since:
- SDK 2.0
-
isolate
public void isolate(java.util.ArrayList<java.lang.String> isolateIds)Isolate a group of objects by object ID Groups of objects can be shown by passing more than one object ID or by passing a "group node" ID- Parameters:
isolateIds
- : An array of object IDs to isolate- Since:
- SDK 2.0
-
select
public void select(java.util.ArrayList<java.lang.String> selectIds)Select a group of objects programmatically- Parameters:
selectIds
- : An array of object IDs to select
-
undoSelections
public void undoSelections()Deselect all objects in the scene -
setHighlightColor
public void setHighlightColor(int color)Change the object highlight color- Parameters:
color
- Color as int
-
setHighlightColor
public void setHighlightColor(float[] highlight)Change the object highlight color- Parameters:
highlight
- color as [r,b,g] in the range 0 - 1, to make it transparent pass in [1.0,1.0,1.0]
-
resetHighlightColor
public void resetHighlightColor()Change the object highlight color back to the original yellow color- Since:
- SDK 2.0
-
disableHighlight
public void disableHighlight()Turn off highlighting the selected object -
enableHighlight
public void enableHighlight()Turn on highlighting the selected object -
highlight
public void highlight(java.util.ArrayList<java.lang.String> highlightIds)Highlight an object even if highlight is disabled for the user- Parameters:
highlightIds
- : object to highlight
-
unhighlight
public void unhighlight(java.lang.String objectId)Unhighlight an object- Parameters:
objectId
- : object to unhighlight
-
disablePicking
public void disablePicking()Disable object selection -
enablePicking
public void enablePicking()Enable object selection -
xray
public void xray(boolean enabled)Turn xray mode ON or OFF in the current scene- Parameters:
enabled
- A boolean to turn xray mode ON or OFF
-
color
Paint an object- Parameters:
objectId
- - the String id of the objectcolor
- - the HKColor to paint the object
-
uncolor
public void uncolor(java.lang.String objectId)Unpaint an object - set it back to it's original color- Parameters:
objectId
- String id of the object
-
getColor
public void getColor(java.lang.String objectId)Query the color of an object, calls onObjectColor with the color value- Parameters:
objectId
- - the String id of the object
-
isolate
public void isolate(boolean enabled)Turn isolate mode ON or OFF in the current scene- Parameters:
enabled
- A boolean to turn isolate mode ON or OFF
-
dissect
public void dissect(boolean enabled)Turn dissect mode ON or OFF in the current scene- Parameters:
enabled
- A boolean to turn dissect mode ON or OFF
-
undo
public void undo()Undo the last dissect -
selectObject
@Deprecated public void selectObject(java.lang.String objectId)Deprecated.use select(ArrayList objectIds) insteadSelect an object programmmatically- Parameters:
objectId
- the object to select
-
translate
public void translate(java.lang.String objectId, double[] translate)Move an object in 3D space- Parameters:
objectId
- : object to transformtranslate
- : [x,y,z] array amount to move the object]- Since:
- SDK 2.0
-
rotate
public void rotate(java.lang.String objectId, double[] rotate)Rotate an object in 3D space- Parameters:
objectId
- : object to transformrotate
- : [x,y,z] array amount to rotate the object]- Since:
- SDK 2.0
-
scale
public void scale(java.lang.String objectId, double[] scale)Scale an object in 3D space- Parameters:
objectId
- : object to transformscale
- : [x,y,z] array amount to scale the object]- Since:
- SDK 2.0
-
pivot
public void pivot(java.lang.String objectId, double[] pivot)Pivot an object in 3D space- Parameters:
objectId
- : object to transformpivot
- : [x,y,z] array amount to rotate the object]- Since:
- SDK 2.0
-
transform
public void transform(java.lang.String objectId, double[] translate, double[] rotate, double[] scale, double[] pivot)Move an object in 3D space- Parameters:
objectId
- : object to transformtranslate
- : [x,y,z] array amount to move the object]rotate
- : [x,y,z] array amount to rotate the object]scale
- : [x,y,z] array amount to scale the object]pivot
- : [x,y,z] array amount to rotate the object]- Since:
- SDK 2.0
-
capture
public void capture()Capture the current state of the scene- Since:
- SDK 2.0
-
restore
public void restore()Restore the scene from the last capture Calls human(_:sceneRestored:) on success- Since:
- SDK 2.0
-
restore
public void restore(java.lang.String restoreString)Restore the scene from a previous capture Calls human(_:sceneRestored:) on success- Parameters:
restoreString
- a capture String- Since:
- SDK 2.0
-