diff --git a/.DS_Store b/.DS_Store deleted file mode 100644 index 00e0360..0000000 Binary files a/.DS_Store and /dev/null differ diff --git a/.classpath b/GAMA Plugin/.classpath similarity index 100% rename from .classpath rename to GAMA Plugin/.classpath diff --git a/.gitignore b/GAMA Plugin/.gitignore similarity index 71% rename from .gitignore rename to GAMA Plugin/.gitignore index 0e6c3d5..38ca3a8 100644 --- a/.gitignore +++ b/GAMA Plugin/.gitignore @@ -9,6 +9,12 @@ logs.zip .DS_Store /*/gaml/ +# MacOS metadata +.DS_Store +._.DS_Store +**/.DS_Store +**/._.DS_Store + src-gen/ xtend-gen/ diff --git a/.project b/GAMA Plugin/.project similarity index 100% rename from .project rename to GAMA Plugin/.project diff --git a/LICENSE b/GAMA Plugin/LICENSE similarity index 100% rename from LICENSE rename to GAMA Plugin/LICENSE diff --git a/README.md b/GAMA Plugin/README.md similarity index 100% rename from README.md rename to GAMA Plugin/README.md diff --git a/eu.project-simple.parent/increment_versions.ant b/GAMA Plugin/eu.project-simple.parent/increment_versions.ant similarity index 100% rename from eu.project-simple.parent/increment_versions.ant rename to GAMA Plugin/eu.project-simple.parent/increment_versions.ant diff --git a/eu.project-simple.parent/launches/eu.project-simple.parent (Copy Repository).launch b/GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Copy Repository).launch similarity index 100% rename from eu.project-simple.parent/launches/eu.project-simple.parent (Copy Repository).launch rename to GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Copy Repository).launch diff --git a/eu.project-simple.parent/launches/eu.project-simple.parent (Deploy).launch b/GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Deploy).launch similarity index 100% rename from eu.project-simple.parent/launches/eu.project-simple.parent (Deploy).launch rename to GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Deploy).launch diff --git a/eu.project-simple.parent/launches/eu.project-simple.parent (Git Add).launch b/GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Git Add).launch similarity index 100% rename from eu.project-simple.parent/launches/eu.project-simple.parent (Git Add).launch rename to GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Git Add).launch diff --git a/eu.project-simple.parent/launches/eu.project-simple.parent (Git Clone).launch b/GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Git Clone).launch similarity index 100% rename from eu.project-simple.parent/launches/eu.project-simple.parent (Git Clone).launch rename to GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Git Clone).launch diff --git a/eu.project-simple.parent/launches/eu.project-simple.parent (Git Commit).launch b/GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Git Commit).launch similarity index 100% rename from eu.project-simple.parent/launches/eu.project-simple.parent (Git Commit).launch rename to GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Git Commit).launch diff --git a/eu.project-simple.parent/launches/eu.project-simple.parent (Package).launch b/GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Package).launch similarity index 100% rename from eu.project-simple.parent/launches/eu.project-simple.parent (Package).launch rename to GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Package).launch diff --git a/eu.project-simple.parent/launches/eu.project-simple.parent (Verify).launch b/GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Verify).launch similarity index 100% rename from eu.project-simple.parent/launches/eu.project-simple.parent (Verify).launch rename to GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (Verify).launch diff --git a/eu.project-simple.parent/launches/eu.project-simple.parent (update versions).launch b/GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (update versions).launch similarity index 100% rename from eu.project-simple.parent/launches/eu.project-simple.parent (update versions).launch rename to GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent (update versions).launch diff --git a/eu.project-simple.parent/launches/eu.project-simple.parent.launch b/GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent.launch similarity index 100% rename from eu.project-simple.parent/launches/eu.project-simple.parent.launch rename to GAMA Plugin/eu.project-simple.parent/launches/eu.project-simple.parent.launch diff --git a/eu.project-simple.parent/pom.xml b/GAMA Plugin/eu.project-simple.parent/pom.xml similarity index 100% rename from eu.project-simple.parent/pom.xml rename to GAMA Plugin/eu.project-simple.parent/pom.xml diff --git a/eu.project-simple.parent/release.properties b/GAMA Plugin/eu.project-simple.parent/release.properties similarity index 100% rename from eu.project-simple.parent/release.properties rename to GAMA Plugin/eu.project-simple.parent/release.properties diff --git a/eu.project-simple.site/NOTES b/GAMA Plugin/eu.project-simple.site/NOTES similarity index 100% rename from eu.project-simple.site/NOTES rename to GAMA Plugin/eu.project-simple.site/NOTES diff --git a/eu.project-simple.site/category.xml b/GAMA Plugin/eu.project-simple.site/category.xml similarity index 100% rename from eu.project-simple.site/category.xml rename to GAMA Plugin/eu.project-simple.site/category.xml diff --git a/eu.project-simple.site/packaging-p2composite.ant b/GAMA Plugin/eu.project-simple.site/packaging-p2composite.ant similarity index 100% rename from eu.project-simple.site/packaging-p2composite.ant rename to GAMA Plugin/eu.project-simple.site/packaging-p2composite.ant diff --git a/eu.project-simple.site/pom.xml b/GAMA Plugin/eu.project-simple.site/pom.xml similarity index 100% rename from eu.project-simple.site/pom.xml rename to GAMA Plugin/eu.project-simple.site/pom.xml diff --git a/gaml.extension.unity/.classpath b/GAMA Plugin/gaml.extension.unity/.classpath similarity index 100% rename from gaml.extension.unity/.classpath rename to GAMA Plugin/gaml.extension.unity/.classpath diff --git a/gaml.extension.unity/.factorypath b/GAMA Plugin/gaml.extension.unity/.factorypath similarity index 100% rename from gaml.extension.unity/.factorypath rename to GAMA Plugin/gaml.extension.unity/.factorypath diff --git a/gaml.extension.unity/.gitignore b/GAMA Plugin/gaml.extension.unity/.gitignore similarity index 100% rename from gaml.extension.unity/.gitignore rename to GAMA Plugin/gaml.extension.unity/.gitignore diff --git a/gaml.extension.unity/.project b/GAMA Plugin/gaml.extension.unity/.project similarity index 100% rename from gaml.extension.unity/.project rename to GAMA Plugin/gaml.extension.unity/.project diff --git a/gaml.extension.unity/.settings/org.eclipse.core.resources.prefs b/GAMA Plugin/gaml.extension.unity/.settings/org.eclipse.core.resources.prefs similarity index 100% rename from gaml.extension.unity/.settings/org.eclipse.core.resources.prefs rename to GAMA Plugin/gaml.extension.unity/.settings/org.eclipse.core.resources.prefs diff --git a/gaml.extension.unity/.settings/org.eclipse.jdt.apt.core.prefs b/GAMA Plugin/gaml.extension.unity/.settings/org.eclipse.jdt.apt.core.prefs similarity index 100% rename from gaml.extension.unity/.settings/org.eclipse.jdt.apt.core.prefs rename to GAMA Plugin/gaml.extension.unity/.settings/org.eclipse.jdt.apt.core.prefs diff --git a/gaml.extension.unity/.settings/org.eclipse.jdt.core.prefs b/GAMA Plugin/gaml.extension.unity/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from gaml.extension.unity/.settings/org.eclipse.jdt.core.prefs rename to GAMA Plugin/gaml.extension.unity/.settings/org.eclipse.jdt.core.prefs diff --git a/gaml.extension.unity/META-INF/MANIFEST.MF b/GAMA Plugin/gaml.extension.unity/META-INF/MANIFEST.MF similarity index 100% rename from gaml.extension.unity/META-INF/MANIFEST.MF rename to GAMA Plugin/gaml.extension.unity/META-INF/MANIFEST.MF diff --git a/gaml.extension.unity/build.properties b/GAMA Plugin/gaml.extension.unity/build.properties similarity index 100% rename from gaml.extension.unity/build.properties rename to GAMA Plugin/gaml.extension.unity/build.properties diff --git a/gaml.extension.unity/models/LinkToUnity/.project b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/.project similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/.project rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/.project diff --git a/gaml.extension.unity/models/LinkToUnity/.settings/org.eclipse.core.resources.prefs b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/.settings/org.eclipse.core.resources.prefs similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/.settings/org.eclipse.core.resources.prefs rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/.settings/org.eclipse.core.resources.prefs diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Limit Player Movement.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Limit Player Movement.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Limit Player Movement.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Limit Player Movement.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Mutli player game.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Mutli player game.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Mutli player game.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Mutli player game.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send DEM.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send DEM.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send DEM.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send DEM.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Dynamic data.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Dynamic data.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Dynamic data.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Dynamic data.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Receive Messages.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Receive Messages.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Receive Messages.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Receive Messages.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Static data.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Static data.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Static data.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Static data.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Water data.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Water data.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Water data.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/Send Water data.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/User Interaction.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/User Interaction.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Code Examples/User Interaction.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Code Examples/User Interaction.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Demo/Multi Player Game/Race.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Demo/Multi Player Game/Race.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Demo/Multi Player Game/Race.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Demo/Multi Player Game/Race.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Demo/Multi Player Game/RaceVR.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Demo/Multi Player Game/RaceVR.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Demo/Multi Player Game/RaceVR.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Demo/Multi Player Game/RaceVR.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Demo/Simple Player Game/DemoModel.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Demo/Simple Player Game/DemoModel.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Demo/Simple Player Game/DemoModel.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Demo/Simple Player Game/DemoModel.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Demo/Simple Player Game/DemoModelVR.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Demo/Simple Player Game/DemoModelVR.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Demo/Simple Player Game/DemoModelVR.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Demo/Simple Player Game/DemoModelVR.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Utilities/ImportGemetriesFromUnity.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Utilities/ImportGemetriesFromUnity.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Utilities/ImportGemetriesFromUnity.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Utilities/ImportGemetriesFromUnity.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/Models/Utilities/SentGemetriesToUnity.gaml b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Utilities/SentGemetriesToUnity.gaml similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/Models/Utilities/SentGemetriesToUnity.gaml rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/Models/Utilities/SentGemetriesToUnity.gaml diff --git a/gaml.extension.unity/models/LinkToUnity/images/headset.png b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/images/headset.png similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/images/headset.png rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/images/headset.png diff --git a/gaml.extension.unity/models/LinkToUnity/includes/altitude_water_level.asc b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/altitude_water_level.asc similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/altitude_water_level.asc rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/altitude_water_level.asc diff --git a/gaml.extension.unity/models/LinkToUnity/includes/altitude_water_level.prj b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/altitude_water_level.prj similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/altitude_water_level.prj rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/altitude_water_level.prj diff --git a/gaml.extension.unity/models/LinkToUnity/includes/bounds.dbf b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/bounds.dbf similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/bounds.dbf rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/bounds.dbf diff --git a/gaml.extension.unity/models/LinkToUnity/includes/bounds.prj b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/bounds.prj similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/bounds.prj rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/bounds.prj diff --git a/gaml.extension.unity/models/LinkToUnity/includes/bounds.shp b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/bounds.shp similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/bounds.shp rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/bounds.shp diff --git a/gaml.extension.unity/models/LinkToUnity/includes/bounds.shx b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/bounds.shx similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/bounds.shx rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/bounds.shx diff --git a/gaml.extension.unity/models/LinkToUnity/includes/building.dbf b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/building.dbf similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/building.dbf rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/building.dbf diff --git a/gaml.extension.unity/models/LinkToUnity/includes/building.prj b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/building.prj similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/building.prj rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/building.prj diff --git a/gaml.extension.unity/models/LinkToUnity/includes/building.shp b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/building.shp similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/building.shp rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/building.shp diff --git a/gaml.extension.unity/models/LinkToUnity/includes/building.shx b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/building.shx similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/building.shx rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/building.shx diff --git a/gaml.extension.unity/models/LinkToUnity/includes/buildings.dbf b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.dbf similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/buildings.dbf rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.dbf diff --git a/gaml.extension.unity/models/LinkToUnity/includes/buildings.fix b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.fix similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/buildings.fix rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.fix diff --git a/gaml.extension.unity/models/LinkToUnity/includes/buildings.prj b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.prj similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/buildings.prj rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.prj diff --git a/gaml.extension.unity/models/LinkToUnity/includes/buildings.qix b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.qix similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/buildings.qix rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.qix diff --git a/gaml.extension.unity/models/LinkToUnity/includes/buildings.shp b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.shp similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/buildings.shp rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.shp diff --git a/gaml.extension.unity/models/LinkToUnity/includes/buildings.shx b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.shx similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/buildings.shx rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/buildings.shx diff --git a/gaml.extension.unity/models/LinkToUnity/includes/dem.asc b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem.asc similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/dem.asc rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem.asc diff --git a/gaml.extension.unity/models/LinkToUnity/includes/dem.prj b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem.prj similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/dem.prj rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem.prj diff --git a/gaml.extension.unity/models/LinkToUnity/includes/dem_altitude.asc b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_altitude.asc similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/dem_altitude.asc rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_altitude.asc diff --git a/gaml.extension.unity/models/LinkToUnity/includes/dem_altitude.prj b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_altitude.prj similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/dem_altitude.prj rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_altitude.prj diff --git a/gaml.extension.unity/models/LinkToUnity/includes/dem_river.asc b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_river.asc similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/dem_river.asc rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_river.asc diff --git a/gaml.extension.unity/models/LinkToUnity/includes/dem_river.prj b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_river.prj similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/dem_river.prj rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_river.prj diff --git a/gaml.extension.unity/models/LinkToUnity/includes/dem_water_level.asc b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_water_level.asc similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/dem_water_level.asc rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_water_level.asc diff --git a/gaml.extension.unity/models/LinkToUnity/includes/dem_water_level.prj b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_water_level.prj similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/dem_water_level.prj rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/dem_water_level.prj diff --git a/gaml.extension.unity/models/LinkToUnity/includes/road.dbf b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/road.dbf similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/road.dbf rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/road.dbf diff --git a/gaml.extension.unity/models/LinkToUnity/includes/road.prj b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/road.prj similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/road.prj rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/road.prj diff --git a/gaml.extension.unity/models/LinkToUnity/includes/road.shp b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/road.shp similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/road.shp rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/road.shp diff --git a/gaml.extension.unity/models/LinkToUnity/includes/road.shx b/GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/road.shx similarity index 100% rename from gaml.extension.unity/models/LinkToUnity/includes/road.shx rename to GAMA Plugin/gaml.extension.unity/models/LinkToUnity/includes/road.shx diff --git a/gaml.extension.unity/plugin.xml b/GAMA Plugin/gaml.extension.unity/plugin.xml similarity index 100% rename from gaml.extension.unity/plugin.xml rename to GAMA Plugin/gaml.extension.unity/plugin.xml diff --git a/gaml.extension.unity/pom.xml b/GAMA Plugin/gaml.extension.unity/pom.xml similarity index 100% rename from gaml.extension.unity/pom.xml rename to GAMA Plugin/gaml.extension.unity/pom.xml diff --git a/gaml.feature.unity/.classpath b/GAMA Plugin/gaml.feature.unity/.classpath similarity index 100% rename from gaml.feature.unity/.classpath rename to GAMA Plugin/gaml.feature.unity/.classpath diff --git a/gaml.feature.unity/.project b/GAMA Plugin/gaml.feature.unity/.project similarity index 100% rename from gaml.feature.unity/.project rename to GAMA Plugin/gaml.feature.unity/.project diff --git a/gaml.feature.unity/.settings/org.eclipse.jdt.core.prefs b/GAMA Plugin/gaml.feature.unity/.settings/org.eclipse.jdt.core.prefs similarity index 100% rename from gaml.feature.unity/.settings/org.eclipse.jdt.core.prefs rename to GAMA Plugin/gaml.feature.unity/.settings/org.eclipse.jdt.core.prefs diff --git a/gaml.feature.unity/.settings/org.eclipse.m2e.core.prefs b/GAMA Plugin/gaml.feature.unity/.settings/org.eclipse.m2e.core.prefs similarity index 100% rename from gaml.feature.unity/.settings/org.eclipse.m2e.core.prefs rename to GAMA Plugin/gaml.feature.unity/.settings/org.eclipse.m2e.core.prefs diff --git a/gaml.feature.unity/build.properties b/GAMA Plugin/gaml.feature.unity/build.properties similarity index 100% rename from gaml.feature.unity/build.properties rename to GAMA Plugin/gaml.feature.unity/build.properties diff --git a/gaml.feature.unity/feature.xml b/GAMA Plugin/gaml.feature.unity/feature.xml similarity index 100% rename from gaml.feature.unity/feature.xml rename to GAMA Plugin/gaml.feature.unity/feature.xml diff --git a/gaml.feature.unity/pom.xml b/GAMA Plugin/gaml.feature.unity/pom.xml similarity index 100% rename from gaml.feature.unity/pom.xml rename to GAMA Plugin/gaml.feature.unity/pom.xml diff --git a/images/Fullscreen to false.png b/GAMA Plugin/images/Fullscreen to false.png similarity index 100% rename from images/Fullscreen to false.png rename to GAMA Plugin/images/Fullscreen to false.png diff --git a/images/InstallPlugin.png b/GAMA Plugin/images/InstallPlugin.png similarity index 100% rename from images/InstallPlugin.png rename to GAMA Plugin/images/InstallPlugin.png diff --git a/images/MenuVR.png b/GAMA Plugin/images/MenuVR.png similarity index 100% rename from images/MenuVR.png rename to GAMA Plugin/images/MenuVR.png diff --git a/images/ModelCreated.png b/GAMA Plugin/images/ModelCreated.png similarity index 100% rename from images/ModelCreated.png rename to GAMA Plugin/images/ModelCreated.png diff --git a/images/Plugin.png b/GAMA Plugin/images/Plugin.png similarity index 100% rename from images/Plugin.png rename to GAMA Plugin/images/Plugin.png diff --git a/images/WizardTutorialBuildingUP.png b/GAMA Plugin/images/WizardTutorialBuildingUP.png similarity index 100% rename from images/WizardTutorialBuildingUP.png rename to GAMA Plugin/images/WizardTutorialBuildingUP.png diff --git a/images/WizardTutorialDisplay.png b/GAMA Plugin/images/WizardTutorialDisplay.png similarity index 100% rename from images/WizardTutorialDisplay.png rename to GAMA Plugin/images/WizardTutorialDisplay.png diff --git a/images/WizardTutorialExperiment.png b/GAMA Plugin/images/WizardTutorialExperiment.png similarity index 100% rename from images/WizardTutorialExperiment.png rename to GAMA Plugin/images/WizardTutorialExperiment.png diff --git a/images/WizardTutorialGeomToSend.png b/GAMA Plugin/images/WizardTutorialGeomToSend.png similarity index 100% rename from images/WizardTutorialGeomToSend.png rename to GAMA Plugin/images/WizardTutorialGeomToSend.png diff --git a/images/WizardTutorialPeopleUP.png b/GAMA Plugin/images/WizardTutorialPeopleUP.png similarity index 100% rename from images/WizardTutorialPeopleUP.png rename to GAMA Plugin/images/WizardTutorialPeopleUP.png diff --git a/images/WizardTutorialPlayer.png b/GAMA Plugin/images/WizardTutorialPlayer.png similarity index 100% rename from images/WizardTutorialPlayer.png rename to GAMA Plugin/images/WizardTutorialPlayer.png diff --git a/images/WizardTutorialRoadUP.png b/GAMA Plugin/images/WizardTutorialRoadUP.png similarity index 100% rename from images/WizardTutorialRoadUP.png rename to GAMA Plugin/images/WizardTutorialRoadUP.png diff --git a/gaml.extension.unity/src/gaml/extension/unity/commands/GenerateVrModelHandler.java b/gaml.extension.unity/src/gaml/extension/unity/commands/GenerateVrModelHandler.java deleted file mode 100644 index 750df75..0000000 --- a/gaml.extension.unity/src/gaml/extension/unity/commands/GenerateVrModelHandler.java +++ /dev/null @@ -1,65 +0,0 @@ -/******************************************************************************************************* - * - * GenerateVrModelHandler.java, in gaml.extension.unity, is part of the source code of the GAMA modeling and simulation - * platform (v.1.9.3). - * - * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) - * - * Visit https://github.com/gama-platform/gama for license information and contacts. - * - ********************************************************************************************************/ -package gaml.extension.unity.commands; - -import java.io.File; - -import org.eclipse.core.commands.AbstractHandler; -import org.eclipse.core.commands.ExecutionEvent; -import org.eclipse.core.commands.ExecutionException; -import org.eclipse.jface.wizard.WizardDialog; -import org.eclipse.swt.widgets.Shell; -import org.eclipse.ui.PlatformUI; - -import gama.core.kernel.model.IModel; -import gama.ui.shared.utils.WorkbenchHelper; -import gaml.compiler.gaml.validation.GamlModelBuilder; -import gaml.compiler.ui.editor.GamlEditor; -import gaml.extension.unity.commands.wizard.ModelToVRWizard; - -/** - * The Class GenerateVrModelHandler. - */ -public class GenerateVrModelHandler extends AbstractHandler { - - @Override - public Object execute(final ExecutionEvent event) throws ExecutionException { - final GamlEditor editor = - (GamlEditor) PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage().getActiveEditor(); - - final IModel model = editor.getDocument() - .readOnly(state -> GamlModelBuilder.getDefaultInstance().compile(state.getURI(), null)); - if (model == null) return null; - File m = new File(model.getFilePath()); - final File file = new File(model.getFilePath().replace(".gaml", "-VR.gaml")); - String path = m.getName(); - createVRModel(path, model, file); - return null; - } - - /** - * Creates the VR model. - * - * @param path - * the path - * @param model - * the model - * @param file - * the file - */ - protected void createVRModel(final String path, final IModel model, final File file) { - Shell shell = WorkbenchHelper.getShell(); - ModelToVRWizard wizard = new ModelToVRWizard(path, model, file); - WizardDialog dialog = new WizardDialog(shell, wizard); - - dialog.open(); - } -} \ No newline at end of file diff --git a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/ModelToVRWizard.java b/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/ModelToVRWizard.java deleted file mode 100644 index 8efd4db..0000000 --- a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/ModelToVRWizard.java +++ /dev/null @@ -1,114 +0,0 @@ -/******************************************************************************************************* - * - * ModelToVRWizard.java, in gaml.extension.unity, is part of the source code of the GAMA modeling and simulation - * platform (v.1.9.3). - * - * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) - * - * Visit https://github.com/gama-platform/gama for license information and contacts. - * - ********************************************************************************************************/ -package gaml.extension.unity.commands.wizard; - -import java.io.File; -import java.io.FileWriter; -import java.io.IOException; - -import org.eclipse.jface.wizard.IWizardPage; -import org.eclipse.jface.wizard.Wizard; - -import gama.core.kernel.model.IModel; - -/** - * The Class ModelToVRWizard. - */ -public class ModelToVRWizard extends Wizard { - - /** The model. */ - IModel model; - - /** The generator. */ - VRModelGenerator generator; - - /** The file. */ - File file; - - /** The path. */ - String path; - - /** The final page. */ - IWizardPage finalPage; - - /** - * Instantiates a new model to VR wizard. - * - * @param path - * the path - * @param model - * the model - * @param file - * the file - */ - public ModelToVRWizard(final String path, final IModel model, final File file) { - generator = new VRModelGenerator(); - setWindowTitle("VR Experiment generation"); - // setNeedsProgressMonitor(true); - this.model = model; - this.file = file; - this.path = path; - - } - - @Override - public void addPages() { - - WizardPageGeneralInformation wizI = new WizardPageGeneralInformation(path, model, generator); - addPage(wizI); - WizardPageDisplay wizD = new WizardPageDisplay(model, generator); - wizI.setwDisplay(wizD); - addPage(wizD); - WizardPageProperties wpp = new WizardPageProperties(model, generator); - addPage(wpp); - WizardPageSpeciesToSend wpSTS = new WizardPageSpeciesToSend(model, generator); - wpp.setWpStS(wpSTS); - addPage(wpSTS); - - //addPage(new WizardPageAgentsToSend(model, generator)); - //addPage(new WizardPageGeometries(model, generator)); - finalPage = new WizardPagePlayer(model, generator); - wpp.setPlayerPage((WizardPagePlayer) finalPage); - - addPage(finalPage); - getShell().setSize(820, 650); - } - - @Override - public boolean canFinish() { - if (getContainer().getCurrentPage() == finalPage) return true; - return false; - } - - @Override - public boolean performFinish() { - String modelVRStr = generator.BuildVRModel(); - - try { - FileWriter fw = new FileWriter(file); - - fw.write(modelVRStr); - fw.close(); - /* - * IFileStore fileStore = EFS.getLocalFileSystem().getStore(file.toURI()); IWorkbenchPage page = - * PlatformUI.getWorkbench().getActiveWorkbenchWindow().getActivePage(); try { IDE.openEditorOnFileStore( - * page, fileStore ); } catch ( PartInitException e ) { e.printStackTrace(); - * System.out.println("An Error occured while loading the file."); } - */ - - } catch (IOException e) { - e.printStackTrace(); - } - - return true; - } - -} diff --git a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/VRModelGenerator.java b/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/VRModelGenerator.java deleted file mode 100644 index 344f6e5..0000000 --- a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/VRModelGenerator.java +++ /dev/null @@ -1,604 +0,0 @@ -/******************************************************************************************************* - * - * VRModelGenerator.java, in gaml.extension.unity, is part of the source code of the GAMA modeling and simulation - * platform (v.1.9.3). - * - * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) - * - * Visit https://github.com/gama-platform/gama for license information and contacts. - * - ********************************************************************************************************/ -package gaml.extension.unity.commands.wizard; - -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - -import gama.core.metamodel.shape.GamaPoint; - -/** - * The Class VRModelGenerator. - */ -public class VRModelGenerator { - - /** The species to send. */ - private Map> speciesToSend ; - - private Map> speciesToSendStatic ; - - private Map> speciesToSendDynamic ; - - - private Map> definedProperties; - - private List playerProperties = null; - - /** The location init. */ - private GamaPoint locationInit = null; - - /** The player agents perception radius. */ - private Double playerAgentsPerceptionRadius = 0.0; - - /** The player agents min dist. */ - private Double playerAgentsMinDist = 0.0; - - /** The player size. */ - private Double playerSize = 1.0; - - /** The player color. */ - private String playerColor = "#red"; - - /** The minimum cycle duration. */ - private Double minimumCycleDuration = 0.1; - - /** The displays to hide. */ - private List displaysToHide = new ArrayList<>(); - - /** The main display. */ - private String mainDisplay; - - /** The model name. */ - private String modelName; - - /** The model path. */ - private String modelPath; - - /** The experiment name. */ - private String experimentName; - - /** The min number player. */ - private int minNumberPlayer; - - /** The max num player. */ - private int maxNumPlayer; - - /** The has max number player. */ - private boolean hasMaxNumberPlayer; - - /** - * Builds the VR model. - * - * @return the string - */ - public String BuildVRModel() { - StringBuilder modelVR = new StringBuilder("model ").append(modelName).append("\n\n"); - - modelVR.append("import \"").append(modelPath).append("\"\n\n"); - modelVR.append(UnityLinkerSpecies()).append("\n\n"); - - modelVR.append(playerStr()).append("\n\n"); - modelVR.append(experimentStr()); - - return modelVR.toString(); - } - - /** - * Experiment str. - * - * @return the string - */ - public String experimentStr() { - StringBuilder modelExp = - new StringBuilder("experiment vr_xp ").append(experimentName != null ? "parent:" + experimentName : "") - .append(" autorun: false type: unity {\n"); - modelExp.append("\tfloat minimum_cycle_duration <- ").append(minimumCycleDuration).append(";\n"); - modelExp.append("\tstring unity_linker_species <- string(unity_linker);\n"); - String disToHide = ""; - boolean first = true; - if (displaysToHide != null) { - for (String d : displaysToHide) { - disToHide += (first ? "" : ",") + "\"" + d + "\""; - first = false; - } - } - - modelExp.append("\tlist displays_to_hide <- [").append(disToHide).append("];\n"); - modelExp.append("\tfloat t_ref;\n\n"); - - modelExp.append("\taction create_player(string id) {\n"); - modelExp.append("\t\task unity_linker {\n"); - modelExp.append("\t\t\tdo create_player(id);\n"); - modelExp.append("\t\t}\n"); - modelExp.append("\t}\n\n"); - - modelExp.append("\taction remove_player(string id_input) {\n"); - modelExp.append("\t\tif (not empty(unity_player)) {\n"); - - modelExp.append("\t\t\task first(unity_player where (each.name = id_input)) {\n"); - modelExp.append("\t\t\t\tdo die;\n"); - modelExp.append("\t\t\t}\n"); - modelExp.append("\t\t}\n"); - modelExp.append("\t}\n\n"); - - modelExp.append("\toutput {\n"); - if (mainDisplay != null) { - - modelExp.append("\t\t display ").append(mainDisplay).append("_VR parent:").append(mainDisplay) - .append("{\n"); - modelExp.append("\t\t\t species unity_player;\n"); - modelExp.append("\t\t\t event #mouse_down{\n"); - - modelExp.append("\t\t\t\t float t <- gama.machine_time;\n"); - modelExp.append("\t\t\t\t if (t - t_ref) > 500 {\n"); - - modelExp.append("\t\t\t\t\t ask unity_linker {\n"); - modelExp.append("\t\t\t\t\t\t move_player_event <- true;\n"); - modelExp.append("\t\t\t\t\t }\n"); - modelExp.append("\t\t\t\t\t t_ref <- t;\n"); - modelExp.append("\t\t\t\t }\n"); - - modelExp.append("\t\t\t }\n"); - modelExp.append("\t\t }\n"); - - modelExp.append("\t}\n"); - - modelExp.append("}\n"); - } - - return modelExp.toString(); - - } - - /** - * Player str. - * - * @return the string - */ - public String playerStr() { - StringBuilder modelPlayer = new StringBuilder("species unity_player parent: abstract_unity_player{\n"); - if (playerAgentsPerceptionRadius != null && playerAgentsPerceptionRadius > 0.0) { - modelPlayer.append("\tfloat player_agents_perception_radius <- ").append(playerAgentsPerceptionRadius) - .append(";\n"); - } - if (playerAgentsMinDist != null && playerAgentsMinDist > 0.0) { - modelPlayer.append("\tfloat player_agents_min_dist <- ").append(playerAgentsMinDist).append(";\n"); - } - modelPlayer.append("\tfloat player_size <- ").append(playerSize).append(";\n"); - modelPlayer.append("\trgb color <- ").append(playerColor).append(";\n"); - modelPlayer.append("\tfloat cone_distance <- 10.0 * player_size;\n"); - modelPlayer.append("\tfloat cone_amplitude <- 90.0;\n"); - modelPlayer.append("\tfloat player_rotation <- 90.0;\n"); - modelPlayer.append("\tbool to_display <- true;\n"); - modelPlayer.append("\tfloat z_offset <- 2.0;\n"); - - modelPlayer.append("\taspect default {\n"); - modelPlayer.append("\t\tif to_display {\n"); - modelPlayer.append("\t\t\tif selected {\n"); - modelPlayer.append("\t\t\t\t draw circle(player_size) at: location + {0, 0, z_offset} color: rgb(#blue, 0.5);\n"); - - modelPlayer.append("\t\t\t}\n"); - - modelPlayer.append("\t\t\tdraw circle(player_size/2.0) at: location + {0, 0, z_offset} color: color ;\n"); - modelPlayer.append("\t\t\tdraw player_perception_cone() color: rgb(color, 0.5);"); - modelPlayer.append("\n\t\t}"); - modelPlayer.append("\n\t}"); - modelPlayer.append("\n}"); - - return modelPlayer.toString(); - } - - /** - * Unity linker species. - * - * @return the string - */ - public String UnityLinkerSpecies() { - StringBuilder modelUnityLinker = new StringBuilder("species unity_linker parent: abstract_unity_linker {\n"); - modelUnityLinker.append("\tstring player_species <- string(unity_player);\n"); - - - - if (hasMaxNumberPlayer) { - modelUnityLinker.append("\tint max_num_players <- ").append(maxNumPlayer).append(";\n"); - } else { - modelUnityLinker.append("\tint max_num_players <- -1;\n"); - } - if (minNumberPlayer > 0) { - modelUnityLinker.append("\tint min_num_players <- ").append(minNumberPlayer).append(";\n"); - } - for (String p : definedProperties.keySet() ) { - modelUnityLinker.append("\tunity_property ").append("up_" + p).append(";\n"); - } - - if (locationInit != null) { - String locationInitStr = ""; - if (maxNumPlayer <= 0) { - locationInitStr += "" + locationInit; - } else { - boolean first = true; - for (int i = 0; i < maxNumPlayer; i++) { - locationInitStr += (first ? "" : ",") + locationInit; - first = false; - } - } - - modelUnityLinker.append("\tlist init_locations <- define_init_locations();\n"); - modelUnityLinker.append("\n\tlist define_init_locations {\n"); - modelUnityLinker.append("\t\treturn [").append(locationInitStr).append("];\n"); - modelUnityLinker.append("\t}\n\n"); - - - } - - if (speciesToSend != null && !speciesToSend.isEmpty()) { - speciesToSendStatic = new Hashtable<>(); - speciesToSendDynamic = new Hashtable<>(); - for (String sp : speciesToSend.keySet()) { - Map data = speciesToSend.get(sp); - if (data.get("keep").equals("true")) { - if (data.get("static").equals("true")) { - speciesToSendStatic.put(sp, data); - } else { - speciesToSendDynamic.put(sp, data); - } - } - } - } - if ((speciesToSendStatic != null && !speciesToSendStatic.isEmpty()) || (definedProperties != null && !definedProperties.isEmpty())){ - modelUnityLinker.append("\n\tinit {"); - if (definedProperties != null && !definedProperties.isEmpty()) { - modelUnityLinker.append("\n\t\tdo define_properties;"); - } - if (playerProperties != null && !playerProperties.isEmpty()) { - String pp = ""; - boolean first = true; - for(String prop : playerProperties) { - pp += (first ? "" : ",") + "up_"+ prop ; - first = false; - } - modelUnityLinker.append("\n\t\tplayer_unity_properties <- [" + pp + "];"); - } - if (speciesToSendStatic != null && !speciesToSendStatic.isEmpty()) { - for (String sp : speciesToSendStatic.keySet()) { - Map data = speciesToSendStatic.get(sp); - modelUnityLinker.append("\n\t\t" ); - Double buffer = Double.valueOf(data.get("buffer")); - String geom = sp + ((buffer != null && buffer != 0.0) ? " collect (each.shape + " + buffer + ")": ""); - modelUnityLinker.append("do add_background_geometries(" + geom + ",up_" + data.get("properties") + ");"); - } - } - - modelUnityLinker.append("\n\t}"); - - } - - if (definedProperties != null && !definedProperties.isEmpty()){ - modelUnityLinker.append("\n\taction define_properties {"); - int cpt = 0; - for (String p : definedProperties.keySet() ) { - Map data = definedProperties.get(p); - String idA = p + "_aspect"; - modelUnityLinker.append("\n\t\tunity_aspect ").append(idA + " <- "); - boolean hasPrefab = "true".equals(data.get("has_prefab")); - if (hasPrefab) { - modelUnityLinker.append("prefab_aspect(\"" + data.get("prefab")+"\","+ data.get("size")+","+ data.get("y-offset") +","+ data.get("rotation_coeff")+","+ data.get("rotation_offset")+",precision);" ); - } else { - String color = data.get("color"); - if (!color.startsWith("#") && ! color.startsWith("rgb")) { - color = "#"+color; - } - String material = data.get("material"); - if (material != null && ! material.isBlank()) - modelUnityLinker.append("geometry_aspect(" + data.get("height")+",\""+ material +"\","+color +",precision);" ); - else - modelUnityLinker.append("geometry_aspect(" + data.get("height")+","+ color +",precision);" ); - } - String interaction = ""; - if ("false".equals(data.get("collider"))) { - interaction = "#no_interaction"; - } else { - if ("false".equals(data.get("interactable"))) { - interaction = "new_geometry_interaction(true, false,false,[])"; - } else if ("false".equals(data.get("grabable"))) { - interaction = "#ray_interactable"; - } else { - interaction = "#grabable"; - } - } - - modelUnityLinker.append("\n\t\t"); - modelUnityLinker.append("up_" + p).append(" <- ").append("geometry_properties(\"").append(data.get("name")+"\",\"").append(data.get("tag")+"\",").append(idA+",").append(interaction+",").append(data.get("follow")+");"); - modelUnityLinker.append("\n\t\tunity_properties << ").append("up_"+p).append(";"); - if (cpt < definedProperties.size()) modelUnityLinker.append("\n\n"); - cpt++; - } - modelUnityLinker.append("\n\t}"); - } - if (speciesToSendDynamic != null && !speciesToSendDynamic.isEmpty()) { - modelUnityLinker.append("\n\treflex send_geometries {"); - for (String sp : speciesToSendDynamic.keySet()) { - Map data = speciesToSendDynamic.get(sp); - String when = data.get("when"); - boolean addC = false; - if (when != null && !when.isBlank() && !"every(1 #cycle)".equals(when)) { - addC = true; - modelUnityLinker.append("\n\t\tif ("+when+"){"); - } - modelUnityLinker.append("\n\t\t" + (addC ? "\t" : "")); - Double buffer = Double.valueOf(data.get("buffer")); - String geom = sp + ((buffer != null && buffer != 0.0) ? " collect (each.shape + " + buffer + ")": ""); - modelUnityLinker.append("do add_geometries_to_send(" + geom + ",up_" + data.get("properties") + ");"); - if (addC) { - modelUnityLinker.append("\n\t\t}"); - } - } - modelUnityLinker.append("\n\t}"); - } - - modelUnityLinker.append("\n}"); - return modelUnityLinker.toString(); - } - - /** - * Gets the player color. - * - * @return the player color - */ - public String getPlayerColor() { return playerColor; } - - /** - * Sets the player color. - * - * @param playerColor - * the new player color - */ - public void setPlayerColor(final String playerColor) { this.playerColor = playerColor; } - - /** - * Gets the model path. - * - * @return the model path - */ - public String getModelPath() { return modelPath; } - - /** - * Sets the model path. - * - * @param modelPath - * the new model path - */ - public void setModelPath(final String modelPath) { this.modelPath = modelPath; } - - - /** - * Gets the location init. - * - * @return the location init - */ - public GamaPoint getLocationInit() { return locationInit; } - - /** - * Sets the location init. - * - * @param locationInit - * the new location init - */ - public void setLocationInit(final GamaPoint locationInit) { this.locationInit = locationInit; } - - /** - * Gets the player agents perception radius. - * - * @return the player agents perception radius - */ - public Double getPlayerAgentsPerceptionRadius() { return playerAgentsPerceptionRadius; } - - /** - * Sets the player agents perception radius. - * - * @param playerAgentsPerceptionRadius - * the new player agents perception radius - */ - public void setPlayerAgentsPerceptionRadius(final Double playerAgentsPerceptionRadius) { - this.playerAgentsPerceptionRadius = playerAgentsPerceptionRadius; - } - - /** - * Gets the player agents min dist. - * - * @return the player agents min dist - */ - public Double getPlayerAgentsMinDist() { return playerAgentsMinDist; } - - /** - * Sets the player agents min dist. - * - * @param playerAgentsMinDist - * the new player agents min dist - */ - public void setPlayerAgentsMinDist(final Double playerAgentsMinDist) { - this.playerAgentsMinDist = playerAgentsMinDist; - } - - /** - * Gets the player size. - * - * @return the player size - */ - public Double getPlayerSize() { return playerSize; } - - /** - * Sets the player size. - * - * @param playerSize - * the new player size - */ - public void setPlayerSize(final Double playerSize) { this.playerSize = playerSize; } - - /** - * Gets the minimum cycle duration. - * - * @return the minimum cycle duration - */ - public Double getMinimumCycleDuration() { return minimumCycleDuration; } - - /** - * Sets the minimum cycle duration. - * - * @param minimumCycleDuration - * the new minimum cycle duration - */ - public void setMinimumCycleDuration(final Double minimumCycleDuration) { - this.minimumCycleDuration = minimumCycleDuration; - } - - /** - * Gets the displays to hide. - * - * @return the displays to hide - */ - public List getDisplaysToHide() { return displaysToHide; } - - /** - * Sets the displays to hide. - * - * @param displaysToHide - * the new displays to hide - */ - public void setDisplaysToHide(final List displaysToHide) { this.displaysToHide = displaysToHide; } - - /** - * Gets the main display. - * - * @return the main display - */ - public String getMainDisplay() { return mainDisplay; } - - /** - * Sets the main display. - * - * @param mainDisplay - * the new main display - */ - public void setMainDisplay(final String mainDisplay) { this.mainDisplay = mainDisplay; } - - /** - * Gets the model name. - * - * @return the model name - */ - public String getModelName() { return modelName; } - - /** - * Sets the model name. - * - * @param modelName - * the new model name - */ - public void setModelName(final String modelName) { this.modelName = modelName; } - - /** - * Gets the experiment name. - * - * @return the experiment name - */ - public String getExperimentName() { return experimentName; } - - /** - * Sets the experiment name. - * - * @param experimentName - * the new experiment name - */ - public void setExperimentName(final String experimentName) { this.experimentName = experimentName; } - - /** - * Gets the min num player. - * - * @return the min num player - */ - public int getMin_num_player() { return minNumberPlayer; } - - /** - * Sets the min num player. - * - * @param min_num_player - * the new min num player - */ - public void setMin_num_player(final int min_num_player) { this.minNumberPlayer = min_num_player; } - - /** - * Gets the max num player. - * - * @return the max num player - */ - public int getMax_num_player() { return maxNumPlayer; } - - /** - * Sets the max num player. - * - * @param max_num_player - * the new max num player - */ - public void setMax_num_player(final int max_num_player) { this.maxNumPlayer = max_num_player; } - - /** - * Checks for max num player. - * - * @return true, if successful - */ - public boolean has_max_num_player() { - return hasMaxNumberPlayer; - } - - /** - * Sets the checks for max num player. - * - * @param has_max_num_player - * the new checks for max num player - */ - public void setHas_max_num_player(final boolean has_max_num_player) { - this.hasMaxNumberPlayer = has_max_num_player; - } - - public Map> getSpeciesToSend() { - if (speciesToSend == null) { - speciesToSend = new Hashtable<>(); - } - return speciesToSend; - } - - public void setSpeciesToSend(Map> speciesToSend) { - this.speciesToSend = speciesToSend; - } - - public Map> getDefinedProperties() { - if (definedProperties == null) - definedProperties = new Hashtable<>(); - return definedProperties; - } - - public void setDefinedProperties(Map> definedProperties) { - this.definedProperties = definedProperties; - } - - public List getPlayerProperties() { - return playerProperties; - } - - public void setPlayerProperties(List playerProperties) { - this.playerProperties = playerProperties; - } - - -} diff --git a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageDisplay.java b/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageDisplay.java deleted file mode 100644 index 318bc6e..0000000 --- a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageDisplay.java +++ /dev/null @@ -1,152 +0,0 @@ -/******************************************************************************************************* - * - * WizardPageDisplay.java, in gaml.extension.unity, is part of the source code of the GAMA modeling and simulation - * platform (v.1.9.3). - * - * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) - * - * Visit https://github.com/gama-platform/gama for license information and contacts. - * - ********************************************************************************************************/ -package gaml.extension.unity.commands.wizard; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; - -import gama.core.kernel.model.IModel; -import gama.core.outputs.IOutput; - -/** - * The Class WizardPageDisplay. - */ -public class WizardPageDisplay extends WizardPage { - - /** The model. */ - IModel model; - - /** The container. */ - private Composite container; - - /** The generator. */ - VRModelGenerator generator; - - /** The items D. */ - List itemsD; - - /** - * Instantiates a new wizard page display. - * - * @param model - * the model - * @param gen - * the gen - */ - protected WizardPageDisplay(final IModel model, final VRModelGenerator gen) { - super("Display"); - setTitle("Define the information about the display"); - setDescription("Please enter information about displays"); - this.model = model; - this.generator = gen; - } - - /** - * Update experiment. - */ - public void updateExperiment() { - itemsD = new ArrayList<>(); - for (IOutput d : model.getExperiment(generator.getExperimentName()).getOriginalSimulationOutputs()) { - itemsD.add(d.getOriginalName()); - } - - } - - /** The cd. */ - Combo cd; - - /** The group display H. */ - Group groupDisplayH; - - @Override - public void createControl(final Composite parent) { - container = new Composite(parent, SWT.NONE); - container.setLayout(new FillLayout(SWT.VERTICAL)); - Group groupDisplay = new Group(container, SWT.NONE); - groupDisplay.setLayout(new GridLayout(2, false)); - groupDisplay.setText("Information about the display"); - - Label ld = new Label(groupDisplay, SWT.LEFT); - ld.setText("Main Display:"); - - cd = new Combo(groupDisplay, SWT.READ_ONLY); - - if (itemsD != null && itemsD.size() > 0) { - - cd.setItems(itemsD.toArray(new String[itemsD.size()])); - if (!itemsD.isEmpty()) { - cd.setText(itemsD.get(0)); - generator.setMainDisplay(cd.getText()); - } - groupDisplayH = new Group(container, SWT.NONE); - groupDisplayH.setLayout(new GridLayout(2, false)); - groupDisplayH.setText("Displays to hide"); - - for (String sp : itemsD) { - Button bt = new Button(groupDisplayH, SWT.CHECK); - bt.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(final SelectionEvent event) { - Button btn = (Button) event.getSource(); - if (btn.getSelection()) { - generator.getDisplaysToHide().add(btn.getText()); - } else { - generator.getDisplaysToHide().remove(btn.getText()); - } - - } - }); - bt.setSelection(true); - bt.setText(sp); - generator.getDisplaysToHide().add(bt.getText()); - bt.pack(); - } - cd.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(final SelectionEvent e) { - generator.setMainDisplay(cd.getText()); - } - }); - } - /* - * Group groupDisplayH = new Group(container, SWT.NONE); groupDisplayH.setLayout(new GridLayout(2, false)); - * groupDisplayH.setText("Displays to hide"); - * - * for (IExperimentPlan ep : model.getExperiments()) { for (IDisplayOutput d - * :ep.getExperimentOutputs().getDisplayOutputs()){ String sp = d.getName(); Button bt = new - * Button(groupDisplayH, SWT.CHECK); bt.addSelectionListener(new SelectionAdapter() { - * - * @Override public void widgetSelected(SelectionEvent event) { Button btn = (Button) event.getSource(); - * if(btn.getSelection()) { generator.getDisplaysToHide().add(btn.getText()); } else { - * - * generator.getDisplaysToHide().remove(btn.getText()); } - * - * } }); bt.setText(sp); bt.pack(); } } - */ - - setControl(container); - - } - -} diff --git a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageGeneralInformation.java b/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageGeneralInformation.java deleted file mode 100644 index 734922e..0000000 --- a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageGeneralInformation.java +++ /dev/null @@ -1,143 +0,0 @@ -/******************************************************************************************************* - * - * WizardPageGeneralInformation.java, in gaml.extension.unity, is part of the source code of the GAMA modeling and - * simulation platform (v.1.9.3). - * - * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) - * - * Visit https://github.com/gama-platform/gama for license information and contacts. - * - ********************************************************************************************************/ -package gaml.extension.unity.commands.wizard; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.FillLayout; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -import gama.core.kernel.experiment.IExperimentPlan; -import gama.core.kernel.model.IModel; - -/** - * The Class WizardPageGeneralInformation. - */ -public class WizardPageGeneralInformation extends WizardPage { - - /** The model. */ - IModel model; - - /** The container. */ - private Composite container; - - /** The generator. */ - VRModelGenerator generator; - - /** The w display. */ - WizardPageDisplay wDisplay; - - /** - * Instantiates a new wizard page general information. - * - * @param path - * the path - * @param model - * the model - * @param gen - * the gen - */ - protected WizardPageGeneralInformation(final String path, final IModel model, final VRModelGenerator gen) { - super("GeneralInformation"); - setTitle("Define the general information to define the VR experiment"); - setDescription("Please enter information about VR experiment"); - this.model = model; - this.generator = gen; - gen.setModelName(model.getName() + "_VR"); - gen.setModelPath(path); - } - - @Override - public void createControl(final Composite parent) { - container = new Composite(parent, SWT.NONE); - container.setLayout(new FillLayout(SWT.VERTICAL)); - /* - * Group groupConnection = new Group(container, SWT.NONE); groupConnection.setLayout(new GridLayout(2, false)); - * groupConnection.setText("Information about the connection"); - * - * Label lp = new Label(groupConnection, SWT.LEFT); lp.setText("Port:" ); Text tp = new Text(groupConnection, - * SWT.BORDER); tp.setText(generator.getPort().toString()); tp.addModifyListener(new ModifyListener() { - * - * @Override - * - * public void modifyText(ModifyEvent e) { Integer port = Integer.decode(tp.getText()); if (port != null) - * generator.setPort(port); } }); - */ - - Group groupExperiment = new Group(container, SWT.NONE); - groupExperiment.setLayout(new GridLayout(2, false)); - groupExperiment.setText("Information about the experiment"); - - Label lc = new Label(groupExperiment, SWT.LEFT); - lc.setText("Minimium duration of a cycle in s (minimum_cycle_duration):"); - Text tc = new Text(groupExperiment, SWT.BORDER); - tc.setText(generator.getMinimumCycleDuration().toString()); - tc.addModifyListener(e -> { - Double duration = Double.valueOf(tc.getText()); - if (duration != null) { generator.setMinimumCycleDuration(duration); } - }); - Label lxp = new Label(groupExperiment, SWT.LEFT); - lxp.setText("Main Experiment:"); - - Combo cXp = new Combo(groupExperiment, SWT.READ_ONLY); - List items = new ArrayList<>(); - for (IExperimentPlan ep : model.getExperiments()) { items.add(ep.getName()); } - - cXp.setItems(items.toArray(new String[items.size()])); - if (!items.isEmpty()) { - cXp.setText(items.get(0)); - generator.setExperimentName(cXp.getText()); - wDisplay.updateExperiment(); - - } - - cXp.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetDefaultSelected(final SelectionEvent e) { - generator.setExperimentName(cXp.getText()); - wDisplay.updateExperiment(); - } - }); - - setControl(container); - - } - - /** - * Gets the w display. - * - * @return the w display - */ - public WizardPageDisplay getwDisplay() { - return wDisplay; - } - - /** - * Sets the w display. - * - * @param wDisplay - * the new w display - */ - public void setwDisplay(final WizardPageDisplay wDisplay) { - this.wDisplay = wDisplay; - } - -} diff --git a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPagePlayer.java b/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPagePlayer.java deleted file mode 100644 index f867977..0000000 --- a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPagePlayer.java +++ /dev/null @@ -1,355 +0,0 @@ -/******************************************************************************************************* - * - * WizardPagePlayer.java, in gaml.extension.unity, is part of the source code of the GAMA modeling and simulation - * platform (v.1.9.3). - * - * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) - * - * Visit https://github.com/gama-platform/gama for license information and contacts. - * - ********************************************************************************************************/ -package gaml.extension.unity.commands.wizard; - -import java.util.ArrayList; -import java.util.List; - -import org.eclipse.jface.viewers.ListViewer; -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.ModifyListener; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Text; - -import gama.core.kernel.model.IModel; -import gama.core.metamodel.shape.GamaPoint; - -/** - * The Class WizardPagePlayer. - */ -public class WizardPagePlayer extends WizardPage { - - /** The model. */ - IModel model; - - /** The generator. */ - VRModelGenerator generator; - - /** The items D. */ - List itemsD; - - - private Text text; - private Text text_1; - private Text text_2; - private Text txtPlayerColor; - private Text text_3; - private Text text_4; - private Text text_5; - private Text text_6; - private Text text_7; - - private org.eclipse.swt.widgets.List list; - private org.eclipse.swt.widgets.List list_1; - /** - * Instantiates a new wizard page player. - * - * @param model - * the model - * @param gen - * the gen - */ - - - - protected WizardPagePlayer(final IModel model, final VRModelGenerator gen) { - super("Player"); - setTitle("Define the information about the player"); - setDescription("Please enter information about the player"); - setPageComplete(true); - this.model = model; - this.generator = gen; - - } - - - - @Override - public void createControl(final Composite parent) { - Composite container = new Composite(parent, SWT.NONE); - - setControl(container); - generator.setLocationInit(new GamaPoint(50.0, 50.0, 0.0)); - - Group group = new Group(container, SWT.NONE); - group.setBounds(31, 130, 752, 36); - - Label lblX = new Label(group, SWT.NONE); - lblX.setBounds(206, 7, 21, 14); - lblX.setText("X:"); - - Label lblY = new Label(group, SWT.NONE); - lblY.setBounds(317, 7, 21, 20); - lblY.setText("Y:"); - - Label lblZ = new Label(group, SWT.NONE); - lblZ.setBounds(426, 7, 15, 14); - lblZ.setText("Z:"); - - text = new Text(group, SWT.BORDER); - text.setBounds(230, 4, 64, 19); - - text_1 = new Text(group, SWT.BORDER); - text_1.setBounds(338, 4, 64, 19); - - text_2 = new Text(group, SWT.BORDER); - text_2.setBounds(447, 4, 64, 19); - - text.setText("" + generator.getLocationInit().x); - text_1.setText("" + generator.getLocationInit().y); - text_2.setText("" + generator.getLocationInit().z); - - ModifyListener ml = e -> { - Double x = Double.valueOf(text.getText()); - Double y = Double.valueOf(text_1.getText()); - Double z = Double.valueOf(text_2.getText()); - if (x != null && y != null && z != null) { generator.setLocationInit(new GamaPoint(x, y, z)); } - - }; - - text.addModifyListener(ml); - text_1.addModifyListener(ml); - text_2.addModifyListener(ml); - - - Label lblInitLocationOf = new Label(group, SWT.NONE); - lblInitLocationOf.setBounds(10, 7, 149, 14); - lblInitLocationOf.setText("Init location of players"); - - Group grpGamaDisplay = new Group(container, SWT.NONE); - grpGamaDisplay.setText("GAMA display"); - grpGamaDisplay.setBounds(31, 266, 752, 228); - - Label lblNewLabel_1 = new Label(grpGamaDisplay, SWT.NONE); - lblNewLabel_1.setBounds(21, 10, 59, 14); - lblNewLabel_1.setText("Player size (Gama display)"); - - txtPlayerColor = new Text(grpGamaDisplay, SWT.BORDER); - txtPlayerColor.setText("#red"); - txtPlayerColor.setBounds(311, 7, 64, 19); - - txtPlayerColor.setText(generator.getPlayerColor()); - txtPlayerColor.addModifyListener(e -> generator.setPlayerColor(txtPlayerColor.getText())); - - - Label lblPlayerColor = new Label(grpGamaDisplay, SWT.NONE); - lblPlayerColor.setBounds(224, 10, 76, 14); - lblPlayerColor.setText("Player color"); - - text_7 = new Text(grpGamaDisplay, SWT.BORDER); - text_7.setBounds(111, 5, 64, 19); - text_7.setText(generator.getPlayerSize().toString()); - text_7.addModifyListener(e -> { - Double ps = Double.valueOf(text_7.getText()); - if (ps != null) { generator.setPlayerSize(ps); } - }); - - Label lblNewLabel_2 = new Label(grpGamaDisplay, SWT.NONE); - lblNewLabel_2.setBounds(21, 44, 364, 14); - lblNewLabel_2.setText("Unity Properties used to represent the other players"); - - - Label lblListOfDefined = new Label(grpGamaDisplay, SWT.NONE); - lblListOfDefined.setBounds(57, 64, 180, 14); - lblListOfDefined.setText("list of defined properties"); - - Label lblListOfProperties = new Label(grpGamaDisplay, SWT.NONE); - lblListOfProperties.setText("list of properties used for players"); - lblListOfProperties.setBounds(320, 64, 180, 14); - - - ListViewer listViewer = new ListViewer(grpGamaDisplay, SWT.BORDER | SWT.V_SCROLL); - list = listViewer.getList(); - - list.setBounds(31, 84, 216, 82); - - ListViewer listViewer_1 = new ListViewer(grpGamaDisplay, SWT.BORDER | SWT.V_SCROLL); - list_1 = listViewer_1.getList(); - list_1.setBounds(305, 84, 216, 80); - - Button btnRemove = new Button(grpGamaDisplay, SWT.NONE); - btnRemove.setBounds(444, 170, 76, 27); - btnRemove.setText("remove"); - btnRemove.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - if ((e.type == SWT.Selection) && (list_1.getSelectionIndex() >= 0)) { - list_1.remove(list_1.getSelectionIndex()); - updatePlayerProperties(); - } - } - }); - - - Button btnDown = new Button(grpGamaDisplay, SWT.NONE); - btnDown.setText("down"); - btnDown.setBounds(365, 170, 59, 27); - btnDown.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - if ((e.type == SWT.Selection) && (list_1.getSelectionIndex() >= 0)) { - int index = list_1.getSelectionIndex(); - if (index < (list_1.getItemCount() - 1)) { - String v = list_1.getItem(index); - String v2 = list_1.getItem(index+1); - list_1.setItem(index+1, v); - list_1.setItem(index, v2); - list_1.setSelection(index+1); - updatePlayerProperties(); - } - } - } - }); - - - Button btnUp = new Button(grpGamaDisplay, SWT.NONE); - btnUp.setText("up"); - btnUp.setBounds(311, 170, 59, 27); - btnUp.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - if ((e.type == SWT.Selection) && (list_1.getSelectionIndex() >= 0)) { - int index = list_1.getSelectionIndex(); - if (index > 0) { - String v = list_1.getItem(index); - String v2 = list_1.getItem(index-1); - list_1.setItem(index-1, v); - list_1.setItem(index, v2); - - list_1.setSelection(index-1); - - updatePlayerProperties(); - } - } - } - }); - - Button btnNewButton = new Button(grpGamaDisplay, SWT.NONE); - btnNewButton.setBounds(57, 172, 64, 27); - btnNewButton.setText("add"); - btnNewButton.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - if ((e.type == SWT.Selection) && (list.getSelectionIndex() >= 0)) { - list_1.add(list.getItem(list.getSelectionIndex())); - - updatePlayerProperties(); - } - } - }); - - Group grpNumberOfPlayers = new Group(container, SWT.NONE); - grpNumberOfPlayers.setText("Number of players"); - grpNumberOfPlayers.setBounds(31, 10, 752, 113); - - Label lblMinNumberOf = new Label(grpNumberOfPlayers, SWT.NONE); - lblMinNumberOf.setBounds(23, 11, 137, 20); - lblMinNumberOf.setText("Min number of players"); - - text_3 = new Text(grpNumberOfPlayers, SWT.BORDER); - //text_3.setText("0"); - text_3.setBounds(230, 8, 64, 19); - text_3.setText(generator.getMin_num_player() + ""); - text_3.addModifyListener(e -> { - Integer tami = Integer.valueOf(text_3.getText()); - if (tami != null) { generator.setMin_num_player(tami); } - }); - - - Button btnHasAMax = new Button(grpNumberOfPlayers, SWT.CHECK); - btnHasAMax.setBounds(23, 37, 200, 16); - btnHasAMax.setText("Has a max number of players?"); - btnHasAMax.setSelection(true); - - btnHasAMax.addSelectionListener(new SelectionAdapter() { - - @Override - public void widgetSelected(final SelectionEvent event) { - Button btn = (Button) event.getSource(); - generator.setHas_max_num_player(btn.getSelection()); - if (btn.getSelection()) { - text_4.setEnabled(true); - - } else { - text_4.setEnabled(false); - } - - } - }); - - - Label lblMaxNumberOf = new Label(grpNumberOfPlayers, SWT.NONE); - lblMaxNumberOf.setBounds(51, 63, 137, 20); - lblMaxNumberOf.setText("Max number of players"); - - text_4 = new Text(grpNumberOfPlayers, SWT.BORDER); - //text_4.setText("0"); - text_4.setBounds(230, 60, 64, 19); - text_4.setText(generator.getMax_num_player() + ""); - text_4.addModifyListener(e -> { - Integer tmaai = Integer.valueOf(text_4.getText()); - if (tmaai != null) { generator.setMax_num_player(tmaai); } - }); - - Group grpFilteringOfThe = new Group(container, SWT.NONE); - grpFilteringOfThe.setText("Filtering of the geometries sent to Unity"); - grpFilteringOfThe.setBounds(31, 178, 752, 82); - - Label lblPerceptionRadiusOf = new Label(grpFilteringOfThe, SWT.NONE); - lblPerceptionRadiusOf.setBounds(23, 10, 214, 14); - lblPerceptionRadiusOf.setText("Perception radius of the player agent"); - - Label lblNewLabel = new Label(grpFilteringOfThe, SWT.NONE); - lblNewLabel.setBounds(23, 38, 332, 14); - lblNewLabel.setText("Min distance between agents to send to be considered"); - - text_5 = new Text(grpFilteringOfThe, SWT.BORDER); - text_5.setBounds(358, 5, 64, 19); - text_5.setText(generator.getPlayerAgentsPerceptionRadius().toString()); - text_5.addModifyListener(e -> { - Double papr = Double.valueOf(text_5.getText()); - if (papr != null) { generator.setPlayerAgentsPerceptionRadius(papr); } - }); - - - text_6 = new Text(grpFilteringOfThe, SWT.BORDER); - text_6.setBounds(358, 35, 64, 19); - text_6.setText(generator.getPlayerAgentsPerceptionRadius().toString()); - text_6.addModifyListener(e -> { - Double pamd = Double.valueOf(text_6.getText()); - if (pamd != null) { generator.setPlayerAgentsMinDist(pamd); } - }); - - - - } - - public void updatePlayerProperties() { - List pp = new ArrayList<>(); - for (String p: list_1.getItems()) { - pp.add(p); - } - generator.setPlayerProperties(pp); - } - - - public void updateUnityProperties() { - list.removeAll(); - for (String up : generator.getDefinedProperties().keySet()) - list.add(up); - - } - -} diff --git a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageProperties.java b/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageProperties.java deleted file mode 100644 index abaa442..0000000 --- a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageProperties.java +++ /dev/null @@ -1,450 +0,0 @@ -/******************************************************************************************************* - * - * WizardPageDisplay.java, in gaml.extension.unity, is part of the source code of the GAMA modeling and simulation - * platform (v.1.9.3). - * - * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) - * - * Visit https://github.com/gama-platform/gama for license information and contacts. - * - ********************************************************************************************************/ -package gaml.extension.unity.commands.wizard; - -import java.util.HashMap; -import java.util.Hashtable; -import java.util.Map; - -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Event; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.List; -import org.eclipse.swt.widgets.Listener; -import org.eclipse.swt.widgets.Text; - -import gama.core.kernel.model.IModel; - -/** - * The Class WizardPageDisplay. - */ -public class WizardPageProperties extends WizardPage { - - /** The model. */ - IModel model; - - /** The generator. */ - VRModelGenerator generator; - - org.eclipse.swt.widgets.List properiesList; - - Map currentValues; - - Map> definedProperties; - - - Map textAreas; - - Map booleanAreas; - - - WizardPageSpeciesToSend wpStS; - - WizardPagePlayer playerPage; - - - private Text text; - private Text text_1; - private Text text_2; - private Text text_3; - private Text text_4; - private Text text_5; - private Text text_6; - private Text text_7; - private Text text_8; - private Text text_material; - - private Button btnHasACollider; - private Button btnIsInteractable; - private Button btnIsGrabable; - private Button btnFollow; - private Button btnHasAPrefab; - /** - * Instantiates a new wizard page display. - * - * @param model - * the model - * @param gen - * the gen - */ - protected WizardPageProperties(final IModel model, final VRModelGenerator gen) { - super("Properties"); - setTitle("Define the information about the Unity properties to link to geometries to send to Unity"); - setDescription("Please enter information about properties"); - this.model = model; - this.generator = gen; - } - - @Override - public void createControl(final Composite parent) { - currentValues = new HashMap<>(); - definedProperties = generator.getDefinedProperties(); - - Composite container = new Composite(parent, SWT.NONE); - - setControl(container); - - Group grpUnityPropertiesDefined = new Group(container, SWT.NONE); - grpUnityPropertiesDefined.setText("Unity properties"); - grpUnityPropertiesDefined.setBounds(10, 0, 800, 151); - - properiesList = new List(grpUnityPropertiesDefined, SWT.BORDER); - properiesList.setBounds(72, 10, 407, 83); - - Button btnEdit = new Button(grpUnityPropertiesDefined, SWT.NONE); - btnEdit.setBounds(83, 99, 96, 27); - btnEdit.setText("Edit"); - - btnEdit.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - if ((e.type == SWT.Selection) && (properiesList.getSelectionIndex() >= 0)) { - String item = properiesList.getItem(properiesList.getSelectionIndex()); - currentValues = definedProperties.get(item); - for( String id : textAreas.keySet()) { - textAreas.get(id).setText(currentValues.get(id) == null ? "" : currentValues.get(id)); - } - for(String id : booleanAreas.keySet()) { - booleanAreas.get(id).setSelection(currentValues.get(id) != null && currentValues.get(id).equals("true")); - - } - updateList(); - } - } - }); - Button btnRemove = new Button(grpUnityPropertiesDefined, SWT.NONE); - btnRemove.setBounds(185, 99, 96, 27); - btnRemove.setText("Remove"); - - btnRemove.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - if ((e.type == SWT.Selection) && (properiesList.getSelectionIndex() >= 0)) { - properiesList.remove(properiesList.getSelectionIndex()); - definedProperties.remove(properiesList.getItem(properiesList.getSelectionIndex())); - updateList(); - } - } - }); - - - Group grpDefinitionOfA = new Group(container, SWT.NONE); - grpDefinitionOfA.setText("Definition of a Unity properties"); - grpDefinitionOfA.setBounds(10, 160, 800, 344); - - Group grpInteraction = new Group(grpDefinitionOfA, SWT.NONE); - grpInteraction.setText("Interaction"); - grpInteraction.setBounds(10, 50, 500, 51); - - btnHasACollider = new Button(grpInteraction, SWT.CHECK); - btnHasACollider.setBounds(30, 10, 93, 16); - btnHasACollider.setText("has a collider"); - btnHasACollider.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(final SelectionEvent event) { - Button btn = (Button) event.getSource(); - currentValues.put("collider", btn.getSelection() +""); - btnIsInteractable.setEnabled(btn.getSelection()); - btnIsGrabable.setEnabled(btn.getSelection() && btnIsInteractable.getSelection()); - } - }); - - btnIsInteractable = new Button(grpInteraction, SWT.CHECK); - btnIsInteractable.setBounds(129, 10, 93, 16); - btnIsInteractable.setText("is interactable"); - btnIsInteractable.setEnabled(false); - btnIsInteractable.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(final SelectionEvent event) { - Button btn = (Button) event.getSource(); - currentValues.put("interactable", btn.getSelection() +""); - btnIsGrabable.setEnabled(btn.getSelection() && btnIsInteractable.getSelection()); - } - }); - - btnIsGrabable = new Button(grpInteraction, SWT.CHECK); - btnIsGrabable.setBounds(245, 10, 93, 16); - btnIsGrabable.setText("is grabable"); - btnIsGrabable.setEnabled(false); - btnIsGrabable.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(final SelectionEvent event) { - Button btn = (Button) event.getSource(); - currentValues.put("grabable", btn.getSelection() +""); - } - }); - - btnFollow = new Button(grpInteraction, SWT.CHECK); - btnFollow.setBounds(350, 10, 150, 16); - btnFollow.setText("send back to GAMA"); - btnFollow.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(final SelectionEvent event) { - Button btn = (Button) event.getSource(); - currentValues.put("follow", btn.getSelection() +""); - } - }); - - text = new Text(grpDefinitionOfA, SWT.BORDER); - text.setBounds(64, 5, 127, 19); - text.addModifyListener(e -> currentValues.put("name", text.getText())); - - Label lblName = new Label(grpDefinitionOfA, SWT.NONE); - lblName.setBounds(10, 30, 59, 14); - lblName.setText("Tag:"); - - Group grpAspect = new Group(grpDefinitionOfA, SWT.NONE); - grpAspect.setText("Aspect"); - grpAspect.setBounds(10, 108, 780, 181); - - btnHasAPrefab = new Button(grpAspect, SWT.CHECK); - btnHasAPrefab.setBounds(12, 77, 93, 16); - btnHasAPrefab.setText("has a prefab"); - btnHasAPrefab.addSelectionListener(new SelectionAdapter() { - @Override - public void widgetSelected(final SelectionEvent event) { - Button btn = (Button) event.getSource(); - currentValues.put("has_prefab", btn.getSelection() +""); - if (btn.getSelection()) { - text_2.setEnabled(true); - text_3.setEnabled(false); - text_4.setEnabled(true); - text_5.setEnabled(false); - text_6.setEnabled(true); - text_7.setEnabled(true); - text_8.setEnabled(true); - text_material.setEnabled(false); - - } else { - text_2.setEnabled(false); - text_3.setEnabled(true); - text_4.setEnabled(false); - text_5.setEnabled(true); - text_6.setEnabled(false); - text_7.setEnabled(false); - text_8.setEnabled(false); - text_material.setEnabled(true); - } - } - }); - - Group grpGeometry = new Group(grpAspect, SWT.NONE); - grpGeometry.setText("Geometry"); - grpGeometry.setBounds(460, 11, 300, 107); - - text_3 = new Text(grpGeometry, SWT.BORDER); - text_3.setBounds(170, 25, 109, 19); - text_3.addModifyListener(e -> currentValues.put("color", text_3.getText())); - - text_material = new Text(grpGeometry, SWT.BORDER); - text_material.setBounds(170, 50, 109, 19); - text_material.addModifyListener(e -> currentValues.put("material", text_material.getText())); - - - text_5 = new Text(grpGeometry, SWT.BORDER); - text_5.setBounds(170, 0, 109, 19); - text_5.addModifyListener(e -> currentValues.put("height", text_5.getText())); - - Label lblHeight = new Label(grpGeometry, SWT.NONE); - lblHeight.setBounds(4, 3, 165, 14); - lblHeight.setText("Height/depth of the geometry:"); - - Label lblColor = new Label(grpGeometry, SWT.NONE); - lblColor.setBounds(4, 28, 165, 14); - lblColor.setText("Color of the geometry:"); - - Label lblMaterial = new Label(grpGeometry, SWT.NONE); - lblMaterial.setBounds(4, 53, 165, 14); - lblMaterial.setText("Material for the geometry:"); - - - Group grpPrefav = new Group(grpAspect, SWT.NONE); - grpPrefav.setText("Prefab"); - grpPrefav.setBounds(111, 11, 350, 145); - - text_2 = new Text(grpPrefav, SWT.BORDER); - text_2.setBounds(220, 23, 109, 19); - text_2.addModifyListener(e -> currentValues.put("size", text_2.getText())); - - Label lblPrefabPath = new Label(grpPrefav, SWT.NONE); - lblPrefabPath.setBounds(4, 3, 200, 14); - lblPrefabPath.setText("Path to the Prefab:"); - - Label lblSize = new Label(grpPrefav, SWT.NONE); - lblSize.setText("Scale of the Prefab:"); - lblSize.setBounds(4, 26, 200, 14); - - text_4 = new Text(grpPrefav, SWT.BORDER); - text_4.setBounds(220, 0, 109, 19); - text_4.addModifyListener(e -> currentValues.put("prefab", text_4.getText())); - - text_6 = new Text(grpPrefav, SWT.BORDER); - text_6.setBounds(220, 48, 109, 19); - text_6.addModifyListener(e -> currentValues.put("rotation_coeff", text_6.getText())); - - text_7 = new Text(grpPrefav, SWT.BORDER); - text_7.setBounds(220, 98, 109, 19); - text_7.addModifyListener(e -> currentValues.put("y-offset", text_7.getText())); - - text_8 = new Text(grpPrefav, SWT.BORDER); - text_8.setBounds(220, 73, 109, 19); - text_8.addModifyListener(e -> currentValues.put("rotation_offset", text_8.getText())); - - Label lblRotationCoeff = new Label(grpPrefav, SWT.NONE); - lblRotationCoeff.setBounds(4, 51, 200, 14); - lblRotationCoeff.setText("Rotation coefficient (Y-Unity axis):"); - - Label lblRotationOffset = new Label(grpPrefav, SWT.NONE); - lblRotationOffset.setBounds(4, 78, 200, 14); - lblRotationOffset.setText("Rotation offset (Y-Unity axis):"); - - Label lblOffset = new Label(grpPrefav, SWT.NONE); - lblOffset.setBounds(4, 101, 200, 14); - lblOffset.setText("Offset along the Y-Unity Axis:"); - - Button btnAddupdate = new Button(grpDefinitionOfA, SWT.NONE); - btnAddupdate.setBounds(95, 297, 96, 27); - btnAddupdate.setText("Add/Update"); - btnAddupdate.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - if ((e.type == SWT.Selection)) { - String name = currentValues.get("name"); - if (!name.isBlank()) { - for (int i = 0; i < properiesList.getItemCount(); i ++) { - String it = properiesList.getItem(i); - if (name.equals(it)) { - properiesList.remove(i); - break; - } - } - properiesList.add(name); - definedProperties.put(name, new HashMap(currentValues)); - initValue(); - updateList() ; - } - - } - } - }); - - Button btnReset = new Button(grpDefinitionOfA, SWT.NONE); - btnReset.setBounds(197, 297, 96, 27); - btnReset.setText("Reset"); - btnReset.addListener(SWT.Selection, new Listener() { - public void handleEvent(Event e) { - if ((e.type == SWT.Selection)) { - initValue(); - } - } - }); - - Label lblName_1 = new Label(grpDefinitionOfA, SWT.NONE); - lblName_1.setText("Name:"); - lblName_1.setBounds(10, 8, 59, 14); - - text_1 = new Text(grpDefinitionOfA, SWT.BORDER); - text_1.setBounds(64, 25, 127, 19); - text_1.addModifyListener(e -> currentValues.put("tag", text_1.getText())); - - - textAreas = new Hashtable(); - textAreas.put("name", text); - textAreas.put("tag", text_1); - textAreas.put("size", text_2); - textAreas.put("prefab", text_4); - textAreas.put("rotation_coeff", text_6); - textAreas.put("y-offset", text_7); - textAreas.put("rotation_offset", text_8); - textAreas.put("color", text_3); - textAreas.put("material", text_material); - textAreas.put("height", text_5); - - booleanAreas = new Hashtable<>(); - booleanAreas.put("has_prefab", btnHasAPrefab); - booleanAreas.put("grabable", btnIsGrabable); - booleanAreas.put("interactable", btnIsInteractable); - booleanAreas.put("collider", btnHasACollider); - booleanAreas.put("follow", btnFollow); - - initValue(); - - } - - - void initValue(){ - currentValues.clear(); - - text_2.setEnabled(false); - text_3.setEnabled(true); - text_material.setEnabled(true); - text_4.setEnabled(false); - text_5.setEnabled(true); - text_6.setEnabled(false); - text_7.setEnabled(false); - text_8.setEnabled(false); - text.setText(""); - text_1.setText(""); - text_2.setText("1.0"); - text_3.setText("gray"); - text_material.setText(""); - text_4.setText("Prefabs/Visual Prefabs/City/Vehicles/Car"); - text_5.setText("1.0"); - text_6.setText("1.0"); - text_7.setText("0.0"); - text_8.setText("0.0"); - - btnHasACollider.setSelection(false); - btnIsInteractable.setSelection(false); - btnIsGrabable.setSelection(false); - btnFollow.setSelection(false); - btnHasAPrefab.setSelection(false); - - for( String id : textAreas.keySet()) { - currentValues.put(id,textAreas.get(id).getText()); - } - for(String id : booleanAreas.keySet()) { - currentValues.put(id,booleanAreas.get(id).getSelection() + ""); - - } - - - } - - - void updateList() { - wpStS.setItemsP(definedProperties); - playerPage.updateUnityProperties(); - - } - public WizardPageSpeciesToSend getWpStS() { - return wpStS; - } - - public void setWpStS(WizardPageSpeciesToSend wpStS) { - this.wpStS = wpStS; - } - - public void setPlayerPage(WizardPagePlayer playerPage) { - this.playerPage = playerPage; - - } - - - - - - - -} diff --git a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageSpeciesToSend.java b/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageSpeciesToSend.java deleted file mode 100644 index 348fc47..0000000 --- a/gaml.extension.unity/src/gaml/extension/unity/commands/wizard/WizardPageSpeciesToSend.java +++ /dev/null @@ -1,239 +0,0 @@ -/******************************************************************************************************* - * - * WizardPageDisplay.java, in gaml.extension.unity, is part of the source code of the GAMA modeling and simulation - * platform (v.1.9.3). - * - * (c) 2007-2024 UMI 209 UMMISCO IRD/SU & Partners (IRIT, MIAT, TLU, CTU) - * - * Visit https://github.com/gama-platform/gama for license information and contacts. - * - ********************************************************************************************************/ -package gaml.extension.unity.commands.wizard; - -import java.util.ArrayList; -import java.util.Hashtable; -import java.util.List; -import java.util.Map; - -import org.eclipse.jface.wizard.WizardPage; -import org.eclipse.swt.SWT; -import org.eclipse.swt.custom.ScrolledComposite; -import org.eclipse.swt.events.SelectionAdapter; -import org.eclipse.swt.events.SelectionEvent; -import org.eclipse.swt.layout.GridData; -import org.eclipse.swt.layout.GridLayout; -import org.eclipse.swt.widgets.Button; -import org.eclipse.swt.widgets.Combo; -import org.eclipse.swt.widgets.Composite; -import org.eclipse.swt.widgets.Group; -import org.eclipse.swt.widgets.Label; -import org.eclipse.swt.widgets.Text; - -import gama.core.kernel.model.IModel; - -/** - * The Class WizardPageDisplay. - */ -public class WizardPageSpeciesToSend extends WizardPage { - - /** The model. */ - IModel model; - - List itemsP; - List combos; - List