diff --git a/doc/notebooks/jupyter_integration.ipynb b/doc/notebooks/jupyter_integration.ipynb index 6b05452098d..17212b5c98c 100644 --- a/doc/notebooks/jupyter_integration.ipynb +++ b/doc/notebooks/jupyter_integration.ipynb @@ -602,8 +602,12 @@ "outputs": [], "source": [ "# Demonstration of GrassRenderer for non-interactive map display\n", +<<<<<<< HEAD "\n", "r = gj.GrassRenderer(height=540, filename = \"streams_maps.png\")\n", +======= + "r = gj.GrassRenderer(height=540)\n", +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) "\n", "r.run(\"d.rast\", map=\"elevation\")\n", "r.run(\"d.vect\", map=\"streams\")\n", diff --git a/gui/wxpython/main_window/frame.py b/gui/wxpython/main_window/frame.py index 932ab9eadd0..556f8332316 100644 --- a/gui/wxpython/main_window/frame.py +++ b/gui/wxpython/main_window/frame.py @@ -159,6 +159,7 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -205,6 +206,10 @@ >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +from lmgr.giface import LayerManagerGrassInterface +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) from lmgr.giface import ( LayerManagerGrassInterface, LayerManagerGrassInterfaceForMapDisplay, @@ -218,6 +223,7 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD from mapdisp.frame import MapPanel from datacatalog.catalog import DataCatalog ======= @@ -255,6 +261,9 @@ ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) from mapdisp.frame import MapPanel from datacatalog.catalog import DataCatalog from history.browser import HistoryBrowser @@ -717,8 +726,8 @@ def show_menu_errors(messages): >>>>>>> 4fcbd3f967 (Add Binder badge/button to readme (#1628)) ======= size = wx.Display().GetGeometry().GetSize() - self.PANE_BEST_SIZE = tuple(t / 5 for t in size) - self.PANE_MIN_SIZE = tuple(t / 10 for t in size) + self.PANE_BEST_SIZE = tuple(t / 3 for t in size) + self.PANE_MIN_SIZE = tuple(t / 7 for t in size) # create widgets and build panes self.CreateMenuBar() @@ -1033,6 +1042,7 @@ def IsPaneShown(self, name): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -1072,6 +1082,8 @@ def IsPaneShown(self, name): >>>>>>> 50aa049e59 (Add Binder badge/button to readme (#1628)) ======= >>>>>>> 17eee702cf (wxGUI/Single-Window GUI: arrangement of basic widgets (#1621)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def SetStatusText(self, *args): """Override SbMain statusbar method""" self.statusbar.SetStatusText(*args) @@ -1098,6 +1110,7 @@ def _createMainNotebook(self): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) @@ -1192,6 +1205,8 @@ def SetStatusText(self, *args): ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def _createMapNotebook(self): """Create Map Display notebook""" # create the notebook off-window to avoid flicker @@ -1212,6 +1227,7 @@ def _createMapNotebook(self): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> osgeo-main ======= @@ -1322,6 +1338,11 @@ def _createMapNotebook(self): ======= >>>>>>> 5871ca876b (wxGUI/Single-Window GUI: arrangement of basic widgets (#1621)) >>>>>>> 17eee702cf (wxGUI/Single-Window GUI: arrangement of basic widgets (#1621)) +======= + self.mapnotebook.SetArtProvider(aui.AuiDefaultTabArt()) + +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def _createDataCatalog(self, parent): """Initialize Data Catalog widget""" self.datacatalog = DataCatalog(parent=parent, giface=self._giface) @@ -1427,6 +1448,7 @@ def _createPythonShell(self, parent): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -1487,6 +1509,10 @@ def _createPythonShell(self, parent): >>>>>>> 50aa049e59 (Add Binder badge/button to readme (#1628)) ======= >>>>>>> 17eee702cf (wxGUI/Single-Window GUI: arrangement of basic widgets (#1621)) +======= +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def OnNewDisplay(self, event=None): """Create new layer tree and map display window instance""" self.NewDisplay() @@ -1517,6 +1543,7 @@ def NewDisplay(self, name=None, show=True): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -1558,6 +1585,8 @@ def NewDisplay(self, name=None, show=True): ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) # create display toolbar dmgrToolbar = DisplayPanelToolbar(guiparent=self.pg_panel, parent=self) @@ -1605,6 +1634,7 @@ def CreateNewMapDisplay(giface, layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> ebc6d3f683 (wxpyimgview: explicit conversion to int (#2704)) ======= @@ -1670,6 +1700,12 @@ def CreateNewMapDisplay(giface, layertree): >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= + self.notebookLayers.AddPage(page=self.pg_panel, text=name, select=True) + self.currentPage = self.notebookLayers.GetCurrentPage() + self.currentPageNum = self.notebookLayers.GetSelection() + +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def CreateNewMapDisplay(layertree): """Callback function which creates a new Map Display window :param layertree: layer tree object @@ -1693,6 +1729,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD >>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) @@ -1735,6 +1772,9 @@ def CreateNewMapDisplay(layertree): ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) id=wx.ID_ANY, tree=layertree, lmgr=self, @@ -1748,6 +1788,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -1797,6 +1838,11 @@ def CreateNewMapDisplay(layertree): >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= + dockable=True, +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) title=name, size=globalvar.MAP_WINDOW_SIZE, ) @@ -1809,6 +1855,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD self.mapnotebook.AddPage(mapdisplay, name) self.mapnotebook.SetSelection(self.currentPageNum) @@ -1831,6 +1878,8 @@ def CreateNewMapDisplay(layertree): >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self.mainnotebook.AddPage(mapdisplay, name) ======= self.mapnotebook.AddPage(mapdisplay, name) @@ -1842,6 +1891,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> a2d9fb4362 (wxpyimgview: explicit conversion to int (#2704)) ======= @@ -1877,6 +1927,8 @@ def CreateNewMapDisplay(layertree): >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) # set map display properties self._setUpMapDisplay(mapdisplay) @@ -1915,6 +1967,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD cb_boxsizer.Add(dmgrToolbar, proportion=0, flag=wx.EXPAND) ======= @@ -2004,6 +2057,11 @@ def CreateNewMapDisplay(layertree): cb_boxsizer.Add(dmgrToolbar, proportion=0, flag=wx.EXPAND) >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= + cb_boxsizer.Add(dmgrToolbar, proportion=0, flag=wx.EXPAND) +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) cb_boxsizer.Add(self.GetLayerTree(), proportion=1, flag=wx.EXPAND, border=1) self.currentPage.SetSizer(cb_boxsizer) cb_boxsizer.Fit(self.GetLayerTree()) @@ -2018,6 +2076,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -2037,6 +2096,8 @@ def CreateNewMapDisplay(layertree): >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) # Repaint Layers pane map display toolbar widget on the wxMac self._repaintLayersPaneMapDisplayToolbar() ======= @@ -2047,6 +2108,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) <<<<<<< HEAD @@ -2076,6 +2138,8 @@ def CreateNewMapDisplay(layertree): ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self.displayIndex += 1 @@ -2097,6 +2161,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -2148,6 +2213,8 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) """Callback to check if user wants to close display. Map Display index can be different from index in Display tab. @@ -2275,6 +2342,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> ebc6d3f683 (wxpyimgview: explicit conversion to int (#2704)) ======= @@ -2332,6 +2400,8 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) caption = _("Close Map Display {}").format(name) if not askIfSaveWorkspace or ( askIfSaveWorkspace and self.workspace_manager.CanClosePage(caption) @@ -2347,6 +2417,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -2371,6 +2442,8 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) return pgnum_dict return None @@ -2387,6 +2460,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= return pgnum_dict >>>>>>> 6cf60c76a4 (wxpyimgview: explicit conversion to int (#2704)) @@ -2414,6 +2488,8 @@ def CanCloseDisplay(askIfSaveWorkspace): return pgnum_dict >>>>>>> 6cf60c76a4 (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) return None mapdisplay.canCloseDisplayCallback = CanCloseDisplay @@ -2426,6 +2502,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> d7075af684 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= @@ -2438,6 +2515,8 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 83bcaf56ef (wxGUI/Single-Window: New change page event for AuiNotebook (#1780)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) mapdisplay.Bind( wx.EVT_ACTIVATE, lambda event, page=self.currentPage: self._onMapDisplayFocus(page), @@ -2448,6 +2527,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 2a3f5af732 (wxGUI/Single-Window: New change page event for AuiNotebook (#1780)) ======= @@ -2530,6 +2610,8 @@ def CanCloseDisplay(askIfSaveWorkspace): ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ) mapdisplay.starting3dMode.connect( @@ -2547,6 +2629,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD mapdisplay.closingDisplay.connect(self._closePageNoEvent) ======= @@ -2599,6 +2682,11 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +======= + mapdisplay.closingDisplay.connect(self._closePageNoEvent) +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) # set default properties mapdisplay.SetProperties( @@ -2627,6 +2715,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -2646,6 +2735,8 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def BuildPanes(self): """Build panes - toolbars as well as panels""" @@ -3646,17 +3737,19 @@ def _createMapDisplay(self, parent): """Set up Map Display""" # blank panel for testing self.mapdisplay = wx.Panel(parent=parent) +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def BuildPanes(self): """Build panes - toolbars as well as panels""" # initialize all main widgets + self._createMapNotebook() self._createDataCatalog(parent=self) self._createDisplay(parent=self) self._createSearchModule(parent=self) self._createConsole(parent=self) self._createPythonShell(parent=self) - self._createMapDisplay(parent=self) self.toolbars = { "workspace": LMWorkspaceToolbar(parent=self), "tools": LMToolsToolbar(parent=self), @@ -3698,8 +3791,8 @@ def BuildPanes(self): ) self._auimgr.AddPane( - self.mapdisplay, - aui.AuiPaneInfo().Name("map display").CenterPane().PaneBorder(True), + self.mapnotebook, + aui.AuiPaneInfo().Name("map display content").CenterPane().PaneBorder(True), ) self._auimgr.AddPane( @@ -4065,6 +4158,7 @@ def AddNvizTools(self, firstTime): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD <<<<<<< HEAD @@ -4086,10 +4180,13 @@ def AddNvizTools(self, firstTime): ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) ======= +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= self._auimgr.GetPane("nviz").Show() self._auimgr.Update() +<<<<<<< HEAD >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) self._auimgr.GetPane("nviz").Show() @@ -4128,6 +4225,9 @@ def AddNvizTools(self, firstTime): ======= >>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self._auimgr.GetPane("nviz").Show() self._auimgr.Update() @@ -4326,6 +4426,7 @@ def OnCBPageChanged(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -4340,6 +4441,8 @@ def OnCBPageChanged(self, event): >>>>>>> osgeo-main ======= >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) if hasattr(self.currentPage, "maptree") and self.mainnotebook.GetCurrentPage(): self.mainnotebook.SetSelectionToMainPage(self.GetMapDisplay()) @@ -4350,6 +4453,7 @@ def OnCBPageChanged(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD >>>>>>> osgeo-main ======= >>>>>>> osgeo-main @@ -4363,6 +4467,8 @@ def OnCBPageChanged(self, event): >>>>>>> osgeo-main ======= >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) try: self.mapnotebook.SetSelection(self.GetMapDisplayIndex()) except Exception: @@ -4374,6 +4480,7 @@ def OnCBPageChanged(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) >>>>>>> d7075af684 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) @@ -4386,6 +4493,9 @@ def OnCBPageChanged(self, event): ======= >>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) event.Skip() @@ -4503,6 +4613,7 @@ def OnCBPageClosing(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD self.mapnotebook.DeletePage(self.GetMapDisplayIndex()) ======= @@ -4524,6 +4635,8 @@ def OnCBPageClosing(self, event): >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self.mainnotebook.DeleteMainPage(self.GetMapDisplay()) ======= self.mapnotebook.DeletePage(self.GetMapDisplayIndex()) @@ -4534,6 +4647,7 @@ def OnCBPageClosing(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= self.mapnotebook.DeletePage(self.GetMapDisplayIndex()) >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) @@ -4568,6 +4682,8 @@ def OnCBPageClosing(self, event): self.mapnotebook.DeletePage(self.GetMapDisplayIndex()) >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) maptree.Close(True) self.currentPage = None @@ -4585,6 +4701,7 @@ def OnCBPageClosing(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -4609,6 +4726,8 @@ def OnCBPageClosing(self, event): >>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def _renamePageNoEvent(self, pgnum_dict, is_docked, text): if is_docked: self.mainnotebook.SetMainPageText( @@ -4629,6 +4748,7 @@ def _closePageNoEvent(self, page_index): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> ebc6d3f683 (wxpyimgview: explicit conversion to int (#2704)) ======= @@ -4821,6 +4941,8 @@ def FocusPage(self, page_text): ======= >>>>>>> 6cf60c76a4 (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 6f30700108 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def _closePageNoEvent(self, pgnum_dict, is_docked): """If map display is docked, close page and destroy map display without @@ -5635,6 +5757,7 @@ def OnRenameDisplay(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD self.mapnotebook.SetPageText(page_idx=self.GetMapDisplayIndex(), text=name) ======= @@ -5656,6 +5779,8 @@ def OnRenameDisplay(self, event): >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self.mainnotebook.SetMainPageText(page=self.GetMapDisplay(), text=name) ======= self.mapnotebook.SetPageText(page_idx=self.GetMapDisplayIndex(), text=name) @@ -5666,6 +5791,7 @@ def OnRenameDisplay(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= self.mapnotebook.SetPageText(page_idx=self.GetMapDisplayIndex(), text=name) >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) @@ -5700,6 +5826,8 @@ def OnRenameDisplay(self, event): self.mapnotebook.SetPageText(page_idx=self.GetMapDisplayIndex(), text=name) >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> 8f5c741ca6 (wxpyimgview: explicit conversion to int (#2704)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) dlg.Destroy() def OnRasterRules(self, event): diff --git a/python/grass/jupyter/display.py b/python/grass/jupyter/display.py index 31961d9410c..8b5636de121 100644 --- a/python/grass/jupyter/display.py +++ b/python/grass/jupyter/display.py @@ -22,6 +22,7 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD import shutil ======= <<<<<<< HEAD @@ -96,9 +97,18 @@ import tempfile >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) from pathlib import Path +======= +import shutil +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) from IPython.display import Image +<<<<<<< HEAD >>>>>>> 033a57360f (libpython: Save and load benchmark results (#1711)) +======= +import tempfile +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) import grass.script as gs @@ -209,8 +219,11 @@ def __init__( <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self, height=400, width=600, @@ -218,6 +231,7 @@ def __init__( env=None, text_size=12, renderer="cairo", +<<<<<<< HEAD <<<<<<< HEAD ): <<<<<<< HEAD @@ -279,10 +293,29 @@ def __init__( >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= self, env=None, width=600, height=400, filename="map.png", text_size=12 +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ): +<<<<<<< HEAD """Initiates an instance of the GrassRenderer class.""" +======= +<<<<<<< HEAD >>>>>>> 033a57360f (libpython: Save and load benchmark results (#1711)) +======= + """Creates an instance of the GrassRenderer class. + + :param int height: height of map in pixels + :param int width: width of map in pixels + :param str filename: filename or path to save a PNG of map + :param str env: environment + :param int text_size: default text size, overwritten by most display modules + :param renderer: GRASS renderer driver (options: cairo, png, ps, html) + """ +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) + + # Copy Environment +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) if env: self._env = env.copy() else: @@ -294,6 +327,7 @@ def __init__( <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> osgeo-main ======= @@ -432,16 +466,40 @@ def __init__( >>>>>>> af1011ff1e (libpython: Save and load benchmark results (#1711)) ======= +======= + # Environment Settings +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self._env["GRASS_RENDER_WIDTH"] = str(width) self._env["GRASS_RENDER_HEIGHT"] = str(height) +<<<<<<< HEAD self._env["GRASS_TEXT_SIZE"] = str(text_size) self._env["GRASS_RENDER_IMMEDIATE"] = "cairo" self._env["GRASS_RENDER_FILE"] = str(filename) +======= + self._env["GRASS_RENDER_TEXT_SIZE"] = str(text_size) + self._env["GRASS_RENDER_IMMEDIATE"] = renderer +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self._env["GRASS_RENDER_FILE_READ"] = "TRUE" - self._legend_file = Path(filename).with_suffix(".grass_vector_legend") + # Create PNG file for map + # If not user-supplied, we will write it to a map.png in a + # temporary directory that we can delete later. We need + # this temporary directory for the legend anyways so we'll + # make it now + self._tmpdir = tempfile.TemporaryDirectory() + + if filename: + self._filename = filename + else: + self._filename = os.path.join(self._tmpdir.name, "map.png") + # Set environment var for file + self._env["GRASS_RENDER_FILE"] = self._filename + + # Create Temporary Legend File + self._legend_file = os.path.join(self._tmpdir.name, "legend.txt") self._env["GRASS_LEGEND_FILE"] = str(self._legend_file) +<<<<<<< HEAD >>>>>>> 033a57360f (libpython: Save and load benchmark results (#1711)) self._filename = filename @@ -462,6 +520,8 @@ def __init__( >>>>>>> ddb6db9b59 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= >>>>>>> 033a57360f (libpython: Save and load benchmark results (#1711)) +======= +>>>>>>> 7ed89dabad (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def run(self, module, **kwargs): """Run modules from "d." GRASS library""" # Check module is from display library then run diff --git a/raster/r.in.pdal/Makefile b/raster/r.in.pdal/Makefile index 8e16de7e559..69d1c22e101 100644 --- a/raster/r.in.pdal/Makefile +++ b/raster/r.in.pdal/Makefile @@ -154,6 +154,8 @@ $(OBJDIR)/grasslidarfilter.o : EXTRA_CFLAGS += $(PDALCPPFLAGS) ======= $(OBJDIR)/main.o : EXTRA_CFLAGS += $(PDALCPPFLAGS) +$(OBJDIR)/info.o : EXTRA_CFLAGS += $(PDALCPPFLAGS) + $(OBJDIR)/grasslidarfilter.o : EXTRA_CFLAGS += $(PDALCPPFLAGS) >>>>>>> 9d4a079d2e (libcairodriver: enable Cairo with and without Fontconfig (#1697))