mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-20 23:23:30 +02:00
feat(editor): heightmap terrain from the terrain model of GUGiK, fitted to the tracks of the scenery
- editorNmt: squares of 500 m of the NMT at 1 m from the WCS service of geoportal.gov.pl, as GeoTIFF, fetched in the background, kept in editor/cache/nmt and sampled in the coordinates of the scenery, placed as its orthophoto is - the terrain panel's Terrain model section: Fit to the tracks moves the model up or down by the median of the differences to the formation of the tracks (Biała Podlaska, built at 0: -145.73 m, 0.28 m around it); Along the tracks and Around the camera make the chunks as the model comes in; each path gets its formation and slopes 1:1.5 as a modifier of the terrain, laid over each other into one corridor, bridges and tunnels keep the model; the orthophoto is turned on and laid onto the new ground - the http client of the orthophoto in editorHttp, shared; fill_from_nearest in editormodeshared.h - after the generator of Hirek (MaszynaTerrainGenerator): the WCS requests, the cache of squares, the corridor by envelopes - self-tests nmtfit, nmtmake, nmtwait
This commit is contained in:
@@ -63,6 +63,36 @@ editor_mode::selftest_result editor_mode::selftest_terrain(std::string const &co
|
||||
WriteLog(format("SELFTEST orthophoto at %.0f %.0f, radius %d, %s%s", config.north, config.east, config.radius, config.drape ? "fitted" : "flat", config.in_scene ? ", in the scene" : ""));
|
||||
return selftest_result::handled;
|
||||
}
|
||||
if (command == "nmtfit")
|
||||
{
|
||||
// the heights of the terrain model fitted to the tracks, as the button of the terrain panel does
|
||||
nmt_fit();
|
||||
WriteLog("SELFTEST nmtfit: " + m_nmt_state.status);
|
||||
return selftest_result::handled;
|
||||
}
|
||||
if (command == "nmtmake")
|
||||
{
|
||||
// chunks from the terrain model along the tracks (with the band in metres) or around the camera
|
||||
std::string where;
|
||||
double band{0.0};
|
||||
words >> where >> band;
|
||||
if (band > 0.0)
|
||||
m_nmt_state.band = band;
|
||||
nmt_make(where == "around" ? nmt_keys_around() : nmt_keys_along_tracks());
|
||||
WriteLog("SELFTEST nmtmake " + where + ": " + m_nmt_state.status);
|
||||
return selftest_result::handled;
|
||||
}
|
||||
if (command == "nmtwait")
|
||||
{
|
||||
// till the model is in and the chunks waiting for it are made
|
||||
if (m_nmt_state.fitting || false == m_nmt_state.pending.empty())
|
||||
{
|
||||
--m_selftest.next;
|
||||
return selftest_result::pause;
|
||||
}
|
||||
WriteLog("SELFTEST nmtwait: " + m_nmt_state.status + (m_nmt_state.error.empty() ? std::string{} : " (" + m_nmt_state.error + ")"));
|
||||
return selftest_result::handled;
|
||||
}
|
||||
if (command == "terrainmode")
|
||||
{
|
||||
m_terrain_open = true;
|
||||
|
||||
Reference in New Issue
Block a user