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 013a3d7a4228e6b250be0a41a5a293a488ef60b3..f53383ca720f69230383a741d4fafd5d0cf33e80 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 e37fc061e49ca068f150aa9127b1e8afd6f60892..81ab67abf90d89509a8b8461f4b5bef81e6188b4 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 b344b4600405af40a89fa2466f9a3ae2461227e2..d15fa3dea531e09ee6a2ccc25e5cdb7186267b28 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 7f51e7f3810f4ae88e6fecb94ac73d5705cb935a..326337084372cca5706c7ebf31f79fd908ec73eb 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 2a20c43842cfa4f90e040e442d3a6fae11017d5a..4caf625d30249dcb915c603f470e6b76c4e9ecd8 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 19e0955610fc5ef3010a94834d14a241d21afde0..2568dcda80ad02e1e8c957e8df93378acb4883f2 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 5d2c1e5d98a44449340c499270e13933b44bd5f6..992c2dde5be19a94af40aec2a93e7b59e6a22b5f 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 67b03800913c8b9f8dc188f20afb07f151f75083..2c6a8b398fc5584cc5afd23536c55cc06b6c77f9 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 e83099d5ab0397a734e7fd68d5dc20ca94b6fa53..d4d641a20e7e95a92a6701b176527ac459a1c468 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 bd2d585257ff7c417ecea80dbc918bd7220e96dc..ed25c3bacbc02d7221587c9941ebfa8c59274c4d 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 40f0fd768f4fa74812cf452120b699b2062fcb2f..cfb3784776e314de7a288e425d123ce7bc80899a 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 e171202c2c7f693766c122e41f2b7efdb71187f7..0000000000000000000000000000000000000000 --- 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