Loading FaceData/src/main/java/cz/fidentis/analyst/data/face/HumanFace.java +4 −4 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ import cz.fidentis.analyst.data.ray.Ray; import cz.fidentis.analyst.data.shapes.Box; import cz.fidentis.analyst.data.shapes.Glyph; import cz.fidentis.analyst.data.shapes.Plane; import cz.fidentis.analyst.data.surfacemask.SurfaceMask; import cz.fidentis.analyst.data.surfacemask.Mask3DProjection; import java.io.Serializable; import java.util.List; Loading Loading @@ -140,7 +140,7 @@ public interface HumanFace extends Serializable { * * @return the interactive mask */ SurfaceMask getSurfaceMask(); Mask3DProjection getMask3DProjection(); /** * Returns a deep copy of current state. Loading Loading @@ -201,9 +201,9 @@ public interface HumanFace extends Serializable { /** * Set a surface mask. * * @param surfaceMask surfaceMask or {@code null} * @param mask3DProjection surfaceMask or {@code null} */ void setSurfaceMask(SurfaceMask surfaceMask); void setMask3DProjection(Mask3DProjection mask3DProjection); /** * Gets face frontal direction. Loading FaceData/src/main/java/cz/fidentis/analyst/data/face/impl/HumanFaceImpl.java +7 −7 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ import cz.fidentis.analyst.data.ray.Ray; import cz.fidentis.analyst.data.shapes.Box; import cz.fidentis.analyst.data.shapes.Glyph; import cz.fidentis.analyst.data.shapes.Plane; import cz.fidentis.analyst.data.surfacemask.SurfaceMask; import cz.fidentis.analyst.data.surfacemask.Mask3DProjection; import org.slf4j.Logger; import java.io.File; Loading Loading @@ -61,7 +61,7 @@ public class HumanFaceImpl implements HumanFace { private final boolean isAverageFace; private transient SurfaceMask surfaceMask = new SurfaceMask(); private transient Mask3DProjection mask3DProjection = new Mask3DProjection(); private List<Glyph> glyphs; Loading Loading @@ -213,8 +213,8 @@ public class HumanFaceImpl implements HumanFace { } @Override public SurfaceMask getSurfaceMask() { return surfaceMask; public Mask3DProjection getMask3DProjection() { return mask3DProjection; } @Override Loading Loading @@ -264,8 +264,8 @@ public class HumanFaceImpl implements HumanFace { } @Override public void setSurfaceMask(SurfaceMask surfaceMask) { this.surfaceMask = surfaceMask; public void setMask3DProjection(Mask3DProjection mask3DProjection) { this.mask3DProjection = mask3DProjection; } @Override Loading Loading @@ -293,7 +293,7 @@ public class HumanFaceImpl implements HumanFace { result = 31 * result + Objects.hashCode(landmarks); result = 31 * result + Objects.hashCode(name); result = 31 * result + Boolean.hashCode(isAverageFace); result = 31 * result + Objects.hashCode(surfaceMask); result = 31 * result + Objects.hashCode(mask3DProjection); result = 31 * result + Objects.hashCode(glyphs); return result; } Loading FaceEngines/src/main/java/cz/fidentis/analyst/engines/face/FaceMasksServices.java +3 −3 Original line number Diff line number Diff line package cz.fidentis.analyst.engines.face; import cz.fidentis.analyst.data.face.HumanFace; import cz.fidentis.analyst.data.surfacemask.SurfaceMask; import cz.fidentis.analyst.data.surfacemask.SurfaceMaskVariant; import cz.fidentis.analyst.data.surfacemask.Mask3DProjection; import cz.fidentis.analyst.data.surfacemask.MaskVariant; import cz.fidentis.analyst.engines.face.exception.LocalResourceUnavailableException; import cz.fidentis.analyst.engines.face.exception.RemoteServiceFailedException; import cz.fidentis.analyst.engines.face.exception.RemoteServiceUnreachableException; Loading @@ -29,7 +29,7 @@ public class FaceMasksServices { * @throws RemoteServiceFailedException if the computational request performed with an error * @throws LocalResourceUnavailableException if the preparation of data for the service has failed */ public static List<SurfaceMask> detectFaceMasks(HumanFace face, Set<SurfaceMaskVariant> variants) public static List<Mask3DProjection> detectFaceMasks(HumanFace face, Set<MaskVariant> variants) throws RemoteServiceUnreachableException, RemoteServiceFailedException, LocalResourceUnavailableException { return new FaceMasksServicesImpl().detectFaceMasks(face, variants); Loading FaceEngines/src/main/java/cz/fidentis/analyst/engines/face/impl/FaceMasksServicesImpl.java +7 −7 Original line number Diff line number Diff line Loading @@ -4,8 +4,8 @@ import cz.fidentis.analyst.data.face.HumanFace; import cz.fidentis.analyst.data.mesh.MeshIO; import cz.fidentis.analyst.data.mesh.MeshModel; import cz.fidentis.analyst.data.shapes.Box; import cz.fidentis.analyst.data.surfacemask.SurfaceMask; import cz.fidentis.analyst.data.surfacemask.SurfaceMaskVariant; import cz.fidentis.analyst.data.surfacemask.Mask3DProjection; import cz.fidentis.analyst.data.surfacemask.MaskVariant; import cz.fidentis.analyst.engines.face.exception.LocalResourceUnavailableException; import cz.fidentis.analyst.engines.face.exception.RemoteServiceFailedException; import cz.fidentis.analyst.engines.face.exception.RemoteServiceUnreachableException; Loading Loading @@ -42,7 +42,7 @@ public class FaceMasksServicesImpl { * @throws RemoteServiceFailedException if the computational request performed with an error * @throws LocalResourceUnavailableException if the preparation of data for the service has failed */ public List<SurfaceMask> detectFaceMasks(HumanFace face, Set<SurfaceMaskVariant> variants) public List<Mask3DProjection> detectFaceMasks(HumanFace face, Set<MaskVariant> variants) throws RemoteServiceUnreachableException, RemoteServiceFailedException, LocalResourceUnavailableException { if (variants.isEmpty()) { Loading @@ -51,7 +51,7 @@ public class FaceMasksServicesImpl { FaceMasksApi api = getFaceMaskDetectorClient(); List<SurfaceMask> surfaceMasks = new ArrayList<>(); List<Mask3DProjection> mask3DProjections = new ArrayList<>(); Box bbox = face.getBoundingBox(); BoundingBoxMaskProjectorConfig bboxProjectorConfig = new BoundingBoxMaskProjectorConfig( Loading @@ -75,7 +75,7 @@ public class FaceMasksServicesImpl { } Set<FaceMaskVariant> variantSet = new HashSet<>(); for (SurfaceMaskVariant variant : variants) { for (MaskVariant variant : variants) { switch (variant) { case LEFT_EYE -> variantSet.add(FaceMaskVariant.LEFT_EYE); case RIGHT_EYE -> variantSet.add(FaceMaskVariant.RIGHT_EYE); Loading @@ -102,7 +102,7 @@ public class FaceMasksServicesImpl { BoundingBoxMaskProjector mp = new BoundingBoxMaskProjector(bboxProjectorConfig, points); face.getOctree().accept(mp); surfaceMasks.add(mp.getResult()); mask3DProjections.add(mp.getResult()); } } catch (ApiException e) { if (e.getCode() == 0) { Loading @@ -124,7 +124,7 @@ public class FaceMasksServicesImpl { } } return surfaceMasks; return mask3DProjections; } private FaceMasksApi getFaceMaskDetectorClient() throws LocalResourceUnavailableException { Loading GUI/src/main/java/cz/fidentis/analyst/gui/elements/LayerPanel.java +14 −14 Original line number Diff line number Diff line package cz.fidentis.analyst.gui.elements; import cz.fidentis.analyst.data.surfacemask.Layer; import cz.fidentis.analyst.data.surfacemask.SurfaceMaskLayers; import cz.fidentis.analyst.data.surfacemask.Mask2DLayer; import cz.fidentis.analyst.data.surfacemask.Mask2DLayers; import javax.swing.*; import java.awt.*; Loading @@ -17,7 +17,7 @@ import static cz.fidentis.analyst.gui.task.masks.InteractiveMaskPanel.ACTION_PRO * Represents a UI panel for managing individual layers in the surface mask editor. * * <p>This panel provides controls for toggling the visibility of a layer, selecting it, * and removing it from the {@link SurfaceMaskLayers} manager. The panel includes: * and removing it from the {@link Mask2DLayers} manager. The panel includes: * - A visual representation of the layer. * - A button to show/hide the layer. * - A button to delete the layer. Loading @@ -31,8 +31,8 @@ public class LayerPanel extends JPanel { private final JLabel layerIcon; private final JButton showHideButton; private final Layer layer; private final SurfaceMaskLayers layerManager; private final Mask2DLayer mask2DLayer; private final Mask2DLayers layerManager; private final JPanel container; private final SurfaceMaskPanel surfaceMaskPanel; private final ActionListener actionListener; Loading @@ -41,14 +41,14 @@ public class LayerPanel extends JPanel { * Creates new form of LayerPanel * * @param container The parent container that holds this panel. * @param layer The {@link Layer} associated with this panel. * @param layerManager The {@link SurfaceMaskLayers} manager handling multiple layers. * @param mask2DLayer The {@link Mask2DLayer} associated with this panel. * @param layerManager The {@link Mask2DLayers} manager handling multiple layers. * @param surfaceMaskPanel The panel responsible for rendering the surface masks. * @param actionListener The listener for handling actions related to layers. * */ public LayerPanel(JPanel container, Layer layer, SurfaceMaskLayers layerManager, SurfaceMaskPanel surfaceMaskPanel, ActionListener actionListener) { this.layer = layer; public LayerPanel(JPanel container, Mask2DLayer mask2DLayer, Mask2DLayers layerManager, SurfaceMaskPanel surfaceMaskPanel, ActionListener actionListener) { this.mask2DLayer = mask2DLayer; this.layerManager = layerManager; this.container = container; this.surfaceMaskPanel = surfaceMaskPanel; Loading Loading @@ -125,11 +125,11 @@ public class LayerPanel extends JPanel { if (layerIcon.getBackground().equals(Color.GRAY)) { layerIcon.setBackground(Color.WHITE); showHideButton.setIcon(loadIcon(HIDE)); layer.setVisibility(false); mask2DLayer.setVisibility(false); } else { layerIcon.setBackground(Color.GRAY); showHideButton.setIcon(loadIcon(SHOW)); layer.setVisibility(true); mask2DLayer.setVisibility(true); } surfaceMaskPanel.setNeedsLayerUpdate(true); Loading @@ -146,10 +146,10 @@ public class LayerPanel extends JPanel { container.remove(this); container.revalidate(); container.repaint(); if (layerManager.getCurrentLayer() == layer) { if (layerManager.getCurrentLayer() == mask2DLayer) { layerManager.setCurrentLayer(null); } layerManager.removeLayer(layer); layerManager.removeLayer(mask2DLayer); surfaceMaskPanel.setNeedsLayerUpdate(true); surfaceMaskPanel.repaint(); Loading @@ -176,7 +176,7 @@ public class LayerPanel extends JPanel { } setBackground(Color.GREEN); layerManager.setCurrentLayer(layer); layerManager.setCurrentLayer(mask2DLayer); surfaceMaskPanel.setNeedsLayerUpdate(true); surfaceMaskPanel.repaint(); Loading Loading
FaceData/src/main/java/cz/fidentis/analyst/data/face/HumanFace.java +4 −4 Original line number Diff line number Diff line Loading @@ -9,7 +9,7 @@ import cz.fidentis.analyst.data.ray.Ray; import cz.fidentis.analyst.data.shapes.Box; import cz.fidentis.analyst.data.shapes.Glyph; import cz.fidentis.analyst.data.shapes.Plane; import cz.fidentis.analyst.data.surfacemask.SurfaceMask; import cz.fidentis.analyst.data.surfacemask.Mask3DProjection; import java.io.Serializable; import java.util.List; Loading Loading @@ -140,7 +140,7 @@ public interface HumanFace extends Serializable { * * @return the interactive mask */ SurfaceMask getSurfaceMask(); Mask3DProjection getMask3DProjection(); /** * Returns a deep copy of current state. Loading Loading @@ -201,9 +201,9 @@ public interface HumanFace extends Serializable { /** * Set a surface mask. * * @param surfaceMask surfaceMask or {@code null} * @param mask3DProjection surfaceMask or {@code null} */ void setSurfaceMask(SurfaceMask surfaceMask); void setMask3DProjection(Mask3DProjection mask3DProjection); /** * Gets face frontal direction. Loading
FaceData/src/main/java/cz/fidentis/analyst/data/face/impl/HumanFaceImpl.java +7 −7 Original line number Diff line number Diff line Loading @@ -14,7 +14,7 @@ import cz.fidentis.analyst.data.ray.Ray; import cz.fidentis.analyst.data.shapes.Box; import cz.fidentis.analyst.data.shapes.Glyph; import cz.fidentis.analyst.data.shapes.Plane; import cz.fidentis.analyst.data.surfacemask.SurfaceMask; import cz.fidentis.analyst.data.surfacemask.Mask3DProjection; import org.slf4j.Logger; import java.io.File; Loading Loading @@ -61,7 +61,7 @@ public class HumanFaceImpl implements HumanFace { private final boolean isAverageFace; private transient SurfaceMask surfaceMask = new SurfaceMask(); private transient Mask3DProjection mask3DProjection = new Mask3DProjection(); private List<Glyph> glyphs; Loading Loading @@ -213,8 +213,8 @@ public class HumanFaceImpl implements HumanFace { } @Override public SurfaceMask getSurfaceMask() { return surfaceMask; public Mask3DProjection getMask3DProjection() { return mask3DProjection; } @Override Loading Loading @@ -264,8 +264,8 @@ public class HumanFaceImpl implements HumanFace { } @Override public void setSurfaceMask(SurfaceMask surfaceMask) { this.surfaceMask = surfaceMask; public void setMask3DProjection(Mask3DProjection mask3DProjection) { this.mask3DProjection = mask3DProjection; } @Override Loading Loading @@ -293,7 +293,7 @@ public class HumanFaceImpl implements HumanFace { result = 31 * result + Objects.hashCode(landmarks); result = 31 * result + Objects.hashCode(name); result = 31 * result + Boolean.hashCode(isAverageFace); result = 31 * result + Objects.hashCode(surfaceMask); result = 31 * result + Objects.hashCode(mask3DProjection); result = 31 * result + Objects.hashCode(glyphs); return result; } Loading
FaceEngines/src/main/java/cz/fidentis/analyst/engines/face/FaceMasksServices.java +3 −3 Original line number Diff line number Diff line package cz.fidentis.analyst.engines.face; import cz.fidentis.analyst.data.face.HumanFace; import cz.fidentis.analyst.data.surfacemask.SurfaceMask; import cz.fidentis.analyst.data.surfacemask.SurfaceMaskVariant; import cz.fidentis.analyst.data.surfacemask.Mask3DProjection; import cz.fidentis.analyst.data.surfacemask.MaskVariant; import cz.fidentis.analyst.engines.face.exception.LocalResourceUnavailableException; import cz.fidentis.analyst.engines.face.exception.RemoteServiceFailedException; import cz.fidentis.analyst.engines.face.exception.RemoteServiceUnreachableException; Loading @@ -29,7 +29,7 @@ public class FaceMasksServices { * @throws RemoteServiceFailedException if the computational request performed with an error * @throws LocalResourceUnavailableException if the preparation of data for the service has failed */ public static List<SurfaceMask> detectFaceMasks(HumanFace face, Set<SurfaceMaskVariant> variants) public static List<Mask3DProjection> detectFaceMasks(HumanFace face, Set<MaskVariant> variants) throws RemoteServiceUnreachableException, RemoteServiceFailedException, LocalResourceUnavailableException { return new FaceMasksServicesImpl().detectFaceMasks(face, variants); Loading
FaceEngines/src/main/java/cz/fidentis/analyst/engines/face/impl/FaceMasksServicesImpl.java +7 −7 Original line number Diff line number Diff line Loading @@ -4,8 +4,8 @@ import cz.fidentis.analyst.data.face.HumanFace; import cz.fidentis.analyst.data.mesh.MeshIO; import cz.fidentis.analyst.data.mesh.MeshModel; import cz.fidentis.analyst.data.shapes.Box; import cz.fidentis.analyst.data.surfacemask.SurfaceMask; import cz.fidentis.analyst.data.surfacemask.SurfaceMaskVariant; import cz.fidentis.analyst.data.surfacemask.Mask3DProjection; import cz.fidentis.analyst.data.surfacemask.MaskVariant; import cz.fidentis.analyst.engines.face.exception.LocalResourceUnavailableException; import cz.fidentis.analyst.engines.face.exception.RemoteServiceFailedException; import cz.fidentis.analyst.engines.face.exception.RemoteServiceUnreachableException; Loading Loading @@ -42,7 +42,7 @@ public class FaceMasksServicesImpl { * @throws RemoteServiceFailedException if the computational request performed with an error * @throws LocalResourceUnavailableException if the preparation of data for the service has failed */ public List<SurfaceMask> detectFaceMasks(HumanFace face, Set<SurfaceMaskVariant> variants) public List<Mask3DProjection> detectFaceMasks(HumanFace face, Set<MaskVariant> variants) throws RemoteServiceUnreachableException, RemoteServiceFailedException, LocalResourceUnavailableException { if (variants.isEmpty()) { Loading @@ -51,7 +51,7 @@ public class FaceMasksServicesImpl { FaceMasksApi api = getFaceMaskDetectorClient(); List<SurfaceMask> surfaceMasks = new ArrayList<>(); List<Mask3DProjection> mask3DProjections = new ArrayList<>(); Box bbox = face.getBoundingBox(); BoundingBoxMaskProjectorConfig bboxProjectorConfig = new BoundingBoxMaskProjectorConfig( Loading @@ -75,7 +75,7 @@ public class FaceMasksServicesImpl { } Set<FaceMaskVariant> variantSet = new HashSet<>(); for (SurfaceMaskVariant variant : variants) { for (MaskVariant variant : variants) { switch (variant) { case LEFT_EYE -> variantSet.add(FaceMaskVariant.LEFT_EYE); case RIGHT_EYE -> variantSet.add(FaceMaskVariant.RIGHT_EYE); Loading @@ -102,7 +102,7 @@ public class FaceMasksServicesImpl { BoundingBoxMaskProjector mp = new BoundingBoxMaskProjector(bboxProjectorConfig, points); face.getOctree().accept(mp); surfaceMasks.add(mp.getResult()); mask3DProjections.add(mp.getResult()); } } catch (ApiException e) { if (e.getCode() == 0) { Loading @@ -124,7 +124,7 @@ public class FaceMasksServicesImpl { } } return surfaceMasks; return mask3DProjections; } private FaceMasksApi getFaceMaskDetectorClient() throws LocalResourceUnavailableException { Loading
GUI/src/main/java/cz/fidentis/analyst/gui/elements/LayerPanel.java +14 −14 Original line number Diff line number Diff line package cz.fidentis.analyst.gui.elements; import cz.fidentis.analyst.data.surfacemask.Layer; import cz.fidentis.analyst.data.surfacemask.SurfaceMaskLayers; import cz.fidentis.analyst.data.surfacemask.Mask2DLayer; import cz.fidentis.analyst.data.surfacemask.Mask2DLayers; import javax.swing.*; import java.awt.*; Loading @@ -17,7 +17,7 @@ import static cz.fidentis.analyst.gui.task.masks.InteractiveMaskPanel.ACTION_PRO * Represents a UI panel for managing individual layers in the surface mask editor. * * <p>This panel provides controls for toggling the visibility of a layer, selecting it, * and removing it from the {@link SurfaceMaskLayers} manager. The panel includes: * and removing it from the {@link Mask2DLayers} manager. The panel includes: * - A visual representation of the layer. * - A button to show/hide the layer. * - A button to delete the layer. Loading @@ -31,8 +31,8 @@ public class LayerPanel extends JPanel { private final JLabel layerIcon; private final JButton showHideButton; private final Layer layer; private final SurfaceMaskLayers layerManager; private final Mask2DLayer mask2DLayer; private final Mask2DLayers layerManager; private final JPanel container; private final SurfaceMaskPanel surfaceMaskPanel; private final ActionListener actionListener; Loading @@ -41,14 +41,14 @@ public class LayerPanel extends JPanel { * Creates new form of LayerPanel * * @param container The parent container that holds this panel. * @param layer The {@link Layer} associated with this panel. * @param layerManager The {@link SurfaceMaskLayers} manager handling multiple layers. * @param mask2DLayer The {@link Mask2DLayer} associated with this panel. * @param layerManager The {@link Mask2DLayers} manager handling multiple layers. * @param surfaceMaskPanel The panel responsible for rendering the surface masks. * @param actionListener The listener for handling actions related to layers. * */ public LayerPanel(JPanel container, Layer layer, SurfaceMaskLayers layerManager, SurfaceMaskPanel surfaceMaskPanel, ActionListener actionListener) { this.layer = layer; public LayerPanel(JPanel container, Mask2DLayer mask2DLayer, Mask2DLayers layerManager, SurfaceMaskPanel surfaceMaskPanel, ActionListener actionListener) { this.mask2DLayer = mask2DLayer; this.layerManager = layerManager; this.container = container; this.surfaceMaskPanel = surfaceMaskPanel; Loading Loading @@ -125,11 +125,11 @@ public class LayerPanel extends JPanel { if (layerIcon.getBackground().equals(Color.GRAY)) { layerIcon.setBackground(Color.WHITE); showHideButton.setIcon(loadIcon(HIDE)); layer.setVisibility(false); mask2DLayer.setVisibility(false); } else { layerIcon.setBackground(Color.GRAY); showHideButton.setIcon(loadIcon(SHOW)); layer.setVisibility(true); mask2DLayer.setVisibility(true); } surfaceMaskPanel.setNeedsLayerUpdate(true); Loading @@ -146,10 +146,10 @@ public class LayerPanel extends JPanel { container.remove(this); container.revalidate(); container.repaint(); if (layerManager.getCurrentLayer() == layer) { if (layerManager.getCurrentLayer() == mask2DLayer) { layerManager.setCurrentLayer(null); } layerManager.removeLayer(layer); layerManager.removeLayer(mask2DLayer); surfaceMaskPanel.setNeedsLayerUpdate(true); surfaceMaskPanel.repaint(); Loading @@ -176,7 +176,7 @@ public class LayerPanel extends JPanel { } setBackground(Color.GREEN); layerManager.setCurrentLayer(layer); layerManager.setCurrentLayer(mask2DLayer); surfaceMaskPanel.setNeedsLayerUpdate(true); surfaceMaskPanel.repaint(); Loading