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>captureJsonJSON describing a scene capture as an Map objectjava.lang.StringcaptureStringJSON describing a scene capture as a Stringjava.util.ArrayList<java.lang.String>objectIdsA flat list of visible objects by IDjava.util.HashMap<java.lang.String,java.lang.String>objectsA map of objectID Strings to Display Namesjava.lang.StringtextThe description of the current loaded scene.java.lang.StringtitleThe title of the current loaded scene. -
Constructor Summary
Constructors Constructor Description HKScene() -
Method Summary
Modifier and Type Method Description voidcapture()Capture the current state of the scenevoidcolor(java.lang.String objectId, HKColor color)Paint an objectvoiddisableHighlight()Turn off highlighting the selected objectvoiddisablePicking()Disable object selectionvoiddissect(boolean enabled)Turn dissect mode ON or OFF in the current scenevoidenableHighlight()Turn on highlighting the selected objectvoidenablePicking()Enable object selectionvoidgetColor(java.lang.String objectId)Query the color of an object, calls onObjectColor with the color valuevoidhide(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" IDvoidhighlight(java.util.ArrayList<java.lang.String> highlightIds)Highlight an object even if highlight is disabled for the uservoidisolate(boolean enabled)Turn isolate mode ON or OFF in the current scenevoidisolate(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" IDvoidpivot(java.lang.String objectId, double[] pivot)Pivot an object in 3D spacevoidreset()Reset the objects to their original state PLEASE NOTE: This does not reset the camera, use HKCamera.reset()voidresetHighlightColor()Change the object highlight color back to the original yellow colorvoidrestore()Restore the scene from the last capture Calls human(_:sceneRestored:) on successvoidrestore(java.lang.String restoreString)Restore the scene from a previous capture Calls human(_:sceneRestored:) on successvoidrotate(java.lang.String objectId, double[] rotate)Rotate an object in 3D spacevoidscale(java.lang.String objectId, double[] scale)Scale an object in 3D spacevoidscreenshot()Calls the onScreenshot interface method with the generated screenshotvoidselect(java.util.ArrayList<java.lang.String> selectIds)Select a group of objects programmaticallyvoidselectObject(java.lang.String objectId)Deprecated.use select(ArrayList objectIds) insteadvoidsetHighlightColor(float[] highlight)Change the object highlight colorvoidsetHighlightColor(int color)Change the object highlight colorvoidshare()Brings up the built-in Android share UI with the current contents of the viewvoidshow(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" IDvoidtransform(java.lang.String objectId, double[] translate, double[] rotate, double[] scale, double[] pivot)Move an object in 3D spacevoidtranslate(java.lang.String objectId, double[] translate)Move an object in 3D spacevoiduncolor(java.lang.String objectId)Unpaint an object - set it back to it's original colorvoidundo()Undo the last dissectvoidundoSelections()Deselect all objects in the scenevoidunhighlight(java.lang.String objectId)Unhighlight an objectvoidxray(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
-