Package cz.fidentis.analyst.rendering
Class Scene
java.lang.Object
cz.fidentis.analyst.rendering.Scene
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 Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoid
Removes all cutting and symmetry planes from scene.void
Removes all objects.Returns all drawable objects.protected int
Computes and returns bounding box of faces (only) in the scene.protected Color
getColorOfFeaturePoints
(Color origColor) getDrawableCuttingPlane
(int slot) Returns drawable cutting plane object.getDrawableFace
(int slot) Returns drawable face.getDrawableFeaturePoints
(int slot) Returns drawable feature points.getDrawableInteractiveMask
(int slot) returns drawable interactive maskgetDrawableSymmetryPlane
(int slot) Returns drawable symmetry plane.Returns all "occupied" slots, i.e., indexes where some human face is stored.int
Finds and returns a first free slot for drawable cutting plane.int
Finds and returns a first free slot for human face and its feature points and symmetry plane.int
Finds and returns a first free slot for other drawable objects.getOtherDrawable
(int slot) Returns other drawable object.int
Returns slot of the primary face or -1int
Returns slot of the secondary face or -1protected boolean
prepareArrays
(int slot) final void
Sets default colors of faces and feature pointsboolean
setDrawableCuttingPlane
(int slot, DrawableCuttingPlane cuttingPlane) Sets drawable cutting plane.boolean
setDrawableFace
(int slot, HumanFace face) Sets the drawable face (mesh).boolean
setDrawableFeaturePoints
(int slot, HumanFace face) Sets the drawable feature points of the face.boolean
setDrawableInteractiveMask
(int slot, SurfaceMask mask) Sets drawable interactive mask.boolean
setDrawableSymmetryPlane
(int slot, HumanFace face) Sets the drawable symmetry plane of the face.void
setFaceAsPrimary
(int slot) Sets the given face as primary.void
setFaceAsSecondary
(int slot) Sets the given face as secondary.boolean
setHumanFace
(int slot, HumanFace face) Sets the face and all its existing drawable components.boolean
setOtherDrawable
(int slot, Drawable dr) Sets other drawable.void
showDrawableFace
(int slot, boolean show) Showing or hiding the face (its mesh)void
showFeaturePoints
(int slot, boolean show) Showing or hiding the feature pointsvoid
showInteractiveMask
(int slot, boolean show) showing or hiding the interactive maskvoid
showSymmetryPlane
(int slot, boolean show) Showing or hiding the symmetry planetoString()
-
Field Details
-
Constructor Details
-
Method Details
-
clearScene
public void clearScene()Removes all objects. -
clearCuttingPlanes
public void clearCuttingPlanes()Removes all cutting and symmetry planes from scene. Prepares slots for new symmetry planes. -
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
public int getFreeSlotForFace()Finds and returns a first free slot for human face and its feature points and symmetry plane. UsegetFreeSlotForOtherDrawables()
to get free slot of other objects.- Returns:
- a first free slot for human face and its feature points and symmetry plane.
-
getFreeSlotForOtherDrawables
public int getFreeSlotForOtherDrawables()Finds and returns a first free slot for other drawable objects.- Returns:
- a first free slot for other drawable objects.
-
getFreeSlotForCuttingPlane
public int getFreeSlotForCuttingPlane()Finds and returns a first free slot for drawable cutting plane.- Returns:
- a first free slot for drawable cutting plane.
-
getPrimaryFaceSlot
public int getPrimaryFaceSlot()Returns slot of the primary face or -1- Returns:
- slot of the primary face or -1
-
getSecondaryFaceSlot
public int getSecondaryFaceSlot()Returns slot of the secondary face or -1- Returns:
- slot of the secondary face or -1
-
setFaceAsPrimary
public void setFaceAsPrimary(int slot) Sets the given face as primary.- Parameters:
slot
- slot of the face that should be set as primary
-
setFaceAsSecondary
public void setFaceAsSecondary(int slot) Sets the given face as secondary.- Parameters:
slot
- slot of the face that should be set as secondary
-
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
Returns drawable face.- Parameters:
slot
- Slot of the face- Returns:
- drawable face or
null
-
setHumanFace
Sets the face and all its existing drawable components. If the face isnull
, then the drawable face and all its components are removed.- Parameters:
slot
- Slot of the faceface
- New face ornull
- Returns:
true
if all drawable components (face, feature points, symmetry plane, etc.) have been set successfully.
-
setDrawableFace
Sets the drawable face (mesh). If the face isnull
, then the drawable face is removed.- Parameters:
slot
- Slot of the faceface
- New face ornull
- Returns:
true
on success.
-
setDrawableFeaturePoints
Sets the drawable feature points of the face. If the face isnull
, then the drawable feature points are removed.- Parameters:
slot
- Slot of the faceface
- New face ornull
- Returns:
true
on success.
-
setDrawableSymmetryPlane
Sets the drawable symmetry plane of the face. If the face isnull
, then the drawable symmetry plane is removed.- Parameters:
slot
- Slot of the faceface
- New face ornull
- Returns:
true
on success.
-
setDrawableInteractiveMask
Sets drawable interactive mask. If the face isnull
or has not a valid mask, then the drawable mask is removed.- Parameters:
slot
- Slot of the drawable cutting planemask
- New face mask ornull
- Returns:
true
on success.
-
setOtherDrawable
Sets other drawable. If the drawable isnull
, then the drawable is removed.- Parameters:
slot
- Slot of the drawabledr
- Drawable- Returns:
true
on success.
-
setDrawableCuttingPlane
Sets drawable cutting plane. If the drawable cutting plane isnull
, then the cutting plane is removed.- Parameters:
slot
- Slot of the drawable cutting planecuttingPlane
- Drawable cutting plane- Returns:
true
on success.
-
setDefaultColors
public final void setDefaultColors()Sets default colors of faces and feature points -
getDrawableFeaturePoints
Returns drawable feature points.- Parameters:
slot
- Slot of the face- Returns:
- drawable face or
null
-
getDrawableSymmetryPlane
Returns drawable symmetry plane.- Parameters:
slot
- Slot of the face- Returns:
- drawable plane or
null
-
showDrawableFace
public void showDrawableFace(int slot, boolean show) Showing or hiding the face (its mesh)- Parameters:
slot
- Slot of the faceshow
- determines whether to hide or show the object
-
showFeaturePoints
public void showFeaturePoints(int slot, boolean show) Showing or hiding the feature points- Parameters:
slot
- Slot of the faceshow
- determines whether to hide or show the object
-
showSymmetryPlane
public void showSymmetryPlane(int slot, boolean show) Showing or hiding the symmetry plane- Parameters:
slot
- Slot of the faceshow
- determines whether to hide or show the object
-
showInteractiveMask
public void showInteractiveMask(int slot, boolean show) showing or hiding the interactive mask- Parameters:
slot
- Slot of the faceshow
- determines whether to hide or show object
-
getOtherDrawable
Returns other drawable object.- Parameters:
slot
- Slot of the drawable object- Returns:
- drawable object or
null
-
getDrawableCuttingPlane
Returns drawable cutting plane object.- Parameters:
slot
- Slot of the cutting plane- Returns:
- drawable cutting plane or
null
-
getDrawableInteractiveMask
returns drawable interactive mask- Parameters:
slot
- Slot of the interactive mask- Returns:
- drawable interactive mask
-
getAllDrawables
Returns all drawable objects.- Returns:
- all drawable objects.
-
getDrawableFaces
-
getCuttingPlanes
-
getColorOfFeaturePoints
-
prepareArrays
protected boolean prepareArrays(int slot) -
getArraySize
protected int getArraySize() -
toString
-