mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-02 10:29:13 +01:00
feat(editor): the download area drawn on the topo map: a polygon is the boundary of what the editor downloads, the orthophoto and the terrain model alike. Drawn from the settings of the orthophoto (Download area, Draw on the map, the top view on): a click puts a point, a point dragged moves, Shift+click removes it, Backspace takes the last one back, Enter closes the area, Esc gives up; it's kept in the scenery as //$a lines in PUWG 1992, so it stays on the ground when the origin moves. Inside it everything the settings ask for, the standard imagery, the 4K one where it's ticked and covers the place, the squares of the terrain model where the scenery has its terrain, goes to the disk cache in the background, nothing decoded nor uploaded, only while no tile around the camera waits and not while the scenery is driven, with its progress, Pause and Retry under it; outside it nothing is asked for, around the camera, along the tracks or ahead of the laying, nor shown. The workers of the orthophoto are 8, at most 3 of them on the tiles around the camera, each holding an image decoded, the rest downloading the area. The 4K tiles: an image the tile no longer wants once it comes, as a 4K one asked for before the camera moved on, isn't uploaded (the 64 MB and the mipmaps of it), nor decoded where a newer job of the tile waits; no two jobs of one tile run at once; a standard tile coming blank twice is remembered by a .blank file, not downloaded again on each return; a 4K tile is uploaded only in a frame with no other upload. Selftests orthoarea, orthostats, orthohires, orthoareapause; unit tests of the tiles a triangle, a concave polygon, a thin band and a polygon about a corner touch (geometry::squares_in, square_touches)
This commit is contained in:
@@ -471,6 +471,20 @@ class editor_mode : public application_mode, private editor_track::observer, pri
|
||||
// the chunks waiting for the terrain model and the tiles of the imagery asked for outlined where they will be, so it's seen
|
||||
// what's on its way
|
||||
void draw_nmt_pending() const;
|
||||
// the download area: a polygon drawn on the map, the boundary of what the orthophoto and the terrain model download in the
|
||||
// background, none of them asking for anything outside it (application/editormodenmt.cpp)
|
||||
void area_start();
|
||||
// Keep: the area drawn taken, else the one before stays
|
||||
void area_finish(bool const Keep);
|
||||
// a press of the left button while drawing: a point added, or the one under the cursor taken to drag, Shift: removed
|
||||
void area_click(bool const Shift);
|
||||
void area_update();
|
||||
// a point of the area (x, z) where it's drawn: over the map of the top view, on the ground in the 3d view
|
||||
glm::dvec3 area_point(glm::dvec2 const &Point) const;
|
||||
void draw_download_area() const;
|
||||
void render_download_area_ui(editor_orthophoto::statistics const &Stats);
|
||||
// the chunk of the terrain (x, z) touches the area, or there's none
|
||||
bool in_download_area(glm::dvec2 const &Low, glm::dvec2 const &High) const;
|
||||
// over the 3d view while the terrain panel isn't seen
|
||||
void render_nmt_banner();
|
||||
bool nmt_busy() const;
|
||||
@@ -712,6 +726,16 @@ class editor_mode : public application_mode, private editor_track::observer, pri
|
||||
std::size_t m_ortho_waiting{0}; // squares of the terrain model asked for and not in yet, the same
|
||||
std::string m_orthophoto_scenery; // scenery whose origin is loaded
|
||||
std::string m_orthophoto_mark;
|
||||
std::vector<std::string> m_orthophoto_area_mark; // the lines of the download area as the scenery keeps them
|
||||
// the download area being drawn on the map: its points in the world (x, z), the one dragged
|
||||
struct area_drawing
|
||||
{
|
||||
bool active{false};
|
||||
std::vector<glm::dvec2> points;
|
||||
int dragged{-1};
|
||||
} m_area_drawing;
|
||||
std::vector<glm::dvec2> m_nmt_prefetched; // the download area the terrain model was given
|
||||
bool m_area_paused{false}; // the download of the area held by the button; out of the editor it's held anyway
|
||||
glm::dvec2 m_orthophoto_origin_edit{0.0}; // origin being typed in (northing, easting); applied when editing ends
|
||||
|
||||
// hierarchy management
|
||||
|
||||
Reference in New Issue
Block a user