Class Scene

java.lang.Object
cz.fidentis.analyst.rendering.Scene

public class Scene extends Object
A simple 3D scene. The structure is as follows: Drawable components of a single human face (mesh, symmetry plane, feature points. etc.) are always stored at the same index (slot). One face can be labeled as "primary", one as "secondary". Other faces have no label. Then, there is a special list of so-called other drawables. The size of this list can differ. List drawableCuttingPlanes contains all cutting planes.
  • Field Details Link icon

  • Constructor Details Link icon

    • Scene Link icon

      public Scene()
  • Method Details Link icon

    • clearScene Link icon

      public void clearScene()
      Removes all objects.
    • clearCuttingPlanes Link icon

      public void clearCuttingPlanes()
      Removes all cutting and symmetry planes from scene. Prepares slots for new symmetry planes.
    • getBoundingBox Link icon

      public Box getBoundingBox()
      Computes and returns bounding box of faces (only) in the scene.
      Returns:
      a bounding box of faces (only) in the scene or null
    • getFreeSlotForFace Link icon

      public int getFreeSlotForFace()
      Finds and returns a first free slot for human face and its feature points and symmetry plane. Use getFreeSlotForOtherDrawables() to get free slot of other objects.
      Returns:
      a first free slot for human face and its feature points and symmetry plane.
    • getFreeSlotForOtherDrawables Link icon

      public int getFreeSlotForOtherDrawables()
      Finds and returns a first free slot for other drawable objects.
      Returns:
      a first free slot for other drawable objects.
    • getFreeSlotForCuttingPlane Link icon

      public int getFreeSlotForCuttingPlane()
      Finds and returns a first free slot for drawable cutting plane.
      Returns:
      a first free slot for drawable cutting plane.
    • getPrimaryFaceSlot Link icon

      public int getPrimaryFaceSlot()
      Returns slot of the primary face or -1
      Returns:
      slot of the primary face or -1
    • getSecondaryFaceSlot Link icon

      public int getSecondaryFaceSlot()
      Returns slot of the secondary face or -1
      Returns:
      slot of the secondary face or -1
    • setFaceAsPrimary Link icon

      public void setFaceAsPrimary(int slot)
      Sets the given face as primary.
      Parameters:
      slot - slot of the face that should be set as primary
    • setFaceAsSecondary Link icon

      public void setFaceAsSecondary(int slot)
      Sets the given face as secondary.
      Parameters:
      slot - slot of the face that should be set as secondary
    • getFaceSlots Link icon

      public List<Integer> getFaceSlots()
      Returns all "occupied" slots, i.e., indexes where some human face is stored.
      Returns:
      "occupied" slots, i.e., indexes where some human face is stored.
    • getDrawableFace Link icon

      public DrawableFace getDrawableFace(int slot)
      Returns drawable face.
      Parameters:
      slot - Slot of the face
      Returns:
      drawable face or null
    • setHumanFace Link icon

      public boolean setHumanFace(int slot, HumanFace face)
      Sets the face and all its existing drawable components. If the face is null, then the drawable face and all its components are removed.
      Parameters:
      slot - Slot of the face
      face - New face or null
      Returns:
      true if all drawable components (face, feature points, symmetry plane, etc.) have been set successfully.
    • setDrawableFace Link icon

      public boolean setDrawableFace(int slot, HumanFace face)
      Sets the drawable face (mesh). If the face is null, then the drawable face is removed.
      Parameters:
      slot - Slot of the face
      face - New face or null
      Returns:
      true on success.
    • setDrawableFeaturePoints Link icon

      public boolean setDrawableFeaturePoints(int slot, HumanFace face)
      Sets the drawable feature points of the face. If the face is null, then the drawable feature points are removed.
      Parameters:
      slot - Slot of the face
      face - New face or null
      Returns:
      true on success.
    • setDrawableSymmetryPlane Link icon

      public boolean setDrawableSymmetryPlane(int slot, HumanFace face)
      Sets the drawable symmetry plane of the face. If the face is null, then the drawable symmetry plane is removed.
      Parameters:
      slot - Slot of the face
      face - New face or null
      Returns:
      true on success.
    • setDrawableInteractiveMask Link icon

      public boolean setDrawableInteractiveMask(int slot, SurfaceMask mask)
      Sets drawable interactive mask. If the face is null or has not a valid mask, then the drawable mask is removed.
      Parameters:
      slot - Slot of the drawable cutting plane
      mask - New face mask or null
      Returns:
      true on success.
    • setOtherDrawable Link icon

      public boolean setOtherDrawable(int slot, Drawable dr)
      Sets other drawable. If the drawable is null, then the drawable is removed.
      Parameters:
      slot - Slot of the drawable
      dr - Drawable
      Returns:
      true on success.
    • setDrawableCuttingPlane Link icon

      public boolean setDrawableCuttingPlane(int slot, DrawableCuttingPlane cuttingPlane)
      Sets drawable cutting plane. If the drawable cutting plane is null, then the cutting plane is removed.
      Parameters:
      slot - Slot of the drawable cutting plane
      cuttingPlane - Drawable cutting plane
      Returns:
      true on success.
    • setDefaultColors Link icon

      public final void setDefaultColors()
      Sets default colors of faces and feature points
    • getDrawableFeaturePoints Link icon

      public DrawableFeaturePoints getDrawableFeaturePoints(int slot)
      Returns drawable feature points.
      Parameters:
      slot - Slot of the face
      Returns:
      drawable face or null
    • getDrawableSymmetryPlane Link icon

      public DrawablePlane getDrawableSymmetryPlane(int slot)
      Returns drawable symmetry plane.
      Parameters:
      slot - Slot of the face
      Returns:
      drawable plane or null
    • showDrawableFace Link icon

      public void showDrawableFace(int slot, boolean show)
      Showing or hiding the face (its mesh)
      Parameters:
      slot - Slot of the face
      show - determines whether to hide or show the object
    • showFeaturePoints Link icon

      public void showFeaturePoints(int slot, boolean show)
      Showing or hiding the feature points
      Parameters:
      slot - Slot of the face
      show - determines whether to hide or show the object
    • showSymmetryPlane Link icon

      public void showSymmetryPlane(int slot, boolean show)
      Showing or hiding the symmetry plane
      Parameters:
      slot - Slot of the face
      show - determines whether to hide or show the object
    • showInteractiveMask Link icon

      public void showInteractiveMask(int slot, boolean show)
      showing or hiding the interactive mask
      Parameters:
      slot - Slot of the face
      show - determines whether to hide or show object
    • getOtherDrawable Link icon

      public Drawable getOtherDrawable(int slot)
      Returns other drawable object.
      Parameters:
      slot - Slot of the drawable object
      Returns:
      drawable object or null
    • getDrawableCuttingPlane Link icon

      public DrawableCuttingPlane getDrawableCuttingPlane(int slot)
      Returns drawable cutting plane object.
      Parameters:
      slot - Slot of the cutting plane
      Returns:
      drawable cutting plane or null
    • getDrawableInteractiveMask Link icon

      public DrawableInteractiveMask getDrawableInteractiveMask(int slot)
      returns drawable interactive mask
      Parameters:
      slot - Slot of the interactive mask
      Returns:
      drawable interactive mask
    • getAllDrawables Link icon

      public List<Drawable> getAllDrawables()
      Returns all drawable objects.
      Returns:
      all drawable objects.
    • getDrawableFaces Link icon

      public List<DrawableFace> getDrawableFaces()
    • getCuttingPlanes Link icon

      public List<DrawableCuttingPlane> getCuttingPlanes()
    • getColorOfFeaturePoints Link icon

      protected Color getColorOfFeaturePoints(Color origColor)
    • prepareArrays Link icon

      protected boolean prepareArrays(int slot)
    • getArraySize Link icon

      protected int getArraySize()
    • toString Link icon

      public String toString()
      Overrides:
      toString in class Object