From a92d839e216e18fbd34b54ee79a5383b74dcda46 Mon Sep 17 00:00:00 2001
From: Radek Oslejsek <oslejsek@fi.muni.cz>
Date: Thu, 22 Oct 2020 19:16:56 +0200
Subject: [PATCH] Introduced HumanFace

---
 .../cz/fidentis/analyst/mesh/HumanFace.java   | 46 +++++++++++++++++++
 1 file changed, 46 insertions(+)
 create mode 100644 MeshModel/src/main/java/cz/fidentis/analyst/mesh/HumanFace.java

diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/mesh/HumanFace.java b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/HumanFace.java
new file mode 100644
index 00000000..93c6511f
--- /dev/null
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/mesh/HumanFace.java
@@ -0,0 +1,46 @@
+package cz.fidentis.analyst.mesh;
+
+import cz.fidentis.analyst.mesh.core.MeshModel;
+import cz.fidentis.analyst.mesh.io.MeshObjLoader;
+import java.io.File;
+import java.io.IOException;
+import java.io.InputStream;
+
+/**
+ * This class encapsulates data for 3D scan of a single human face.
+ * 
+ * @author oslejsek
+ */
+public class HumanFace {
+    
+    private MeshModel meshModel;
+    
+    /**
+     * Reads a 3D human phase from file.
+     * 
+     * @param file OBJ file
+     * @throws IOException on I/O failure
+     */
+    public HumanFace(File file) throws IOException {
+        meshModel = MeshObjLoader.read(file);
+    }
+    
+    /**
+     * Reads a 3D human phase from file.
+     * 
+     * @param is input stream with OBJ data
+     * @throws IOException on I/O failure
+     */
+    public HumanFace(InputStream is) throws IOException {
+        meshModel = MeshObjLoader.read(is);
+    }
+    
+    /**
+     * Returns the triangular mesh model of the human face.
+     * 
+     * @return the triangular mesh model of the human face
+     */
+    public MeshModel getMeshModel() {
+        return meshModel;
+    }
+}
-- 
GitLab