From 3dcc80d31a5fd2c839ee42fae9dbd76781ba6d70 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Matej=20Kov=C3=A1r?= <matko@192.168.1.105>
Date: Tue, 19 Oct 2021 10:35:41 +0200
Subject: [PATCH] added getShortName method (name of the file without path)

---
 .../java/cz/fidentis/analyst/face/HumanFace.java     | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/Comparison/src/main/java/cz/fidentis/analyst/face/HumanFace.java b/Comparison/src/main/java/cz/fidentis/analyst/face/HumanFace.java
index 60c2644b..b9163f6e 100644
--- a/Comparison/src/main/java/cz/fidentis/analyst/face/HumanFace.java
+++ b/Comparison/src/main/java/cz/fidentis/analyst/face/HumanFace.java
@@ -225,6 +225,18 @@ public class HumanFace implements MeshListener, Serializable {
         return name;
     }
     
+    /**
+     * Returns short name of the face without its path in the name.
+     * @return short name of the face without its path in the name
+     */
+    public String getShortName() {
+        String name = this.getName();
+        int from = name.length() - 1;
+        while (Character.valueOf('\\').compareTo(name.charAt(from)) != 0) {from--;}
+        name = name.substring(from + 1);
+        return name;
+    }
+    
     /**
      * Returns already computed k-d tree of the triangular mesh or {@code null}.
      * @return Already computed k-d tree of the triangular mesh or {@code null}
-- 
GitLab