From 04d278fb44de1bfe0a5bfe5f3e9a13dc4dbc3f0c Mon Sep 17 00:00:00 2001
From: Jakub Kolman <kubokolman@gmail.com>
Date: Mon, 8 Nov 2021 16:14:55 +0100
Subject: [PATCH] [#81] documentation: adding java docs

---
 .../analyst/feature/FeaturePointType.java     |   1 +
 .../provider/FeaturePointTypeProvider.java    |  11 +-
 .../services/FeaturePointCsvExporter.java     |  13 +-
 .../services/FeaturePointCsvLoader.java       |  10 +-
 .../services/FeaturePointExportService.java   |  24 ++-
 .../services/FeaturePointFpExporter.java      |   8 +
 .../services/FeaturePointFpLoader.java        |   1 -
 .../services/FeaturePointImportService.java   |   5 -
 .../services/FeaturePointTypesService.java    |   7 +-
 .../utils/FeaturePointFileFormatTypes.java    |  17 +-
 .../feature/utils/FileResourcesUtils.java     |   4 -
 MeshModel/test_file_landmarks.fp              | 170 ------------------
 12 files changed, 56 insertions(+), 215 deletions(-)
 delete mode 100644 MeshModel/test_file_landmarks.fp

diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/FeaturePointType.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/FeaturePointType.java
index 013a3d7a..f53383ca 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/FeaturePointType.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/FeaturePointType.java
@@ -3,6 +3,7 @@ package cz.fidentis.analyst.feature;
 import java.io.Serializable;
 
 /**
+ * Class with basic structure of feature point 
  * 
  * @author Jakub Kolman
  */
diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/provider/FeaturePointTypeProvider.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/provider/FeaturePointTypeProvider.java
index e37fc061..81ab67ab 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/provider/FeaturePointTypeProvider.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/provider/FeaturePointTypeProvider.java
@@ -1,8 +1,3 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
 package cz.fidentis.analyst.feature.provider;
 
 import cz.fidentis.analyst.feature.FeaturePointType;
@@ -11,6 +6,7 @@ import java.util.HashMap;
 import java.util.Map;
 
 /**
+ * Feature point type provider class
  * 
  * @author Jakub Kolman
  */
@@ -19,7 +15,10 @@ public class FeaturePointTypeProvider {
     private final Map<Integer, FeaturePointType> featurePointTypesById;
     private final Map<String, FeaturePointType> featurePointTypesByCode;
 
-    // provide thread safe singleton
+    /**
+     * provide thread safe singleton
+     * @author Jakub Kolman
+     */
     private static class InstanceHolder {
 
         public static FeaturePointTypeProvider instance = new FeaturePointTypeProvider();
diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointCsvExporter.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointCsvExporter.java
index b344b460..d15fa3de 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointCsvExporter.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointCsvExporter.java
@@ -11,12 +11,19 @@ import java.util.logging.Logger;
 
 /**
  * Class used to export feature points to file of csv format
- * 
+ *
  * @author Jakub Kolman
  */
 public class FeaturePointCsvExporter {
-   
-        public static void exportFeaturePointsToCSV(List<FeaturePoint> featurePointList, String objectName) throws IOException {
+
+    /**
+     * Exports a file to default location in csv format
+     *
+     * @param featurePointList
+     * @param objectName
+     * @throws IOException
+     */
+    public static void exportFeaturePointsToCSV(List<FeaturePoint> featurePointList, String objectName) throws IOException {
         File csvOutputFile = new File(String.format("%s_landmarks.csv", objectName));
         // CSV is a normal text file, need a writer
         try (BufferedWriter bw = new BufferedWriter(new FileWriter(csvOutputFile))) {
diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointCsvLoader.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointCsvLoader.java
index 7f51e7f3..32633708 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointCsvLoader.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointCsvLoader.java
@@ -11,8 +11,6 @@ import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.List;
-import java.util.logging.Level;
-import java.util.logging.Logger;
 import java.util.stream.Stream;
 
 /**
@@ -25,6 +23,14 @@ public class FeaturePointCsvLoader {
     private static final String COLUMN_DELIMETER = ",";
     private static final String CODE_PREFIX_DELIMETER = " ";
 
+    /**
+     * Loads feature points from file of csv format
+     * @param path
+     * @param fileName
+     * @return
+     * @throws FileNotFoundException
+     * @throws IOException 
+     */
     public static List<FeaturePoint> loadFeaturePoints(String path, String fileName) throws FileNotFoundException, IOException {
         FileResourcesUtils app = new FileResourcesUtils();
         try (InputStreamReader streamReader
diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointExportService.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointExportService.java
index 2a20c438..4caf625d 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointExportService.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointExportService.java
@@ -8,40 +8,38 @@ import java.util.List;
 
 /**
  * Class used for exporting feature points from file
- 
- for more details @see cz.fidentis.analyst.feature.services.FeaturePointCsvExporter or @see cz.fidentis.analyst.feature.services.FeaturePointFpExporter
- * 
+ *
+ * for more details @see
+ * cz.fidentis.analyst.feature.services.FeaturePointCsvExporter or @see
+ * cz.fidentis.analyst.feature.services.FeaturePointFpExporter
+ *
  * @author Jakub Kolman
  */
 public class FeaturePointExportService {
 
     /**
      * Method calls either @see FeaturePointCsvExporter or @see
- FeaturePointFpExporter based on the format given as parameter
-     * 
+     * FeaturePointFpExporter based on the format given as parameter
+     *
      * @param featurePointList
      * @param objectName
      * @param format
      * @throws FileNotFoundException
-     * @throws IOException 
+     * @throws IOException
      */
     public void exportFeaturePoints(List<FeaturePoint> featurePointList, String objectName, String format) throws FileNotFoundException, IOException {
         switch (format) {
             case FeaturePointFileFormatTypes.FORMAT_TYPE_CSV:
-                FeaturePointCsvExporter csvExporter = new FeaturePointCsvExporter();
-                csvExporter.exportFeaturePointsToCSV(featurePointList, objectName);
+                FeaturePointCsvExporter.exportFeaturePointsToCSV(featurePointList, objectName);
                 break;
 
             case FeaturePointFileFormatTypes.FORMAT_TYPE_FP:
-                FeaturePointFpExporter fpExporter = new FeaturePointFpExporter();
-                fpExporter.exportFeaturePointsToFP(featurePointList, objectName);
+                FeaturePointFpExporter.exportFeaturePointsToFP(featurePointList, objectName);
                 break;
-                
+
             default:
                 break;
         }
     }
 
-
-
 }
diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointFpExporter.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointFpExporter.java
index 19e09556..2568dcda 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointFpExporter.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointFpExporter.java
@@ -17,6 +17,14 @@ import java.util.logging.Logger;
  */
 public class FeaturePointFpExporter {
     
+    /**
+     * Exports feature points to file format fp at default location
+     * 
+     * @param featurePointList
+     * @param objectName
+     * @throws FileNotFoundException
+     * @throws IOException 
+     */
         public static void exportFeaturePointsToFP(List<FeaturePoint> featurePointList, String objectName) throws FileNotFoundException, IOException {
         File csvOutputFile = new File(String.format("%s_landmarks.fp", objectName));
         // CSV is a normal text file, need a writer
diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointFpLoader.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointFpLoader.java
index 5d2c1e5d..992c2dde 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointFpLoader.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointFpLoader.java
@@ -11,7 +11,6 @@ import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
 import java.util.ArrayList;
 import java.util.List;
-import java.util.Optional;
 import java.util.stream.Stream;
 
 /**
diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointImportService.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointImportService.java
index 67b03800..2c6a8b39 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointImportService.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointImportService.java
@@ -1,8 +1,3 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
 package cz.fidentis.analyst.feature.services;
 
 import cz.fidentis.analyst.feature.FeaturePoint;
diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointTypesService.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointTypesService.java
index e83099d5..d4d641a2 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointTypesService.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/services/FeaturePointTypesService.java
@@ -2,8 +2,10 @@ package cz.fidentis.analyst.feature.services;
 
 import cz.fidentis.analyst.feature.FeaturePointType;
 import cz.fidentis.analyst.feature.utils.FileResourcesUtils;
-
-import java.io.*;
+import java.io.BufferedReader;
+import java.io.IOException;
+import java.io.InputStream;
+import java.io.InputStreamReader;
 import java.nio.charset.StandardCharsets;
 import java.util.Map;
 import java.util.Optional;
@@ -51,6 +53,7 @@ public class FeaturePointTypesService {
 
     /**
      * Creates map of feature point types
+     * @param featurePointTypes
      * @return Optional map of feature point types mapped by code
      */
     public Map<String, FeaturePointType> getFeaturepointTypesByCode(Map<Integer, FeaturePointType> featurePointTypes) {
diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/utils/FeaturePointFileFormatTypes.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/utils/FeaturePointFileFormatTypes.java
index bd2d5852..ed25c3ba 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/utils/FeaturePointFileFormatTypes.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/utils/FeaturePointFileFormatTypes.java
@@ -1,16 +1,12 @@
-/*
- * To change this license header, choose License Headers in Project Properties.
- * To change this template file, choose Tools | Templates
- * and open the template in the editor.
- */
 package cz.fidentis.analyst.feature.utils;
 
 /**
+ * Currently are available csv and fp formats. Rest can be added later.
  * 
  * @author Jakub Kolman
  */
 public class FeaturePointFileFormatTypes {
-    
+
     public static final String FORMAT_TYPE_OBJ = "OBJ";
     public static final String FORMAT_TYPE_STL = "STL";
     public static final String FORMAT_TYPE_PLY = "PLY";
@@ -22,9 +18,12 @@ public class FeaturePointFileFormatTypes {
     public static final String FORMAT_TYPE_PNG = "PNG";
     public static final String FORMAT_TYPE_FID = "FID";
     public static final String FORMAT_TYPE_NONE = "NONE";
-    
-    
-    enum formatType {
+
+    /**
+     * enum containing all possible file formats of feature points
+     * @author Jakub Kolman
+     */
+    enum FormatType {
         OBJ,
         STL,
         PLY,
diff --git a/MeshModel/src/main/java/cz/fidentis/analyst/feature/utils/FileResourcesUtils.java b/MeshModel/src/main/java/cz/fidentis/analyst/feature/utils/FileResourcesUtils.java
index 40f0fd76..cfb37847 100644
--- a/MeshModel/src/main/java/cz/fidentis/analyst/feature/utils/FileResourcesUtils.java
+++ b/MeshModel/src/main/java/cz/fidentis/analyst/feature/utils/FileResourcesUtils.java
@@ -7,10 +7,6 @@ import java.nio.charset.StandardCharsets;
 import java.nio.file.Files;
 import java.util.List;
 
-/**
- * 
- * @author Jakub Kolman
- */
 
 public class FileResourcesUtils {
 
diff --git a/MeshModel/test_file_landmarks.fp b/MeshModel/test_file_landmarks.fp
deleted file mode 100644
index e171202c..00000000
--- a/MeshModel/test_file_landmarks.fp
+++ /dev/null
@@ -1,170 +0,0 @@
-<!--Saved by software Fidentis Analyst--><facialPoints model="test_file">
-<facialPoint type="1">
-<x>-45.329800</x>
-<y>37.146600</y>
-<z>-40.541500</z>
-<facialPoint type="2">
-<x>44.303300</x>
-<y>36.255000</y>
-<z>-42.623000</z>
-<facialPoint type="3">
-<x>-18.513400</x>
-<y>33.233600</y>
-<z>-36.792100</z>
-<facialPoint type="4">
-<x>16.188000</x>
-<y>32.637900</y>
-<z>-37.219700</z>
-<facialPoint type="5">
-<x>-34.336300</x>
-<y>41.530600</y>
-<z>-33.656400</z>
-<facialPoint type="6">
-<x>33.828800</x>
-<y>39.563400</y>
-<z>-34.253100</z>
-<facialPoint type="7">
-<x>-34.413200</x>
-<y>31.901700</y>
-<z>-35.264200</z>
-<facialPoint type="8">
-<x>33.582700</x>
-<y>30.789000</y>
-<z>-36.755000</z>
-<facialPoint type="9">
-<x>0.129590</x>
-<y>51.885300</y>
-<z>-14.423500</z>
-<facialPoint type="10">
-<x>-0.035611</x>
-<y>-13.082700</y>
-<z>-16.998300</z>
-<facialPoint type="11">
-<x>-16.662300</x>
-<y>-4.058840</y>
-<z>-19.179800</z>
-<facialPoint type="12">
-<x>15.503800</x>
-<y>-4.973230</y>
-<z>-21.183600</z>
-<facialPoint type="13">
-<x>0.044336</x>
-<y>39.423600</y>
-<z>-19.185300</z>
-<facialPoint type="14">
-<x>-0.029147</x>
-<y>0.258132</y>
-<z>-0.140334</z>
-<facialPoint type="15">
-<x>-0.090110</x>
-<y>-29.103900</y>
-<z>-16.707600</z>
-<facialPoint type="16">
-<x>0.055705</x>
-<y>-35.751100</y>
-<z>-21.781900</z>
-<facialPoint type="17">
-<x>0.028509</x>
-<y>-44.879100</y>
-<z>-21.185200</z>
-<facialPoint type="18">
-<x>-28.153700</x>
-<y>-35.880200</y>
-<z>-32.267700</z>
-<facialPoint type="19">
-<x>24.470200</x>
-<y>-34.656400</y>
-<z>-34.317000</z>
-<facialPoint type="20">
-<x>-5.681640</x>
-<y>-26.782700</y>
-<z>-16.818400</z>
-<facialPoint type="21">
-<x>5.631710</x>
-<y>-26.317300</y>
-<z>-17.441300</z>
-<facialPoint type="22">
-<x>0.040378</x>
-<y>-52.287900</y>
-<z>-27.004100</z>
-<facialPoint type="23">
-<x>0.098163</x>
-<y>-80.282700</y>
-<z>-43.523300</z>
-<facialPoint type="24">
-<x>-57.080600</x>
-<y>-39.890600</y>
-<z>-118.469000</z>
-<facialPoint type="25">
-<x>50.448200</x>
-<y>-38.958000</y>
-<z>-118.260000</z>
-<facialPoint type="26">
-<x>-63.254000</x>
-<y>40.895100</y>
-<z>-53.951000</z>
-<facialPoint type="27">
-<x>59.710700</x>
-<y>38.768200</y>
-<z>-58.102400</z>
-<facialPoint type="28">
-<x>0.046802</x>
-<y>-61.437600</y>
-<z>-25.988100</z>
-<facialPoint type="29">
-<x>-78.370200</x>
-<y>26.048000</y>
-<z>-120.740000</z>
-<facialPoint type="30">
-<x>70.653400</x>
-<y>28.112500</y>
-<z>-122.519000</z>
-<facialPoint type="31">
-<x>-91.268900</x>
-<y>55.537700</y>
-<z>-137.688000</z>
-<facialPoint type="32">
-<x>87.563100</x>
-<y>56.411700</y>
-<z>-137.202000</z>
-<facialPoint type="33">
-<x>-75.636800</x>
-<y>-4.455820</y>
-<z>-120.828000</z>
-<facialPoint type="34">
-<x>70.477600</x>
-<y>-1.817100</y>
-<z>-120.704000</z>
-<facialPoint type="35">
-<x>-93.242100</x>
-<y>34.181200</y>
-<z>-155.155000</z>
-<facialPoint type="36">
-<x>90.044900</x>
-<y>35.834900</y>
-<z>-155.402000</z>
-<facialPoint type="37">
-<x>-82.709900</x>
-<y>46.637500</y>
-<z>-123.483000</z>
-<facialPoint type="38">
-<x>76.087000</x>
-<y>46.789100</y>
-<z>-123.211000</z>
-<facialPoint type="39">
-<x>-72.065100</x>
-<y>-5.472070</y>
-<z>-119.272000</z>
-<facialPoint type="40">
-<x>64.199200</x>
-<y>-3.958970</y>
-<z>-118.937000</z>
-<facialPoint type="41">
-<x>-83.352100</x>
-<y>40.131400</y>
-<z>-121.805000</z>
-<facialPoint type="42">
-<x>75.374700</x>
-<y>40.026300</y>
-<z>-121.781000</z>
-</facialPoints>
\ No newline at end of file
-- 
GitLab