diff --git a/.gitignore b/.gitignore index e2118b8405706926a84fd70dad15e1692dd64e03..91b0b71fa2c3a1fb9f915c0a4322ce9a7e92302f 100644 --- a/.gitignore +++ b/.gitignore @@ -17,4 +17,3 @@ bin/ tmp/ .settings/ -/MeshModel/nbproject/ diff --git a/MeshModel/nbproject/project.properties b/MeshModel/nbproject/project.properties deleted file mode 100644 index e69de29bb2d1d6434b8b29ae775ad8c2e48c5391..0000000000000000000000000000000000000000 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 bf418c5ec64fa4ff4e4b55623a6dc910dd3a23a7..f24d6935da1f8bca80b4d07029edffe56c1a93aa 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 @@ -2,12 +2,14 @@ package cz.fidentis.analyst.feature.provider; import cz.fidentis.analyst.feature.FeaturePointType; import cz.fidentis.analyst.feature.services.FeaturePointTypesService; + +import java.util.Collections; import java.util.HashMap; import java.util.Map; /** * Feature point type provider class - * + * * @author Jakub Kolman */ public final class FeaturePointTypeProvider { @@ -17,16 +19,15 @@ public final class FeaturePointTypeProvider { /** * provide thread safe singleton + * * @author Jakub Kolman */ private static class InstanceHolder { - public static final FeaturePointTypeProvider INSTANCE = new FeaturePointTypeProvider(); - } /** - * + * */ private FeaturePointTypeProvider() { FeaturePointTypesService service = new FeaturePointTypesService(); @@ -45,24 +46,27 @@ public final class FeaturePointTypeProvider { /** * get feature points types by id - * @return + * + * @return */ public Map<Integer, FeaturePointType> getFeaturePointTypesById() { - return featurePointTypesById; + return Collections.unmodifiableMap(featurePointTypesById); } /** * sorted feature point types by code - * @return + * + * @return */ public Map<String, FeaturePointType> getFeaturePointTypesByCode() { - return featurePointTypesByCode; + return Collections.unmodifiableMap(featurePointTypesByCode); } /** * get single feature point type by its code + * * @param code - * @return + * @return */ public FeaturePointType getFeaturePointTypeByCode(String code) { return getFeaturePointTypesByCode().get(code); @@ -70,8 +74,9 @@ public final class FeaturePointTypeProvider { /** * get single feature point type by its id + * * @param id - * @return + * @return */ public FeaturePointType getFeaturePointTypeById(int id) { return getFeaturePointTypesById().get(id); diff --git a/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointExportServiceTest.java b/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointExportServiceTest.java index b3d80a890bec8977b189debe735047fc06ea4239..96e7b333c00375c66b8e0e5bd618fe89bbf11466 100644 --- a/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointExportServiceTest.java +++ b/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointExportServiceTest.java @@ -7,15 +7,16 @@ package cz.fidentis.analyst.feature.services; import cz.fidentis.analyst.feature.FeaturePoint; import cz.fidentis.analyst.feature.services.FeaturePointCsvLoader; + import java.io.IOException; import java.nio.file.Path; import java.nio.file.Paths; import java.util.List; + import org.junit.jupiter.api.Test; import org.junit.jupiter.api.DisplayName; /** - * * @author Jakub Kolman */ public class FeaturePointExportServiceTest { @@ -28,7 +29,7 @@ public class FeaturePointExportServiceTest { void exportFeaturePointsCSVTest() throws IOException { FeaturePointExportService service = new FeaturePointExportService(); List<FeaturePoint> featurePoints = loadFeaturePoints(); - service.exportFeaturePoints(featurePoints, "test_file_csv", "CSV"); + service.exportFeaturePoints(featurePoints, MODEL_TEST_FILE_DIRECTORY.toString() + "test_file_csv", "CSV"); } @DisplayName("Test writing a FP file") @@ -36,7 +37,7 @@ public class FeaturePointExportServiceTest { void exportFeaturePointsFPTest() throws IOException { FeaturePointExportService service = new FeaturePointExportService(); List<FeaturePoint> featurePoints = loadFeaturePoints(); - service.exportFeaturePoints(featurePoints, "test_file_fp", "FP"); + service.exportFeaturePoints(featurePoints, MODEL_TEST_FILE_DIRECTORY.toString() + "test_file_fp", "FP"); } private List<FeaturePoint> loadFeaturePoints() throws IOException { diff --git a/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointTypeTypesServiceTest.java b/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointTypeTypesServiceTest.java index cada9ca4cbd0f840752f3e0fd5c615173ce0c9e3..04ab3761c5080c44f14b35b079f0bb3f27beedf8 100644 --- a/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointTypeTypesServiceTest.java +++ b/MeshModel/src/test/java/cz/fidentis/analyst/feature/services/FeaturePointTypeTypesServiceTest.java @@ -25,4 +25,8 @@ class FeaturePointTypeTypesServiceTest { && featurePointTypes.get().get(1).getCode().equals("EX_R")); } + void aTest() { + FeaturePointTypesService service = new FeaturePointTypesService(); + } + } \ No newline at end of file diff --git a/MeshModel/test_file_csv_landmarks.csv b/MeshModel/test_file_csv_landmarks.csv deleted file mode 100644 index c818665137ad06fcfb8038a8e7d02c70f3218b95..0000000000000000000000000000000000000000 --- a/MeshModel/test_file_csv_landmarks.csv +++ /dev/null @@ -1,2 +0,0 @@ -Scan name,EX_R x,EX_R y,EX_R z,EX_L x,EX_L y,EX_L z,EN_R x,EN_R y,EN_R z,EN_L x,EN_L y,EN_L z,PAS_R x,PAS_R y,PAS_R z,PAS_L x,PAS_L y,PAS_L z,PAI_R x,PAI_R y,PAI_R z,PAI_L x,PAI_L y,PAI_L z,G x,G y,G z,SN x,SN y,SN z,AL_R x,AL_R y,AL_R z,AL_L x,AL_L y,AL_L z,N x,N y,N z,PRN x,PRN y,PRN z,LS x,LS y,LS z,STO x,STO y,STO z,LI x,LI y,LI z,CH_R x,CH_R y,CH_R z,CH_L x,CH_L y,CH_L z,CP_R x,CP_R y,CP_R z,CP_L x,CP_L y,CP_L z,SL x,SL y,SL z,GN x,GN y,GN z,GOL_R x,GOL_R y,GOL_R z,GOL_L x,GOL_L y,GOL_L z,ZY_R x,ZY_R y,ZY_R z,ZY_L x,ZY_L y,ZY_L z,PG x,PG y,PG z,T_R x,T_R y,T_R z,T_L x,T_L y,T_L z,SA_R x,SA_R y,SA_R z,SA_L x,SA_L y,SA_L z,SBA_R x,SBA_R y,SBA_R z,SBA_L x,SBA_L y,SBA_L z,PA_R x,PA_R y,PA_R z,PA_L x,PA_L y,PA_L z,OBS_R x,OBS_R y,OBS_R z,OBS_L x,OBS_L y,OBS_L z,OBI_R x,OBI_R y,OBI_R z,OBI_L x,OBI_L y,OBI_L z,PRA_R x,PRA_R y,PRA_R z,PRA_L x,PRA_L y,PRA_L z -test_file_csv,-45.3298,37.1466,-40.5415,44.3033,36.255,-42.623,-18.5134,33.2336,-36.7921,16.188,32.6379,-37.2197,-34.3363,41.5306,-33.6564,33.8288,39.5634,-34.2531,-34.4132,31.9017,-35.2642,33.5827,30.789,-36.755,0.12959,51.8853,-14.4235,-0.0356107,-13.0827,-16.9983,-16.6623,-4.05884,-19.1798,15.5038,-4.97323,-21.1836,0.044336,39.4236,-19.1853,-0.0291473,0.258132,-0.140334,-0.0901103,-29.1039,-16.7076,0.055705,-35.7511,-21.7819,0.0285089,-44.8791,-21.1852,-28.1537,-35.8802,-32.2677,24.4702,-34.6564,-34.317,-5.68164,-26.7827,-16.8184,5.63171,-26.3173,-17.4413,0.0403775,-52.2879,-27.0041,0.0981629,-80.2827,-43.5233,-57.0806,-39.8906,-118.469,50.4482,-38.958,-118.26,-63.254,40.8951,-53.951,59.7107,38.7682,-58.1024,0.0468024,-61.4376,-25.9881,-78.3702,26.048,-120.74,70.6534,28.1125,-122.519,-91.2689,55.5377,-137.688,87.5631,56.4117,-137.202,-75.6368,-4.45582,-120.828,70.4776,-1.8171,-120.704,-93.2421,34.1812,-155.155,90.0449,35.8349,-155.402,-82.7099,46.6375,-123.483,76.087,46.7891,-123.211,-72.0651,-5.47207,-119.272,64.1992,-3.95897,-118.937,-83.3521,40.1314,-121.805,75.3747,40.0263,-121.781 \ No newline at end of file diff --git a/MeshModel/test_file_fp_landmarks.fp b/MeshModel/test_file_fp_landmarks.fp deleted file mode 100644 index 13e775a3e5c1c38e6348d9fc5d10e575de13dfb7..0000000000000000000000000000000000000000 --- a/MeshModel/test_file_fp_landmarks.fp +++ /dev/null @@ -1,170 +0,0 @@ -<!--Saved by software Fidentis Analyst--><facialPoints model="test_file_fp"> -<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