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 object
    java.lang.String captureString
    JSON describing a scene capture as a String
    java.util.ArrayList<java.lang.String> objectIds
    A flat list of visible objects by ID
    java.util.HashMap<java.lang.String,​java.lang.String> objects
    A map of objectID Strings to Display Names
    java.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 scene
    void color​(java.lang.String objectId, HKColor color)
    Paint an object
    void disableHighlight()
    Turn off highlighting the selected object
    void disablePicking()
    Disable object selection
    void dissect​(boolean enabled)
    Turn dissect mode ON or OFF in the current scene
    void enableHighlight()
    Turn on highlighting the selected object
    void enablePicking()
    Enable object selection
    void getColor​(java.lang.String objectId)
    Query the color of an object, calls onObjectColor with the color value
    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
    void highlight​(java.util.ArrayList<java.lang.String> highlightIds)
    Highlight an object even if highlight is disabled for the user
    void isolate​(boolean enabled)
    Turn isolate mode ON or OFF in the current scene
    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
    void pivot​(java.lang.String objectId, double[] pivot)
    Pivot an object in 3D space
    void 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 color
    void restore()
    Restore the scene from the last capture Calls human(_:sceneRestored:) on success
    void restore​(java.lang.String restoreString)
    Restore the scene from a previous capture Calls human(_:sceneRestored:) on success
    void rotate​(java.lang.String objectId, double[] rotate)
    Rotate an object in 3D space
    void scale​(java.lang.String objectId, double[] scale)
    Scale an object in 3D space
    void screenshot()
    Calls the onScreenshot interface method with the generated screenshot
    void select​(java.util.ArrayList<java.lang.String> selectIds)
    Select a group of objects programmatically
    void selectObject​(java.lang.String objectId)
    Deprecated.
    use select(ArrayList objectIds) instead
    void setHighlightColor​(float[] highlight)
    Change the object highlight color
    void setHighlightColor​(int color)
    Change the object highlight color
    void share()
    Brings up the built-in Android share UI with the current contents of the view
    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
    void transform​(java.lang.String objectId, double[] translate, double[] rotate, double[] scale, double[] pivot)
    Move an object in 3D space
    void translate​(java.lang.String objectId, double[] translate)
    Move an object in 3D space
    void uncolor​(java.lang.String objectId)
    Unpaint an object - set it back to it's original color
    void undo()
    Undo the last dissect
    void undoSelections()
    Deselect all objects in the scene
    void unhighlight​(java.lang.String objectId)
    Unhighlight an object
    void xray​(boolean enabled)
    Turn xray mode ON or OFF in the current scene

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • title

      public java.lang.String title
      The title of the current loaded scene.
    • text

      public java.lang.String text
      The description of the current loaded scene.
    • objectIds

      public java.util.ArrayList<java.lang.String> objectIds
      A flat list of visible objects by ID
    • objects

      public java.util.HashMap<java.lang.String,​java.lang.String> objects
      A map of objectID Strings to Display Names
    • captureString

      public java.lang.String captureString
      JSON describing a scene capture as a String
    • captureJson

      public java.util.Map<java.lang.String,​java.lang.Object> captureJson
      JSON describing a scene capture as an Map object
  • Constructor Details

  • 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

      public void color​(java.lang.String objectId, HKColor color)
      Paint an object
      Parameters:
      objectId - - the String id of the object
      color - - 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) instead
      Select 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 transform
      translate - : [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 transform
      rotate - : [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 transform
      scale - : [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 transform
      pivot - : [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 transform
      translate - : [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