├── .gitattributes ├── .gitignore ├── .vs ├── ProjectSettings.json ├── SkylinesPlateau │ └── v16 │ │ └── .suo ├── UC22-010-SkylinesPLATEAU │ └── v16 │ │ └── .suo ├── VSWorkspaceState.json └── slnx.sqlite ├── Docs ├── Manuals │ ├── CsPLATEAU_manual.pdf │ └── readme.md ├── resources │ └── img │ │ ├── PreviewImage.psd │ │ ├── index2.jpg │ │ ├── top1.jpg │ │ ├── top2.jpg │ │ ├── top3.jpg │ │ ├── top_intro.jpg │ │ ├── top_mod-001.jpg │ │ ├── top_mod-002.jpg │ │ ├── top_mod.png │ │ ├── top_mod.psd │ │ └── top_ui.jpg └── 参考サイト.md ├── LICENSE ├── MOD_Settings ├── ColossalOrder_CSグループ.zip ├── SkylinesPlateau.zip ├── common_CSグループ.zip └── readme.md ├── Readme.md ├── SampleData ├── 08234_hokota-shi_2020_citygml_4_op_sample_area.zip └── readme.md ├── SkylinesPlateau.sln ├── SkylinesPlateau ├── GUI │ ├── ImpFeaturesPanel.cs │ ├── ImpGUI.cs │ ├── ImpMapPanel.cs │ ├── SettingUI.cs │ ├── UIFolderDialog.cs │ └── UIUtil.cs ├── GmlData │ ├── GmlBuildingData.cs │ ├── GmlCodeListData.cs │ ├── GmlDemData.cs │ ├── GmlRailData.cs │ ├── GmlRoadData.cs │ ├── GmlUtil.cs │ ├── GmlWaterwayData.cs │ └── GmlZoneData.cs ├── ImportSettingData.cs ├── IniFileData.cs ├── MapExtent.cs ├── ModLoading.cs ├── ModThreading.cs ├── Properties │ └── AssemblyInfo.cs ├── SkylinesPlateau.cs ├── SkylinesPlateau.csproj ├── Table │ ├── AssetTbl.cs │ ├── BuildingSgTbl.cs │ └── ZoneSgTbl.cs ├── common │ ├── CommonBL.cs │ ├── CommonFunc.cs │ ├── InteriorPoints.cs │ ├── Logger.cs │ └── SimpleNode.cs ├── lib │ ├── Assembly-CSharp.dll │ ├── ColossalManaged.dll │ ├── ICities.dll │ └── UnityEngine.dll ├── obj │ └── Debug │ │ ├── DesignTimeResolveAssemblyReferencesInput.cache │ │ └── SkylinesPlateau.csproj.AssemblyReference.cache └── res │ ├── icon │ ├── folderDialog_desktop.png │ ├── folderDialog_folder.png │ ├── folderDialog_pc.png │ └── folderIcon.png │ └── tbl │ ├── SkylinesPlateau.ini │ ├── asset.tbl │ ├── bldgname.tbl │ ├── buildingID.tbl │ ├── detailedUsage.tbl │ ├── districtsAndZonesType.tbl │ ├── orgUsage.tbl │ ├── orgUsage2.tbl │ └── usage.tbl └── dll ├── Mapbox.VectorTile.ExtensionMethods.dll ├── Mapbox.VectorTile.Geometry.dll ├── Mapbox.VectorTile.LICENSE ├── Mapbox.VectorTile.PbfReader.dll └── Mapbox.VectorTile.VectorTileReader.dll /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | ## Ignore Visual Studio temporary files, build results, and 2 | ## files generated by popular Visual Studio add-ons. 3 | ## 4 | ## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore 5 | 6 | ##MOD setting folder 7 | /MOD_Settings/SkylinesPlateau_setting/ 8 | 9 | # User-specific files 10 | *.rsuser 11 | *.suo 12 | *.user 13 | *.userosscache 14 | *.sln.docstates 15 | 16 | # User-specific files (MonoDevelop/Xamarin Studio) 17 | *.userprefs 18 | 19 | # Mono auto generated files 20 | mono_crash.* 21 | 22 | # Build results 23 | [Dd]ebug/ 24 | [Dd]ebugPublic/ 25 | x64/ 26 | x86/ 27 | [Ww][Ii][Nn]32/ 28 | [Aa][Rr][Mm]/ 29 | [Aa][Rr][Mm]64/ 30 | bld/ 31 | [Bb]in/ 32 | [Oo]bj/ 33 | [Oo]ut/ 34 | [Ll]og/ 35 | [Ll]ogs/ 36 | 37 | # Visual Studio 2015/2017 cache/options directory 38 | .vs/ 39 | .vs/* 40 | # Uncomment if you have tasks that create the project's static files in wwwroot 41 | #wwwroot/ 42 | 43 | # Visual Studio 2017 auto generated files 44 | Generated\ Files/ 45 | 46 | # MSTest test Results 47 | [Tt]est[Rr]esult*/ 48 | [Bb]uild[Ll]og.* 49 | 50 | # NUnit 51 | *.VisualState.xml 52 | TestResult.xml 53 | nunit-*.xml 54 | 55 | # Build Results of an ATL Project 56 | [Dd]ebugPS/ 57 | [Rr]eleasePS/ 58 | dlldata.c 59 | 60 | # Benchmark Results 61 | BenchmarkDotNet.Artifacts/ 62 | 63 | # .NET Core 64 | project.lock.json 65 | project.fragment.lock.json 66 | artifacts/ 67 | 68 | # ASP.NET Scaffolding 69 | ScaffoldingReadMe.txt 70 | 71 | # StyleCop 72 | StyleCopReport.xml 73 | 74 | # Files built by Visual Studio 75 | *_i.c 76 | *_p.c 77 | *_h.h 78 | *.ilk 79 | *.meta 80 | *.obj 81 | *.iobj 82 | *.pch 83 | *.pdb 84 | *.ipdb 85 | *.pgc 86 | *.pgd 87 | *.rsp 88 | *.sbr 89 | *.tlb 90 | *.tli 91 | *.tlh 92 | *.tmp 93 | *.tmp_proj 94 | *_wpftmp.csproj 95 | *.log 96 | *.vspscc 97 | *.vssscc 98 | .builds 99 | *.pidb 100 | *.svclog 101 | *.scc 102 | 103 | # Chutzpah Test files 104 | _Chutzpah* 105 | 106 | # Visual C++ cache files 107 | ipch/ 108 | *.aps 109 | *.ncb 110 | *.opendb 111 | *.opensdf 112 | *.sdf 113 | *.cachefile 114 | *.VC.db 115 | *.VC.VC.opendb 116 | 117 | # Visual Studio profiler 118 | *.psess 119 | *.vsp 120 | *.vspx 121 | *.sap 122 | 123 | # Visual Studio Trace Files 124 | *.e2e 125 | 126 | # TFS 2012 Local Workspace 127 | $tf/ 128 | 129 | # Guidance Automation Toolkit 130 | *.gpState 131 | 132 | # ReSharper is a .NET coding add-in 133 | _ReSharper*/ 134 | *.[Rr]e[Ss]harper 135 | *.DotSettings.user 136 | 137 | # TeamCity is a build add-in 138 | _TeamCity* 139 | 140 | # DotCover is a Code Coverage Tool 141 | *.dotCover 142 | 143 | # AxoCover is a Code Coverage Tool 144 | .axoCover/* 145 | !.axoCover/settings.json 146 | 147 | # Coverlet is a free, cross platform Code Coverage Tool 148 | coverage*.json 149 | coverage*.xml 150 | coverage*.info 151 | 152 | # Visual Studio code coverage results 153 | *.coverage 154 | *.coveragexml 155 | 156 | # NCrunch 157 | _NCrunch_* 158 | .*crunch*.local.xml 159 | nCrunchTemp_* 160 | 161 | # MightyMoose 162 | *.mm.* 163 | AutoTest.Net/ 164 | 165 | # Web workbench (sass) 166 | .sass-cache/ 167 | 168 | # Installshield output folder 169 | [Ee]xpress/ 170 | 171 | # DocProject is a documentation generator add-in 172 | DocProject/buildhelp/ 173 | DocProject/Help/*.HxT 174 | DocProject/Help/*.HxC 175 | DocProject/Help/*.hhc 176 | DocProject/Help/*.hhk 177 | DocProject/Help/*.hhp 178 | DocProject/Help/Html2 179 | DocProject/Help/html 180 | 181 | # Click-Once directory 182 | publish/ 183 | 184 | # Publish Web Output 185 | *.[Pp]ublish.xml 186 | *.azurePubxml 187 | # Note: Comment the next line if you want to checkin your web deploy settings, 188 | # but database connection strings (with potential passwords) will be unencrypted 189 | *.pubxml 190 | *.publishproj 191 | 192 | # Microsoft Azure Web App publish settings. Comment the next line if you want to 193 | # checkin your Azure Web App publish settings, but sensitive information contained 194 | # in these scripts will be unencrypted 195 | PublishScripts/ 196 | 197 | # NuGet Packages 198 | *.nupkg 199 | # NuGet Symbol Packages 200 | *.snupkg 201 | # The packages folder can be ignored because of Package Restore 202 | **/[Pp]ackages/* 203 | # except build/, which is used as an MSBuild target. 204 | !**/[Pp]ackages/build/ 205 | # Uncomment if necessary however generally it will be regenerated when needed 206 | #!**/[Pp]ackages/repositories.config 207 | # NuGet v3's project.json files produces more ignorable files 208 | *.nuget.props 209 | *.nuget.targets 210 | 211 | # Microsoft Azure Build Output 212 | csx/ 213 | *.build.csdef 214 | 215 | # Microsoft Azure Emulator 216 | ecf/ 217 | rcf/ 218 | 219 | # Windows Store app package directories and files 220 | AppPackages/ 221 | BundleArtifacts/ 222 | Package.StoreAssociation.xml 223 | _pkginfo.txt 224 | *.appx 225 | *.appxbundle 226 | *.appxupload 227 | 228 | # Visual Studio cache files 229 | # files ending in .cache can be ignored 230 | *.[Cc]ache 231 | # but keep track of directories ending in .cache 232 | !?*.[Cc]ache/ 233 | 234 | # Others 235 | ClientBin/ 236 | ~$* 237 | *~ 238 | *.dbmdl 239 | *.dbproj.schemaview 240 | *.jfm 241 | *.pfx 242 | *.publishsettings 243 | orleans.codegen.cs 244 | 245 | # Including strong name files can present a security risk 246 | # (https://github.com/github/gitignore/pull/2483#issue-259490424) 247 | #*.snk 248 | 249 | # Since there are multiple workflows, uncomment next line to ignore bower_components 250 | # (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) 251 | #bower_components/ 252 | 253 | # RIA/Silverlight projects 254 | Generated_Code/ 255 | 256 | # Backup & report files from converting an old project file 257 | # to a newer Visual Studio version. Backup files are not needed, 258 | # because we have git ;-) 259 | _UpgradeReport_Files/ 260 | Backup*/ 261 | UpgradeLog*.XML 262 | UpgradeLog*.htm 263 | ServiceFabricBackup/ 264 | *.rptproj.bak 265 | 266 | # SQL Server files 267 | *.mdf 268 | *.ldf 269 | *.ndf 270 | 271 | # Business Intelligence projects 272 | *.rdl.data 273 | *.bim.layout 274 | *.bim_*.settings 275 | *.rptproj.rsuser 276 | *- [Bb]ackup.rdl 277 | *- [Bb]ackup ([0-9]).rdl 278 | *- [Bb]ackup ([0-9][0-9]).rdl 279 | 280 | # Microsoft Fakes 281 | FakesAssemblies/ 282 | 283 | # GhostDoc plugin setting file 284 | *.GhostDoc.xml 285 | 286 | # Node.js Tools for Visual Studio 287 | .ntvs_analysis.dat 288 | node_modules/ 289 | 290 | # Visual Studio 6 build log 291 | *.plg 292 | 293 | # Visual Studio 6 workspace options file 294 | *.opt 295 | 296 | # Visual Studio 6 auto-generated workspace file (contains which files were open etc.) 297 | *.vbw 298 | 299 | # Visual Studio LightSwitch build output 300 | **/*.HTMLClient/GeneratedArtifacts 301 | **/*.DesktopClient/GeneratedArtifacts 302 | **/*.DesktopClient/ModelManifest.xml 303 | **/*.Server/GeneratedArtifacts 304 | **/*.Server/ModelManifest.xml 305 | _Pvt_Extensions 306 | 307 | # Paket dependency manager 308 | .paket/paket.exe 309 | paket-files/ 310 | 311 | # FAKE - F# Make 312 | .fake/ 313 | 314 | # CodeRush personal settings 315 | .cr/personal 316 | 317 | # Python Tools for Visual Studio (PTVS) 318 | __pycache__/ 319 | *.pyc 320 | 321 | # Cake - Uncomment if you are using it 322 | # tools/** 323 | # !tools/packages.config 324 | 325 | # Tabs Studio 326 | *.tss 327 | 328 | # Telerik's JustMock configuration file 329 | *.jmconfig 330 | 331 | # BizTalk build output 332 | *.btp.cs 333 | *.btm.cs 334 | *.odx.cs 335 | *.xsd.cs 336 | 337 | # OpenCover UI analysis results 338 | OpenCover/ 339 | 340 | # Azure Stream Analytics local run output 341 | ASALocalRun/ 342 | 343 | # MSBuild Binary and Structured Log 344 | *.binlog 345 | 346 | # NVidia Nsight GPU debugger configuration file 347 | *.nvuser 348 | 349 | # MFractors (Xamarin productivity tool) working folder 350 | .mfractor/ 351 | 352 | # Local History for Visual Studio 353 | .localhistory/ 354 | 355 | # BeatPulse healthcheck temp database 356 | healthchecksdb 357 | 358 | # Backup folder for Package Reference Convert tool in Visual Studio 2017 359 | MigrationBackup/ 360 | 361 | # Ionide (cross platform F# VS Code tools) working folder 362 | .ionide/ 363 | 364 | # Fody - auto-generated XML schema 365 | FodyWeavers.xsd 366 | /README_temp.md 367 | /Docs/README_tmp.md 368 | /.vs/slnx.sqlite 369 | -------------------------------------------------------------------------------- /.vs/ProjectSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "CurrentProjectSetting": null 3 | } -------------------------------------------------------------------------------- /.vs/SkylinesPlateau/v16/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/.vs/SkylinesPlateau/v16/.suo -------------------------------------------------------------------------------- /.vs/UC22-010-SkylinesPLATEAU/v16/.suo: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/.vs/UC22-010-SkylinesPLATEAU/v16/.suo -------------------------------------------------------------------------------- /.vs/VSWorkspaceState.json: -------------------------------------------------------------------------------- 1 | { 2 | "ExpandedNodes": [ 3 | "", 4 | "\\dll", 5 | "\\Docs" 6 | ], 7 | "SelectedNode": "\\Readme.md", 8 | "PreviewInSolutionExplorer": false 9 | } -------------------------------------------------------------------------------- /.vs/slnx.sqlite: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/.vs/slnx.sqlite -------------------------------------------------------------------------------- /Docs/Manuals/CsPLATEAU_manual.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/Manuals/CsPLATEAU_manual.pdf -------------------------------------------------------------------------------- /Docs/Manuals/readme.md: -------------------------------------------------------------------------------- 1 | 鉾田市での実証環境構築のためのマニュアル 2 | -------------------------------------------------------------------------------- /Docs/resources/img/PreviewImage.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/PreviewImage.psd -------------------------------------------------------------------------------- /Docs/resources/img/index2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/index2.jpg -------------------------------------------------------------------------------- /Docs/resources/img/top1.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/top1.jpg -------------------------------------------------------------------------------- /Docs/resources/img/top2.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/top2.jpg -------------------------------------------------------------------------------- /Docs/resources/img/top3.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/top3.jpg -------------------------------------------------------------------------------- /Docs/resources/img/top_intro.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/top_intro.jpg -------------------------------------------------------------------------------- /Docs/resources/img/top_mod-001.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/top_mod-001.jpg -------------------------------------------------------------------------------- /Docs/resources/img/top_mod-002.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/top_mod-002.jpg -------------------------------------------------------------------------------- /Docs/resources/img/top_mod.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/top_mod.png -------------------------------------------------------------------------------- /Docs/resources/img/top_mod.psd: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/top_mod.psd -------------------------------------------------------------------------------- /Docs/resources/img/top_ui.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/resources/img/top_ui.jpg -------------------------------------------------------------------------------- /Docs/参考サイト.md: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/Docs/参考サイト.md -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Apache License 2 | Version 2.0, January 2004 3 | http://www.apache.org/licenses/ 4 | 5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION 6 | 7 | 1. Definitions. 8 | 9 | "License" shall mean the terms and conditions for use, reproduction, 10 | and distribution as defined by Sections 1 through 9 of this document. 11 | 12 | "Licensor" shall mean the copyright owner or entity authorized by 13 | the copyright owner that is granting the License. 14 | 15 | "Legal Entity" shall mean the union of the acting entity and all 16 | other entities that control, are controlled by, or are under common 17 | control with that entity. For the purposes of this definition, 18 | "control" means (i) the power, direct or indirect, to cause the 19 | direction or management of such entity, whether by contract or 20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the 21 | outstanding shares, or (iii) beneficial ownership of such entity. 22 | 23 | "You" (or "Your") shall mean an individual or Legal Entity 24 | exercising permissions granted by this License. 25 | 26 | "Source" form shall mean the preferred form for making modifications, 27 | including but not limited to software source code, documentation 28 | source, and configuration files. 29 | 30 | "Object" form shall mean any form resulting from mechanical 31 | transformation or translation of a Source form, including but 32 | not limited to compiled object code, generated documentation, 33 | and conversions to other media types. 34 | 35 | "Work" shall mean the work of authorship, whether in Source or 36 | Object form, made available under the License, as indicated by a 37 | copyright notice that is included in or attached to the work 38 | (an example is provided in the Appendix below). 39 | 40 | "Derivative Works" shall mean any work, whether in Source or Object 41 | form, that is based on (or derived from) the Work and for which the 42 | editorial revisions, annotations, elaborations, or other modifications 43 | represent, as a whole, an original work of authorship. For the purposes 44 | of this License, Derivative Works shall not include works that remain 45 | separable from, or merely link (or bind by name) to the interfaces of, 46 | the Work and Derivative Works thereof. 47 | 48 | "Contribution" shall mean any work of authorship, including 49 | the original version of the Work and any modifications or additions 50 | to that Work or Derivative Works thereof, that is intentionally 51 | submitted to Licensor for inclusion in the Work by the copyright owner 52 | or by an individual or Legal Entity authorized to submit on behalf of 53 | the copyright owner. For the purposes of this definition, "submitted" 54 | means any form of electronic, verbal, or written communication sent 55 | to the Licensor or its representatives, including but not limited to 56 | communication on electronic mailing lists, source code control systems, 57 | and issue tracking systems that are managed by, or on behalf of, the 58 | Licensor for the purpose of discussing and improving the Work, but 59 | excluding communication that is conspicuously marked or otherwise 60 | designated in writing by the copyright owner as "Not a Contribution." 61 | 62 | "Contributor" shall mean Licensor and any individual or Legal Entity 63 | on behalf of whom a Contribution has been received by Licensor and 64 | subsequently incorporated within the Work. 65 | 66 | 2. Grant of Copyright License. Subject to the terms and conditions of 67 | this License, each Contributor hereby grants to You a perpetual, 68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 69 | copyright license to reproduce, prepare Derivative Works of, 70 | publicly display, publicly perform, sublicense, and distribute the 71 | Work and such Derivative Works in Source or Object form. 72 | 73 | 3. Grant of Patent License. Subject to the terms and conditions of 74 | this License, each Contributor hereby grants to You a perpetual, 75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable 76 | (except as stated in this section) patent license to make, have made, 77 | use, offer to sell, sell, import, and otherwise transfer the Work, 78 | where such license applies only to those patent claims licensable 79 | by such Contributor that are necessarily infringed by their 80 | Contribution(s) alone or by combination of their Contribution(s) 81 | with the Work to which such Contribution(s) was submitted. If You 82 | institute patent litigation against any entity (including a 83 | cross-claim or counterclaim in a lawsuit) alleging that the Work 84 | or a Contribution incorporated within the Work constitutes direct 85 | or contributory patent infringement, then any patent licenses 86 | granted to You under this License for that Work shall terminate 87 | as of the date such litigation is filed. 88 | 89 | 4. Redistribution. You may reproduce and distribute copies of the 90 | Work or Derivative Works thereof in any medium, with or without 91 | modifications, and in Source or Object form, provided that You 92 | meet the following conditions: 93 | 94 | (a) You must give any other recipients of the Work or 95 | Derivative Works a copy of this License; and 96 | 97 | (b) You must cause any modified files to carry prominent notices 98 | stating that You changed the files; and 99 | 100 | (c) You must retain, in the Source form of any Derivative Works 101 | that You distribute, all copyright, patent, trademark, and 102 | attribution notices from the Source form of the Work, 103 | excluding those notices that do not pertain to any part of 104 | the Derivative Works; and 105 | 106 | (d) If the Work includes a "NOTICE" text file as part of its 107 | distribution, then any Derivative Works that You distribute must 108 | include a readable copy of the attribution notices contained 109 | within such NOTICE file, excluding those notices that do not 110 | pertain to any part of the Derivative Works, in at least one 111 | of the following places: within a NOTICE text file distributed 112 | as part of the Derivative Works; within the Source form or 113 | documentation, if provided along with the Derivative Works; or, 114 | within a display generated by the Derivative Works, if and 115 | wherever such third-party notices normally appear. The contents 116 | of the NOTICE file are for informational purposes only and 117 | do not modify the License. You may add Your own attribution 118 | notices within Derivative Works that You distribute, alongside 119 | or as an addendum to the NOTICE text from the Work, provided 120 | that such additional attribution notices cannot be construed 121 | as modifying the License. 122 | 123 | You may add Your own copyright statement to Your modifications and 124 | may provide additional or different license terms and conditions 125 | for use, reproduction, or distribution of Your modifications, or 126 | for any such Derivative Works as a whole, provided Your use, 127 | reproduction, and distribution of the Work otherwise complies with 128 | the conditions stated in this License. 129 | 130 | 5. Submission of Contributions. Unless You explicitly state otherwise, 131 | any Contribution intentionally submitted for inclusion in the Work 132 | by You to the Licensor shall be under the terms and conditions of 133 | this License, without any additional terms or conditions. 134 | Notwithstanding the above, nothing herein shall supersede or modify 135 | the terms of any separate license agreement you may have executed 136 | with Licensor regarding such Contributions. 137 | 138 | 6. Trademarks. This License does not grant permission to use the trade 139 | names, trademarks, service marks, or product names of the Licensor, 140 | except as required for reasonable and customary use in describing the 141 | origin of the Work and reproducing the content of the NOTICE file. 142 | 143 | 7. Disclaimer of Warranty. Unless required by applicable law or 144 | agreed to in writing, Licensor provides the Work (and each 145 | Contributor provides its Contributions) on an "AS IS" BASIS, 146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or 147 | implied, including, without limitation, any warranties or conditions 148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A 149 | PARTICULAR PURPOSE. You are solely responsible for determining the 150 | appropriateness of using or redistributing the Work and assume any 151 | risks associated with Your exercise of permissions under this License. 152 | 153 | 8. Limitation of Liability. In no event and under no legal theory, 154 | whether in tort (including negligence), contract, or otherwise, 155 | unless required by applicable law (such as deliberate and grossly 156 | negligent acts) or agreed to in writing, shall any Contributor be 157 | liable to You for damages, including any direct, indirect, special, 158 | incidental, or consequential damages of any character arising as a 159 | result of this License or out of the use or inability to use the 160 | Work (including but not limited to damages for loss of goodwill, 161 | work stoppage, computer failure or malfunction, or any and all 162 | other commercial damages or losses), even if such Contributor 163 | has been advised of the possibility of such damages. 164 | 165 | 9. Accepting Warranty or Additional Liability. While redistributing 166 | the Work or Derivative Works thereof, You may choose to offer, 167 | and charge a fee for, acceptance of support, warranty, indemnity, 168 | or other liability obligations and/or rights consistent with this 169 | License. However, in accepting such obligations, You may act only 170 | on Your own behalf and on Your sole responsibility, not on behalf 171 | of any other Contributor, and only if You agree to indemnify, 172 | defend, and hold each Contributor harmless for any liability 173 | incurred by, or claims asserted against, such Contributor by reason 174 | of your accepting any such warranty or additional liability. 175 | 176 | END OF TERMS AND CONDITIONS 177 | 178 | APPENDIX: How to apply the Apache License to your work. 179 | 180 | To apply the Apache License to your work, attach the following 181 | boilerplate notice, with the fields enclosed by brackets "[]" 182 | replaced with your own identifying information. (Don't include 183 | the brackets!) The text should be enclosed in the appropriate 184 | comment syntax for the file format. We also recommend that a 185 | file or class name and description of purpose be included on the 186 | same "printed page" as the copyright notice for easier 187 | identification within third-party archives. 188 | 189 | Copyright [yyyy] [name of copyright owner] 190 | 191 | Licensed under the Apache License, Version 2.0 (the "License"); 192 | you may not use this file except in compliance with the License. 193 | You may obtain a copy of the License at 194 | 195 | http://www.apache.org/licenses/LICENSE-2.0 196 | 197 | Unless required by applicable law or agreed to in writing, software 198 | distributed under the License is distributed on an "AS IS" BASIS, 199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 200 | See the License for the specific language governing permissions and 201 | limitations under the License. 202 | -------------------------------------------------------------------------------- /MOD_Settings/ColossalOrder_CSグループ.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/MOD_Settings/ColossalOrder_CSグループ.zip -------------------------------------------------------------------------------- /MOD_Settings/SkylinesPlateau.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/MOD_Settings/SkylinesPlateau.zip -------------------------------------------------------------------------------- /MOD_Settings/common_CSグループ.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/MOD_Settings/common_CSグループ.zip -------------------------------------------------------------------------------- /MOD_Settings/readme.md: -------------------------------------------------------------------------------- 1 | 2 | - 新規開発したMOD(SkylinesPLATEAU)の設定ファイルとユースケース実証の際に使用したゲーム環境の再現に必要なMODの設定ファイルです。 3 | - 各ファイルの保存先は[Docs/Manuals](../Docs/Manuals/)フォルダ内のマニュアルを参照してください. 4 | 5 | 6 | #### 保存データ一覧 7 | ##### SkylinesPlateau.zip 8 | - SkylinesPLATEAU(新規開発MOD)の設定ファイル 9 | 10 | ##### ColossalOrder_CSグループ.zip、common_CSグループ.zip 11 | - 既存MODの設定ファイル 12 | -------------------------------------------------------------------------------- /Readme.md: -------------------------------------------------------------------------------- 1 | # Cities: Skylines PLATEAU MOD 2 | ![top画像](Docs/resources/img/top3.jpg) 3 | 4 | ### 更新履歴 5 | 6 | | 更新日時 | リリース | 更新内容 | 7 | | ----------------------| ---------------------- | ---------------------- | 8 | | 2024/03/29 | **2nd Release** | インポートする3D都市モデルの指定や地形読込時に基準とする座標・標高等の設定各種パラメータを一つのウィンドウで実施できるようにユーザーインタフェースを改良。
事前に用意する必要があった設定ファイルを自動生成するよう改良。 | 9 | | 2023/03/27 | **1st Release** | | 10 | 11 | ## 1.概要 12 | PLATEAUの3D都市モデルを都市育成シミュレーションゲーム"Cities: Skylines"にインポートするMOD(SkylinesPLATEAU)のソースプログラムです。( Cities: Skylines II には対応していません。) 13 | 14 | オープンデータである3D都市モデルをCities: Skylinesのワールドデータとしてインポートすることで実際の都市を再現できます。 15 | 16 | まちづくりシミュレータとして、まちづくりの計画検討やワークショップ、教育の現場等で活用することができます。 17 | 18 | 19 | ## 2.「ゲーミフィケーションによる参加型まちづくり v2.0」について 20 | 21 | 近年、都市計画やまちづくりの分野において、市民の意見やアイデア収集、完成イメージの共有等に3D技術を活用したワークショップ方式が用いられつつあります。他方、それらのツールの導入コストは高く、専門知識が求められることからも容易に導入することはできませんでした。 22 | 23 | 2022年度の実証実験では、「ゲーミフィケーションによる参加型まちづくり」の実現に向けて、3D都市モデルを市販のシミュレーションゲームである「Cities:Skylines」に取り込み、まちづくりのシミュレータとして利用するためのMODシステムを開発しました。今回の実証実験では、昨年度の課題等を踏まえ、同システムを更に直感的にまちづくりの検討に活用できるようにするためのバージョンアップを実施しました。加えて、本システムを活用したまちづくり検討のプロセスを体験できるワークショップを設計・開発し、実際のまちづくりの検討プロセスにおける有用性を検証しました。 24 | 25 | ## 3.利用手順 26 | 本システムの構築手順及び利用手順については[利用チュートリアル](https://186nobu.github.io/SkylinesPLATEAU/) を参照してください。 27 | 28 | ## 4.システム概要 29 | 30 | ### 【読込機能】 31 | #### ①地形・高速道路の3D形状及び属性情報読込機能 32 | - 3D都市モデルの地形モデル(dem)の形状及び土地利用モデル(luse)の用途から地形を再現する。 33 | - 3D都市モデルの道路モデル(tran)の形状・機能から高速道路と一般道路を分類して再現する。 34 | - 高速道路については、ポリゴンの形状から道路中心線を算出し、その中心線に沿ってアセットを配置する。 35 | 36 | 37 | #### ②地物の3D形状及び属性情報読込機能 38 | - 一般道路については、高速道路と同様の処理により、幅員・道路中心線をもとにアセットを配置する。 39 | - 3D都市モデルの建築物モデル(bldg)の形状・用途・高さに応じて建築物の区画を割り当てるとともに、モデルの名称・建物IDを参照して学校や図書館等の建物を配置できる。 40 | - 国土地理院ベクトルタイルの鉄道の中心線・構造等を参照し、敷設位置や高架部を再現する。 41 | - 3D都市モデルの都市計画決定情報モデル(uro)に含まれる用途地域の区分を参照してゲーム内の区画用途を割り当てる。 42 | 43 | ### 【UI/UX機能】 44 | 45 | #### ③3D都市モデル読込時のパラメータ設定機能 46 | 47 | - オプションメニューから以下の設定が可能です。 48 | - 3D都市モデルフォルダ:読込み対象の3D都市モデルをPC上の任意のフォルダ位置で指定。 49 | - 中心座標:ゲーム内の中心座標位置を10進法の緯度経度で指定。 50 | - 平面直角座標系番号:読込み範囲の平面直角座標系番号をプルダウンで指定。 51 | - 地盤レベル:地形読込み時に基準とする海面の高さを指定。 52 | - 水面オフセット:水部を地表からどれだけ低くするかを指定。 53 | - TIN読込最大面積:読込対象とするTINの最大面積を指定。(湖沼、海面の部分には三角形ポリゴン(TIN)の頂点がなく、標高が正しく反映されないため、この部分を読込みの対象外とし、標高を0mとすることで湖沼、海面を再現しています。) 54 | - 三角道路ポリゴン除外面積:除外する狭小な道路ポリゴンの最大面積を任意の値で指定。 55 | 56 | ![システム画像](Docs/resources/img/index2.jpg) 57 | 58 | ### 5.利用技術 59 | 60 | | 種別 | 名称 | バージョン | 内容 | 61 | | ----------------- | --------|-------------|-----------------------------| 62 | | ミドルウェア | [Steam®](https://store.steampowered.com/) | 1702079146 | ゲーミングプラットフォームアプリケーション | 63 | | | [Cities: Skylines](https://steamcommunity.com/app/255710) | | 市販の都市シミュレーションゲーム | 64 | | ライブラリ | [ICities](https://skylines.paradoxwikis.com/Modding_API) | | Cities: SkylinesのMODを開発する際に使用するライブラリ | 65 | | | [Mapbox-vector-tile-cs](https://github.com/mapbox/vector-tile-cs) | | Mapbox(地図開発プラットフォーム)の機能を使用するためのライブラリ | 66 | 67 | 68 | ## 6. 動作環境 69 | | 項目 | 最小動作環境 | 推奨動作環境 | 70 | | ------------------ | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------------------------ | 71 | | OS | Microsoft Windows 10、11 | 同左 | 72 | | CPU | Intel Core i7以上 | 同左 | 73 | | メモリ | 8GB以上 | 32GB以上 | 74 | | GPU | NVIDIA® GeForce GTX™ 1060 | NVIDIA® GeForce RTX™ 3050 | 75 | | ディスプレイ | 1280x720以上 | 同左 | 76 | | ネットワーク | Cities: Skylinesのアカウント認証、鉄道読込時に必要 | 同左 | 77 | 78 | 79 | ## 7. 本リポジトリのフォルダ構成 80 | | フォルダ名 | 詳細 | 81 | |-|-| 82 | | Docs | マニュアル、参考サイト | 83 | | MOD_Settings | 実証時に使用したMODの設定ファイル | 84 | | SampleData | 読込み動作確認のための3D都市モデル(鉾田市の一部)| 85 | | SkylinesPlateau | ソースプログラム | 86 | | dll | 開発に必要なライブラリ | 87 | 88 | 89 | ## 8. ライセンス 90 | 91 | - ソースコード及び関連ドキュメントの著作権は国土交通省に帰属します。 92 | - 本ドキュメントは[Project PLATEAUのサイトポリシー](https://www.mlit.go.jp/plateau/site-policy/)(CCBY4.0及び政府標準利用規約2.0)に従い提供されています。 93 | 94 | ## 9. 注意事項 95 | 96 | - 本リポジトリは参考資料として提供しているものです。動作保証は行っていません。 97 | - 本リポジトリについては予告なく変更又は削除をする可能性があります。 98 | - 本リポジトリの利用により生じた損失及び損害等について、国土交通省はいかなる責任も負わないものとします。 99 | 100 | ## 10. 参考資料 101 | - 技術検証レポート: https://www.mlit.go.jp/plateau/file/libraries/doc/plateau_tech_doc_0082_ver01.pdf 102 | - PLATEAU WebサイトのUse Caseページ「ゲーミフィケーションによる参加型まちづくり v2.0」: https://www.mlit.go.jp/plateau/use-case/uc23-12/ 103 | - Cities: Skylines Wiki / Category:Programming : https://skylines.paradoxwikis.com/Category:Programming 104 | - mapbox/vector-tile-cs : https://github.com/mapbox/vector-tile-cs 105 | - その他の参考サイトは、本リポジトリのDocsフォルダ内の参考サイト.mdに記載しています。 106 | 107 | -------------------------------------------------------------------------------- /SampleData/08234_hokota-shi_2020_citygml_4_op_sample_area.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SampleData/08234_hokota-shi_2020_citygml_4_op_sample_area.zip -------------------------------------------------------------------------------- /SampleData/readme.md: -------------------------------------------------------------------------------- 1 | - MOD(SkylinesPLATEAU)の動作確認用の3D都市モデルです。 2 | - 鉾田市の3D都市モデルの一部を保存しています。 3 | - 地形、高速道路、地物読込の際に表示されるダイアログで中心座標「36.152783,140.520347」座標系番号「平面直角座標系9系」を指定してください。 4 | - 土地利用モデルはファイルサイズ上限のため、保存されていないエリアがあります。 5 | - 高速道路が存在しないエリアになります。 6 | 7 | 8 | #### 保存データ一覧 9 | - 地形、道路、建築物 10 | 54401470~54401473 11 | 54401480~54401483 12 | 54401490~54401493 13 | (道路については上記に加え、高速道路を含むデータ) 14 | 15 | - 都市計画決定情報 16 | 544013、544014 17 | 18 | - 土地利用 19 | 544004、544013、544033、544034 20 | -------------------------------------------------------------------------------- /SkylinesPlateau.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.8.34330.188 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SkylinesPlateau", "SkylinesPlateau\SkylinesPlateau.csproj", "{FC7BC991-7E2B-4DB2-B70A-8181EE7705F2}" 7 | EndProject 8 | Global 9 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 10 | Debug|Any CPU = Debug|Any CPU 11 | Release|Any CPU = Release|Any CPU 12 | EndGlobalSection 13 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 14 | {FC7BC991-7E2B-4DB2-B70A-8181EE7705F2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 15 | {FC7BC991-7E2B-4DB2-B70A-8181EE7705F2}.Release|Any CPU.ActiveCfg = Release|Any CPU 16 | {FC7BC991-7E2B-4DB2-B70A-8181EE7705F2}.Release|Any CPU.Build.0 = Release|Any CPU 17 | EndGlobalSection 18 | GlobalSection(SolutionProperties) = preSolution 19 | HideSolutionNode = FALSE 20 | EndGlobalSection 21 | GlobalSection(ExtensibilityGlobals) = postSolution 22 | SolutionGuid = {C72AB19E-3E31-49EE-BC43-6617AB397DA1} 23 | EndGlobalSection 24 | EndGlobal 25 | -------------------------------------------------------------------------------- /SkylinesPlateau/GUI/ImpGUI.cs: -------------------------------------------------------------------------------- 1 | using ColossalFramework; 2 | using ColossalFramework.UI; 3 | using System; 4 | using System.Collections.Generic; 5 | using UnityEngine; 6 | using UIUtils = SkylinesPlateau.common.UIUtils; 7 | 8 | // 参考サイト 9 | // https://skylines.paradoxwikis.com/UI_Framework 10 | 11 | namespace SkylinesPlateau 12 | { 13 | internal class ImpGUI : MonoBehaviour 14 | { 15 | //---------------------------------------------- 16 | // 固定値 17 | //---------------------------------------------- 18 | // ボタン名称 19 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_START 20 | private const string BTN_TITLE_MAPCREATE = "地形、高速道路読込"; 21 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_END 22 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 23 | // private const string BTN_TITLE_IMPORT_HW = "高速道路読込"; 24 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 25 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_START 26 | private const string BTN_TITLE_IMPORT = "地物読込"; 27 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_END 28 | 29 | // ボタンサイズ 30 | private const int BTN_SIZE_W = 170; 31 | private const int BTN_SIZE_H = 30; 32 | // ダイアログの各種名称 33 | private const string DIALOG_TITLE = "地物読込"; 34 | private const string DIALOG_MSG_BTN_OK_1 = "インポート"; 35 | private const string DIALOG_MSG_BTN_OK_2 = "高さマップを作成"; 36 | private const string DIALOG_MSG_BTN_CANSEL = "キャンセル"; 37 | private const string DIALOG_MSG_IMPTYPE = "インポートする地物を選択"; 38 | private const string DIALOG_MSG_IMPTYPE_1 = "河川"; 39 | private const string DIALOG_MSG_IMPTYPE_2 = "道路"; 40 | private const string DIALOG_MSG_IMPTYPE_3 = "線路"; 41 | private const string DIALOG_MSG_IMPTYPE_4 = "一般建築物"; 42 | private const string DIALOG_MSG_IMPTYPE_5 = "特定建築物"; 43 | private const string DIALOG_MSG_IMPTYPE_6 = "区域区分"; 44 | private const string DIALOG_MSG_IMPTYPE_7 = "土地利用"; 45 | private const string DIALOG_MSG_CENTER = "中心座標"; 46 | private const string DIALOG_MSG_AREA = "読み込み範囲指定 (Km)"; 47 | private const string DIALOG_MSG_AREA_HOSOKU = "*1タイルはおよそ2km x 2kmです"; 48 | // ダイアログサイズ 49 | private const int DIALOG_SIZE_W = 300; 50 | private const int DIALOG_SIZE_H = 500; 51 | // ダイアログに表示するメッセージの高さ 52 | private const int DIALOG_MSG_W = DIALOG_SIZE_W - 20; 53 | private const int DIALOG_MSG_H = 25; 54 | // 各項目間のスペース 55 | private const int DIALOG_SPACE_H1 = 10; 56 | // 同一項目間のスペース 57 | private const int DIALOG_SPACE_H2 = 2; 58 | 59 | /// 60 | /// インポートモード 61 | /// 62 | public enum GML_IMPORT_MODE 63 | { 64 | /// 65 | /// 高さ地図 66 | /// 67 | mapCreate = 0, 68 | /// 69 | /// 高速道路取込 70 | /// 71 | highway = 1, 72 | /// 73 | /// 地物取込 74 | /// 75 | features = 2 76 | } 77 | 78 | //---------------------------------------------- 79 | // メンバ変数 80 | //---------------------------------------------- 81 | public UIView uiView; 82 | private UITextureAtlas _ingameAtlas; 83 | private UIButton _btnImpMapCreate; 84 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 85 | // private UIButton _btnImpHighway; 86 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 87 | private UIButton _btnImpFeatures; 88 | private ImpMapPanel _impMapPanel; 89 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 90 | // private ImpHighwayPanel _impHighwayPanel; 91 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 92 | private ImpFeaturesPanel _impFeaturesPanel; 93 | 94 | private GameObject _objBtnImpMapCreate; 95 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 96 | // private GameObject _objBtnImpHighway; 97 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 98 | private GameObject _objBtnImpFeatures; 99 | 100 | private void Start() 101 | { 102 | // 道路のアセット一覧 103 | #if false 104 | //---------------------------------- 105 | // 使用可能な建物アセットを取得しログ出力 106 | //---------------------------------- 107 | var map = new Dictionary(); 108 | Logger.Log("[TEST] 道路の全件数 : " + PrefabCollection.LoadedCount()); 109 | for (uint i = 0; i < PrefabCollection.LoadedCount(); i++) 110 | { 111 | // 建物読み込み 112 | var prefab = PrefabCollection.GetLoaded(i); 113 | if (prefab == null) 114 | { 115 | continue; 116 | } 117 | Logger.Log("[TEST] NetInfo [" + i + "] : " + prefab.name); 118 | 119 | if (!prefab.name.EndsWith("_Data")) 120 | { 121 | continue; 122 | } 123 | map[prefab] = 0; 124 | } 125 | #endif 126 | // 建物のアセット一覧 127 | #if false 128 | //---------------------------------- 129 | // 使用可能な建物アセットを取得しログ出力 130 | //---------------------------------- 131 | var map = new Dictionary(); 132 | Logger.Log("[TEST] 建物の全件数 : " + PrefabCollection.LoadedCount()); 133 | for (uint i = 0; i < PrefabCollection.LoadedCount(); i++) 134 | { 135 | // 建物読み込み 136 | var prefab = PrefabCollection.GetLoaded(i); 137 | if (prefab == null) 138 | { 139 | continue; 140 | } 141 | Logger.Log("[TEST] BuildingInfo [" + i + "] : " + prefab.name); 142 | 143 | if (!prefab.name.EndsWith("_Data")) 144 | { 145 | continue; 146 | } 147 | map[prefab] = 0; 148 | } 149 | 150 | string assetName = "Cemetery"; 151 | BuildingInfo bi = null; 152 | // アセットが対応しているか判定 153 | if (PrefabCollection.LoadedExists(assetName)) 154 | { 155 | // アセットを用いる 156 | bi = PrefabCollection.FindLoaded(assetName); 157 | } 158 | // 対応しているアセットがない場合 159 | if (bi == null) 160 | { 161 | Logger.Log("× assetなし:" + assetName); 162 | } 163 | else 164 | { 165 | Logger.Log("〇 assetあり:" + assetName); 166 | } 167 | #endif 168 | 169 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 170 | // //---------------------------------- 171 | // // 設定ファイルの読み込み 172 | // //---------------------------------- 173 | // ImportSettingData.Instance.Load(); 174 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 175 | 176 | //---------------------------------- 177 | // テクスチャ取得 178 | //---------------------------------- 179 | UITextureAtlas[] array = Resources.FindObjectsOfTypeAll(typeof(UITextureAtlas)) as UITextureAtlas[]; 180 | for (int i = 0; i < array.Length; i++) 181 | { 182 | if (((UnityEngine.Object)array[i]).name == "Ingame") 183 | { 184 | _ingameAtlas = array[i]; 185 | break; 186 | } 187 | } 188 | _ingameAtlas = UIView.GetAView().defaultAtlas; 189 | 190 | //---------------------------------- 191 | // ボタン表示 192 | //---------------------------------- 193 | ItemClass.Availability ins_mode = Singleton.instance.m_properties.m_mode; 194 | // マップエディターモードの場合 195 | if (ins_mode == ItemClass.Availability.MapEditor) 196 | { 197 | //---------------------------------------- 198 | // 高さマップ作成ボタン 199 | //---------------------------------------- 200 | // パネル 201 | if (_impMapPanel == null) 202 | { 203 | GameObject obj = GameObject.Find("ImpMapPanel"); 204 | _impMapPanel = ((obj != null) ? obj.GetComponent() : null); 205 | } 206 | // ボタン 207 | _objBtnImpMapCreate = new GameObject("UIButton1"); 208 | _objBtnImpMapCreate.transform.parent = uiView.transform; 209 | _objBtnImpMapCreate.AddComponent(); 210 | _btnImpMapCreate = _objBtnImpMapCreate.GetComponent(); 211 | _btnImpMapCreate.name = "_btnImpMapCreate"; 212 | _btnImpMapCreate.atlas = _ingameAtlas; 213 | _btnImpMapCreate.foregroundSpriteMode = UIForegroundSpriteMode.Stretch; 214 | _btnImpMapCreate.normalFgSprite = "ButtonMenu"; 215 | _btnImpMapCreate.hoveredFgSprite = "ButtonMenu" + "Hovered"; 216 | _btnImpMapCreate.pressedFgSprite = "ButtonMenu" + "Pressed"; 217 | _btnImpMapCreate.disabledFgSprite = "ButtonMenu" + "Disabled"; 218 | _btnImpMapCreate.text = BTN_TITLE_MAPCREATE; 219 | _btnImpMapCreate.height = BTN_SIZE_H; 220 | _btnImpMapCreate.width = BTN_SIZE_W; 221 | _btnImpMapCreate.relativePosition = new Vector3(60, 10); 222 | _btnImpMapCreate.eventClicked += delegate (UIComponent component, UIMouseEventParameter eventParam) 223 | { 224 | if (!eventParam.used) 225 | { 226 | IniFileData.Instance.Load(); 227 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 228 | // ImportSettingData.Instance.Load(); 229 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 230 | _impMapPanel.drawDialog(); 231 | eventParam.Use(); 232 | } 233 | }; 234 | 235 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 236 | #if false 237 | /* 238 | //---------------------------------------- 239 | // 高速道路インポートボタン 240 | //---------------------------------------- 241 | // パネル 242 | if (_impHighwayPanel == null) 243 | { 244 | GameObject obj = GameObject.Find("ImpHighwayPanel"); 245 | _impHighwayPanel = ((obj != null) ? obj.GetComponent() : null); 246 | } 247 | // ボタン 248 | _objBtnImpHighway = new GameObject("UIButton2"); 249 | _objBtnImpHighway.transform.parent = uiView.transform; 250 | _objBtnImpHighway.AddComponent(); 251 | _btnImpHighway = _objBtnImpHighway.GetComponent(); 252 | _btnImpHighway.name = "_btnImpFeatures"; 253 | _btnImpHighway.atlas = _ingameAtlas; 254 | _btnImpHighway.foregroundSpriteMode = UIForegroundSpriteMode.Stretch; 255 | _btnImpHighway.normalFgSprite = "ButtonMenu"; 256 | _btnImpHighway.hoveredFgSprite = "ButtonMenu" + "Hovered"; 257 | _btnImpHighway.pressedFgSprite = "ButtonMenu" + "Pressed"; 258 | _btnImpHighway.disabledFgSprite = "ButtonMenu" + "Disabled"; 259 | _btnImpHighway.text = BTN_TITLE_IMPORT_HW; 260 | _btnImpHighway.height = BTN_SIZE_H; 261 | _btnImpHighway.width = BTN_SIZE_W; 262 | _btnImpHighway.relativePosition = new Vector3(70 + BTN_SIZE_W, 10); 263 | _btnImpHighway.eventClicked += delegate (UIComponent component, UIMouseEventParameter eventParam) 264 | { 265 | if (!eventParam.used) 266 | { 267 | IniFileData.Instance.Load(); 268 | ImportSettingData.Instance.Load(); 269 | _impHighwayPanel.drawDialog(); 270 | eventParam.Use(); 271 | } 272 | }; 273 | */ 274 | #endif 275 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 276 | } 277 | // ゲームモードの場合 278 | else if (ins_mode == ItemClass.Availability.Game) 279 | { 280 | //---------------------------------------- 281 | // 高速道路インポートボタン 282 | //---------------------------------------- 283 | // パネル 284 | if (_impFeaturesPanel == null) 285 | { 286 | GameObject obj = GameObject.Find("ImpFeaturesPanel"); 287 | _impFeaturesPanel = ((obj != null) ? obj.GetComponent() : null); 288 | } 289 | // ボタン 290 | _objBtnImpFeatures = new GameObject("UIButton3"); 291 | _objBtnImpFeatures.transform.parent = uiView.transform; 292 | _objBtnImpFeatures.AddComponent(); 293 | _btnImpFeatures = _objBtnImpFeatures.GetComponent(); 294 | _btnImpFeatures.name = "_btnImpFeatures"; 295 | _btnImpFeatures.atlas = _ingameAtlas; 296 | _btnImpFeatures.foregroundSpriteMode = UIForegroundSpriteMode.Stretch; 297 | _btnImpFeatures.normalFgSprite = "ButtonMenu"; 298 | _btnImpFeatures.hoveredFgSprite = "ButtonMenu" + "Hovered"; 299 | _btnImpFeatures.pressedFgSprite = "ButtonMenu" + "Pressed"; 300 | _btnImpFeatures.disabledFgSprite = "ButtonMenu" + "Disabled"; 301 | _btnImpFeatures.text = BTN_TITLE_IMPORT; 302 | _btnImpFeatures.height = BTN_SIZE_H; 303 | _btnImpFeatures.width = BTN_SIZE_W; 304 | _btnImpFeatures.relativePosition = new Vector3(60, 10); 305 | // _btnImpFeatures.relativePosition = new Vector3(80 + BTN_SIZE_W * 2, 10); 306 | _btnImpFeatures.eventClicked += delegate (UIComponent component, UIMouseEventParameter eventParam) 307 | { 308 | if (!eventParam.used) 309 | { 310 | IniFileData.Instance.Load(); 311 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 312 | // ImportSettingData.Instance.Load(); 313 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 314 | _impFeaturesPanel.drawDialog(); 315 | eventParam.Use(); 316 | } 317 | }; 318 | } 319 | } 320 | 321 | public void Update() 322 | { 323 | } 324 | } 325 | } -------------------------------------------------------------------------------- /SkylinesPlateau/GUI/SettingUI.cs: -------------------------------------------------------------------------------- 1 | using ColossalFramework; 2 | using ColossalFramework.UI; 3 | using ICities; 4 | using System; 5 | using System.Reflection; 6 | using UnityEngine; 7 | 8 | using UIUtils = SkylinesPlateau.common.UIUtils; 9 | using ColossalFramework.PlatformServices; 10 | 11 | namespace SkylinesPlateau 12 | { 13 | public static class SettingsUI 14 | { 15 | private const string FILE_NAME = "SkylinesPLATEAU"; 16 | private const string DIALOG_TITLE = "地形、高速道路読込"; 17 | private const string DIALOG_MSG_FOLDER = "3D都市モデルフォルダ"; 18 | private const string DIALOG_MSG_CENTER = "中心座標"; 19 | private const string DIALOG_MSG_SYS = "座標系系番号"; 20 | private const string DIALOG_MSG_DEM_SEALEVEL = "地盤レベル"; 21 | private const string DIALOG_MSG_DEM_SEALEVEL_HOSOKU = "地形読み込み時に基準となるゲーム上の高さ"; 22 | private const string DIALOG_MSG_WATER_DOWNHEIGHT = "水面オフセット"; 23 | private const string DIALOG_MSG_WATER_DOWNHEIGHT_HOSOKU = "地形と水部のレベル差。設定値分、水部を下げる"; 24 | private const string DIALOG_MSG_DEM_FILTER = "TIN読込最大面積"; 25 | private const string DIALOG_MSG_DEM_FILTER_HOSOKU = "最大面積を超える三角形ポリゴン(TIN)は標高0mとする"; 26 | private const string DIALOG_MSG_AREASIZE = "読み込み範囲"; 27 | private const string DIALOG_MSG_AREASIZE_HOSOKU = "地物読込を行う中心からの距離"; 28 | private const string DIALOG_MSG_ROAD_FILTER = "三角道路ポリゴン除外面積"; 29 | private const string DIALOG_MSG_ROAD_FILTER_HOSOKU = "狭小な道路ポリゴンを除外するための閾値"; 30 | private const string DIALOG_MSG_SUPPORT = "サポート"; 31 | private const string DIALOG_MSG_SUPPORT_BTN = "SkylinesPLATEAUのマニュアルを開く"; 32 | 33 | private static UIFolderDialog _folderDialog = null; 34 | private static UITextField _folderPathField; 35 | private static UITextField _centerField; 36 | private static UIDropDown _systemDropdown; 37 | private static UITextField _demSeaLevelField; 38 | private static UITextField _waterDownHeightField; 39 | private static UITextField _demFilterField; 40 | private static UITextField _areaSizeField; 41 | private static UITextField _roadFilterField; 42 | 43 | static SettingsUI() 44 | { 45 | if (GameSettings.FindSettingsFileByName(FILE_NAME) == null) 46 | { 47 | GameSettings.AddSettingsFile(new SettingsFile 48 | { 49 | fileName = FILE_NAME 50 | }); 51 | } 52 | } 53 | 54 | public static UIPanel Panel(this UIHelperBase helper) 55 | { 56 | return (helper as UIHelper).self as UIPanel; 57 | } 58 | 59 | public static void UpdateOptionSetting() 60 | { 61 | if (_folderPathField != null) 62 | { 63 | _folderPathField.text = IniFileData.Instance.inputFolderPath; 64 | } 65 | if (_centerField != null) 66 | { 67 | _centerField.text = IniFileData.Instance.center; 68 | } 69 | if (_systemDropdown != null) 70 | { 71 | _systemDropdown.selectedIndex = IniFileData.Instance.isystem; 72 | } 73 | if (_demSeaLevelField != null) 74 | { 75 | _demSeaLevelField.text = IniFileData.Instance.demSeaLevel.ToString("F1"); 76 | } 77 | if (_waterDownHeightField != null) 78 | { 79 | _waterDownHeightField.text = IniFileData.Instance.demWaterAreaDownHeight.ToString("F1"); 80 | } 81 | if (_demFilterField != null) 82 | { 83 | _demFilterField.text = IniFileData.Instance.demFilterAreaSize.ToString("F0"); 84 | } 85 | if (_areaSizeField != null) 86 | { 87 | _areaSizeField.text = IniFileData.Instance.areaSize; 88 | } 89 | if (_roadFilterField != null) 90 | { 91 | _roadFilterField.text = IniFileData.Instance.roadFilterAreaSize.ToString("F0"); 92 | } 93 | } 94 | 95 | public static void OnSettingsUI(UIHelper helper) 96 | { 97 | _folderPathField = AddTextfield2(helper, DIALOG_MSG_FOLDER, "", IniFileData.Instance.inputFolderPath, "", true, 98 | (value) => { }, 99 | (value) => { 100 | IniFileData.Instance.inputFolderPath = value; 101 | IniFileData.Instance.Save(); 102 | }, 103 | //------------------------------------------------------------------------------------------------------------------- 104 | () => { 105 | try 106 | { 107 | if (_folderDialog != null) 108 | { 109 | _folderDialog.Visible = true; 110 | if (!_folderDialog.Visible) 111 | { 112 | _folderDialog = null; 113 | } 114 | } 115 | if (_folderDialog == null) 116 | { 117 | _folderDialog = new UIFolderDialog(); 118 | _folderDialog.onOkButtonCallback = () => { 119 | IniFileData.Instance.inputFolderPath = _folderDialog.m_FolderPath; 120 | _folderPathField.text = _folderDialog.m_FolderPath; 121 | IniFileData.Instance.Save(); 122 | }; 123 | _folderDialog.onCancelButtonCallback = () => { 124 | }; 125 | _folderDialog.m_FolderPath = IniFileData.Instance.inputFolderPath; 126 | _folderDialog.drawDialog(((UIComponent)helper.self).parent); 127 | } 128 | else 129 | { 130 | _folderDialog.m_FolderPath = IniFileData.Instance.inputFolderPath; 131 | _folderDialog.Visible = true; 132 | } 133 | } 134 | catch (Exception ex) 135 | { 136 | Debug.Log("Exception Error : " + ex.Message); 137 | Debug.Log("Exception Tracer: " + ex.StackTrace); 138 | } 139 | }); 140 | //------------------------------------------------------------------------------------------------------------------- 141 | 142 | _centerField = AddTextfield2(helper, DIALOG_MSG_CENTER, "", IniFileData.Instance.center, "", false, 143 | (value) => { }, 144 | (value) => { 145 | IniFileData.Instance.center = value; 146 | IniFileData.Instance.Save(); 147 | }, 148 | null); 149 | 150 | _systemDropdown = AddDropdown2(helper, DIALOG_MSG_SYS, CommonBL.SYS_NAME_LIST, IniFileData.Instance.isystem, 151 | (index) => { 152 | IniFileData.Instance.isystem = index; 153 | IniFileData.Instance.Save(); 154 | }); 155 | 156 | _demSeaLevelField = AddTextfield2(helper, DIALOG_MSG_DEM_SEALEVEL, DIALOG_MSG_DEM_SEALEVEL_HOSOKU, IniFileData.Instance.demSeaLevel.ToString("F1"), "(m)", false, 157 | (value) => { }, 158 | (value) => { 159 | IniFileData.Instance.demSeaLevel = double.Parse(value); 160 | IniFileData.Instance.Save(); 161 | }, 162 | null); 163 | 164 | _waterDownHeightField = AddTextfield2(helper, DIALOG_MSG_WATER_DOWNHEIGHT, DIALOG_MSG_WATER_DOWNHEIGHT_HOSOKU, IniFileData.Instance.demWaterAreaDownHeight.ToString("F1"), "(m)", false, 165 | (value) => { }, 166 | (value) => { 167 | IniFileData.Instance.demWaterAreaDownHeight = double.Parse(value); 168 | IniFileData.Instance.Save(); 169 | }, 170 | null); 171 | 172 | _demFilterField = AddTextfield2(helper, DIALOG_MSG_DEM_FILTER, DIALOG_MSG_DEM_FILTER_HOSOKU, IniFileData.Instance.demFilterAreaSize.ToString("F0"), "(㎡)", false, 173 | (value) => { }, 174 | (value) => { 175 | IniFileData.Instance.demFilterAreaSize = double.Parse(value); 176 | IniFileData.Instance.Save(); 177 | }, 178 | null); 179 | 180 | _areaSizeField = AddTextfield2(helper, DIALOG_MSG_AREASIZE, DIALOG_MSG_AREASIZE_HOSOKU, IniFileData.Instance.areaSize, "(km)", false, 181 | (value) => { }, 182 | (value) => { 183 | IniFileData.Instance.areaSize = value; 184 | IniFileData.Instance.Save(); 185 | }, 186 | null); 187 | 188 | _roadFilterField = AddTextfield2(helper, DIALOG_MSG_ROAD_FILTER, DIALOG_MSG_ROAD_FILTER_HOSOKU, IniFileData.Instance.roadFilterAreaSize.ToString("F0"), "(㎡)", false, 189 | (value) => { }, 190 | (value) => { 191 | IniFileData.Instance.roadFilterAreaSize = double.Parse(value); 192 | IniFileData.Instance.Save(); 193 | }, 194 | null); 195 | 196 | // ヘルプの指定がある場合のみ表示 197 | if (!string.IsNullOrEmpty(IniFileData.Instance.helpUrl)) 198 | { 199 | // スペース配置 200 | helper.AddSpace(50); 201 | 202 | // ボタン配置 203 | AddButton2(helper, DIALOG_MSG_SUPPORT, DIALOG_MSG_SUPPORT_BTN, 204 | () => { 205 | try 206 | { 207 | if (PlatformService.IsOverlayEnabled()) 208 | { 209 | if (PlatformService.apiBackend == APIBackend.Steam) 210 | { 211 | PlatformService.ActivateGameOverlayToWebPage(IniFileData.Instance.helpUrl); 212 | } 213 | else 214 | { 215 | PlatformService.ActivateGameOverlayToStore(346791u, OverlayToStoreFlag.None); 216 | } 217 | } 218 | } 219 | catch (Exception ex) 220 | { 221 | Debug.Log("Exception Error : " + ex.Message); 222 | Debug.Log("Exception Tracer: " + ex.StackTrace); 223 | } 224 | }); 225 | } 226 | 227 | // バージョン表示 228 | try 229 | { 230 | // バージョン取得 231 | System.Reflection.Assembly assembly = Assembly.GetExecutingAssembly(); 232 | System.Reflection.AssemblyName asmName = assembly.GetName(); 233 | System.Version version = asmName.Version; 234 | // バージョン表示 235 | AddLabel2(helper, "v" + version.ToString()); 236 | } 237 | catch (Exception ex) 238 | { 239 | Debug.Log("[2023] バージョン取得に失敗"); 240 | Debug.Log("Exception Error : " + ex.Message); 241 | Debug.Log("Exception Tracer: " + ex.StackTrace); 242 | Debug.Log("Exception : " + ex); 243 | } 244 | } 245 | 246 | 247 | private static UITextField AddTextfield2(UIHelper inHelper, string inTitle, string inSubTitle, string inText, string inUnitText, bool inDrawBtn, OnTextChanged eventChangedCallback, OnTextSubmitted eventSubmittedCallback, OnButtonClicked eventCallback) 248 | { 249 | UITextField rtnTextField = null; 250 | float lbl_h = 20f; 251 | float txt_h = 30f; 252 | float btn_w = 30f; 253 | float btn_h = 22f; 254 | 255 | float areaW = ((UIComponent)inHelper.self).width; 256 | 257 | float offset_x = 0f; 258 | float offset_y = 0f; 259 | float space_w = 30f; 260 | float space_h = 1f; 261 | 262 | UILabel baseLabel = UIUtils.GetOptionTemplate_TextLabel(); 263 | UITextField baseTextField = UIUtils.GetOptionTemplate_TextField(); 264 | 265 | //-------------------------------------------- 266 | // 背景用のパネル 267 | //-------------------------------------------- 268 | UIPanel panel_bg = ((UIComponent)inHelper.self).AddUIComponent(); 269 | panel_bg.width = areaW; 270 | panel_bg.height = 70; 271 | { 272 | //-------------------------------------------- 273 | // 項目名ラベル 274 | //-------------------------------------------- 275 | UILabel txtLabel = UIUtils.CreateLabel(panel_bg, "_txtLabel", inTitle, baseLabel); 276 | txtLabel.height = lbl_h; 277 | txtLabel.relativePosition = new Vector3(offset_x, offset_y); 278 | txtLabel.verticalAlignment = UIVerticalAlignment.Bottom; 279 | 280 | //-------------------------------------------- 281 | // 項目名ラベル(SUB) 282 | //-------------------------------------------- 283 | if (!string.IsNullOrEmpty(inSubTitle)) 284 | { 285 | float bkSize = txtLabel.width + space_w; 286 | offset_x += bkSize; 287 | UILabel txtSubLabel = UIUtils.CreateLabel(panel_bg, "_txtSubLabel", inSubTitle, baseLabel); 288 | txtSubLabel.relativePosition = new Vector3(offset_x, offset_y + 2f); 289 | txtSubLabel.verticalAlignment = UIVerticalAlignment.Bottom; 290 | txtSubLabel.textScale = 0.75f; 291 | txtSubLabel.height = lbl_h; 292 | offset_x -= bkSize; 293 | } 294 | 295 | offset_y += (txtLabel.height + space_h); 296 | 297 | //-------------------------------------------- 298 | // テキストフィールド 299 | //-------------------------------------------- 300 | rtnTextField = UIUtils.CreateTextField(panel_bg, "_txtField", inText, baseTextField); 301 | rtnTextField.width = (areaW / 4) * 3; 302 | rtnTextField.height = txt_h; 303 | rtnTextField.relativePosition = new Vector3(offset_x, offset_y); 304 | // txtField.color = Color.white; 305 | 306 | rtnTextField.eventTextChanged += delegate (UIComponent c, string sel) 307 | { 308 | eventChangedCallback(sel); 309 | }; 310 | rtnTextField.eventTextSubmitted += delegate (UIComponent c, string sel) 311 | { 312 | if (eventSubmittedCallback != null) 313 | { 314 | eventSubmittedCallback(sel); 315 | } 316 | }; 317 | 318 | //-------------------------------------------- 319 | // ボタン 320 | //-------------------------------------------- 321 | if (inDrawBtn) 322 | { 323 | try 324 | { 325 | UIButton folderButton = UIUtils.Instance.CreateImageButton(rtnTextField, "FolderIconButton", "folderIcon"); 326 | folderButton.tooltip = ""; 327 | folderButton.height = btn_h; 328 | folderButton.width = btn_w; 329 | folderButton.relativePosition = new Vector3(rtnTextField.width - (btn_w + 5.0f), (txt_h - btn_h) / 2.0f); 330 | folderButton.eventClicked += delegate (UIComponent component, UIMouseEventParameter eventParam) 331 | { 332 | eventCallback(); 333 | }; 334 | 335 | rtnTextField.padding.right = (int)Math.Ceiling(btn_w) + 5; 336 | } 337 | catch (Exception ex) 338 | { 339 | Debug.Log("Exception Error : " + ex.Message); 340 | Debug.Log("Exception Tracer: " + ex.StackTrace); 341 | } 342 | } 343 | 344 | //-------------------------------------------- 345 | // 単位 346 | //-------------------------------------------- 347 | if (!string.IsNullOrEmpty(inUnitText)) 348 | { 349 | float bkSize = rtnTextField.width + 10f; 350 | offset_x += bkSize; 351 | UILabel unitLabel = UIUtils.CreateLabel(panel_bg, "_unitLabel", inUnitText, baseLabel); 352 | unitLabel.relativePosition = new Vector3(offset_x, offset_y); 353 | unitLabel.verticalAlignment = UIVerticalAlignment.Bottom; 354 | unitLabel.textScale = 1.3f; 355 | unitLabel.height = txt_h; 356 | offset_x -= bkSize; 357 | } 358 | 359 | offset_y += (rtnTextField.height); 360 | } 361 | panel_bg.height = offset_y + 10f; 362 | 363 | return rtnTextField; 364 | } 365 | 366 | private static UIDropDown AddDropdown2(UIHelper inHelper, string text, string[] options, int defaultSelection, OnDropdownSelectionChanged eventCallback) 367 | { 368 | if (eventCallback != null && !string.IsNullOrEmpty(text)) 369 | { 370 | float areaW = ((UIComponent)inHelper.self).width; 371 | UIPanel uIPanel = ((UIComponent)inHelper.self).AttachUIComponent(UITemplateManager.GetAsGameObject("OptionsDropdownTemplate")) as UIPanel; 372 | uIPanel.Find("Label").text = text; 373 | UIDropDown uIDropDown = uIPanel.Find("Dropdown"); 374 | uIDropDown.items = options; 375 | uIDropDown.selectedIndex = defaultSelection; 376 | uIDropDown.width = (areaW / 4) * 3; 377 | uIDropDown.eventSelectedIndexChanged += delegate (UIComponent c, int sel) 378 | { 379 | eventCallback(sel); 380 | }; 381 | return uIDropDown; 382 | } 383 | return null; 384 | } 385 | 386 | public static void AddButton2(UIHelper inHelper, string inTitle, string inBtnText, OnButtonClicked eventCallback) 387 | { 388 | float lbl_h = 20f; 389 | float btn_w = 400f; 390 | float btn_h = 40f; 391 | 392 | float areaW = ((UIComponent)inHelper.self).width; 393 | float offset_x = 0f; 394 | float offset_y = 0f; 395 | float space_h = 1f; 396 | 397 | UILabel baseLabel = UIUtils.GetOptionTemplate_TextLabel(); 398 | GameObject txtTmplate = UnityEngine.Object.Instantiate(UITemplateManager.GetAsGameObject("OptionsButtonTemplate")); 399 | UIButton baseButton = txtTmplate.GetComponent() as UIButton; 400 | 401 | //-------------------------------------------- 402 | // 背景用のパネル 403 | //-------------------------------------------- 404 | UIPanel panel_bg = ((UIComponent)inHelper.self).AddUIComponent(); 405 | panel_bg.width = areaW; 406 | panel_bg.height = 70; 407 | { 408 | //-------------------------------------------- 409 | // 項目名ラベル 410 | //-------------------------------------------- 411 | UILabel txtLabel = UIUtils.CreateLabel(panel_bg, "_txtLabel", inTitle, baseLabel); 412 | txtLabel.height = lbl_h; 413 | txtLabel.relativePosition = new Vector3(offset_x, offset_y); 414 | txtLabel.verticalAlignment = UIVerticalAlignment.Bottom; 415 | offset_y += (txtLabel.height + space_h); 416 | 417 | //-------------------------------------------- 418 | // ボタン配置 419 | //-------------------------------------------- 420 | UIButton txtButton = UIUtils.CreateButton(panel_bg, "_txtButton", baseButton.atlas, baseButton.normalFgSprite, baseButton); 421 | txtButton.width = btn_w; 422 | txtButton.height = btn_h; 423 | txtButton.relativePosition = new Vector3(offset_x + 10f, offset_y); 424 | txtButton.text = inBtnText; 425 | txtButton.eventClick += delegate 426 | { 427 | eventCallback(); 428 | }; 429 | offset_y += (txtButton.height); 430 | } 431 | panel_bg.height = offset_y + 10f; 432 | } 433 | 434 | public static void AddLabel2(UIHelper inHelper, string inTitle) 435 | { 436 | //-------------------------------------------- 437 | // 項目名ラベル 438 | //-------------------------------------------- 439 | UILabel baseLabel = UIUtils.GetOptionTemplate_TextLabel(); 440 | UILabel txtLabel = UIUtils.CreateLabel((UIComponent)inHelper.self, "_txtLabel", inTitle, baseLabel); 441 | txtLabel.autoSize = false; 442 | txtLabel.width = ((UIComponent)inHelper.self).width-50; 443 | txtLabel.height = 20f; 444 | txtLabel.relativePosition = new Vector3(0, 0); 445 | txtLabel.verticalAlignment = UIVerticalAlignment.Bottom; 446 | txtLabel.textAlignment = UIHorizontalAlignment.Right; 447 | } 448 | } 449 | } 450 | -------------------------------------------------------------------------------- /SkylinesPlateau/GmlData/GmlCodeListData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace SkylinesPlateau 8 | { 9 | public class GmlCodeListData 10 | { 11 | public string key; 12 | public string value; 13 | 14 | public GmlCodeListData(string data1, string data2) 15 | { 16 | key = data1; 17 | value = data2; 18 | } 19 | 20 | /// 21 | /// コードリストから該当するKey値の設定値を取得する 22 | /// 23 | static public string FindData(Dictionary> codeListMap, string fileName, string keyStr) 24 | { 25 | string rtnStr = ""; 26 | List list = null; 27 | 28 | //---------------------------------------------- 29 | // GMLファイルが読み込み済みか判定 30 | //---------------------------------------------- 31 | // 読み込み済みの場合 32 | if (codeListMap.ContainsKey(fileName)) 33 | { 34 | list = codeListMap[fileName]; 35 | } 36 | // 読み込み済みではない場合 37 | else 38 | { 39 | // GMLファイルを読み込む 40 | GmlUtil gml = GmlUtil(fileName); 41 | list = GmlUtil.readData(); 42 | // 読み込みデータを保持 43 | codeListMap[fileName] = list; 44 | } 45 | 46 | //---------------------------------------------- 47 | // リスト内に該当データが存在するか判定 48 | //---------------------------------------------- 49 | var match = codeListMap[fileName].FindAll(item => 50 | { 51 | if(item.key == keyStr) 52 | { 53 | return true; 54 | } 55 | return false; 56 | } 57 | // 発見できた場合 58 | if(match.count > 0) 59 | { 60 | return match[0].value; 61 | } 62 | return ""; 63 | } 64 | } 65 | } 66 | -------------------------------------------------------------------------------- /SkylinesPlateau/GmlData/GmlUtil.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.IO; 4 | using System.Linq; 5 | using System.Text; 6 | using System.Xml; 7 | using System.Xml.XPath; 8 | using UnityEngine; 9 | 10 | namespace SkylinesPlateau 11 | { 12 | class GmlUtil 13 | { 14 | //------------------------------------- 15 | // メンバ変数 16 | //------------------------------------- 17 | private string _fileName; 18 | XPathNavigator _xml = null; 19 | private XmlNamespaceManager _xmlnsManager = null; 20 | 21 | //------------------------------------- 22 | // メソッド 23 | //------------------------------------- 24 | public GmlUtil(string fileName) 25 | { 26 | _fileName = fileName; 27 | OpenXML(fileName); 28 | } 29 | /// 30 | /// XMLファイルのオープン 31 | /// 32 | public bool OpenXML(string fileName) 33 | { 34 | //------------------------------------- 35 | // ファイル読み込み 36 | //------------------------------------- 37 | Logger.Log("ファイルの読み込み開始:" + fileName); 38 | try 39 | { 40 | XPathDocument xPathDoc = new XPathDocument(fileName); 41 | _xml = xPathDoc.CreateNavigator(); 42 | _xmlnsManager = new XmlNamespaceManager(_xml.NameTable); 43 | _xmlnsManager.AddNamespace("grp", "http://www.opengis.net/citygml/cityobjectgroup/2.0"); 44 | _xmlnsManager.AddNamespace("core", "http://www.opengis.net/citygml/2.0"); 45 | _xmlnsManager.AddNamespace("bldg", "http://www.opengis.net/citygml/building/2.0"); 46 | _xmlnsManager.AddNamespace("smil20", "http://www.w3.org/2001/SMIL20/"); 47 | _xmlnsManager.AddNamespace("pbase", "http://www.opengis.net/citygml/profiles/base/2.0"); 48 | _xmlnsManager.AddNamespace("smil20lang", "http://www.w3.org/2001/SMIL20/Language"); 49 | _xmlnsManager.AddNamespace("xsi", "http://www.w3.org/2001/XMLSchema-instance"); 50 | _xmlnsManager.AddNamespace("xAL", "urn:oasis:names:tc:ciq:xsdschema:xAL:2.0"); 51 | _xmlnsManager.AddNamespace("luse", "http://www.opengis.net/citygml/landuse/2.0"); 52 | _xmlnsManager.AddNamespace("app", "http://www.opengis.net/citygml/appearance/2.0"); 53 | _xmlnsManager.AddNamespace("gen", "http://www.opengis.net/citygml/generics/2.0"); 54 | _xmlnsManager.AddNamespace("dem", "http://www.opengis.net/citygml/relief/2.0"); 55 | _xmlnsManager.AddNamespace("tex", "http://www.opengis.net/citygml/texturedsurface/2.0"); 56 | _xmlnsManager.AddNamespace("xlink", "http://www.w3.org/1999/xlink"); 57 | _xmlnsManager.AddNamespace("tun", "http://www.opengis.net/citygml/tunnel/2.0"); 58 | _xmlnsManager.AddNamespace("sch", "http://www.ascc.net/xml/schematron"); 59 | _xmlnsManager.AddNamespace("veg", "http://www.opengis.net/citygml/vegetation/2.0"); 60 | _xmlnsManager.AddNamespace("frn", "http://www.opengis.net/citygml/cityfurniture/2.0"); 61 | _xmlnsManager.AddNamespace("gml", "http://www.opengis.net/gml"); 62 | _xmlnsManager.AddNamespace("tran", "http://www.opengis.net/citygml/transportation/2.0"); 63 | _xmlnsManager.AddNamespace("wtr", "http://www.opengis.net/citygml/waterbody/2.0"); 64 | _xmlnsManager.AddNamespace("brid", "http://www.opengis.net/citygml/bridge/2.0"); 65 | _xmlnsManager.AddNamespace("uro", "https://www.geospatial.jp/iur/uro/2.0"); 66 | _xmlnsManager.AddNamespace("urf", "https://www.geospatial.jp/iur/urf/2.0"); 67 | } 68 | catch (Exception ex) 69 | { 70 | Logger.Log("xmlファイルの解析に失敗しました。:" + ex.Message); 71 | return false; 72 | } 73 | return true; 74 | } 75 | 76 | /// 77 | /// 範囲チェック 78 | /// 79 | public bool CheckXmlArea() 80 | { 81 | if (_xml == null) 82 | { 83 | return false; 84 | } 85 | 86 | bool bRet; 87 | Vector3 areaMax = new Vector3(0, 0, 0); 88 | Vector3 areaMin = new Vector3(0, 0, 0); 89 | 90 | // 入力ファイルの範囲(最大値) 91 | bRet = GetTagData(null, "core:CityModel/gml:boundedBy/gml:Envelope/gml:upperCorner", out areaMax); 92 | if (!bRet) 93 | { 94 | // タグが無いので範囲チェックしない 95 | return true; 96 | } 97 | 98 | // 入力ファイルの範囲(最小値) 99 | bRet = GetTagData(null, "core:CityModel/gml:boundedBy/gml:Envelope/gml:lowerCorner", out areaMin); 100 | if (!bRet) 101 | { 102 | // タグが無いので範囲チェックしない 103 | return true; 104 | } 105 | 106 | // 読み込み対象の範囲かチェック 107 | int iret = CommonFunc.checkAreaInArea( MapExtent.Instance.readAreaMax, MapExtent.Instance.readAreaMin, areaMax, areaMin); 108 | if (iret == 0) 109 | { 110 | Logger.Log("読み込み範囲外"); 111 | Logger.Log("読み込み範囲 : (" + MapExtent.Instance.readAreaMin.x + "," + MapExtent.Instance.readAreaMin.y + "," + MapExtent.Instance.readAreaMin.y + ") - (" + MapExtent.Instance.readAreaMax.x + "," + MapExtent.Instance.readAreaMax.y + "," + MapExtent.Instance.readAreaMax.y + ")"); 112 | Logger.Log("GML範囲  : (" + areaMin.x + "," + areaMin.y + "," + areaMin.y + ") - (" + areaMax.x + "," + areaMax.y + "," + areaMax.y + ")"); 113 | return false; 114 | } 115 | 116 | return true; 117 | } 118 | 119 | /// 120 | /// 指定フォルダのXMLファイルを解析して読み込む 121 | /// 122 | public XPathNodeIterator GetXmlNodeList(XPathNavigator node, string xpath) 123 | { 124 | try 125 | { 126 | object obj; 127 | 128 | XPathExpression query; 129 | if (node == null) 130 | { 131 | query = _xml.Compile(xpath); 132 | query.SetContext(_xmlnsManager); 133 | obj = _xml.Select(query); 134 | } 135 | else 136 | { 137 | query = node.Compile(xpath); 138 | query.SetContext(_xmlnsManager); 139 | obj = node.Select(query); 140 | } 141 | 142 | if (obj is XPathNodeIterator) 143 | { 144 | return (XPathNodeIterator)obj; 145 | } 146 | } 147 | catch (System.Xml.XmlException Ex) 148 | { 149 | Logger.Log("TAGの解析に失敗 : " + xpath); 150 | Logger.Log(Ex.Message); 151 | return null; 152 | } 153 | return null; 154 | } 155 | 156 | /// 157 | /// タグ読み込み(String) 158 | /// 159 | public bool GetTagData(XPathNavigator node, string xpath, out string rtnData) 160 | { 161 | //----------------------------- 162 | // XMLのパース 163 | //----------------------------- 164 | object obj; 165 | rtnData = ""; 166 | 167 | try 168 | { 169 | XPathExpression query; 170 | if (node == null) 171 | { 172 | query = _xml.Compile(xpath); 173 | query.SetContext(_xmlnsManager); 174 | obj = _xml.Select(query); 175 | } 176 | else 177 | { 178 | query = node.Compile(xpath); 179 | query.SetContext(_xmlnsManager); 180 | obj = node.Select(query); 181 | } 182 | if (obj == null) 183 | { 184 | Logger.Log("TAGが存在しない : " + xpath); 185 | return false; 186 | } 187 | 188 | // タグデータ取得 189 | if (obj is XPathNodeIterator) 190 | { 191 | XPathNodeIterator ite = (XPathNodeIterator)obj; 192 | foreach (XPathNavigator nav in ite) 193 | { 194 | rtnData = nav.Value; 195 | return true; 196 | } 197 | } 198 | else 199 | { 200 | rtnData = ((XPathNavigator)obj).Value; 201 | return true; 202 | } 203 | } 204 | catch (System.Xml.XmlException Ex) 205 | { 206 | Logger.Log("TAGの解析に失敗 : " + xpath); 207 | Logger.Log(Ex.Message); 208 | return false; 209 | } 210 | 211 | return false; 212 | } 213 | 214 | /// 215 | /// タグ読み込み(Int) 216 | /// 217 | public bool GetTagData(XPathNavigator node, string xpath, out int rtnData) 218 | { 219 | rtnData = -1; 220 | 221 | // タグ読み込み 222 | string TagStr = ""; 223 | bool bRet = GetTagData(node, xpath, out TagStr); 224 | if (!bRet) 225 | { 226 | return false; 227 | } 228 | // データ型変換 229 | int.TryParse(TagStr, out rtnData); 230 | 231 | return true; 232 | } 233 | 234 | /// 235 | /// タグ読み込み(Double) 236 | /// 237 | public bool GetTagData(XPathNavigator node, string xpath, out double rtnData) 238 | { 239 | rtnData = -1; 240 | 241 | // タグ読み込み 242 | string TagStr = ""; 243 | bool bRet = GetTagData(node, xpath, out TagStr); 244 | if (!bRet) 245 | { 246 | return false; 247 | } 248 | // データ型変換 249 | double.TryParse(TagStr, out rtnData); 250 | 251 | return true; 252 | } 253 | 254 | /// 255 | /// タグ読み込み(Vector3) 256 | /// 257 | public bool GetTagData(XPathNavigator node, string xpath, out Vector3 rtnData) 258 | { 259 | rtnData.x = 0; 260 | rtnData.y = 0; 261 | rtnData.z = 0; 262 | 263 | // タグ読み込み 264 | string TagStr = ""; 265 | bool bRet = GetTagData(node, xpath, out TagStr); 266 | if (!bRet) 267 | { 268 | return false; 269 | } 270 | 271 | // Vector3に変換 272 | string[] splitStr = TagStr.Split(' '); 273 | if (splitStr.Length == 3) 274 | { 275 | double lat, lon, x, y, z; 276 | double.TryParse(splitStr[0], out lat); 277 | double.TryParse(splitStr[1], out lon); 278 | double.TryParse(splitStr[2], out z); 279 | // Webメルカトルに変換 280 | // CommonBL.latlng2merc(lat, lon, out x, out y); 281 | // 平面直角座標に変換 282 | CommonBL.Instance.bl2xy(lat, lon, out x, out y); 283 | // 保持 284 | rtnData.x = (float)x; 285 | rtnData.y = (float)y; 286 | rtnData.z = (float)z; 287 | } 288 | else 289 | { 290 | Logger.Log("TAGの形式不正 : " + xpath + " (" + TagStr + ")"); 291 | return false; 292 | } 293 | 294 | return true; 295 | } 296 | 297 | /// 298 | /// タグ読み込み(指定パスのXMLをDicに展開。Dicに指定Keyが含まれていればrtnDataを取得) 299 | /// 300 | public bool GetTagDataGML(string path, string key, Dictionary> gmlDic, out string rtnData) 301 | { 302 | rtnData = ""; 303 | if (path == "") return false; 304 | if (key == "") return false; 305 | 306 | Dictionary rtnDic = new Dictionary(); 307 | string xmlPath, data1, data2; 308 | 309 | //----------------------------------------------- 310 | // 指定されたPathのXMLファイルを読み込む 311 | //----------------------------------------------- 312 | xmlPath = path; 313 | // 相対パスの場合 314 | if (!Path.IsPathRooted(path)) 315 | { 316 | // Gmlファイルのパスを取得 317 | // Uri gmlPath = new Uri(Path.GetDirectoryName(_fileName)); 318 | Uri gmlPath = new Uri(_fileName); 319 | // 相対パスからフルパスに変換する 320 | xmlPath = new Uri(gmlPath, path).LocalPath; 321 | } 322 | 323 | //----------------------------------------------- 324 | // XMLを読み込んでいない場合 325 | //----------------------------------------------- 326 | if (!gmlDic.ContainsKey(xmlPath)) 327 | { 328 | // ファイルが無ければ終了 329 | if (!File.Exists(xmlPath)) 330 | { 331 | gmlDic[xmlPath] = rtnDic; 332 | return false; 333 | } 334 | 335 | // XMLファイルのオープン 336 | GmlUtil gml2 = new GmlUtil(xmlPath); 337 | // dictionaryEntryタグを抽出 338 | XPathNodeIterator nodeList3 = gml2.GetXmlNodeList(null, "gml:Dictionary/gml:dictionaryEntry"); 339 | // dictionaryEntryrタグでループ 340 | foreach (XPathNavigator nav3 in nodeList3) 341 | { 342 | gml2.GetTagData(nav3, "gml:Definition/gml:name", out data1); 343 | gml2.GetTagData(nav3, "gml:Definition/gml:description", out data2); 344 | // 戻り値の配列に追加 345 | rtnDic[data1] = data2; 346 | } 347 | if (nodeList3.Count == 0) 348 | { 349 | return false; 350 | } 351 | // Dictionaryで保持 352 | gmlDic[xmlPath] = rtnDic; 353 | } 354 | 355 | //----------------------------------------------- 356 | // データがある場合に取得する 357 | //----------------------------------------------- 358 | gmlDic[xmlPath].TryGetValue(key, out rtnData); 359 | 360 | return true; 361 | } 362 | 363 | 364 | /// 365 | /// に格納された頂点を、Vector3型の配列に展開する。 366 | /// 367 | /// 「gml:posList」タグのValue値(半角スペース区切りの展開対象文字列) 368 | /// 範囲外頂点の扱い方(0:範囲外の頂点があれば除外、1:全頂点が範囲外であれば除外、2:除外しない) 369 | /// 370 | static public List ConvertStringToListVec(string str, int areaCheckMode=0) 371 | { 372 | List rtnData = new List(); 373 | 374 | // Listに変換 375 | string[] splitStr = str.Split(' '); 376 | 377 | int cnt = 0; 378 | for (int loop_cnt = 0; loop_cnt < splitStr.Length; loop_cnt += 3) 379 | { 380 | // X,Y,Zの3種が含まれている場合のみ取得 381 | if (loop_cnt + 2 >= splitStr.Length) 382 | { 383 | break; 384 | } 385 | 386 | //---------------------------------- 387 | // 頂点取得 388 | //---------------------------------- 389 | double x, y, z; 390 | double lat, lon; 391 | // 数値に変換 392 | double.TryParse(splitStr[loop_cnt + 0], out lat); // 経度,緯度で格納されている 393 | double.TryParse(splitStr[loop_cnt + 1], out lon); 394 | double.TryParse(splitStr[loop_cnt + 2], out z); 395 | 396 | // Webメルカトルに変換 397 | // CommonBL.latlng2merc(lat, lon, out x, out y); 398 | // 平面直角座標に変換 399 | CommonBL.Instance.bl2xy(lat, lon, out x, out y); 400 | // 画面中央を(0,0)とした座標系に変換 401 | x = x - MapExtent.Instance.centerX; 402 | y = y - MapExtent.Instance.centerY; 403 | // 画面範囲に対応するよう倍率を調整 404 | x = x * MapExtent.Instance.areaScaleX; 405 | y = y * MapExtent.Instance.areaScaleY; 406 | // 範囲チェックするモードの場合 407 | if (areaCheckMode == 0 || areaCheckMode == 1) 408 | { 409 | // 範囲外の頂点の場合 410 | if (Math.Abs(x) > MapExtent.Instance.importDist || Math.Abs(y) > MapExtent.Instance.importDist) 411 | { 412 | cnt++; 413 | } 414 | } 415 | 416 | // 1点でも範囲外の頂点があればスルーするモードの場合 417 | if (areaCheckMode == 0 && cnt > 0) 418 | { 419 | // 範囲外を含むオブジェクトは表示対象外とする 420 | rtnData.Clear(); 421 | return rtnData; 422 | } 423 | // 頂点を追加 424 | rtnData.Add(new Vector3((float)x, (float)y, (float)z)); 425 | } 426 | 427 | // 全点範囲外ならスルーするモード 428 | if (areaCheckMode == 0 && cnt == rtnData.Count) 429 | { 430 | // 範囲外を含むオブジェクトは表示対象外とする 431 | rtnData.Clear(); 432 | } 433 | 434 | return rtnData; 435 | } 436 | } 437 | } 438 | -------------------------------------------------------------------------------- /SkylinesPlateau/GmlData/GmlWaterwayData.cs: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // GmlWaterwayData.cs 3 | // 4 | // ■概要 5 | // 河川を管理するクラス 6 | // 7 | // 8 | //---------------------------------------------------------------------------- 9 | using System; 10 | using System.Collections.Generic; 11 | using System.IO; 12 | using System.Xml.XPath; 13 | using UnityEngine; 14 | 15 | namespace SkylinesPlateau 16 | { 17 | public class GmlWaterwayData 18 | { 19 | //------------------------------------- 20 | // 固定値 21 | //------------------------------------- 22 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 23 | // public const string INPUT_PATH = @"Files/SkylinesPlateau/in"; 24 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 25 | public const string INPUT_PATH2 = @"/udx/luse"; 26 | // 読み込み対象の区分 27 | public const int KASEN_LANDUSE = 5; 28 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 29 | // 読み込み対象の区分 30 | public const int KASEN_LANDUSETYPE = 204; 31 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 32 | 33 | //------------------------------------- 34 | // メンバ変数 35 | //------------------------------------- 36 | // 名称 37 | public string name; 38 | // 土地利用用途の区分 39 | public int landUse; 40 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 41 | // 土地利用用途の区分 42 | public int landUseType; 43 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 44 | // 形状ポリゴン 45 | public List points = new List(); 46 | // 道路ポリゴンの範囲 47 | public Vector3 areaMax = new Vector3(float.MinValue, float.MinValue, float.MinValue); 48 | public Vector3 areaMin = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); 49 | // 形状ポリゴン (穴あき) 50 | public List interiorList = new List(); 51 | 52 | /// 53 | /// 建物のインポート処理 54 | /// 55 | static public int Import() 56 | { 57 | Logger.Log("河川の読み込み処理 開始"); 58 | 59 | //------------------------------------- 60 | // XMLファイルの解析 61 | //------------------------------------- 62 | List dataList = GmlWaterwayData.ReadXML(); 63 | if (dataList.Count == 0) 64 | { 65 | // ファイルなし 66 | Logger.Log("建物データなし"); 67 | return 0; 68 | } 69 | //------------------------------------- 70 | // 画面への反映処理 71 | //------------------------------------- 72 | drawWaterway(dataList); 73 | 74 | Logger.Log("建物の読み込み処理 終了"); 75 | 76 | return dataList.Count; 77 | } 78 | 79 | /// 80 | /// 指定フォルダのXMLファイルを解析して読み込む 81 | /// 82 | static public List ReadXML() 83 | { 84 | // 読み込みデータを保持 85 | List dataList = new List(); 86 | 87 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_START 88 | /* 89 | //------------------------------------- 90 | // フォルダの存在チェック 91 | //------------------------------------- 92 | if (!Directory.Exists(INPUT_PATH)) 93 | { 94 | // ファイルなし 95 | Logger.Log("フォルダがありません:" + INPUT_PATH); 96 | return dataList; 97 | } 98 | 99 | // 指定フォルダの全フォルダを取得する 100 | DirectoryInfo di = new DirectoryInfo(INPUT_PATH); 101 | DirectoryInfo[] subFolders = di.GetDirectories(); 102 | foreach (DirectoryInfo dir in subFolders) 103 | { 104 | if (!Directory.Exists(dir.FullName + INPUT_PATH2)) 105 | { 106 | // ファイルなし 107 | Logger.Log("フォルダがありません:" + dir.FullName + INPUT_PATH2); 108 | continue; 109 | } 110 | */ 111 | 112 | //------------------------------------- 113 | // フォルダの存在チェック 114 | //------------------------------------- 115 | if (!Directory.Exists(IniFileData.Instance.inputFolderPath)) 116 | { 117 | // ファイルなし 118 | Logger.Log("フォルダがありません:" + IniFileData.Instance.inputFolderPath); 119 | return dataList; 120 | } 121 | 122 | DirectoryInfo dir = new DirectoryInfo(IniFileData.Instance.inputFolderPath); 123 | if (!Directory.Exists(dir.FullName + INPUT_PATH2)) 124 | { 125 | // ファイルなし 126 | Logger.Log("フォルダがありません:" + dir.FullName + INPUT_PATH2); 127 | return dataList; 128 | } 129 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_END 130 | 131 | //------------------------------------- 132 | // フォルダ内のXMLファイルを取得 133 | //------------------------------------- 134 | IEnumerable files = Directory.GetFiles(dir.FullName + INPUT_PATH2, "*.gml"); 135 | // ファイル数分ループ処理 136 | foreach (string str in files) 137 | { 138 | //------------------------------------- 139 | // ファイル読み込み 140 | //------------------------------------- 141 | Logger.Log("河川ファイルの読み込み開始:" + str); 142 | try 143 | { 144 | // GMLファイルのオープン 145 | GmlUtil gml = new GmlUtil(str); 146 | // 範囲チェック 147 | if (!gml.CheckXmlArea()) continue; 148 | 149 | // cityObjectMemberタグを抽出 150 | XPathNodeIterator nodeList = gml.GetXmlNodeList(null, "core:CityModel/core:cityObjectMember"); 151 | // cityObjectMemberタグでループ 152 | foreach (XPathNavigator nav in nodeList) 153 | { 154 | GmlWaterwayData gmldata = new GmlWaterwayData(); 155 | 156 | //------------------------------------------------- 157 | // GMLから各種要素を取得 158 | //------------------------------------------------- 159 | // 識別する名称 160 | gml.GetTagData(nav, "luse:LandUse/@gml:id", out gmldata.name); 161 | 162 | // 土地利用用途の区分 163 | gml.GetTagData(nav, "luse:LandUse/uro:landUseDetailAttribute/uro:LandUseDetailAttribute/uro:orgLandUse", out gmldata.landUse); 164 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 165 | // if (gmldata.landUse != KASEN_LANDUSE) 166 | // { 167 | // continue; 168 | // } 169 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 170 | 171 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 172 | // 土地利用用途の区分 173 | gml.GetTagData(nav, "luse:LandUse/luse:class", out gmldata.landUseType); 174 | if (gmldata.landUseType != KASEN_LANDUSETYPE) 175 | { 176 | continue; 177 | } 178 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 179 | 180 | // 形状ポリゴン 181 | XPathNodeIterator nodeList2 = gml.GetXmlNodeList(nav, "luse:LandUse/luse:lod1MultiSurface/gml:MultiSurface/gml:surfaceMember/gml:Polygon/gml:exterior/gml:LinearRing/gml:posList"); 182 | if (nodeList2.Count == 0) 183 | { 184 | // ※ではなく、で指定されている場合 185 | nodeList2 = gml.GetXmlNodeList(nav, "luse:LandUse/luse:lod1MultiSurface/gml:MultiSurface/gml:surfaceMember/gml:Polygon/gml:exterior/gml:Ring/gml:curveMember/gml:LineString/gml:posList"); 186 | } 187 | foreach (XPathNavigator nav2 in nodeList2) 188 | { 189 | // 頂点を取得 190 | gmldata.points = GmlUtil.ConvertStringToListVec(nav2.Value, 1); 191 | foreach (Vector3 vec in gmldata.points) 192 | { 193 | //---------------------------------- 194 | // 最大最小範囲の設定 195 | //---------------------------------- 196 | if (gmldata.areaMax.x < vec.x) gmldata.areaMax.x = (float)vec.x; 197 | if (gmldata.areaMax.y < vec.y) gmldata.areaMax.y = (float)vec.y; 198 | if (gmldata.areaMax.z < vec.z) gmldata.areaMax.z = (float)vec.z; 199 | if (gmldata.areaMin.x > vec.x) gmldata.areaMin.x = (float)vec.x; 200 | if (gmldata.areaMin.y > vec.y) gmldata.areaMin.y = (float)vec.y; 201 | if (gmldata.areaMin.z > vec.z) gmldata.areaMin.z = (float)vec.z; 202 | } 203 | if (gmldata.points.Count > 2) 204 | { 205 | break; 206 | } 207 | gmldata.points.Clear(); 208 | } 209 | // 形状ポリゴン(内側) 210 | XPathNodeIterator nodeList3 = gml.GetXmlNodeList(nav, "luse:LandUse/luse:lod1MultiSurface/gml:MultiSurface/gml:surfaceMember/gml:Polygon/gml:interior/gml:LinearRing/gml:posList"); 211 | if (nodeList3.Count == 0) 212 | { 213 | // ※ではなく、で指定されている場合 214 | nodeList3 = gml.GetXmlNodeList(nav, "luse:LandUse/luse:lod1MultiSurface/gml:MultiSurface/gml:surfaceMember/gml:Polygon/gml:interior/gml:Ring/gml:curveMember/gml:LineString/gml:posList"); 215 | } 216 | foreach (XPathNavigator nav3 in nodeList3) 217 | { 218 | InteriorPoints interior = new InteriorPoints(); 219 | List tmpPoints; 220 | // 頂点を取得 221 | tmpPoints = GmlUtil.ConvertStringToListVec(nav3.Value); 222 | foreach (Vector3 vec in tmpPoints) 223 | { 224 | //---------------------------------- 225 | // 最大最小範囲の設定 226 | //---------------------------------- 227 | if (interior.areaMax.x < vec.x) interior.areaMax.x = (float)vec.x; 228 | if (interior.areaMax.y < vec.y) interior.areaMax.y = (float)vec.y; 229 | if (interior.areaMax.z < vec.z) interior.areaMax.z = (float)vec.z; 230 | if (interior.areaMin.x > vec.x) interior.areaMin.x = (float)vec.x; 231 | if (interior.areaMin.y > vec.y) interior.areaMin.y = (float)vec.y; 232 | if (interior.areaMin.z > vec.z) interior.areaMin.z = (float)vec.z; 233 | } 234 | // 頂点を取得できているか確認 235 | if (tmpPoints.Count > 2) 236 | { 237 | interior.points.Clear(); 238 | 239 | // 頂点順を判定 240 | if (!CommonFunc.checkPolyL2R(tmpPoints)) 241 | { 242 | // 時計回りになるよう再設定 243 | for (int i = tmpPoints.Count - 1; i >= 0; i--) 244 | { 245 | interior.points.Add(tmpPoints[i]); 246 | } 247 | } 248 | else 249 | { 250 | interior.points.AddRange(tmpPoints); 251 | } 252 | // 内側ポリゴンの設定 253 | gmldata.interiorList.Add(interior); 254 | } 255 | } 256 | 257 | //------------------------------------------------- 258 | // 描画用の建物リストに追加 259 | //------------------------------------------------- 260 | // 頂点を取得できているか確認 261 | if (gmldata.points.Count > 2) 262 | { 263 | if (IniFileData.Instance.logOut) 264 | { 265 | Logger.Log("名称   : " + gmldata.name); 266 | Logger.Log("区分 : " + gmldata.landUse); 267 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 268 | Logger.Log("区分(TYPE) : " + gmldata.landUseType); 269 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 270 | Logger.Log("形状ポリゴン : ", gmldata.points); 271 | foreach (InteriorPoints pos in gmldata.interiorList) 272 | { 273 | Logger.Log("形状ポリゴン内 : ", pos.points); 274 | } 275 | Logger.Log("--------------------------------"); 276 | } 277 | 278 | //-------------------------------------- 279 | // 情報を戻り値に追加 280 | //-------------------------------------- 281 | dataList.Add(gmldata); 282 | } 283 | } 284 | } 285 | catch (Exception ex) 286 | { 287 | Logger.Log("xmlファイルの解析に失敗しました。:" + ex.Message); 288 | } 289 | } 290 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 291 | // } 292 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 293 | 294 | Logger.Log("読み込み河川のデータ数:" + dataList.Count); 295 | 296 | return dataList; 297 | } 298 | 299 | /// 300 | /// 画面上に反映する 301 | /// 302 | static private void drawWaterway(List dataList) 303 | { 304 | TerrainManager tm = TerrainManager.instance; 305 | Vector3 baseVec = new Vector3(MapExtent.MAX_AREA_SIZE / 2, MapExtent.MAX_AREA_SIZE / 2, 0); 306 | // 何度も標高減算処理を行わないよう、セルに対するフラグ管理を行う 307 | bool[] meshChkFlags = new bool[(TerrainManager.RAW_RESOLUTION + 1) * (TerrainManager.RAW_RESOLUTION + 1)]; 308 | for (int i = 0; i < meshChkFlags.Length; i++) meshChkFlags[i] = false; 309 | 310 | // 高さをushort範囲内で表現するための比率 311 | float oneMetreBytes = ushort.MaxValue / (ushort)TerrainManager.TERRAIN_HEIGHT; 312 | ushort waterH = (ushort)(IniFileData.Instance.demWaterAreaDownHeight * oneMetreBytes); 313 | 314 | // 対象の数でループ処理 315 | foreach (var segment in dataList) 316 | { 317 | if (IniFileData.Instance.logOut) 318 | { 319 | Logger.Log(segment.name); 320 | } 321 | 322 | //-------------------------------- 323 | // ローカル変数定義 324 | //-------------------------------- 325 | int iXstep, iYstep, iXstart, iYstart, iXend, iYend; 326 | int xidx, yidx, iXnum, iYnum; 327 | int iCellSize; 328 | bool bRet, bRet2; 329 | int idx; 330 | 331 | // グリッドサイズ 332 | iCellSize = (int)TerrainManager.RAW_CELL_SIZE; 333 | 334 | // Game画面中央ではなく、左上原点に変更 335 | Vector3 areaMin = segment.areaMin + baseVec; 336 | Vector3 areaMax = segment.areaMax + baseVec; 337 | 338 | // XY方向の始終点 (グリッドサイズで丸める) 339 | iXstart = (int)Math.Floor(areaMin.x / iCellSize) * iCellSize; 340 | iYstart = (int)Math.Floor(areaMin.y / iCellSize) * iCellSize; 341 | iXend = (int)Math.Ceiling(areaMax.x / iCellSize) * iCellSize; 342 | iYend = (int)Math.Ceiling(areaMax.y / iCellSize) * iCellSize; 343 | // グリッド数 344 | iXnum = (iXend - iXstart) / iCellSize; 345 | iYnum = (iYend - iYstart) / iCellSize; 346 | 347 | // 始終点をGame画面中央の座標系に戻す 348 | iXstart -= (int)baseVec.x; 349 | iYstart -= (int)baseVec.y; 350 | iXend -= (int)baseVec.x; 351 | iYend -= (int)baseVec.y; 352 | 353 | if (IniFileData.Instance.logOut) 354 | { 355 | Logger.Log("範囲: [" + iXnum + "," + iYnum + "]"); 356 | } 357 | 358 | //---------------------------------------- 359 | // ポリゴン範囲内の矩形数分ループ処理 360 | //---------------------------------------- 361 | List tmpPoints = new List(); 362 | for (iYstep = iYstart; iYstep <= iYend; iYstep += iCellSize) 363 | { 364 | for (iXstep = iXstart; iXstep <= iXend; iXstep += iCellSize) 365 | { 366 | // 矩形範囲生成 367 | tmpPoints.Clear(); 368 | tmpPoints.Add(new Vector3(iXstep, iYstep, 0)); 369 | tmpPoints.Add(new Vector3(iXstep + iCellSize, iYstep, 0)); 370 | tmpPoints.Add(new Vector3(iXstep + iCellSize, iYstep + iCellSize, 0)); 371 | tmpPoints.Add(new Vector3(iXstep, iYstep + iCellSize, 0)); 372 | 373 | // 内外判定 374 | bRet = CommonFunc.checkPolyInPoly(tmpPoints, segment.points); 375 | if (bRet) 376 | { 377 | bRet2 = false; 378 | // ポリゴン内側の場合、穴あきの内部になっていないか判定する 379 | foreach (InteriorPoints pos in segment.interiorList) 380 | { 381 | bRet2 = CommonFunc.checkPolyInPoly(tmpPoints, pos.points); 382 | if (bRet2) 383 | { 384 | if (IniFileData.Instance.logOut) 385 | { 386 | Logger.Log("穴の内側"); 387 | } 388 | break; 389 | } 390 | } 391 | if (bRet2) 392 | { 393 | // 穴の内側なのでスルーする 394 | continue; 395 | } 396 | 397 | //-------------------------------------- 398 | // Index番号の取得 399 | //-------------------------------------- 400 | // 該当する番号のセルを算出(CitiesSkylinesの座標系であるため、tmpPにMaxを加算することにより、左上原点にしている) 401 | xidx = (int)Math.Floor((double)((iXstep + (iCellSize / 2)) + (MapExtent.MAX_AREA_SIZE / 2)) / iCellSize); 402 | yidx = (int)Math.Floor((double)((iYstep + (iCellSize / 2)) + (MapExtent.MAX_AREA_SIZE / 2)) / iCellSize); 403 | // 内外判定 404 | if (xidx > TerrainManager.RAW_RESOLUTION || yidx > TerrainManager.RAW_RESOLUTION) 405 | { 406 | if (IniFileData.Instance.logOut) 407 | { 408 | Logger.Log("画面範囲外なのでスルー: [" + xidx + "," + yidx + "]"); 409 | } 410 | // 画面範囲外 411 | continue; 412 | } 413 | idx = yidx * (TerrainManager.RAW_RESOLUTION + 1) + xidx; 414 | 415 | // 河川高さ導入済みの場合 416 | if (meshChkFlags[idx]) 417 | { 418 | if (IniFileData.Instance.logOut) 419 | { 420 | Logger.Log("[Skip] 二重導入を防ぐ: [" + xidx + "," + yidx + "] : " + idx); 421 | } 422 | continue; 423 | } 424 | // 二重導入され内容フラグを立てる 425 | meshChkFlags[idx] = true; 426 | 427 | if (IniFileData.Instance.logOut) 428 | { 429 | Logger.Log("対象の番号: [" + xidx + "," + yidx + "] : " + idx); 430 | } 431 | 432 | //------------------------------------- 433 | // 地形の高さ設定 434 | //------------------------------------- 435 | var currentHeight = tm.RawHeights[idx]; 436 | if (tm.RawHeights[idx] < waterH) tm.RawHeights[idx] = 0; 437 | else tm.RawHeights[idx] -= waterH; 438 | 439 | if (IniFileData.Instance.logOut) 440 | { 441 | Logger.Log("標高変更 : " + currentHeight + " -> " + tm.RawHeights[idx]); 442 | } 443 | } 444 | } 445 | } 446 | } 447 | 448 | //------------------------------------- 449 | // 画面再描画 450 | //------------------------------------- 451 | int num4 = 120; 452 | for (int k = 0; k < 9; k++) 453 | { 454 | for (int l = 0; l < 9; l++) 455 | { 456 | TerrainModify.UpdateArea(l * num4, k * num4, (l + 1) * num4, (k + 1) * num4, heights: true, surface: true, zones: true); 457 | } 458 | } 459 | } 460 | } 461 | } 462 | -------------------------------------------------------------------------------- /SkylinesPlateau/ImportSettingData.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.IO; 3 | using System.Runtime.Serialization.Formatters.Binary; 4 | 5 | namespace SkylinesPlateau 6 | { 7 | public class ImportSettingData 8 | { 9 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_START 10 | // private const string SETTING_FILE = @"Files/SkylinesPlateau/setting.dat"; 11 | public const string SETTING_FILE = @"Files/SkylinesPlateau/setting.dat"; 12 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_END 13 | private static ImportSettingData instance; 14 | public static ImportSettingData Instance => instance ?? (instance = new ImportSettingData()); 15 | 16 | // インポート有無(河川) 17 | public bool isImpWaterway; 18 | // インポート有無(道路) 19 | public bool isImpRoad; 20 | // インポート有無(線路) 21 | public bool isImpRail; 22 | // インポート有無(一般建築物) 23 | public bool isImpBuilding; 24 | // インポート有無(特定建築物) 25 | public bool isImpUniqueBuilding; 26 | // インポート有無(区域区分) 27 | public bool isImpZone; 28 | // インポート有無(土地利用) 29 | public bool isImpArea; 30 | // 中心座標読み込み範囲 31 | public string center; 32 | // インポート範囲有無 33 | public bool isUseAreaSize; 34 | // 読み込み範囲指定[km] 35 | public string areaSize; 36 | // 区画用途が判定できない場合のプルダウン項目 37 | public int zoneType; 38 | // 平面直角座標系の系番号 39 | public int isystem; 40 | 41 | // コンストラクタ 42 | public ImportSettingData() 43 | { 44 | // 規定値の設定 45 | SetDefData(); 46 | // 設定ファイルの読み込み 47 | Load(); 48 | } 49 | 50 | private void SetDefData() 51 | { 52 | // インポート有無(河川) 53 | isImpWaterway = true; 54 | // インポート有無(道路) 55 | isImpRoad = true; 56 | // インポート有無(線路) 57 | isImpRail = true; 58 | // インポート有無(一般建築物) 59 | isImpBuilding = true; 60 | // インポート有無(特定建築物) 61 | isImpUniqueBuilding = true; 62 | // インポート有無(区域区分) 63 | isImpZone = true; 64 | // インポート有無(土地利用) 65 | isImpArea = true; 66 | // 中心座標読み込み範囲 67 | center = ""; 68 | // インポート範囲有無 69 | isUseAreaSize = false; 70 | // 読み込み範囲指定[km] 71 | areaSize = ""; 72 | // 区画用途が判定できない場合のプルダウン項目 73 | zoneType = 0; 74 | // 平面直角座標系の系番号(9系) 75 | isystem = 8; 76 | } 77 | 78 | 79 | // 保存 80 | public void Save() 81 | { 82 | try 83 | { 84 | // 中心位置のトリミング処理 85 | trimCenterStr(); 86 | 87 | FileStream fileStream = File.Create(SETTING_FILE); 88 | StreamWriter sw = new StreamWriter(fileStream); 89 | sw.WriteLine(isImpWaterway); 90 | sw.WriteLine(isImpRoad); 91 | sw.WriteLine(isImpRail); 92 | sw.WriteLine(isImpBuilding); 93 | sw.WriteLine(isImpUniqueBuilding); 94 | sw.WriteLine(isImpZone); 95 | sw.WriteLine(isImpArea); 96 | sw.WriteLine(center); 97 | sw.WriteLine(isUseAreaSize); 98 | sw.WriteLine(areaSize); 99 | sw.WriteLine(zoneType); 100 | sw.WriteLine(isystem); 101 | sw.Close(); 102 | fileStream.Close(); 103 | } 104 | catch (Exception ex) 105 | { 106 | Logger.Log("設定ファイルの保存失敗 : " + ex.Message); 107 | } 108 | } 109 | // 読み込み 110 | public void Load() 111 | { 112 | try 113 | { 114 | // 規定値を設定 115 | SetDefData(); 116 | 117 | // ファイルが無ければ終了 118 | if (!File.Exists(SETTING_FILE)) 119 | { 120 | return; 121 | } 122 | // ファイル読み込み 123 | FileStream fileStream = File.Open(SETTING_FILE, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 124 | StreamReader sr = new StreamReader(fileStream); 125 | string text = sr.ReadToEnd(); 126 | string[] splitStr = text.Split('\n'); 127 | Logger.Log("設定ファイル読み込み : " + text); 128 | if (splitStr.Length > 10) 129 | { 130 | // 読み込み値をメンバに設定 131 | isImpWaterway = bool.Parse(splitStr[0]); 132 | isImpRoad = bool.Parse(splitStr[1]); 133 | isImpRail = bool.Parse(splitStr[2]); 134 | isImpBuilding = bool.Parse(splitStr[3]); 135 | isImpUniqueBuilding = bool.Parse(splitStr[4]); 136 | isImpZone = bool.Parse(splitStr[5]); 137 | isImpArea = bool.Parse(splitStr[6]); 138 | center = splitStr[7].Trim(); 139 | isUseAreaSize = bool.Parse(splitStr[8]); ; 140 | areaSize = splitStr[9].Trim(); 141 | zoneType = int.Parse(splitStr[10]); 142 | if (splitStr.Length > 11) 143 | { 144 | isystem = int.Parse(splitStr[11]); 145 | } 146 | 147 | // 中心位置のトリミング処理 148 | trimCenterStr(); 149 | } 150 | sr.Close(); 151 | fileStream.Close(); 152 | } 153 | catch (Exception ex) 154 | { 155 | Logger.Log("設定ファイルの読み込み失敗 : " + ex.Message); 156 | try 157 | { 158 | // 読み込めないファイルなようなので、削除指定おく 159 | File.Delete(SETTING_FILE); 160 | } 161 | catch (Exception ex2) 162 | { 163 | Logger.Log("設定ファイルの削除失敗 : " + ex2.Message); 164 | } 165 | } 166 | } 167 | 168 | private void trimCenterStr() 169 | { 170 | // 中央の座標値の桁数チェック 171 | double lat = 0.0, lon = 0.0; 172 | string[] splitStr = center.Split(','); 173 | if (splitStr.Length > 1) 174 | { 175 | lat = double.Parse(splitStr[0]); 176 | lon = double.Parse(splitStr[1]); 177 | // 小数点以下6桁で丸める 178 | lat = (Math.Floor(lat * 1000000) / 1000000); 179 | lon = (Math.Floor(lon * 1000000) / 1000000); 180 | // 文字列として再設定 181 | center = lat + "," + lon; 182 | } 183 | } 184 | } 185 | } 186 | -------------------------------------------------------------------------------- /SkylinesPlateau/IniFileData.cs: -------------------------------------------------------------------------------- 1 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 2 | using ColossalFramework.IO; 3 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 9 | using System.Reflection; 10 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 11 | using System.Text; 12 | 13 | namespace SkylinesPlateau 14 | { 15 | public class IniFileData 16 | { 17 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 18 | private const string SYSTEM_FOLDER_1 = @"Files/SkylinesPlateau"; 19 | private const string SYSTEM_FOLDER_2 = @"Files/SkylinesPlateau/tbl"; 20 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 21 | private const string SETTING_FILE = @"Files/SkylinesPlateau/tbl/SkylinesPlateau.ini"; 22 | private const string KEY_DEM_TIN_FILTER_AREASIZE = @"TIN除外面積"; 23 | private const string KEY_DEM_WATERAREA_DOWNHEIGHT = @"水面補正高さ"; 24 | private const string KEY_DEM_SEA_LEVEL = @"海面高さ"; 25 | private const string KEY_ROAD_FILTER_AREASIZE = @"三角道路ポリゴン除外面積"; 26 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 27 | private const string DIALOG_MSG_IMPTYPE_1 = "インポート有無(地形)"; 28 | private const string DIALOG_MSG_IMPTYPE_2 = "インポート有無(高速道路)"; 29 | private const string DIALOG_MSG_IMPTYPE_3 = "インポート有無(道路)"; 30 | private const string DIALOG_MSG_IMPTYPE_4 = "インポート有無(線路)"; 31 | private const string DIALOG_MSG_IMPTYPE_5 = "インポート有無(一般建築物)"; 32 | private const string DIALOG_MSG_IMPTYPE_6 = "インポート有無(特定建築物)"; 33 | private const string DIALOG_MSG_IMPTYPE_7 = "インポート有無(区域区分)"; 34 | private const string DIALOG_MSG_CENTER = "中心座標読み込み範囲"; 35 | private const string DIALOG_MSG_IMPAREA = "インポート範囲有無"; 36 | private const string DIALOG_MSG_AREA = "読み込み範囲指定"; 37 | private const string DIALOG_MSG_SYS = "平面直角座標系の系番号"; 38 | private const string DIALOG_MSG_FOLDER = "3D都市モデルパス"; 39 | private const string DIALOG_MSG_HELPURL = "マニュアルURL"; 40 | private const string DIALOG_HELPURL_DEF = @"https://186nobu.github.io/SkylinesPLATEAU/"; 41 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 42 | // 検証用の隠しコマンド 43 | private const string KEY_TEST_LOG = @"ログ出力"; 44 | private const string KEY_TEST_RAIL_MODE = @"rail_TestMode"; 45 | private const string KEY_TEST_RAIL_FTCODE = @"rail_FTCODE"; 46 | private const string KEY_TEST_RAIL_RAILSTATE = @"rail_RAILSTATE"; 47 | private const string KEY_TEST_RAIL_RTCODE = @"rail_RTCODE"; 48 | 49 | private static IniFileData instance; 50 | public static IniFileData Instance => instance ?? (instance = new IniFileData()); 51 | 52 | // TIN除外面積 53 | public double demFilterAreaSize = 0.0; 54 | // 水面補正高さ 55 | public double demWaterAreaDownHeight = 0.0; 56 | // 海面高さ 57 | public double demSeaLevel = 0.0; 58 | // 三角道路ポリゴン除外面積 59 | public double roadFilterAreaSize = 0.0; 60 | 61 | // 詳細ログの出力有無 62 | public bool logOut = false; 63 | // 線路の動作検証用 (INI指定値に強制的に書き換えるモード。各スタイルの確認に) 64 | public bool rail_isTestMode = false; 65 | public long rail_ftCode = -1; 66 | public long rail_railState = -1; 67 | public string rail_rtCode = ""; 68 | 69 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 70 | private bool hiddenMode1 = false; 71 | private bool hiddenMode2 = false; 72 | private bool hiddenMode3 = false; 73 | private bool hiddenMode4 = false; 74 | private bool hiddenMode5 = false; 75 | 76 | // インポート有無(地形) 77 | public bool isImpMap; 78 | // インポート有無(高速道路) 79 | public bool isImpHighway; 80 | // インポート有無(道路) 81 | public bool isImpRoad; 82 | // インポート有無(線路) 83 | public bool isImpRail; 84 | // インポート有無(一般建築物) 85 | public bool isImpBuilding; 86 | // インポート有無(特定建築物) 87 | public bool isImpUniqueBuilding; 88 | // インポート有無(区域区分) 89 | public bool isImpZone; 90 | // 中心座標読み込み範囲 91 | public string center; 92 | // インポート範囲有無 93 | public bool isUseAreaSize; 94 | // 読み込み範囲指定[km] 95 | public string areaSize; 96 | // 平面直角座標系の系番号 97 | public int isystem; 98 | // 区画用途が判定できない場合のプルダウン項目 99 | public int zoneType; 100 | // 地形・3D都市モデル 101 | public string inputFolderPath; 102 | // ヘルプURL 103 | public string helpUrl; 104 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 105 | 106 | // コンストラクタ 107 | public IniFileData() 108 | { 109 | // 既定値 110 | SetDefData(); 111 | 112 | // 設定ファイルがあれば読み込む 113 | Load(); 114 | } 115 | 116 | private void SetDefData() 117 | { 118 | // 既定値 119 | demFilterAreaSize = 20; 120 | demWaterAreaDownHeight = 5; 121 | demSeaLevel = 40; 122 | roadFilterAreaSize = 10; 123 | 124 | // 詳細ログの出力有無 125 | logOut = false; 126 | // 線路の動作検証用 127 | rail_isTestMode = false; 128 | rail_ftCode = -2; 129 | rail_railState = -2; 130 | rail_rtCode = ""; 131 | 132 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 133 | // インポート有無(道路) 134 | isImpRoad = true; 135 | // インポート有無(線路) 136 | isImpRail = true; 137 | // インポート有無(一般建築物) 138 | isImpBuilding = true; 139 | // インポート有無(特定建築物) 140 | isImpUniqueBuilding = true; 141 | // インポート有無(区域区分) 142 | isImpZone = true; 143 | // 中心座標読み込み範囲 144 | center = "36.0,140.0"; 145 | // インポート範囲有無 146 | isUseAreaSize = true; 147 | // 読み込み範囲指定[km] 148 | areaSize = "6"; 149 | // 平面直角座標系の系番号(9系) 150 | isystem = 8; 151 | // 区画用途が判定できない場合のプルダウン項目 152 | zoneType = 0; 153 | 154 | inputFolderPath = ""; 155 | helpUrl = DIALOG_HELPURL_DEF; 156 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 157 | 158 | } 159 | 160 | 161 | // 読み込み 162 | public void Load() 163 | { 164 | try 165 | { 166 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 167 | // ファイルが無ければ、リソースからコピーする 168 | if (!File.Exists(SETTING_FILE)) 169 | { 170 | // フォルダ存在チェック 171 | CreateSystemFolder(); 172 | 173 | Logger.Log("リソースからファイルコピー : " + SETTING_FILE); 174 | Assembly executingAssembly = Assembly.GetExecutingAssembly(); 175 | using (Stream resourceStream = executingAssembly.GetManifestResourceStream("SkylinesPlateau.res.tbl." + Path.GetFileName(SETTING_FILE))) 176 | { 177 | if (resourceStream != null) 178 | { 179 | // ファイルをコピー 180 | using (FileStream fileStream2 = new FileStream(SETTING_FILE, FileMode.Create)) 181 | { 182 | Logger.Log("リソースからファイルコピー完了 : " + SETTING_FILE); 183 | resourceStream.CopyTo(fileStream2); 184 | fileStream2.Close(); 185 | } 186 | resourceStream.Close(); 187 | } 188 | } 189 | } 190 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 191 | // ファイルが無ければ終了 192 | if (!File.Exists(SETTING_FILE)) 193 | { 194 | // 既定値 195 | SetDefData(); 196 | return; 197 | } 198 | // ファイル読み込み 199 | FileStream fileStream = File.Open(SETTING_FILE, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 200 | StreamReader sr = new StreamReader(fileStream); 201 | string text = sr.ReadToEnd(); 202 | string[] splitStr = text.Split('\n'); 203 | Logger.Log("ファイル読み込み : " + text); 204 | foreach (string line in splitStr) 205 | { 206 | if (line.StartsWith("#")) continue; 207 | string[] strList = line.Trim().Split('='); 208 | if (strList.Length >= 2) 209 | { 210 | if (strList[0] == KEY_DEM_TIN_FILTER_AREASIZE) demFilterAreaSize = double.Parse(strList[1]); 211 | else if (strList[0] == KEY_DEM_WATERAREA_DOWNHEIGHT) demWaterAreaDownHeight = double.Parse(strList[1]); 212 | else if (strList[0] == KEY_DEM_SEA_LEVEL) demSeaLevel = double.Parse(strList[1]); 213 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 214 | // else if (strList[0] == KEY_TEST_LOG) logOut = int.Parse(strList[1]) > 0 ? true : false; 215 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 216 | else if (strList[0] == KEY_ROAD_FILTER_AREASIZE) roadFilterAreaSize = double.Parse(strList[1]); 217 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 218 | else if (strList[0] == DIALOG_MSG_IMPTYPE_1) isImpMap = int.Parse(strList[1]) > 0 ? true : false; 219 | else if (strList[0] == DIALOG_MSG_IMPTYPE_2) isImpHighway = int.Parse(strList[1]) > 0 ? true : false; 220 | else if (strList[0] == DIALOG_MSG_IMPTYPE_3) isImpRoad = int.Parse(strList[1]) > 0 ? true : false; 221 | else if (strList[0] == DIALOG_MSG_IMPTYPE_4) isImpRail = int.Parse(strList[1]) > 0 ? true : false; 222 | else if (strList[0] == DIALOG_MSG_IMPTYPE_5) isImpBuilding = int.Parse(strList[1]) > 0 ? true : false; 223 | else if (strList[0] == DIALOG_MSG_IMPTYPE_6) isImpUniqueBuilding = int.Parse(strList[1]) > 0 ? true : false; 224 | else if (strList[0] == DIALOG_MSG_IMPTYPE_7) isImpZone = int.Parse(strList[1]) > 0 ? true : false; 225 | else if (strList[0] == DIALOG_MSG_CENTER) center = strList[1]; 226 | else if (strList[0] == DIALOG_MSG_IMPAREA) isUseAreaSize = int.Parse(strList[1]) > 0 ? true : false; 227 | else if (strList[0] == DIALOG_MSG_AREA) areaSize = strList[1]; 228 | else if (strList[0] == DIALOG_MSG_SYS) isystem = int.Parse(strList[1]); 229 | else if (strList[0] == DIALOG_MSG_FOLDER) inputFolderPath = strList[1]; 230 | else if (strList[0] == DIALOG_MSG_HELPURL) helpUrl = DIALOG_HELPURL_DEF;// strList[1]; 231 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 232 | 233 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_START 234 | // テスト用 235 | else if (strList[0] == KEY_TEST_RAIL_MODE) 236 | { 237 | rail_isTestMode = int.Parse(strList[1]) > 0 ? true : false; 238 | hiddenMode1 = true; 239 | } 240 | else if (strList[0] == KEY_TEST_RAIL_FTCODE) 241 | { 242 | rail_ftCode = long.Parse(strList[1]); 243 | hiddenMode2 = true; 244 | } 245 | else if (strList[0] == KEY_TEST_RAIL_RAILSTATE) 246 | { 247 | rail_railState = long.Parse(strList[1]); 248 | hiddenMode3 = true; 249 | } 250 | else if (strList[0] == KEY_TEST_RAIL_RTCODE) 251 | { 252 | rail_rtCode = strList[1]; 253 | hiddenMode4 = true; 254 | } 255 | else if (strList[0] == KEY_TEST_LOG) 256 | { 257 | logOut = int.Parse(strList[1]) > 0 ? true : false; 258 | hiddenMode5 = true; 259 | } 260 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_END 261 | } 262 | } 263 | sr.Close(); 264 | fileStream.Close(); 265 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 266 | trimCenterStr(); 267 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 268 | 269 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 270 | // DATファイルがあればIniファイルに設定値を引き継ぐ 271 | LoadDatFile(); 272 | 273 | // ヘルプのURLが存在しない場合、ひとまず固定値を設定しておく 274 | if (helpUrl.Length == 0) helpUrl = DIALOG_HELPURL_DEF; 275 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 276 | } 277 | catch (Exception ex) 278 | { 279 | Logger.Log("ファイルの読み込み失敗 : " + ex.Message); 280 | Logger.Log("ファイルの読み込み失敗 : " + ex); 281 | } 282 | } 283 | 284 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 285 | // 書き込み 286 | public void Save() 287 | { 288 | try 289 | { 290 | trimCenterStr(); 291 | // ファイル書き込み 292 | FileStream fileStream = File.Create(SETTING_FILE); 293 | StreamWriter sw = new StreamWriter(fileStream); 294 | sw.WriteLine(KEY_DEM_TIN_FILTER_AREASIZE + "=" + demFilterAreaSize); 295 | sw.WriteLine(KEY_DEM_WATERAREA_DOWNHEIGHT + "=" + demWaterAreaDownHeight); 296 | sw.WriteLine(KEY_DEM_SEA_LEVEL + "=" + demSeaLevel); 297 | sw.WriteLine(KEY_ROAD_FILTER_AREASIZE + "=" + roadFilterAreaSize); 298 | sw.WriteLine(DIALOG_MSG_IMPTYPE_1 + "=" + (isImpMap ? 1 : 0)); 299 | sw.WriteLine(DIALOG_MSG_IMPTYPE_2 + "=" + (isImpHighway ? 1 : 0)); 300 | sw.WriteLine(DIALOG_MSG_IMPTYPE_3 + "=" + (isImpRoad ? 1 : 0)); 301 | sw.WriteLine(DIALOG_MSG_IMPTYPE_4 + "=" + (isImpRail ? 1 : 0)); 302 | sw.WriteLine(DIALOG_MSG_IMPTYPE_5 + "=" + (isImpBuilding ? 1 : 0)); 303 | sw.WriteLine(DIALOG_MSG_IMPTYPE_6 + "=" + (isImpUniqueBuilding ? 1 : 0)); 304 | sw.WriteLine(DIALOG_MSG_IMPTYPE_7 + "=" + (isImpZone ? 1 : 0)); 305 | sw.WriteLine(DIALOG_MSG_CENTER + "=" + center); 306 | sw.WriteLine(DIALOG_MSG_IMPAREA + "=" + (isUseAreaSize ? 1 : 0)); 307 | sw.WriteLine(DIALOG_MSG_AREA + "=" + areaSize); 308 | sw.WriteLine(DIALOG_MSG_SYS + "=" + isystem); 309 | sw.WriteLine(DIALOG_MSG_FOLDER + "=" + inputFolderPath); 310 | sw.WriteLine(DIALOG_MSG_HELPURL + "=" + helpUrl); 311 | // テスト用 312 | if (hiddenMode1) sw.WriteLine(KEY_TEST_RAIL_MODE + "=" + (rail_isTestMode ? 1 : 0)); 313 | if (hiddenMode2) sw.WriteLine(KEY_TEST_RAIL_FTCODE + "=" + rail_ftCode); 314 | if (hiddenMode3) sw.WriteLine(KEY_TEST_RAIL_RAILSTATE + "=" + rail_railState); 315 | if (hiddenMode4) sw.WriteLine(KEY_TEST_RAIL_RTCODE + "=" + rail_rtCode); 316 | if (hiddenMode5) sw.WriteLine(KEY_TEST_LOG + "=" + (logOut ? 1 : 0)); 317 | sw.Close(); 318 | fileStream.Close();; 319 | } 320 | catch (Exception ex) 321 | { 322 | Logger.Log("ファイルの書き込み失敗 : " + ex.Message); 323 | } 324 | } 325 | 326 | private void trimCenterStr() 327 | { 328 | // 中央の座標値の桁数チェック 329 | double lat = 0.0, lon = 0.0; 330 | string[] splitStr = center.Split(','); 331 | if (splitStr.Length > 1) 332 | { 333 | lat = double.Parse(splitStr[0]); 334 | lon = double.Parse(splitStr[1]); 335 | // 小数点以下6桁で丸める 336 | lat = (Math.Floor(lat * 1000000) / 1000000); 337 | lon = (Math.Floor(lon * 1000000) / 1000000); 338 | // 文字列として再設定 339 | center = lat.ToString("F6") + "," + lon.ToString("F6"); 340 | } 341 | } 342 | 343 | private void LoadDatFile() { 344 | // DATファイルの移行処理 345 | if (!File.Exists(ImportSettingData.SETTING_FILE)) 346 | { 347 | return; 348 | } 349 | 350 | Logger.Log("DATファイルが存在するため、設定値をIniファイルに移行する。 : " + ImportSettingData.SETTING_FILE); 351 | // インポート有無(道路) 352 | isImpRoad = ImportSettingData.Instance.isImpRoad; 353 | // インポート有無(線路) 354 | isImpRail = ImportSettingData.Instance.isImpRail; 355 | // インポート有無(一般建築物) 356 | isImpBuilding = ImportSettingData.Instance.isImpBuilding; 357 | // インポート有無(特定建築物) 358 | isImpUniqueBuilding = ImportSettingData.Instance.isImpUniqueBuilding; 359 | // インポート有無(区域区分) 360 | isImpZone = ImportSettingData.Instance.isImpZone; 361 | // 中心座標読み込み範囲 362 | center = ImportSettingData.Instance.center; 363 | // インポート範囲有無 364 | isUseAreaSize = ImportSettingData.Instance.isUseAreaSize; 365 | // 読み込み範囲指定[km] 366 | areaSize = ImportSettingData.Instance.areaSize; 367 | // 平面直角座標系の系番号(9系) 368 | isystem = ImportSettingData.Instance.isystem; 369 | // 区画用途が判定できない場合のプルダウン項目 370 | zoneType = ImportSettingData.Instance.zoneType; 371 | 372 | Logger.Log("データ移行したため、DATファイルは削除する。 : " + ImportSettingData.SETTING_FILE); 373 | File.Delete(ImportSettingData.SETTING_FILE); 374 | 375 | // 設定した内容をIniファイルに上書き保存 376 | Save(); 377 | } 378 | 379 | static public void CreateSystemFolder() 380 | { 381 | if (!System.IO.Directory.Exists(SYSTEM_FOLDER_1)) 382 | { 383 | Directory.CreateDirectory(SYSTEM_FOLDER_1); 384 | } 385 | if (!System.IO.Directory.Exists(SYSTEM_FOLDER_2)) 386 | { 387 | Directory.CreateDirectory(SYSTEM_FOLDER_2); 388 | } 389 | } 390 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 391 | } 392 | } 393 | -------------------------------------------------------------------------------- /SkylinesPlateau/MapExtent.cs: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // MapExtent.cs 3 | // 4 | // ■概要 5 | // Cities:Skylinesのゲーム画面の座標系を管理するクラス 6 | // 7 | //---------------------------------------------------------------------------- 8 | using System.IO; // ファイル読み込み用 9 | using UnityEngine; 10 | 11 | namespace SkylinesPlateau 12 | { 13 | /// 14 | /// ゲーム画面の座標系を管理するクラス 15 | /// 16 | public class MapExtent 17 | { 18 | //------------------------------------- 19 | // 固定値定義 20 | //------------------------------------- 21 | /// 22 | /// readmeファイルパス(Cities.appからの相対パス) 23 | /// 24 | private const string INPUT_README_FILENAME = @"Files/SkylinesCityGml/readme.txt"; 25 | 26 | /// 27 | /// ゲーム画面で表示可能な最大範囲 (17.28km) 28 | /// 29 | public const int MAX_AREA_SIZE = 17280; 30 | public const int MAX_AREA_SIZE_H = (MAX_AREA_SIZE / 5) / 2; 31 | public const int MAX_AREA_SIZE_H1 = (MAX_AREA_SIZE / 50); // ZONEの1/3の範囲(345.6) 32 | 33 | /// 34 | /// ZONEサイズ (8m) 35 | /// 36 | public const int ZONE_SIZE = 8; 37 | /// 38 | /// タイル1つ分のサイズ (1920m) 39 | /// 40 | public const int TILE_AREA_SIZE = 1920; 41 | /// 42 | /// タイル1つにあるZONE数 (240個) 43 | /// 44 | public const int TILE_AREA_ZONE_NUM = TILE_AREA_SIZE / ZONE_SIZE; 45 | /// 46 | /// タイル1つにある区画数? (ZONEを8個まとめた物) (30個) 47 | /// 48 | public const int TILE_AREA_KUKAKU_NUM = TILE_AREA_ZONE_NUM / 8; 49 | 50 | /// 51 | /// タイル 3*3の範囲 52 | /// 53 | public const int AREA_SIZE_3 = (int)(TILE_AREA_SIZE * 1.5); // 区画 [3*3] 54 | /// 55 | /// タイル 5*5の範囲 56 | /// 57 | public const int AREA_SIZE_5 = (int)(TILE_AREA_SIZE * 2.5); // 区画 [5*5] 58 | /// 59 | /// タイル 9*9の範囲 60 | /// 61 | public const int AREA_SIZE_9 = (int)(TILE_AREA_SIZE * 4.5); // 区画 [9*9] 62 | 63 | //------------------------------------- 64 | // メンバ変数 65 | //------------------------------------- 66 | private static MapExtent instance; 67 | public static MapExtent Instance => instance ?? (instance = new MapExtent()); 68 | 69 | public double centerX { get; set; } // 中心位置(Webメルカトル) 70 | public double centerY { get; set; } // 中心位置(Webメルカトル) 71 | public double areaScaleX { get; set; } // 範囲の割合 72 | public double areaScaleY { get; set; } // 範囲の割合 73 | public double centerLon = 0; // 緯度経度の中心 74 | public double centerLat = 0; // 緯度経度の中心 75 | public double minlon = 0; // readmeの範囲 76 | public double minlat = 0; // readmeの範囲 77 | public double maxlon = 0; // readmeの範囲 78 | public double maxlat = 0; // readmeの範囲 79 | public uint zoomLevel = 16; // ズームレベル 80 | public double importDist = MapExtent.AREA_SIZE_9; // インポート範囲(画面中央からのメートル単位) 81 | 82 | //------------------------------------- 83 | // メンバ変数 84 | //------------------------------------- 85 | /// 86 | /// ゲーム画面の最小タイル番号X 87 | /// 88 | public uint minTileX 89 | { 90 | get 91 | { 92 | return (uint)System.Math.Floor(((minlon + 180.0) / 360.0) * System.Math.Pow(2.0, zoomLevel)); 93 | } 94 | } 95 | /// 96 | /// ゲーム画面の最大タイル番号X 97 | /// 98 | public uint maxTileX 99 | { 100 | get 101 | { 102 | return (uint)System.Math.Floor(((maxlon + 180.0) / 360.0) * System.Math.Pow(2.0, zoomLevel)); 103 | } 104 | } 105 | /// 106 | /// ゲーム画面の最小タイル番号Y 107 | /// 108 | public uint minTileY 109 | { 110 | get 111 | { 112 | var sinLatitude = System.Math.Sin(maxlat * System.Math.PI / 180.0); 113 | return (uint)((0.5 - System.Math.Log((1.0 + sinLatitude) / (1.0 - sinLatitude)) / (4.0 * System.Math.PI)) * System.Math.Pow(2.0, zoomLevel)); 114 | } 115 | } 116 | /// 117 | /// ゲーム画面の最大タイル番号Y 118 | /// 119 | public uint maxTileY 120 | { 121 | get 122 | { 123 | var sinLatitude = System.Math.Sin(minlat * System.Math.PI / 180.0); 124 | return (uint)((0.5 - System.Math.Log((1.0 + sinLatitude) / (1.0 - sinLatitude)) / (4.0 * System.Math.PI)) * System.Math.Pow(2.0, zoomLevel)); 125 | } 126 | } 127 | 128 | /// 129 | /// 読み込み範囲の最大位置(XY座標系) 130 | /// 131 | public Vector3 readAreaMax 132 | { 133 | get 134 | { 135 | return new Vector3((float)(centerX + importDist), (float)(centerY + importDist), 0.0f); 136 | } 137 | } 138 | /// 139 | /// 読み込み範囲の最小位置(XY座標系) 140 | /// 141 | public Vector3 readAreaMin 142 | { 143 | get 144 | { 145 | return new Vector3((float)(centerX - importDist), (float)(centerY - importDist), 0.0f); 146 | } 147 | } 148 | 149 | //------------------------------------- 150 | // メソッド定義 151 | //------------------------------------- 152 | /// 153 | /// コンストラクタ 154 | /// 155 | public MapExtent() 156 | { 157 | // // readmeファイルを読み込む 158 | // loadReadMe(); 159 | } 160 | 161 | /// 162 | /// RaedMeファイルからゲーム画面の範囲を取得 163 | /// 164 | public void loadReadMe() 165 | { 166 | //------------------------------------- 167 | // ファイルの存在チェック 168 | //------------------------------------- 169 | if (!File.Exists(INPUT_README_FILENAME)) 170 | { 171 | // ファイルなし 172 | Logger.Log("ReadMeファイルがありません:" + INPUT_README_FILENAME); 173 | return; 174 | } 175 | 176 | //------------------------------------- 177 | // ファイル読み込み 178 | //------------------------------------- 179 | string keyStr = "&box="; 180 | StreamReader inSr = File.OpenText(INPUT_README_FILENAME); 181 | while (!inSr.EndOfStream) 182 | { 183 | string lineStr = inSr.ReadLine(); 184 | 185 | // 四隅座標の書かれている行か判定 186 | int idx = lineStr.IndexOf(keyStr); 187 | if (idx >= 0) 188 | { 189 | // 四隅座標を取得 190 | string tmpStr = lineStr.Substring(idx + keyStr.Length); 191 | // 分割する 192 | string[] strlist = tmpStr.Split(','); 193 | // 要素数の確認 194 | if (strlist.Length != 4) 195 | { 196 | Logger.Log("座標値の取得に失敗:" + tmpStr); 197 | inSr.Close(); 198 | return; 199 | } 200 | // 座標値をメンバ変数に設定 201 | double.TryParse(strlist[0], out maxlon); 202 | double.TryParse(strlist[1], out maxlat); 203 | double.TryParse(strlist[2], out minlon); 204 | double.TryParse(strlist[3], out minlat); 205 | Logger.Log(" 緯度経度の範囲:" + "( " + minlat + " , " + minlon + " ) ( " + maxlat + " , " + maxlon + " )"); 206 | // Webメルカトルに変換する 207 | double maxX, maxY, minX, minY; 208 | // CommonBL.latlng2merc(maxlat, maxlon, out maxX, out maxY); 209 | // CommonBL.latlng2merc(minlat, minlon, out minX, out minY); 210 | CommonBL.Instance.bl2xy(maxlat, maxlon, out maxX, out maxY); 211 | CommonBL.Instance.bl2xy(minlat, minlon, out minX, out minY); 212 | Logger.Log("WEBメルカトルの範囲:" + "( " + minX + " , " + minY + " ) ( " + maxX + " , " + maxY + " )"); 213 | // 中心座標を算出 214 | centerX = minX + ((maxX - minX) / 2.0); 215 | centerY = minY + ((maxY - minY) / 2.0); 216 | Logger.Log("WEBメルカトルの中央:" + "( " + centerX + " , " + centerY + " )"); 217 | // ゲーム画面に対する範囲のスケール 218 | areaScaleX = MAX_AREA_SIZE / (maxX - minX); 219 | areaScaleY = MAX_AREA_SIZE / (maxY - minY); 220 | Logger.Log("WEBメルカトルの割合:" + "( " + areaScaleX + " , " + areaScaleY + " )"); 221 | } 222 | } 223 | inSr.Close(); 224 | } 225 | /// 226 | /// Map範囲の設定 227 | /// 228 | public void SetMapExtent(double centerLat, double centerLon, double dist) 229 | { 230 | // 中心座標を算出 231 | double x,y; 232 | // CommonBL.latlng2merc(centerLat, centerLon, out x, out y); 233 | CommonBL.Instance.bl2xy(centerLat, centerLon, out x, out y); 234 | this.centerLat = centerLat; 235 | this.centerLon = centerLon; 236 | centerX = x; 237 | centerY = y; 238 | // (平面直角の場合、内部ではXYを逆転させている。描画範囲を回転させたいので) 239 | Logger.Log("平面直角座標系の中央:" + "( " + y + " , " + x + " )"); 240 | // 範囲を算出 241 | double maxX, maxY, minX, minY; 242 | minX = x - MAX_AREA_SIZE / 2; 243 | minY = y - MAX_AREA_SIZE / 2; 244 | maxX = x + MAX_AREA_SIZE / 2; 245 | maxY = y + MAX_AREA_SIZE / 2; 246 | // (平面直角の場合、内部ではXYを逆転させている。描画範囲を回転させたいので) 247 | Logger.Log("平面直角座標系の範囲:" + "( " + minY + " , " + minX + " ) ( " + maxY + " , " + maxX + " )"); 248 | // ゲーム画面に対する範囲のスケール 249 | areaScaleX = 1.0; 250 | areaScaleY = 1.0; 251 | 252 | // 座標値をメンバ変数に設定 253 | CommonBL.Instance.ido_keido(minX, minY, out minlat, out minlon); 254 | CommonBL.Instance.ido_keido(maxX, maxY, out maxlat, out maxlon); 255 | Logger.Log(" 緯度経度の範囲:" + "( " + minlat + " , " + minlon + " ) ( " + maxlat + " , " + maxlon + " )"); 256 | 257 | // インポート範囲を設定 258 | importDist = dist; 259 | Logger.Log("インポート対象の半径:" + "( " + importDist + " )"); 260 | } 261 | 262 | /// 263 | /// Map範囲の設定 264 | /// 265 | public void SetMapExtent(double dist) 266 | { 267 | //------------------------------------ 268 | // 設定ファイルの読み込み 269 | //------------------------------------ 270 | double lat = 0.0, lon = 0.0; 271 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_START 272 | // string[] splitStr = ImportSettingData.Instance.center.Split(','); 273 | string[] splitStr = IniFileData.Instance.center.Split(','); 274 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_END 275 | if (splitStr.Length > 1) 276 | { 277 | lat = double.Parse(splitStr[0]); 278 | lon = double.Parse(splitStr[1]); 279 | } 280 | else 281 | { 282 | return; 283 | } 284 | 285 | //------------------------------------ 286 | // 範囲設定 287 | //------------------------------------ 288 | SetMapExtent(lat, lon, dist); 289 | } 290 | 291 | /// 292 | /// Map範囲の設定 293 | /// 294 | public void SetMapExtent() 295 | { 296 | //------------------------------------ 297 | // 設定ファイルの読み込み 298 | //------------------------------------ 299 | double lat = 0.0, lon = 0.0; 300 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_START 301 | // string[] splitStr = ImportSettingData.Instance.center.Split(','); 302 | string[] splitStr = IniFileData.Instance.center.Split(','); 303 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_END 304 | if (splitStr.Length > 1) 305 | { 306 | lat = double.Parse(splitStr[0]); 307 | lon = double.Parse(splitStr[1]); 308 | } 309 | else 310 | { 311 | return; 312 | } 313 | 314 | double dist; 315 | // 距離が有効 316 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_START 317 | #if false 318 | if (ImportSettingData.Instance.isUseAreaSize) 319 | { 320 | // km単位で格納されているため1000倍する 321 | dist = double.Parse(ImportSettingData.Instance.areaSize) * 1000.0; 322 | // 直径から半径に変換 323 | dist = dist / 2; 324 | } 325 | #endif 326 | if (IniFileData.Instance.isUseAreaSize) 327 | { 328 | // km単位で格納されているため1000倍する 329 | dist = double.Parse(IniFileData.Instance.areaSize) * 1000.0; 330 | // 直径から半径に変換 331 | dist = dist / 2; 332 | } 333 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_END 334 | else 335 | { 336 | // 全域を対象とする 337 | dist = MapExtent.AREA_SIZE_9; 338 | } 339 | 340 | //------------------------------------ 341 | // 範囲設定 342 | //------------------------------------ 343 | SetMapExtent(lat, lon, dist); 344 | } 345 | } 346 | } 347 | -------------------------------------------------------------------------------- /SkylinesPlateau/ModLoading.cs: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // ModLoading.cs 3 | // 4 | // ■概要 5 | // MOD読み込み時の動作を管理するクラス 6 | // 7 | // 8 | //---------------------------------------------------------------------------- 9 | using ColossalFramework; 10 | using ColossalFramework.UI; 11 | using ICities; 12 | using System.IO; 13 | using UnityEngine; 14 | 15 | namespace SkylinesPlateau 16 | { 17 | public class ModLoading : ILoadingExtension 18 | { 19 | private GameObject _objImpGui = null; 20 | private GameObject _objImpMapPanel = null; 21 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 22 | // private GameObject _objImpHighwayPanel = null; 23 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 24 | private GameObject _objImpFeaturesPanel = null; 25 | 26 | // called when level loading begins 27 | public void OnCreated(ILoading loading) 28 | { 29 | } 30 | 31 | // called when level is loaded 32 | public void OnLevelLoaded(LoadMode mode) 33 | { 34 | UIView uiView = Object.FindObjectOfType(); 35 | if (uiView != null) 36 | { 37 | if (_objImpMapPanel == null) 38 | { 39 | _objImpMapPanel = (GameObject)(object)new GameObject("ImpMapPanel"); 40 | _objImpMapPanel.transform.parent = uiView.transform; 41 | _objImpMapPanel.AddComponent(); 42 | } 43 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_START 44 | /* 45 | if (_objImpHighwayPanel == null) 46 | { 47 | _objImpHighwayPanel = (GameObject)(object)new GameObject("ImpHighwayPanel"); 48 | _objImpHighwayPanel.transform.parent = uiView.transform; 49 | _objImpHighwayPanel.AddComponent(); 50 | } 51 | */ 52 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] DEL_END 53 | if (_objImpFeaturesPanel == null) 54 | { 55 | _objImpFeaturesPanel = (GameObject)(object)new GameObject("ImpFeaturesPanel"); 56 | _objImpFeaturesPanel.transform.parent = uiView.transform; 57 | _objImpFeaturesPanel.AddComponent(); 58 | } 59 | if (_objImpGui == null) 60 | { 61 | _objImpGui = (GameObject)(object)new GameObject("SkylinesCityGml_GUI"); 62 | _objImpGui.transform.parent = uiView.transform; 63 | _objImpGui.AddComponent(); 64 | } 65 | } 66 | } 67 | 68 | // called when unloading begins 69 | public void OnLevelUnloading() 70 | { 71 | // if (_objImpGui != null) { Object.Destroy(_objImpGui); _objImpGui } 72 | // if (_objImpMapPanel != null) { Object.Destroy(_objImpMapPanel); } 73 | // if (_objImpHighwayPanel != null) { Object.Destroy(_objImpHighwayPanel); } 74 | // if (_objImpFeaturesPanel != null) { Object.Destroy(_objImpFeaturesPanel); } 75 | } 76 | 77 | // called when unloading finished 78 | public void OnReleased() 79 | { 80 | } 81 | } 82 | } 83 | -------------------------------------------------------------------------------- /SkylinesPlateau/ModThreading.cs: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // ModThreading.cs 3 | // 4 | // ■概要 5 | // Cities:Skylinesのゲーム画面上で動作するスレッドを管理するクラス 6 | // 7 | // 8 | //---------------------------------------------------------------------------- 9 | using ColossalFramework.UI; 10 | using ICities; 11 | using UnityEngine; 12 | 13 | namespace SkylinesPlateau 14 | { 15 | public class ModThreading : ThreadingExtensionBase 16 | { 17 | /// 18 | /// 多重操作を防止するためのフラグ (true : 実行中, false: 待機中) 19 | /// 20 | private bool _processed = false; 21 | 22 | /// 23 | /// 描画対象のView 24 | /// 25 | private UIView uiView; 26 | 27 | /// 28 | /// ボタン表示するViewクラス 29 | /// 30 | private ImpGUI gui; 31 | 32 | public void drawGUI() 33 | { 34 | if (uiView == null) 35 | { 36 | uiView = Object.FindObjectOfType(); 37 | gui = (ImpGUI)uiView.gameObject.GetComponent(typeof(ImpGUI)); 38 | } 39 | if (gui == null) 40 | { 41 | gui = (uiView.gameObject.AddComponent(typeof(ImpGUI)) as ImpGUI); 42 | } 43 | if (gui.uiView == null) 44 | { 45 | gui.uiView = uiView; 46 | } 47 | // _ = base.managers.threading.simulationPaused; 48 | } 49 | 50 | //--------------------------------------------------- 51 | // 画面更新のタイミングで動作するメソッド 52 | //--------------------------------------------------- 53 | public override void OnUpdate(float realTimeDelta, float simulationTimeDelta) 54 | { 55 | //---------------------------------------- 56 | // 画面上にボタン配置 57 | //---------------------------------------- 58 | drawGUI(); 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /SkylinesPlateau/Properties/AssemblyInfo.cs: -------------------------------------------------------------------------------- 1 | using System.Reflection; 2 | using System.Runtime.CompilerServices; 3 | using System.Runtime.InteropServices; 4 | 5 | // アセンブリに関する一般情報は以下の属性セットをとおして制御されます。 6 | // アセンブリに関連付けられている情報を変更するには、 7 | // これらの属性値を変更してください。 8 | [assembly: AssemblyTitle("SkylinesPLATEAU")] 9 | [assembly: AssemblyDescription("")] 10 | [assembly: AssemblyConfiguration("")] 11 | [assembly: AssemblyCompany("")] 12 | [assembly: AssemblyProduct("SkylinesPLATEAU")] 13 | [assembly: AssemblyCopyright("Copyright © 2023")] 14 | [assembly: AssemblyTrademark("")] 15 | [assembly: AssemblyCulture("")] 16 | 17 | // ComVisible を false に設定すると、その型はこのアセンブリ内で COM コンポーネントから 18 | // 参照不可能になります。COM からこのアセンブリ内の型にアクセスする場合は、 19 | // その型の ComVisible 属性を true に設定してください。 20 | [assembly: ComVisible(false)] 21 | 22 | // 次の GUID は、このプロジェクトが COM に公開される場合の、typelib の ID です 23 | [assembly: Guid("d99e16ba-676c-4e3a-8534-f22c9c543297")] 24 | 25 | // アセンブリのバージョン情報は、以下の 4 つの値で構成されています: 26 | // 27 | // Major Version 28 | // Minor Version 29 | // Build Number 30 | // Revision 31 | // 32 | // すべての値を指定するか、下のように '*' を使ってビルドおよびリビジョン番号を 33 | // 既定値にすることができます: 34 | // [assembly: AssemblyVersion("1.0.*")] 35 | [assembly: AssemblyVersion("2.0.0.*")] 36 | [assembly: AssemblyFileVersion("2.0.0.0")] 37 | -------------------------------------------------------------------------------- /SkylinesPlateau/SkylinesPlateau.cs: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // SkylinesPlateau.cs 3 | // 4 | // ■概要 5 | // Cities:SkylinesのMOD画面に表示する内容を定義するクラス 6 | // 7 | // 8 | //---------------------------------------------------------------------------- 9 | using ICities; 10 | 11 | namespace SkylinesPlateau 12 | { 13 | public class SkylinesPlateau: IUserMod 14 | { 15 | // MOD名 16 | public string Name 17 | { 18 | get { return "SkylinesPLATEAU"; } 19 | } 20 | 21 | // MODの説明文 22 | public string Description 23 | { 24 | get { return "3D都市モデルを参照し、Cities: Skylines上に実在都市を再現するModです。"; } 25 | } 26 | 27 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 28 | // MODの設定項目 29 | public void OnSettingsUI(UIHelper helper) 30 | { 31 | SettingsUI.OnSettingsUI(helper); 32 | } 33 | 34 | public void OnEnabled() 35 | { 36 | IniFileData.Instance.Load(); 37 | AssetTbl.Instance.Load(); 38 | ZoneSgTbl zoneTbl = new ZoneSgTbl(); 39 | BuildingSgTbl build = new BuildingSgTbl(); 40 | zoneTbl = null; 41 | build = null; 42 | SettingsUI.UpdateOptionSetting(); 43 | } 44 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 45 | } 46 | } 47 | -------------------------------------------------------------------------------- /SkylinesPlateau/SkylinesPlateau.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | 4 | 5 | Debug 6 | AnyCPU 7 | {FC7BC991-7E2B-4DB2-B70A-8181EE7705F2} 8 | Library 9 | Properties 10 | SkylinesPlateau 11 | SkylinesPlateau 12 | v3.5 13 | 512 14 | 15 | 16 | 17 | true 18 | full 19 | false 20 | bin\Debug\ 21 | TRACE;DEBUG;TOOL_DEBUG_;TOOL_DEBUG_TINDATA_; 22 | prompt 23 | 4 24 | false 25 | ConcurrencyRules.ruleset 26 | false 27 | false 28 | 29 | 30 | pdbonly 31 | true 32 | bin\Release\ 33 | 34 | 35 | prompt 36 | 4 37 | false 38 | true 39 | 40 | 41 | 42 | lib\Assembly-CSharp.dll 43 | False 44 | 45 | 46 | lib\ColossalManaged.dll 47 | False 48 | 49 | 50 | lib\ICities.dll 51 | False 52 | 53 | 54 | ..\dll\Mapbox.VectorTile.ExtensionMethods.dll 55 | 56 | 57 | ..\dll\Mapbox.VectorTile.Geometry.dll 58 | 59 | 60 | ..\dll\Mapbox.VectorTile.PbfReader.dll 61 | 62 | 63 | ..\dll\Mapbox.VectorTile.VectorTileReader.dll 64 | 65 | 66 | 67 | 68 | 69 | 70 | 71 | 72 | 73 | 74 | 75 | 76 | 77 | lib\UnityEngine.dll 78 | False 79 | 80 | 81 | 82 | 83 | 84 | 85 | 86 | 87 | 88 | 89 | 90 | 91 | 92 | 93 | 94 | 95 | 96 | 97 | 98 | 99 | 100 | 101 | 102 | 103 | 104 | 105 | 106 | 107 | Code 108 | 109 | 110 | 111 | 112 | 113 | 114 | 115 | 116 | 117 | 118 | 119 | 120 | 121 | 122 | 123 | 124 | 125 | 126 | 127 | 128 | 129 | 130 | 131 | 132 | 133 | 134 | 135 | 136 | 137 | @rem mkdir "%25LOCALAPPDATA%25\Colossal Order\Cities_Skylines\Addons\Mods\$(SolutionName)" 138 | @rem del "%25LOCALAPPDATA%25\Colossal Order\Cities_Skylines\Addons\Mods\$(SolutionName)\$(TargetFileName)" 139 | @rem xcopy /y "$(TargetPath)" "%25LOCALAPPDATA%25\Colossal Order\Cities_Skylines\Addons\Mods\$(SolutionName)" 140 | @rem xcopy /y/s/I $(SolutionDir)\dll $(TargetDir)$(SolutionName)\ 141 | @rem xcopy /y "$(TargetPath)" $(TargetDir)$(SolutionName)\ 142 | 143 | 150 | -------------------------------------------------------------------------------- /SkylinesPlateau/Table/AssetTbl.cs: -------------------------------------------------------------------------------- 1 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 2 | using ColossalFramework.IO; 3 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 9 | using System.Reflection; 10 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 11 | using System.Text; 12 | 13 | namespace SkylinesPlateau 14 | { 15 | /* 16 | 2.アセットテーブル 17 | 18 | ■asset.tbl 19 | 20 | # key, アセット名 21 | 22 |   ●「key」(string型) 23 |    ・","(半角カンマ)、"/"(半角スラッシュ)は指定不可。 24 | 25 |   ●「アセット名」(string型) 26 |    ・アセット名を指定する。(基本的には「アセットのID」+"."+「建物名称」+"_Data"の形式) 27 | --------------------------------------- 28 | (例) 29 |   1,1100810441.???????_Data 30 |   2,1337303718.???????_Data 31 |   3,447188028,.???????_Data 32 | */ 33 | class AssetTbl 34 | { 35 | //-------------------------------------------------- 36 | // 固定値 37 | //-------------------------------------------------- 38 | public const string TBL_FILE = @"Files/SkylinesPlateau/tbl/asset.tbl"; 39 | 40 | //-------------------------------------------------- 41 | // メンバ変数 42 | //-------------------------------------------------- 43 | // インスタンス 44 | private static AssetTbl instance; 45 | public static AssetTbl Instance => instance ?? (instance = new AssetTbl()); 46 | 47 | // 設定値一覧 48 | public Dictionary dataDic = new Dictionary(); 49 | 50 | //-------------------------------------------------- 51 | // メソッド 52 | //-------------------------------------------------- 53 | public AssetTbl() 54 | { 55 | Load(); 56 | } 57 | 58 | // 読み込み 59 | public void Load() 60 | { 61 | try 62 | { 63 | dataDic.Clear(); 64 | 65 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 66 | // ファイルが無ければ、リソースからコピーする 67 | if (!File.Exists(TBL_FILE)) 68 | { 69 | // フォルダ存在チェック 70 | IniFileData.CreateSystemFolder(); 71 | 72 | Logger.Log("リソースからファイルコピー : " + TBL_FILE); 73 | Assembly executingAssembly = Assembly.GetExecutingAssembly(); 74 | using (Stream resourceStream = executingAssembly.GetManifestResourceStream("SkylinesPlateau.res.tbl." + Path.GetFileName(TBL_FILE))) 75 | { 76 | if (resourceStream != null) 77 | { 78 | // ファイルをコピー 79 | using (FileStream fileStream2 = new FileStream(TBL_FILE, FileMode.Create)) 80 | { 81 | Logger.Log("リソースからファイルコピー完了 : " + TBL_FILE); 82 | resourceStream.CopyTo(fileStream2); 83 | fileStream2.Close(); 84 | } 85 | resourceStream.Close(); 86 | } 87 | } 88 | } 89 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 90 | 91 | // ファイルが無ければ終了 92 | if (!File.Exists(TBL_FILE)) 93 | { 94 | return; 95 | } 96 | 97 | Logger.Log("ファイル読み込み : " + TBL_FILE); 98 | 99 | // ファイル読み込み 100 | FileStream fileStream = File.Open(TBL_FILE, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 101 | StreamReader sr = new StreamReader(fileStream); 102 | string text = sr.ReadToEnd(); 103 | string[] splitStr = text.Split('\n'); 104 | if (IniFileData.Instance.logOut) 105 | { 106 | Logger.Log("ファイル読み込み : " + text); 107 | } 108 | foreach (string line in splitStr) 109 | { 110 | if (line.StartsWith("#")) continue; 111 | string[] strList = line.Trim().Split(','); 112 | if (strList.Length >= 2) 113 | { 114 | if (IniFileData.Instance.logOut) 115 | { 116 | Logger.Log(line); 117 | } 118 | dataDic[strList[0]] = strList[1]; 119 | } 120 | else 121 | { 122 | Logger.Log("不正レコード : " + line); 123 | } 124 | } 125 | sr.Close(); 126 | fileStream.Close(); 127 | } 128 | catch (Exception ex) 129 | { 130 | Logger.Log("ファイルの読み込み失敗 : " + ex.Message); 131 | } 132 | } 133 | } 134 | } 135 | -------------------------------------------------------------------------------- /SkylinesPlateau/Table/ZoneSgTbl.cs: -------------------------------------------------------------------------------- 1 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 2 | using ColossalFramework.IO; 3 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 4 | using System; 5 | using System.Collections.Generic; 6 | using System.IO; 7 | using System.Linq; 8 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 9 | using System.Reflection; 10 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 11 | using System.Text; 12 | 13 | namespace SkylinesPlateau 14 | { 15 | /* 16 | 3.区画テーブル 17 | ■districtsAndZonesType.tbl 18 | 19 | # key, 区画番号 20 | 21 |   ●「key」(string型) 22 |    ・タグの値と比較される。 23 |    24 |   ●「区画番号」(int型) 25 |    ・区画番号を指定 26 | */ 27 | class ZoneSgTbl 28 | { 29 | //-------------------------------------------------- 30 | // 固定値 31 | //-------------------------------------------------- 32 | public const string TBL_FILE = @"Files/SkylinesPlateau/tbl/districtsAndZonesType.tbl"; 33 | 34 | //-------------------------------------------------- 35 | // メンバ変数 36 | //-------------------------------------------------- 37 | // 設定値一覧 38 | public Dictionary dataDic = new Dictionary(); 39 | 40 | //-------------------------------------------------- 41 | // メソッド 42 | //-------------------------------------------------- 43 | public ZoneSgTbl() 44 | { 45 | Load(); 46 | } 47 | 48 | // 読み込み 49 | public void Load() 50 | { 51 | try 52 | { 53 | dataDic.Clear(); 54 | 55 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_START 56 | // ファイルが無ければ、リソースからコピーする 57 | if (!File.Exists(TBL_FILE)) 58 | { 59 | // フォルダ存在チェック 60 | IniFileData.CreateSystemFolder(); 61 | 62 | Logger.Log("リソースからファイルコピー : " + TBL_FILE); 63 | Assembly executingAssembly = Assembly.GetExecutingAssembly(); 64 | using (Stream resourceStream = executingAssembly.GetManifestResourceStream("SkylinesPlateau.res.tbl." + Path.GetFileName(TBL_FILE))) 65 | { 66 | if (resourceStream != null) 67 | { 68 | // ファイルをコピー 69 | using (FileStream fileStream2 = new FileStream(TBL_FILE, FileMode.Create)) 70 | { 71 | Logger.Log("リソースからファイルコピー完了 : " + TBL_FILE); 72 | resourceStream.CopyTo(fileStream2); 73 | fileStream2.Close(); 74 | } 75 | resourceStream.Close(); 76 | } 77 | } 78 | } 79 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] ADD_END 80 | 81 | // ファイルが無ければ終了 82 | if (!File.Exists(TBL_FILE)) 83 | { 84 | return; 85 | } 86 | 87 | Logger.Log("ファイル読み込み : " + TBL_FILE); 88 | 89 | // ファイル読み込み 90 | FileStream fileStream = File.Open(TBL_FILE, FileMode.Open, FileAccess.Read, FileShare.ReadWrite); 91 | StreamReader sr = new StreamReader(fileStream); 92 | string text = sr.ReadToEnd(); 93 | string[] splitStr = text.Split('\n'); 94 | if (IniFileData.Instance.logOut) 95 | { 96 | Logger.Log("ファイル読み込み : " + text); 97 | } 98 | foreach (string line in splitStr) 99 | { 100 | if (line.StartsWith("#")) continue; 101 | string[] strList = line.Trim().Split(','); 102 | if (strList.Length >= 2) 103 | { 104 | if (IniFileData.Instance.logOut) 105 | { 106 | Logger.Log(line); 107 | } 108 | dataDic[strList[0]] = int.Parse(strList[1]); 109 | } 110 | else 111 | { 112 | Logger.Log("不正レコード : " + line); 113 | } 114 | } 115 | sr.Close(); 116 | fileStream.Close(); 117 | } 118 | catch (Exception ex) 119 | { 120 | Logger.Log("ファイルの読み込み失敗 : " + ex.Message); 121 | } 122 | } 123 | } 124 | } 125 | -------------------------------------------------------------------------------- /SkylinesPlateau/common/CommonBL.cs: -------------------------------------------------------------------------------- 1 | //---------------------------------------------------------------------------- 2 | // CommonBL.cs 3 | // 4 | // ■概要 5 | // 座標系の変換機能を提供するクラス 6 | // 7 | // ■改版履歴 8 | // Ver00.03.00 2020.03.31 G.Arakawa@Cmind 新規作成 9 | // 10 | //---------------------------------------------------------------------------- 11 | using System; 12 | 13 | namespace SkylinesPlateau 14 | { 15 | //-------------------------- 16 | // 座標変換機能を提供するクラス 17 | //-------------------------- 18 | public class CommonBL 19 | { 20 | //-------------------------- 21 | // 固定値 22 | //-------------------------- 23 | private readonly double[] gPsi = { 0.0, 33.0, 33.0, 36.0, 33.0, 36.0, 36.0, 36.0, 36.0, 36.0, 40.0, 44.0, 44.0, 44.0, 26.0, 26.0, 26.0, 26.0, 20.0, 26.0 }; 24 | private readonly double[] gLmd = { 0.0, 129.5, 131.0, 132.1666666666, 133.5, 134.3333333333, 136.0, 137.1666666666, 138.5, 139.8333333333, 140.8333333333, 140.25, 142.25, 144.25, 142.0, 127.5, 124.0, 131.0, 136.0, 154.0 }; 25 | private readonly double[] CC = { 123.0, 129.0, 135.0, 141.0, 147.0, 153.0 }; 26 | private readonly double[] C_L = { 1.005037306048555E0, 5.0478492403E-3, 1.0563786831E-5, 2.0633322E-8, 3.8853E-11, 7.0E-14 }; 27 | private const double JA = 6377397.155; // 日本測地系 28 | private const double JFS = 1.0 / 299.152813; // 日本測地系 29 | private const double WA = 6378137.0; // 世界測地系 30 | private const double WFS = 1.0 / 298.257222101; // 世界測地系 31 | private const double M0 = 0.9999; 32 | private const double QQ = 9.996E-1; 33 | private const double R2 = 6.377397155E6; 34 | private const double E1 = 6.674372231315E-3; 35 | private const double E2 = 6.719218798677E-3; 36 | private const double Y0 = 5.0E5; 37 | private const double EE = 0.006674372231315; 38 | private const double B0 = 1.005037306045577; 39 | private const double B1 = 0.002511273240647; 40 | private const double B2 = 0.000003678785849; 41 | private const double B3 = 0.000000007380969; 42 | private const double B4 = 0.000000000016832; 43 | private const double B5 = 0.000000000000041; 44 | 45 | // 平面直角座標系 46 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_START 47 | // public static readonly string[] SYS_NAME_LIST = { "平面直角座標 1系", "平面直角座標 2系", "平面直角座標 3系", "平面直角座標 4系", "平面直角座標 5系", 48 | // "平面直角座標 6系", "平面直角座標 7系", "平面直角座標 8系", "平面直角座標 9系", "平面直角座標10系", "平面直角座標11系", "平面直角座標12系", 49 | // "平面直角座標13系", "平面直角座標14系", "平面直角座標15系", "平面直角座標16系", "平面直角座標17系", "平面直角座標18系", "平面直角座標19系" }; 50 | public static readonly string[] SYS_NAME_LIST = { 51 | "01: 長崎, 鹿児島(南西部)", 52 | "02: 福岡, 佐賀, 熊本, 大分, 宮崎, 鹿児島(北東部)", 53 | "03: 山口, 島根, 広島", 54 | "04: 香川, 愛媛, 徳島, 高知", 55 | "05: 兵庫, 鳥取, 岡山", 56 | "06: 京都, 大阪, 福井, 滋賀, 三重, 奈良, 和歌山", 57 | "07: 石川, 富山, 岐阜, 愛知", 58 | "08: 新潟, 長野, 山梨, 静岡", 59 | "09: 東京(本州), 福島, 栃木, 茨城, 埼玉, 千葉, 群馬, 神奈川", 60 | "10: 青森, 秋田, 山形, 岩手, 宮城", 61 | "11: 北海道(西部)", 62 | "12: 北海道(中央部)", 63 | "13: 北海道(東部)", 64 | "14: 諸島(東京南部)", 65 | "15: 沖縄", 66 | "16: 諸島(沖縄西部)", 67 | "17: 諸島(沖縄東部)", 68 | "18: 小笠原諸島", 69 | "19: 南鳥島" }; 70 | // 2023.08.18 G.Arakawa@cmind [2023年度の改修対応] UPD_END 71 | 72 | //-------------------------- 73 | // ローカル変数 74 | //-------------------------- 75 | private static CommonBL instance; 76 | public static CommonBL Instance => instance ?? (instance = new CommonBL()); 77 | 78 | private double A = WA; 79 | private double FS = WFS; 80 | public int iSystem = 9; 81 | 82 | /// 83 | /// 度単位の数値をラジアン単位に変換 84 | /// 85 | /// 度単位の数値 86 | /// ラジアン単位の数値 87 | public static double deg2rad(double deg) 88 | { 89 | return deg / 180.0 * Math.PI; 90 | } 91 | 92 | /// 93 | /// 緯度経度をWEBメルカトルに変換 94 | /// 95 | /// 緯度 96 | /// 経度 97 | /// X座標(WEBメルカトル) 98 | /// Y座標(WEBメルカトル) 99 | public static void latlng2merc(double lat, double lon, out double x, out double y) 100 | { 101 | y = Math.Log(Math.Tan(Math.PI / 4.0 + deg2rad(lat) / 2.0)) * WA; 102 | x = deg2rad(lon) * WA; 103 | 104 | } 105 | 106 | // Webメルカトル図法から経度に変換 107 | public static double XToLon(double x) 108 | { 109 | return (x / (WA * Math.PI)) * 180.0; 110 | } 111 | // Webメルカトル図法から緯度に変換 112 | public static double YToLat(double y) 113 | { 114 | // 引数チェック 115 | double lat = (y / (6378137.0 * Math.PI)) * 180; 116 | lat = 180.0 / Math.PI * (2.0 * Math.Atan(Math.Exp(lat * Math.PI / 180.0)) - Math.PI / 2.0); 117 | return lat; 118 | } 119 | // 経度からWebメルカトル図法に変換 120 | public static double LonToX(double lon) 121 | { 122 | // 参考サイト:http://qiita.com/kochizufan/items/bf880c8d2b25385d4efe 123 | return WA * lon * Math.PI / 180.0; 124 | } 125 | // 緯度からWebメルカトル図法に変換 126 | public static double LatToY(double lat) { 127 | // 参考サイト:http://qiita.com/kochizufan/items/bf880c8d2b25385d4efe 128 | return WA * Math.Log(Math.Tan(Math.PI / 360.0 * (90.0 + lat))); 129 | } 130 | 131 | 132 | // 現在設定されている座標系から、世界測地系の緯度経度に変換する 133 | public void ido_keido(double posX, double posY, out double dpIdo, out double dpKeido) 134 | { 135 | // 戻り値を設定 136 | dpIdo = 0.0; 137 | dpKeido = 0.0; 138 | 139 | // (平面直角の場合、内部ではXYを逆転させている。描画範囲を回転させたいので) 140 | double x = posY; 141 | double y = posX; 142 | 143 | double psi1 = psi(x); 144 | double t1 = Math.Tan(psi1); 145 | double eta2 = ED * ED * Math.Cos(psi1) * Math.Cos(psi1); 146 | 147 | //----------------------------------- 148 | // 緯度を算出 149 | //----------------------------------- 150 | double tmp1 = 1.0 + eta2; 151 | double tmp2 = 5.0 + 3.0 * Math.Pow(t1, 2) + 6.0 * eta2 - 6.0 * Math.Pow(t1, 2) * eta2 - 3.0 * Math.Pow(eta2, 2) - 9.0 * Math.Pow(t1, 2) * Math.Pow(eta2, 2); 152 | double tmp3 = 61.0 + 90.0 * Math.Pow(t1, 2) + 45.0 * Math.Pow(t1, 4) + 107.0 * eta2 - 162.0 * Math.Pow(t1, 2) * eta2 - 45.0 * Math.Pow(t1, 4) * eta2; 153 | double tmp4 = 1385.0 + 3633.0 * Math.Pow(t1, 2) + 4095.0 * Math.Pow(t1, 4) + 1575.0 * Math.Pow(t1, 6); 154 | 155 | dpIdo = psi1 - 1.0 / 2.0 * 1.0 / Math.Pow(N(psi1), 2) * t1 * tmp1 * Math.Pow((y / M0), 2) 156 | + 1.0 / 24.0 * 1.0 / Math.Pow(N(psi1), 4) * t1 * tmp2 * Math.Pow((y / M0), 4) 157 | - 1.0 / 720.0 * 1.0 / Math.Pow(N(psi1), 6) * t1 * tmp3 * Math.Pow((y / M0), 6) 158 | + 1.0 / 40320.0 * 1.0 / Math.Pow(N(psi1), 8) * t1 * tmp4 * Math.Pow((y / M0), 8); 159 | dpIdo = dpIdo * 180.0 / Math.PI; 160 | 161 | //----------------------------------- 162 | // 経度を算出 163 | //----------------------------------- 164 | double lmd0 = gLmd[iSystem] * Math.PI / 180.0; 165 | double tmp5 = 1.0 + 2.0 * Math.Pow(t1, 2) + eta2; 166 | double tmp6 = 5.0 + 28.0 * Math.Pow(t1, 2) + 24.0 * Math.Pow(t1, 4) + 6.0 * eta2 + 8.0 * Math.Pow(t1, 2) * eta2; 167 | double tmp7 = 61.0 + 662.0 * Math.Pow(t1, 2) + 1320.0 * Math.Pow(t1, 4) + 720.0 * Math.Pow(t1, 6); 168 | dpKeido = lmd0 + 1.0 / (N(psi1) * Math.Cos(psi1)) * (y / M0) 169 | - 1.0 / (6.0 * Math.Pow(N(psi1), 3) * Math.Cos(psi1)) * tmp5 * Math.Pow((y / M0), 3) 170 | + 1.0 / (120.0 * Math.Pow(N(psi1), 5) * Math.Cos(psi1)) * tmp6 * Math.Pow((y / M0), 5) 171 | - 1.0 / (5040.0 * Math.Pow(N(psi1), 7) * Math.Cos(psi1)) * tmp7 * Math.Pow((y / M0), 7); 172 | dpKeido = dpKeido * 180.0 / Math.PI; 173 | } 174 | 175 | // 世界測地系の緯度経度から、現在設定されている座標系に変換する 176 | public void bl2xy(double ido, double keido, out double posX, out double posY) 177 | { 178 | posX = 0; 179 | posY = 0; 180 | 181 | double psi0 = gPsi[iSystem] * Math.PI / 180.0; 182 | double lmd0 = gLmd[iSystem] * Math.PI / 180.0; 183 | double psi1 = ido * Math.PI / 180.0; 184 | double lmd1 = keido * Math.PI / 180.0; 185 | double dlmd = lmd1 - lmd0; 186 | double t1 = Math.Tan(psi1); 187 | double eta2 = ED * ED * Math.Cos(psi1) * Math.Cos(psi1); 188 | double S0 = ss(psi0); 189 | double S1 = ss(psi1); 190 | 191 | //----------------------------------- 192 | // X座標を算出 193 | //----------------------------------- 194 | double tmp1 = 5.0 - Math.Pow(t1, 2) + 9.0 * eta2 + 4.0 * Math.Pow(eta2, 2); 195 | double tmp2 = -61.0 + 58.0 * Math.Pow(t1, 2) - Math.Pow(t1, 4) - 270.0 * eta2 + 330.0 * Math.Pow(t1, 2) * eta2; 196 | double tmp3 = -1385.0 + 3111.0 * Math.Pow(t1, 2) - 543.0 * Math.Pow(t1, 4) + Math.Pow(t1, 6); 197 | posX = ((S1 - S0) 198 | + 1.0 / 2.0 * N(psi1) * Math.Pow(Math.Cos(psi1), 2) * t1 * Math.Pow(dlmd, 2) 199 | + 1.0 / 24.0 * N(psi1) * Math.Pow(Math.Cos(psi1), 4) * t1 * tmp1 * Math.Pow(dlmd, 4) 200 | - 1.0 / 720.0 * N(psi1) * Math.Pow(Math.Cos(psi1), 6) * t1 * tmp2 * Math.Pow(dlmd, 6) 201 | - 1.0 / 40320.0 * N(psi1) * Math.Pow(Math.Cos(psi1), 8) * t1 * tmp3 * Math.Pow(dlmd, 8)) * M0; 202 | 203 | //----------------------------------- 204 | // Y座標を算出 205 | //----------------------------------- 206 | double tmp4 = -1.0 + Math.Pow(t1, 2) - Math.Pow(eta2, 2); 207 | double tmp5 = -5.0 + 18.0 * Math.Pow(t1, 2) - Math.Pow(t1, 4) - 14.0 * Math.Pow(eta2, 2) + 58.0 * Math.Pow(t1, 2) * eta2; 208 | double tmp6 = -61.0 + 479.0 * Math.Pow(t1, 2) - 179.0 * Math.Pow(t1, 4) + Math.Pow(t1, 6); 209 | posY = (N(psi1) * Math.Cos(psi1) * dlmd 210 | - 1.0 / 6.0 * N(psi1) * Math.Pow(Math.Cos(psi1), 3) * tmp4 * Math.Pow(dlmd, 3) 211 | - 1.0 / 120.0 * N(psi1) * Math.Pow(Math.Cos(psi1), 5) * tmp5 * Math.Pow(dlmd, 5) 212 | - 1.0 / 5040.0 * N(psi1) * Math.Pow(Math.Cos(psi1), 7) * tmp6 * Math.Pow(dlmd, 7)) * M0; 213 | 214 | // (平面直角の場合、内部ではXYを逆転させている。描画範囲を回転させたいので) 215 | double tmp = posX; 216 | posX = posY; 217 | posY = tmp; 218 | } 219 | 220 | //----------------------------------- 221 | // ReadOnly 222 | //----------------------------------- 223 | private double FL { get { return 1 / FS; }} 224 | private double B { get { return A * (1.0 - FS); }} 225 | private double C { get { return A / (1.0 - FS); }} 226 | private double E { get { return Math.Sqrt(2.0 * FS - FS * FS); }} 227 | private double ED { get { return Math.Sqrt(E * E / (1.0 - E * E)); }} 228 | private double P { get { return 180.0 / Math.PI; }} 229 | private double AEE { get { return A * (1.0 - EE); }} 230 | private double EEE { get { return EE / (1.0 - EE); }} 231 | private double V(double PSI) { return Math.Sqrt(1.0 + (ED * ED) * Math.Pow(Math.Cos(PSI), 2)); } 232 | private double W(double PSI) { return Math.Sqrt(1.0 + (E * E * -1.0) * Math.Pow(Math.Sin(PSI), 2));} 233 | private double M(double PSI) { return C / (Math.Pow(V(PSI), 3)); } 234 | private double N(double PSI) { return C / V(PSI); } 235 | private double R(double PSI) { return C / (Math.Pow(V(PSI), 2)); } 236 | 237 | private double psi(double dX) 238 | { 239 | int i = 0; 240 | double dPsi_N, dPsi_N1; 241 | 242 | dPsi_N = gPsi[iSystem] * Math.PI / 180.0; 243 | dPsi_N1 = psi_NtoN1(dPsi_N, dX); 244 | i += 1; 245 | 246 | while (Math.Abs(dPsi_N1 - dPsi_N) > 2.0 / 60.0 / 60.0 * Math.Pow(10, -5)) 247 | { 248 | dPsi_N = dPsi_N1; 249 | dPsi_N1 = psi_NtoN1(dPsi_N, dX); 250 | i += 1; 251 | } 252 | 253 | return dPsi_N1; 254 | } 255 | 256 | private double psi_NtoN1(double psi_n, double posX) 257 | { 258 | double dSpsi = ss(psi_n); 259 | double dM = ss((gPsi[iSystem] * Math.PI / 180.0)) + posX / M0; 260 | double dTmp1 = dSpsi - dM; 261 | double dTmp2 = 1 - E * E * Math.Sin(psi_n) * Math.Sin(psi_n); 262 | double dTmp3 = 1 - E * E; 263 | double psi_n1 = psi_n + 2 * dTmp1 * Math.Pow(dTmp2, 3 / 2) / (3 * Math.Pow(E, 2) * dTmp1 * Math.Sin(psi_n) * Math.Cos(psi_n) * Math.Pow(dTmp2, 1 / 2) - 2 * A * dTmp3); 264 | return psi_n1; 265 | } 266 | 267 | private double ss(double dPsi) 268 | { 269 | double dA, dB, dC, dD, dE, dF, dG, dH, dI; 270 | double[] aB = new double[10]; 271 | 272 | dA = 1.0 + 3.0 / 4.0 * Math.Pow(E, 2) + 45.0 / 64.0 * Math.Pow(E, 4) + 175.0 / 256.0 * Math.Pow(E, 6) + 11025.0 / 16384.0 * Math.Pow(E, 8) + 43659.0 / 65536.0 * Math.Pow(E, 10) + 693693.0 / 1048576.0 * Math.Pow(E, 12) + 19324305.0 / 29360128.0 * Math.Pow(E, 14) + 4927697775.0 / 7516192768.0 * Math.Pow(E, 16); 273 | dB = 3.0 / 4.0 * Math.Pow(E, 2) + 15.0 / 16.0 * Math.Pow(E, 4) + 525.0 / 512.0 * Math.Pow(E, 6) + 2205.0 / 2048.0 * Math.Pow(E, 8) + 72765.0 / 65536.0 * Math.Pow(E, 10) + 297297.0 / 262144.0 * Math.Pow(E, 12) + 135270135.0 / 117440512.0 * Math.Pow(E, 14) + 547521975.0 / 469762048.0 * Math.Pow(E, 16); 274 | dC = 15.0 / 64.0 * Math.Pow(E, 4) + 105.0 / 256.0 * Math.Pow(E, 6) + 2205.0 / 4096.0 * Math.Pow(E, 8) + 10395.0 / 16384.0 * Math.Pow(E, 10) + 1486485.0 / 2097152.0 * Math.Pow(E, 12) + 45090045.0 / 58720256.0 * Math.Pow(E, 14) + 766530765.0 / 939524096.0 * Math.Pow(E, 16); 275 | dD = 35.0 / 512.0 * Math.Pow(E, 6) + 315.0 / 2048.0 * Math.Pow(E, 8) + 31185.0 / 131072.0 * Math.Pow(E, 10) + 165165.0 / 524288.0 * Math.Pow(E, 12) + 45090045.0 / 117440512.0 * Math.Pow(E, 14) + 209053845.0 / 469762048.0 * Math.Pow(E, 16); 276 | dE = 315.0 / 16384.0 * Math.Pow(E, 8) + 3465.0 / 65536.0 * Math.Pow(E, 10) + 99099.0 / 1048576.0 * Math.Pow(E, 12) + 4099095.0 / 29360128.0 * Math.Pow(E, 14) + 348423075.0 / 1879048192.0 * Math.Pow(E, 16); 277 | dF = 693.0 / 131072.0 * Math.Pow(E, 10) + 9009.0 / 524288.0 * Math.Pow(E, 12) + 4099095.0 / 117440512.0 * Math.Pow(E, 14) + 26801775.0 / 469762048.0 * Math.Pow(E, 16); 278 | dG = 3003.0 / 2097152.0 * Math.Pow(E, 12) + 315315.0 / 58720256.0 * Math.Pow(E, 14) + 11486475.0 / 939524096.0 * Math.Pow(E, 16); 279 | dH = 45045.0 / 117440512.0 * Math.Pow(E, 14) + 765765.0 / 469762048.0 * Math.Pow(E, 16); 280 | dI = 765765.0 / 7516192768.0 * Math.Pow(E, 16); 281 | 282 | aB[0] = 0.0; 283 | aB[1] = A * (1.0 - E * E) * dA; 284 | aB[2] = A * (1.0 - E * E) * (-dB / 2.0); 285 | aB[3] = A * (1.0 - E * E) * (dC / 4.0); 286 | aB[4] = A * (1.0 - E * E) * (-dD / 6.0); 287 | aB[5] = A * (1.0 - E * E) * (dE / 8.0); 288 | aB[6] = A * (1.0 - E * E) * (-dF / 10.0); 289 | aB[7] = A * (1.0 - E * E) * (dG / 12.0); 290 | aB[8] = A * (1.0 - E * E) * (-dH / 14.0); 291 | aB[9] = A * (1.0 - E * E) * (dI / 16.0); 292 | 293 | return aB[1] * dPsi + aB[2] * Math.Sin(2.0 * dPsi) + aB[3] * Math.Sin(4.0 * dPsi) + aB[4] * Math.Sin(6.0 * dPsi) + aB[5] * Math.Sin(8.0 * dPsi) + aB[6] * Math.Sin(10.0 * dPsi) + aB[7] * Math.Sin(12.0 * dPsi) + aB[8] * Math.Sin(14.0 * dPsi) + aB[9] * Math.Sin(16.0 * dPsi); 294 | } 295 | } 296 | } 297 | -------------------------------------------------------------------------------- /SkylinesPlateau/common/InteriorPoints.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace SkylinesPlateau 8 | { 9 | public class InteriorPoints 10 | { 11 | // 形状ポリゴン (穴あき) 12 | public List points = new List(); 13 | // 道路ポリゴンの範囲 14 | public Vector3 areaMax = new Vector3(float.MinValue, float.MinValue, float.MinValue); 15 | public Vector3 areaMin = new Vector3(float.MaxValue, float.MaxValue, float.MaxValue); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /SkylinesPlateau/common/Logger.cs: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/common/Logger.cs -------------------------------------------------------------------------------- /SkylinesPlateau/common/SimpleNode.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using System.Collections.Generic; 3 | using System.Linq; 4 | using System.Text; 5 | using UnityEngine; 6 | 7 | namespace SkylinesPlateau 8 | { 9 | public class SimpleNode 10 | { 11 | const int trimValue = 6; 12 | 13 | public ushort nodeId; 14 | public float[] nodeCoords; 15 | 16 | public SimpleNode(ushort node, Vector3 pos) 17 | { 18 | nodeId = node; 19 | nodeCoords = new float[2] { pos.x, pos.z }; 20 | } 21 | 22 | /// 23 | /// 同じ座標位置の頂点が存在するか確認する 24 | /// 25 | static public bool FindNode(Dictionary> nodeMap, out ushort netNodeId, Vector2 nodePoint) 26 | { 27 | short xRound = (short)Math.Round(nodePoint.x); 28 | 29 | if (nodeMap.ContainsKey(xRound)) 30 | { 31 | foreach (SimpleNode node in nodeMap[xRound]) 32 | { 33 | if (node.nodeCoords[0] > nodePoint.x - trimValue && 34 | node.nodeCoords[0] < nodePoint.x + trimValue) 35 | { 36 | if (node.nodeCoords[1] > nodePoint.y - trimValue && 37 | node.nodeCoords[1] < nodePoint.y + trimValue) 38 | { 39 | netNodeId = node.nodeId; 40 | return true; 41 | } 42 | } 43 | } 44 | } 45 | 46 | netNodeId = 0; 47 | return false; 48 | } 49 | } 50 | } 51 | -------------------------------------------------------------------------------- /SkylinesPlateau/lib/Assembly-CSharp.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/lib/Assembly-CSharp.dll -------------------------------------------------------------------------------- /SkylinesPlateau/lib/ColossalManaged.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/lib/ColossalManaged.dll -------------------------------------------------------------------------------- /SkylinesPlateau/lib/ICities.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/lib/ICities.dll -------------------------------------------------------------------------------- /SkylinesPlateau/lib/UnityEngine.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/lib/UnityEngine.dll -------------------------------------------------------------------------------- /SkylinesPlateau/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/obj/Debug/DesignTimeResolveAssemblyReferencesInput.cache -------------------------------------------------------------------------------- /SkylinesPlateau/obj/Debug/SkylinesPlateau.csproj.AssemblyReference.cache: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/obj/Debug/SkylinesPlateau.csproj.AssemblyReference.cache -------------------------------------------------------------------------------- /SkylinesPlateau/res/icon/folderDialog_desktop.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/res/icon/folderDialog_desktop.png -------------------------------------------------------------------------------- /SkylinesPlateau/res/icon/folderDialog_folder.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/res/icon/folderDialog_folder.png -------------------------------------------------------------------------------- /SkylinesPlateau/res/icon/folderDialog_pc.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/res/icon/folderDialog_pc.png -------------------------------------------------------------------------------- /SkylinesPlateau/res/icon/folderIcon.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/SkylinesPlateau/res/icon/folderIcon.png -------------------------------------------------------------------------------- /SkylinesPlateau/res/tbl/SkylinesPlateau.ini: -------------------------------------------------------------------------------- 1 | TIN除外面積=20 2 | 水面補正高さ=5 3 | 海面高さ=40 4 | 三角道路ポリゴン除外面積=10 5 | 水面コード=5 6 | #水面コードは自治体ごとの値を入力後、ゲームを再起動 (鉾田市5、熊本市4、川崎市10500) 7 | インポート有無(地形)=1 8 | インポート有無(高速道路)=1 9 | インポート有無(道路)=1 10 | インポート有無(線路)=1 11 | インポート有無(一般建築物)=1 12 | インポート有無(特定建築物)=1 13 | インポート有無(区域区分)=1 14 | 中心座標読み込み範囲=36.0,140.0 15 | インポート範囲有無=1 16 | 読み込み範囲指定=6 17 | 区画用途が判定できない場合のプルダウン項目=0 18 | 平面直角座標系の系番号=8 19 | 3D都市モデルパス= 20 | マニュアルURL=https://186nobu.github.io/SkylinesPLATEAU/ 21 | -------------------------------------------------------------------------------- /SkylinesPlateau/res/tbl/bldgname.tbl: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------- 2 | # ■テーブル名 3 | #   bldgname.tbl 4 | # 5 | # ■説明 6 | #  ・「udx\bldg」配下に配置されている建物のGMLファイルをインポートする際に参照されるテーブル 7 | # 8 | # ■設定値 9 | #  1.建物名称(string型) 10 | #  2.種類名称(string型) 11 | #   ・「建物名称」「種類名称」のいずれも指定がない設定は無効とする。 12 | #   ・「建物名称」は、タグの値に、指定文字が含まれるか判定される。 13 | #   ・「種類名称」は未使用 14 | # 15 | #  3.高さ(double型) 16 | #  4.面積(double型) 17 | #   ・「高さ」はメートル単位とし、指定した高さ以上の設定で最も小さい高さの設定を有効とする。 18 | #   ・「面積」は平方メートル単位とし、指定した面積以上の設定で最も小さい面積の設定を有効とする。 19 | #   ・「高さ」、「面積」どちらも指定した場合、両方の値で判定し、高さ>面積の優先度で、最も小さい設定を有効とする。 20 | # 21 | #  5.アセット(string型) 22 | #  6.デフォルトアセット(string型) 23 | #   ・[/](半角スラッシュ)区切りで複数指定可能とし、複数ある場合にはランダムで採用される。 24 | #   ・以下の3つの値を指定可能。 25 | #    ・拡張アセット:asset.tblのkey値を指定 26 | #    ・標準アセット:先頭に[B]を付与した建物番号を指定(例:B628 <- 墓地) 27 | #             ⇒建物番号はDLLを解析し一覧を作成予定。 28 | #    ・区画    :先頭に[Z]を付与した区画番号を指定(例:Z2 <- 低密度住宅) 29 | #             ⇒(2:低密度住宅 3:高密度住宅 4=低密度商業 5=高密度商業 6=産業 7=オフィス) 30 | #   ・「アセット」に指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には「デフォルトアセット」を有効とする。 31 | #   ・「デフォルトアセット」が有効で、指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には、次のタグを判定対象とする。" 32 | #     (detailedUsage.tblで判定していた場合、orgUsage.tblでの判定処理に移行する) 33 | # 34 | # ■その他 35 | #  ・先頭#の行はコメントとして扱われます。 36 | #  ・各項目は半角カンマ区切りで指定します。 37 | #  ・項目数が6以上の行が有効。項目7以降はスルーされます。 38 | # --------------------------------------------------------------------- 39 | # 建物名称, 種類名称, 高さ, 面積, アセット, デフォルトアセット 40 | 市役所,,10,200,鉾田市役所,B682, 41 | 小学校,,10,200,小学校1,B326, 42 | 中学校,,10,200,中学校1,B328, 43 | 県立鉾田第一高等学校,,10,200,高校2,B328, 44 | 県立鉾田第二高等学校,,10,200,高校1,B328, 45 | # 46 | #検索優先度調整のため、高校はorgUsage.tblで指定 47 | #高等学校,,10,200,高校1,B328, 48 | # 49 | 消防,,,100,消防署1/消防署2,B280, 50 | 駐在所,,,,駐在所1/駐在所2/駐在所3,, 51 | 警察署,,,,警察署1,B259, 52 | 病院,,,50,病院1,B625/B626, 53 | #郵便局,,,,,, 54 | 保健所,,,50,病院1,B625/B626, -------------------------------------------------------------------------------- /SkylinesPlateau/res/tbl/buildingID.tbl: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------- 2 | # ■テーブル名 3 | #   buildingID.tbl 4 | # 5 | # ■説明 6 | #  ・「udx\bldg」配下に配置されている建物のGMLファイルをインポートする際に参照されるテーブル 7 | #  ・と比較し、導入する建物を設定する。 8 | # 9 | # ■設定値 10 | #  1.key(string型) 11 | #  2.建物名称(string型) 12 | #  3.種類名称(string型) 13 | #   ・「key」「建物名称」「種類名称」のいずれも指定がない設定は無効とする。 14 | #   ・「key」は、タグの値と比較される。 15 | #   ・「建物名称」は、タグの値に、指定文字が含まれるか判定される。 16 | #   ・「種類名称」は、「key」で参照するタグの属性値codeSpaceで指定されたXMLファイルから、該当するタグを取得し、指定文字が含まれるか判定される。 17 | #   ・判定条件の優先順は、「key」>「建物名称」>「種類名称」とする。 18 | #     優先度1:「key」有、「建物名称」有、「種類名称」有 19 | #     優先度2:「key」有、「建物名称」有、「種類名称」  20 | #     優先度3:「key」有、「建物名称」 、「種類名称」有 21 | #     優先度4:「key」有、「建物名称」 、「種類名称」  22 | #     優先度5:「key」 、「建物名称」有、「種類名称」有 23 | #     優先度6:「key」 、「建物名称」有、「種類名称」  24 | #     優先度7:「key」 、「建物名称」 、「種類名称」有 25 | # 26 | #  4.高さ(double型) 27 | #  5.面積(double型) 28 | #   ・「高さ」はメートル単位とし、指定した高さ以上の設定で最も小さい高さの設定を有効とする。 29 | #   ・「面積」は平方メートル単位とし、指定した面積以上の設定で最も小さい面積の設定を有効とする。 30 | #   ・「高さ」、「面積」どちらも指定した場合、両方の値で判定し、高さ>面積の優先度で、最も小さい設定を有効とする。 31 | # 32 | #  6.アセット(string型)asset.tblで指定したアセット名 33 | #  7.デフォルトアセット(string型) 34 | #   ・[/](半角スラッシュ)区切りで複数指定可能とし、複数ある場合にはランダムで採用される。 35 | #   ・以下の3つの値を指定可能。 36 | #    ・拡張アセット:asset.tblのkey値を指定 37 | #    ・標準アセット:先頭に[B]を付与した建物番号を指定(例:B628 <- 墓地) 38 | #             ⇒建物番号はDLLを解析し一覧を作成予定。 39 | #    ・区画    :先頭に[Z]を付与した区画番号を指定(例:Z2 <- 低密度住宅) 40 | #             ⇒(2:低密度住宅 3:高密度住宅 4=低密度商業 5=高密度商業 6=産業 7=オフィス) 41 | #   ・「アセット」に指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には「デフォルトアセット」を有効とする。 42 | #   ・「デフォルトアセット」が有効で、指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には、次のタグを判定対象とする。" 43 | #     (detailedUsage.tblで判定していた場合、orgUsage.tblでの判定処理に移行する) 44 | # 45 | # ■その他 46 | #  ・先頭#の行はコメントとして扱われます。 47 | #  ・各項目は半角カンマ区切りで指定します。 48 | #  ・項目数が7以上の行が有効。項目8以降はスルーされます。 49 | # --------------------------------------------------------------------- 50 | # key, 建物名称, 種類名称, 高さ, 面積, アセット, デフォルトアセット 51 | #市役所は名称を参照して配置 52 | #08234-bldg-38428,,,,,鉾田市役所,B694,鉾田市役所 53 | 08234-bldg-37910,,,,,鉾田市保健センター,B682,鉾田市保健センター 54 | 08234-bldg-38312,,,,,鉾田市福祉事務所,B682,鉾田市福祉事務所 55 | 08234-bldg-36728,,,,,鉾田中央公民館,B693,鉾田中央公民館 56 | 08234-bldg-37909,,,,,鉾田市立図書館,B330,鉾田市立図書館 57 | 08234-bldg-38314,,,,,鉾田合同庁舎本庁舎,B729,鉾田合同庁舎本庁舎 58 | 08234-bldg-38439,,,,,鉾田合同庁舎分庁舎,B728,鉾田合同庁舎分庁舎 59 | #08234-bldg-38428,,,,,市役所3,B301,鉾田市役所 60 | #08234-bldg-37910,,,,,鉾田市保健センタ,B393,鉾田市保健センター 61 | #08234-bldg-38312,,,,,鉾田市福祉事務所,B481,鉾田市福祉事務所 62 | #08234-bldg-36728,,,,,鉾田中央公民館,B481,鉾田中央公民館 63 | #08234-bldg-37909,,,,,鉾田市立図書館,B481,鉾田市立図書館 64 | #08234-bldg-38314,,,,,鉾田合同庁舎本庁舎,B561,鉾田合同庁舎本庁舎 65 | #08234-bldg-38439,,,,,鉾田合同庁舎分庁舎,B566,鉾田合同庁舎分庁舎 66 | 67 | -------------------------------------------------------------------------------- /SkylinesPlateau/res/tbl/detailedUsage.tbl: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------- 2 | # ■テーブル名 3 | #   detailedUsage.tbl 4 | # 5 | # ■説明 6 | #  ・「udx\bldg」配下に配置されている建物のGMLファイルをインポートする際に参照されるテーブル 7 | #  ・と比較し、導入する建物を設定する。 8 | # 9 | # ■設定値 10 | #  1.key(string型) 11 | #  2.建物名称(string型) 12 | #  3.種類名称(string型) 13 | #   ・「key」「建物名称」「種類名称」のいずれも指定がない設定は無効とする。 14 | #   ・「key」は、タグの値と比較される。 15 | #   ・「建物名称」は、タグの値に、指定文字が含まれるか判定される。 16 | #   ・「種類名称」は、「key」で参照するタグの属性値codeSpaceで指定されたXMLファイルから、該当するタグを取得し、指定文字が含まれるか判定される。 17 | #   ・判定条件の優先順は、「key」>「建物名称」>「種類名称」とする。 18 | #     優先度1:「key」有、「建物名称」有、「種類名称」有 19 | #     優先度2:「key」有、「建物名称」有、「種類名称」  20 | #     優先度3:「key」有、「建物名称」 、「種類名称」有 21 | #     優先度4:「key」有、「建物名称」 、「種類名称」  22 | #     優先度5:「key」 、「建物名称」有、「種類名称」有 23 | #     優先度6:「key」 、「建物名称」有、「種類名称」  24 | #     優先度7:「key」 、「建物名称」 、「種類名称」有 25 | # 26 | #  4.高さ(double型) 27 | #  5.面積(double型) 28 | #   ・「高さ」はメートル単位とし、指定した高さ以上の設定で最も小さい高さの設定を有効とする。 29 | #   ・「面積」は平方メートル単位とし、指定した面積以上の設定で最も小さい面積の設定を有効とする。 30 | #   ・「高さ」、「面積」どちらも指定した場合、両方の値で判定し、高さ>面積の優先度で、最も小さい設定を有効とする。 31 | # 32 | #  6.アセット(string型) 33 | #  7.デフォルトアセット(string型) 34 | #   ・[/](半角スラッシュ)区切りで複数指定可能とし、複数ある場合にはランダムで採用される。 35 | #   ・以下の3つの値を指定可能。 36 | #    ・拡張アセット:asset.tblのkey値を指定 37 | #    ・標準アセット:先頭に[B]を付与した建物番号を指定(例:B628 <- 墓地) 38 | #             ⇒建物番号はDLLを解析し一覧を作成予定。 39 | #    ・区画    :先頭に[Z]を付与した区画番号を指定(例:Z2 <- 低密度住宅) 40 | #             ⇒(2:低密度住宅 3:高密度住宅 4=低密度商業 5=高密度商業 6=産業 7=オフィス) 41 | #   ・「アセット」に指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には「デフォルトアセット」を有効とする。 42 | #   ・「デフォルトアセット」が有効で、指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には、次のタグを判定対象とする。 43 | #     (detailedUsage.tblで判定していた場合、orgUsage.tblでの判定処理に移行する) 44 | # 45 | # ■その他 46 | #  ・先頭#の行はコメントとして扱われます。 47 | #  ・各項目は半角カンマ区切りで指定します。 48 | #  ・項目数が7以上の行が有効。項目8以降はスルーされます。 49 | # --------------------------------------------------------------------- 50 | # key, 建物名称, 種類名称, 高さ, 面積, アセット, デフォルトアセット, 51 | 401,,,,,,,業務施設 52 | 401101,,,,,,,事務所 53 | 401102,,,,,,,銀行 54 | 401103,,,,,,,会議場・展示場 55 | 401104,,,,,,,郵便局 56 | 401105,,,,,,,電話局 57 | 401106,,,,,,,民間研究所 58 | 401107,,,,,,,研修所 59 | 402,,,,,,,商業施設 60 | 4021,,,,,,,商業施設 1(百貨店、小売店、卸売店、ガソリンスタンド 等) 61 | 402101,,,,,,,百貨店 62 | 402102,,,,,,,小売店 63 | 402103,,,,,,,卸売店 64 | 402104,,,,,,,ガソリンスタンド 65 | 4022,,,,,,,商業施設2(食堂、喫茶店、弁当屋・宅配等) 66 | 402201,,,,,,,食堂 67 | 402202,,,,,,,喫茶店 68 | 402203,,,,,,,弁当屋・宅配 69 | 4023,,,,,,,商業施設3(理容店、美容院、レンタル業、宴会場、結婚式場、習い事教室、予備校、自動車教習所、住宅展示場、その他のサービス施設) 70 | 402301,,,,,,,理容店 71 | 402302,,,,,,,美容院 72 | 402303,,,,,,,レンタル業 73 | 402304,,,,,,,宴会場 74 | 402305,,,,,,,結婚式場 75 | 402306,,,,,,,習い事教室 76 | 402307,,,,,,,予備校 77 | 402308,,,,,,,自動車教習所 78 | 402309,,,,,,,住宅展示場 79 | 402310,,,,,,,その他サービス施設 80 | 4024,,,,,,,商業施設4(料理店、キャバレー、クラブ、バー、飲み屋等) 81 | 402401,,,,,,,料理店 82 | 402402,,,,,,,キャバレー 83 | 402403,,,,,,,クラブ 84 | 402404,,,,,,,バー 85 | 402405,,,,,,,飲み屋 86 | 4025,,,,,,,商業施設5(劇場、映画館等) 87 | 402501,,,,,,,劇場 88 | 402502,,,,,,,映画館 89 | 4026,,,,,,,商業施設6(ボーリング場、バッティングセンター、ゴルフ練習場、フィットネス、カラオケボックス、インターネットカフェ等) 90 | 402601,,,,,,,ボーリング場 91 | 402602,,,,,,,バッティングセンター 92 | 402603,,,,,,,ゴルフ練習場 93 | 402604,,,,,,,フィットネス 94 | 402605,,,,,,,カラオケボックス 95 | 402606,,,,,,,インターネットカフェ 96 | 4027,,,,,,,商業施設7(マージャン屋、パチンコ屋、馬券・車券発売所等) 97 | 402701,,,,,,,マージャン屋 98 | 402702,,,,,,,パチンコ店 99 | 402703,,,,,,,馬券・車券発売所 100 | 403,,,,,,,宿泊施設 101 | 403101,,,,,,,ホテル 102 | 403102,,,,,,,旅館 103 | 403103,,,,,,,民宿 104 | 403104,,,,,,,ラブホテル 105 | 404,,,,,,,商業系複合施設 106 | 4041,,,,,,,商業系複合施設 107 | 411,,,,,,,住宅 108 | 4111,,,,,,,専用住宅(住宅に付随する物置、車庫を含む) 109 | 412,,,,,,,共同住宅 110 | 412101,,,,,,,アパート 111 | 412102,,,,,,,マンション 112 | 412103,,,,,,,長屋 113 | 412104,,,,,,,寮 114 | 413,,,,,,,店舗等併用住宅 115 | 4131,,,,,,,店舗等併用住宅 116 | 414,,,,,,,店舗等併用共同住宅 117 | 4141,,,,,,,店舗等併用共同住宅 118 | 415,,,,,,,作業所併用住宅 119 | 4151,,,,,,,作業所併用住宅 120 | 421,,,,,市役所1/市役所2,B694,官公庁施設 121 | 421101,,,,,市役所1/市役所2,B694,国県市町村庁舎 122 | 421102,,,,,,B302,裁判所 123 | 421103,,,,250,税務署1,B301,税務署 124 | 421104,,,,250,警察署1,B259/B260,警察署 125 | 421105,,,,250,消防署1/消防署2,B280/B281,消防署 126 | 421106,,,,50,駐在所1/駐在所2/駐在所3,駐在所 127 | 422,,,,,高校1,B328,文教厚生施設 128 | 4221,,,,,250,B329,文教厚生施設1(大学、高等専門学校、各種学校、公的研究所等) 129 | 422101,,,,,250,B329,大学 130 | 422102,,,250,,高校1,B328,高等専門学校 131 | 422103,,,,250,高校1,B328,各種学校 132 | 422104,,,,250,研究所1,公的研究所 133 | 4222,,,,250,高校1/小学校1/小学校2,B326,文教厚生施設2(小・中・高等学校、保育所等) 134 | 422201,,,,250,高校1/小学校1/小学校2,B326,小・中・高等学校 135 | 422202,,,,250,保育所1,保育所 136 | 4223,,,,250,図書館1/図書館2,B330,文教厚生施設3(図書館、博物館、文化ホール、集会所、動物園等) 137 | 422301,,,,250,図書館1/図書館2,B330,図書館 138 | 422302,,,,250,博物館1/博物館2,B330,博物館 139 | 422303,,,,250,集会所1,B693,文化ホール 140 | 422304,,,,250,集会所1,集会所 141 | 422305,,,,,250,動物園 142 | 4224,,,,250,体育館1/体育館2/体育館3,文教厚生施設4(体育館、水泳場、野球場、陸上競技場その他のスポーツ施設(主に公共施設)) 143 | 422401,,,,250,体育館1/体育館2/体育館3,体育館 144 | 422402,,,,250,体育館1/体育館2/体育館3,水泳場 145 | 422403,,,,250,野球場1/野球場2,野球場 146 | 422404,,,,250,サッカー場1/サッカー場2,陸上競技場その他のスポーツ施設(主に公共施設) 147 | 4225,,,,250,病院1,B625/B626,文教厚生施設5(病院) 148 | 4226,,,,250,診療所1/診療所2,B625,文教厚生施設6(診療所、老人ホーム、介護福祉施設、公衆浴場、公衆便所等) 149 | 422601,,,,250,診療所1/診療所2,B625,診療所 150 | 422602,,,,,250,B630,老人ホーム 151 | 422603,,,,,250,B630,介護福祉施設 152 | 422604,,,,,,公衆浴場 153 | 422605,,,,,公衆トイレ1/公衆トイレ2/公衆トイレ3/公衆トイレ4,公衆便所 154 | 4227,,,,250,神社1/神社2/神社3,文教厚生施設7(神社、寺院、教会等) 155 | 422701,,,,250,神社1/神社2/神社3,神社 156 | 422702,,,,250,神社1/神社2/神社3,寺院 157 | 422703,,,,250,教会1,教会 158 | 431,,,,,,,運輸倉庫施設 159 | 4311,,,,,,,運輸倉庫施設1(駅舎、電車車庫、バスターミナル、港湾・空港施設等) 160 | 431101,,,,,,,駅舎 161 | 431102,,,,,,,電車車庫 162 | 431103,,,,,,,バスターミナル 163 | 431104,,,,,,,港湾・空港施設 164 | 4312,,,,,,,運輸倉庫施設2(卸売市場、倉庫、トラックターミナル等) 165 | 431201,,,,,,,卸売市場 166 | 431202,,,,,,,倉庫 167 | 431203,,,,,,,トラックターミナル 168 | 4313,,,,,,,運輸倉庫施設3(立体駐車場、駐輪施設等) 169 | 431301,,,,,,,立体駐車場 170 | 431302,,,,,,,駐輪施設 171 | 441,,,,,,,工場 172 | 4411,,,,,,,工場1(危険物の製造、液化ガスの製造、塩素・臭素等の製造、肥料の製造、製紙、製革、アスファルトの精製、セメントの製造、金属の溶融等(準工業地域において立地不可)) 173 | 441101,,,,,,,危険物の製造 174 | 441102,,,,,,,液化ガスの製造 175 | 441103,,,,,,,塩素・臭素等の製造 176 | 441104,,,,,,,肥料の製造 177 | 441105,,,,,,,製紙 178 | 441106,,,,,,,製革 179 | 441107,,,,,,,アスファルトの精製 180 | 441108,,,,,,,セメントの製造 181 | 441109,,,,,,,金属の溶解 182 | 4412,,,,,,,工場2(原動機を使用する150㎡を超える工場、引火性溶剤を用いるドライクリーニング、原動機を使用する岩石の粉砕、レディミクストコンクリートの製造、陶磁器・ガラスの製造等(商業地域において立地不可)) 183 | 441201,,,,,,,原動機を使用する150㎡を超える工場 184 | 441202,,,,,,,引火性溶剤を用いるドライクリーニング 185 | 441203,,,,,,,原動機を使用する岩石の粉砕 186 | 441204,,,,,,,レディミクストコンクリートの製造 187 | 441205,,,,,,,陶磁器・ガラスの製造 188 | 4413,,,,,,,工場3(原動機を使用する50,㎡を超える工場、原動機を使用する魚肉の練製品の製造・セメント製品の製造・金属の加工・印刷、木工所、めっき等(住居地域において立地不可) 189 | 441301,,,,,,,原動機を使用する50㎡を超える工場 190 | 441302,,,,,,,原動機を使用する魚肉の練製品の製造・セメント製品の製造・金属の加工・印刷 191 | 441303,,,,,,,木工所 192 | 441304,,,,,,,めっき 193 | 4414,,,,,,,工場4(50㎡以内のパン屋、米屋、豆腐屋、菓子屋その他これらに類する食品製造業を営む工場等) 194 | 441401,,,,,,,50㎡以内のパン屋 195 | 441402,,,,,,,米屋 196 | 441403,,,,,,,豆腐屋 197 | 441404,,,,,,,菓子屋その他これらに類する食品製造業を営む工場 198 | 4415,,,,,,,工場5(自動車修理工場) 199 | 451,,,,,,,農林漁業用施設 200 | 451101,,,,,,,農業用納屋 201 | 451102,,,,,,,畜舎 202 | 451103,,,,,,,温室 203 | 451104,,,,,,,船小屋 204 | 451105,,,,,,,農林漁業用作業場 205 | 452,,,,,,,供給処理施設 206 | 452101,,,,,,,処理場 207 | 452102,,,,,,,浄水場 208 | 452103,,,,,,,ポンプ場 209 | 452104,,,,,,,火葬場 210 | 452105,,,,,,,発電所 211 | 452106,,,,,,,変電所 212 | 452107,,,,,,,ガス・熱供給施設 213 | 453,,,,,,,防衛施設 214 | 454,,,,,,,その他 215 | 461,,,,,,,不明 216 | -------------------------------------------------------------------------------- /SkylinesPlateau/res/tbl/districtsAndZonesType.tbl: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------- 2 | # ■テーブル名 3 | #   districtsAndZonesType.tbl 4 | # 5 | # ■説明 6 | #  ・「udx\urf」配下に配置されている条例のGMLファイルをインポートする際に参照されるテーブル 7 | #  ・と比較し、導入する区画を設定する。 8 | # 9 | # ■設定値 10 | #  1.key(string型) 11 | #   ・タグの値と比較される。 12 | #    13 | #  2.区画番号(int型) 14 | #   ・導入する区画の区画番号を指定 15 | #    (2:低密度住宅, 3:高密度住宅, 4=低密度商業, 5=高密度商業, 6=工業, 7=オフィス) 16 | # 17 | # ■その他 18 | #  ・先頭#の行はコメントとして扱われます。 19 | #  ・各項目は半角カンマ区切りで指定します。 20 | #  ・項目数が2以上の行が有効。項目3以降はスルーされます。 21 | # --------------------------------------------------------------------- 22 | # key,区画番号 23 | 1,2,第 1 種低層住居専用地域 24 | 2,2,第 2 種低層住居専用地域 25 | 3,2,第 1 種中高層住居専用地域 26 | 4,2,第 2 種中高層住居専用地域 27 | 5,2,第 1 種住居地域 28 | 6,3,第 2 種住居地域 29 | 7,3,準住居地域 30 | 8,2,田園住居地域 31 | 9,4,近隣商業地域 32 | 10,5,商業地域 33 | 11,6,準工業地域 34 | 12,6,工業地域 35 | 13,6,工業専用地域 36 | 14,,特別用途地区 37 | 15,,特定用途制限地域 38 | 16,,特例容積率適用地区 39 | 17,,高層住居誘導地区 40 | 18,,高度地区 41 | 19,,高度利用地区 42 | 20,,特定街区 43 | 21,,都市再生特別地区 44 | 22,,居住調整地域 45 | 23,,特定用途誘導地区 46 | 24,,防火地域 47 | 25,,準防火地域 48 | 26,,特定防災街区整備地区 49 | -------------------------------------------------------------------------------- /SkylinesPlateau/res/tbl/orgUsage.tbl: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------- 2 | # ■テーブル名 3 | #   orgUsage.tbl 4 | # 5 | # ■説明 6 | #  ・「udx\bldg」配下に配置されている建物のGMLファイルをインポートする際に参照されるテーブル 7 | #  ・と比較し、導入する建物を設定する。 8 | # 9 | # ■設定値 10 | #  1.key(string型) 11 | #  2.建物名称(string型) 名称によるフィルタリングを行いたい場合に設定 12 | #  3.種類名称(string型) 13 | #   ・「key」「建物名称」「種類名称」のいずれも指定がない設定は無効とする。 14 | #   ・「key」は、タグの値と比較される。 15 | #   ・「建物名称」は、タグの値に、指定文字が含まれるか判定される。 16 | #   ・「種類名称」は、「key」で参照するタグの属性値codeSpaceで指定されたXMLファイルから、該当するタグを取得し、指定文字が含まれるか判定される。 17 | #   ・判定条件の優先順は、「key」>「建物名称」>「種類名称」とする。 18 | #     優先度1:「key」有、「建物名称」有、「種類名称」有 19 | #     優先度2:「key」有、「建物名称」有、「種類名称」  20 | #     優先度3:「key」有、「建物名称」 、「種類名称」有 21 | #     優先度4:「key」有、「建物名称」 、「種類名称」  22 | #     優先度5:「key」 、「建物名称」有、「種類名称」有 23 | #     優先度6:「key」 、「建物名称」有、「種類名称」  24 | #     優先度7:「key」 、「建物名称」 、「種類名称」有 25 | # 26 | #  4.高さ(double型) 27 | #  5.面積(double型) 28 | #   ・「高さ」はメートル単位とし、指定した高さ以上の設定で最も小さい高さの設定を有効とする。 29 | #   ・「面積」は平方メートル単位とし、指定した面積以上の設定で最も小さい面積の設定を有効とする。 30 | #   ・「高さ」、「面積」どちらも指定した場合、両方の値で判定し、高さ>面積の優先度で、最も小さい設定を有効とする。 31 | # 32 | #  6.アセット(string型) 33 | #  7.デフォルトアセット(string型) 34 | #   ・[/](半角スラッシュ)区切りで複数指定可能とし、複数ある場合にはランダムで採用される。 35 | #   ・以下の3つの値を指定可能。 36 | #    ・拡張アセット:asset.tblのkey値を指定 37 | #    ・標準アセット:先頭に[B]を付与した建物番号を指定(例:B628 <- 墓地) 38 | #             ⇒建物番号はDLLを解析し一覧を作成予定。 39 | #    ・区画    :先頭に[Z]を付与した区画番号を指定(例:Z2 <- 低密度住宅) 40 | #             ⇒(2:低密度住宅 3:高密度住宅 4=低密度商業 5=高密度商業 6=産業 7=オフィス) 41 | #   ・「アセット」に指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には「デフォルトアセット」を有効とする。 42 | #   ・「デフォルトアセット」が有効で、指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には、次のタグを判定対象とする。" 43 | #     (detailedUsage.tblで判定していた場合、orgUsage.tblでの判定処理に移行する) 44 | # 45 | # ■その他 46 | #  ・先頭#の行はコメントとして扱われます。 47 | #  ・各項目は半角カンマ区切りで指定します。 48 | #  ・項目数が7以上の行が有効。項目8以降はスルーされます。 49 | # --------------------------------------------------------------------- 50 | # key, 建物名称, 種類名称, 高さ, 面積, アセット, デフォルトアセット 51 | 1,,,0,,,住宅(一般住宅) 52 | 1,,,12,,,住宅(一般住宅) 53 | 2,,,0,,,共同住宅(共同住宅、寄宿舎、公営住宅) 54 | 2,,,12,,,共同住宅(共同住宅、寄宿舎、公営住宅) 55 | 3,,,0,,,併用住宅(1)(店舗併用住宅、事務所併用住宅) 56 | 3,,,12,,,併用住宅(1)(店舗併用住宅、事務所併用住宅) 57 | 4,,,0,,,併用住宅(2)(作業所併用住宅、農林漁業併用住宅) 58 | 4,,,12,,,併用住宅(2)(作業所併用住宅、農林漁業併用住宅) 59 | 5,,,,,,官公庁施設(県庁、市役所、役場、出先官庁、税務署、裁判所、消防署、刑務所、警察署) 60 | 6,高等学校,,10,1000,高校1,B326/B328/B329,文教厚生施設(1)(幼稚園、小学校、中学校、高等学校、大学、各種学校) 61 | #6,,,10,1000,高校1/小学校1/小学校2,B326/B328/B329,文教厚生施設(1)(幼稚園、小学校、中学校、高等学校、大学、各種学校) 62 | #7,,10,1000,,,文教厚生施設(2)(図書館、博物館、美術館、老人ホーム、養老院、身体障害福祉ホーム、神社・寺院・教会、保育所、託児所、派出所、公衆浴場、診療所、老人福祉センター、児童厚生施設各種養成所、研究所、市民会館、試験所、気象台、病院、保健所等) 63 | #8,,,,10,1000,体育館1/体育館2/体育館3,競技施設(専用体育館、スタンド、競技場) 64 | 9,,,0,,,業務施設(銀行、郵便局、会社、事務所、事務所附属倉庫) 65 | 9,,,12,,,業務施設(銀行、郵便局、会社、事務所、事務所附属倉庫) 66 | 10,,,0,,,商業施設(1)(小売店、百貨店、スーパーマーケット、コンビニエンスストア) 67 | 10,,,12,,,商業施設(1)(小売店、百貨店、スーパーマーケット、コンビニエンスストア) 68 | 11,,,0,,,商業施設(2)(食堂、喫茶店、スナック、浴場、ドライブイン、理髪店、レストラン) 69 | 11,,,12,,,商業施設(2)(食堂、喫茶店、スナック、浴場、ドライブイン、理髪店、レストラン) 70 | 12,,,0,,,問屋・卸売施設(卸売問屋、中央卸売問屋、魚市場、青果市場) 71 | 12,,,12,,,問屋・卸売施設(卸売問屋、中央卸売問屋、魚市場、青果市場) 72 | 13,,,0,,,宿泊施設(ホテル、旅館、モーテル) 73 | 13,,,12,,,宿泊施設(ホテル、旅館、モーテル) 74 | 14,,,0,,,遊技施設(ボーリング場、スケート場、自動車教習所、マージャン屋、パチンコ屋、勝馬投票券発売所、カラオケボックス等) 75 | 14,,,12,,,遊技施設(ボーリング場、スケート場、自動車教習所、マージャン屋、パチンコ屋、勝馬投票券発売所、カラオケボックス等) 76 | 15,,,0,,,娯楽施設(劇場、映画館、演芸場、観覧場、キャバレー、料理店、ナイトクラブ、ダンスホール等、個室付き浴場業に係わる公衆浴場等) 77 | 15,,,12,,,娯楽施設(劇場、映画館、演芸場、観覧場、キャバレー、料理店、ナイトクラブ、ダンスホール等、個室付き浴場業に係わる公衆浴場等) 78 | 16,,,,,,,運輸施設(駅舎、停車場、電車車庫、飛行場、バスターミナル、トラックターミナル、航空施設) 79 | 17,,,,,,,倉庫施設(営業を営む倉庫(店舗や事務所等の附属倉庫は含まない)) 80 | 18,,,,,,,自動車車庫 81 | 19,,,,,,重化学工業施設 82 | 20,,,,,,軽工業施設 83 | 21,,,,,,サービス工業施設 84 | 22,,,,,,自動車修理工場 85 | 23,,,,,,家内工業施設 86 | 24,,,,,,農漁業用施設(畜舎、温室、漁業施設等) 87 | 25,,,,,,,その他の施設(仮設建築物、その他分類できない施設) 88 | -------------------------------------------------------------------------------- /SkylinesPlateau/res/tbl/orgUsage2.tbl: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------- 2 | # ■テーブル名 3 | #   orgUsage2.tbl 4 | # 5 | # ■説明 6 | #  ・「udx\bldg」配下に配置されている建物のGMLファイルをインポートする際に参照されるテーブル 7 | #  ・と比較し、導入する建物を設定する。 8 | # 9 | # ■設定値 10 | #  1.key(string型) 11 | #  2.建物名称(string型) 12 | #  3.種類名称(string型) 13 | #   ・「key」「建物名称」「種類名称」のいずれも指定がない設定は無効とする。 14 | #   ・「key」は、タグの値と比較される。 15 | #   ・「建物名称」は、タグの値に、指定文字が含まれるか判定される。 16 | #   ・「種類名称」は、「key」で参照するタグの属性値codeSpaceで指定されたXMLファイルから、該当するタグを取得し、指定文字が含まれるか判定される。 17 | #   ・判定条件の優先順は、「key」>「建物名称」>「種類名称」とする。 18 | #     優先度1:「key」有、「建物名称」有、「種類名称」有 19 | #     優先度2:「key」有、「建物名称」有、「種類名称」  20 | #     優先度3:「key」有、「建物名称」 、「種類名称」有 21 | #     優先度4:「key」有、「建物名称」 、「種類名称」  22 | #     優先度5:「key」 、「建物名称」有、「種類名称」有 23 | #     優先度6:「key」 、「建物名称」有、「種類名称」  24 | #     優先度7:「key」 、「建物名称」 、「種類名称」有 25 | # 26 | #  4.高さ(double型) 27 | #  5.面積(double型) 28 | #   ・「高さ」はメートル単位とし、指定した高さ以上の設定で最も小さい高さの設定を有効とする。 29 | #   ・「面積」は平方メートル単位とし、指定した面積以上の設定で最も小さい面積の設定を有効とする。 30 | #   ・「高さ」、「面積」どちらも指定した場合、両方の値で判定し、高さ>面積の優先度で、最も小さい設定を有効とする。 31 | # 32 | #  6.アセット(string型) 33 | #  7.デフォルトアセット(string型) 34 | #   ・[/](半角スラッシュ)区切りで複数指定可能とし、複数ある場合にはランダムで採用される。 35 | #   ・以下の3つの値を指定可能。 36 | #    ・拡張アセット:asset.tblのkey値を指定 37 | #    ・標準アセット:先頭に[B]を付与した建物番号を指定(例:B628 <- 墓地) 38 | #             ⇒建物番号はDLLを解析し一覧を作成予定。 39 | #    ・区画    :先頭に[Z]を付与した区画番号を指定(例:Z2 <- 低密度住宅) 40 | #             ⇒(2:低密度住宅 3:高密度住宅 4=低密度商業 5=高密度商業 6=産業 7=オフィス) 41 | #   ・「アセット」に指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には「デフォルトアセット」を有効とする。 42 | #   ・「デフォルトアセット」が有効で、指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には、次のタグを判定対象とする。" 43 | #     (detailedUsage.tblで判定していた場合、orgUsage.tblでの判定処理に移行する) 44 | # 45 | # ■その他 46 | #  ・先頭#の行はコメントとして扱われます。 47 | #  ・各項目は半角カンマ区切りで指定します。 48 | #  ・項目数が7以上の行が有効。項目8以降はスルーされます。 49 | # --------------------------------------------------------------------- 50 | # key, 建物名称, 種類名称, 高さ, 面積, アセット, デフォルトアセット 51 | -------------------------------------------------------------------------------- /SkylinesPlateau/res/tbl/usage.tbl: -------------------------------------------------------------------------------- 1 | # --------------------------------------------------------------------- 2 | # ■テーブル名 3 | #   usage.tbl 4 | # 5 | # ■説明 6 | #  ・「udx\bldg」配下に配置されている建物のGMLファイルをインポートする際に参照されるテーブル 7 | #  ・と比較し、導入する建物を設定する。 8 | # 9 | # ■設定値 10 | #  1.key(string型) 11 | #  2.建物名称(string型) 12 | #  3.種類名称(string型) 13 | #   ・「key」「建物名称」「種類名称」のいずれも指定がない設定は無効とする。 14 | #   ・「key」は、タグの値と比較される。 15 | #   ・「建物名称」は、タグの値に、指定文字が含まれるか判定される。 16 | #   ・「種類名称」は、「key」で参照するタグの属性値codeSpaceで指定されたXMLファイルから、該当するタグを取得し、指定文字が含まれるか判定される。 17 | #   ・判定条件の優先順は、「key」>「建物名称」>「種類名称」とする。 18 | #     優先度1:「key」有、「建物名称」有、「種類名称」有 19 | #     優先度2:「key」有、「建物名称」有、「種類名称」  20 | #     優先度3:「key」有、「建物名称」 、「種類名称」有 21 | #     優先度4:「key」有、「建物名称」 、「種類名称」  22 | #     優先度5:「key」 、「建物名称」有、「種類名称」有 23 | #     優先度6:「key」 、「建物名称」有、「種類名称」  24 | #     優先度7:「key」 、「建物名称」 、「種類名称」有 25 | # 26 | #  4.高さ(double型) 27 | #  5.面積(double型) 28 | #   ・「高さ」はメートル単位とし、指定した高さ以上の設定で最も小さい高さの設定を有効とする。 29 | #   ・「面積」は平方メートル単位とし、指定した面積以上の設定で最も小さい面積の設定を有効とする。 30 | #   ・「高さ」、「面積」どちらも指定した場合、両方の値で判定し、高さ>面積の優先度で、最も小さい設定を有効とする。 31 | # 32 | #  6.アセット(string型) 33 | #  7.デフォルトアセット(string型) 34 | #   ・[/](半角スラッシュ)区切りで複数指定可能とし、複数ある場合にはランダムで採用される。 35 | #   ・以下の3つの値を指定可能。 36 | #    ・拡張アセット:asset.tblのkey値を指定 37 | #    ・標準アセット:先頭に[B]を付与した建物番号を指定(例:B628 <- 墓地) 38 | #             ⇒建物番号はDLLを解析し一覧を作成予定。 39 | #    ・区画    :先頭に[Z]を付与した区画番号を指定(例:Z2 <- 低密度住宅) 40 | #             ⇒(2:低密度住宅 3:高密度住宅 4=低密度商業 5=高密度商業 6=産業 7=オフィス) 41 | #   ・「アセット」に指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には「デフォルトアセット」を有効とする。 42 | #   ・「デフォルトアセット」が有効で、指定されたアセットがゲーム上に存在しない場合、空欄や[none]の場合には、次のタグを判定対象とする。" 43 | #     (detailedUsage.tblで判定していた場合、orgUsage.tblでの判定処理に移行する) 44 | # 45 | # ■その他 46 | #  ・先頭#の行はコメントとして扱われます。 47 | #  ・各項目は半角カンマ区切りで指定します。 48 | #  ・項目数が7以上の行が有効。項目8以降はスルーされます。 49 | # --------------------------------------------------------------------- 50 | # key, 建物名称, 種類名称, 高さ, 面積, アセット, デフォルトアセット 51 | 401,,,,,Z7,,業務施設 52 | 402,,,0,,Z4,,商業施設 53 | 402,,,12,,Z5,,商業施設 54 | 403,,,0,,Z4,,宿泊施設 55 | 403,,,12,,Z5,,宿泊施設 56 | 404,,,0,,Z4,,商業系複合施設 57 | 404,,,12,,Z5,,商業系複合施設 58 | 411,,,0,,Z2,,住宅 59 | 411,,,12,,Z3,,住宅 60 | 412,,,0,,Z2,,共同住宅 61 | 412,,,12,,Z3,,共同住宅 62 | 413,,,0,,Z4,,店舗等併用住宅 63 | 413,,,12,,Z5,,店舗等併用住宅 64 | 414,,,0,,Z4,,店舗等併用共同住宅 65 | 414,,,12,,Z5,,店舗等併用共同住宅 66 | 415,,,0,,Z4,,作業所併用住宅 67 | 415,,,12,,Z5,,作業所併用住宅 68 | 421,,,,,Z7,,官公庁施設 69 | 422,,,,,Z4,,文教厚生施設 70 | 431,,,0,,Z4,,運輸倉庫施設 71 | 431,,,12,,Z5,,運輸倉庫施設 72 | 441,,,,,Z6,,工場 73 | 451,,,,,Z6,,農林漁業用施設 74 | 452,,,,,Z6,,供給処理施設 75 | 453,,,,,,,防衛施設 76 | 454,,,,,,,その他 77 | 461,,,,,,,不明 78 | #,,,,,Z2/Z3/Z6/Z4/Z2,,属性なし 79 | -------------------------------------------------------------------------------- /dll/Mapbox.VectorTile.ExtensionMethods.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/dll/Mapbox.VectorTile.ExtensionMethods.dll -------------------------------------------------------------------------------- /dll/Mapbox.VectorTile.Geometry.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/dll/Mapbox.VectorTile.Geometry.dll -------------------------------------------------------------------------------- /dll/Mapbox.VectorTile.LICENSE: -------------------------------------------------------------------------------- 1 | BSD 3-Clause License 2 | 3 | Copyright (c) 2017, Mapbox 4 | All rights reserved. 5 | 6 | Redistribution and use in source and binary forms, with or without 7 | modification, are permitted provided that the following conditions are met: 8 | 9 | * Redistributions of source code must retain the above copyright notice, this 10 | list of conditions and the following disclaimer. 11 | 12 | * Redistributions in binary form must reproduce the above copyright notice, 13 | this list of conditions and the following disclaimer in the documentation 14 | and/or other materials provided with the distribution. 15 | 16 | * Neither the name of the copyright holder nor the names of its 17 | contributors may be used to endorse or promote products derived from 18 | this software without specific prior written permission. 19 | 20 | THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" 21 | AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 22 | IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE 23 | DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE 24 | FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL 25 | DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 26 | SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER 27 | CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 28 | OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 29 | OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 30 | 31 | https://github.com/mapbox/vector-tile-cs 32 | -------------------------------------------------------------------------------- /dll/Mapbox.VectorTile.PbfReader.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/dll/Mapbox.VectorTile.PbfReader.dll -------------------------------------------------------------------------------- /dll/Mapbox.VectorTile.VectorTileReader.dll: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/Project-PLATEAU/SkylinesPLATEAU/1f58887e1aaf050ac824b7fec55235550d0db1a7/dll/Mapbox.VectorTile.VectorTileReader.dll --------------------------------------------------------------------------------