From 0bbf44c068a1e4360ac34594787b3ec6af583165 Mon Sep 17 00:00:00 2001 From: Alex Barreto Date: Mon, 2 Aug 2021 09:25:17 -0400 Subject: [PATCH] r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768) --- doc/notebooks/jupyter_integration.ipynb | 4 + gui/wxpython/main_window/frame.py | 138 +++++++++++++++++++++++- python/grass/jupyter/display.py | 62 ++++++++++- raster/r.in.pdal/Makefile | 2 + 4 files changed, 200 insertions(+), 6 deletions(-) diff --git a/doc/notebooks/jupyter_integration.ipynb b/doc/notebooks/jupyter_integration.ipynb index e6e7bbd60b9..ecf2364d9ea 100644 --- a/doc/notebooks/jupyter_integration.ipynb +++ b/doc/notebooks/jupyter_integration.ipynb @@ -842,8 +842,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 5ad9317eb88..dfa5cdc2a61 100644 --- a/gui/wxpython/main_window/frame.py +++ b/gui/wxpython/main_window/frame.py @@ -210,6 +210,7 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -296,6 +297,10 @@ >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +from lmgr.giface import LayerManagerGrassInterface +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) from lmgr.giface import ( LayerManagerGrassInterface, LayerManagerGrassInterfaceForMapDisplay, @@ -314,6 +319,7 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD from mapdisp.frame import MapPanel from datacatalog.catalog import DataCatalog ======= @@ -385,6 +391,9 @@ ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> osgeo-main +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) from mapdisp.frame import MapPanel from datacatalog.catalog import DataCatalog from history.browser import HistoryBrowser @@ -1120,8 +1129,8 @@ def show_menu_errors(messages): >>>>>>> f4f8e0d593 (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() @@ -1540,6 +1549,7 @@ def IsPaneShown(self, name): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> main ======= @@ -1603,6 +1613,8 @@ def IsPaneShown(self, name): >>>>>>> f4f8e0d593 (Add Binder badge/button to readme (#1628)) ======= >>>>>>> cc1e106d6d (wxGUI/Single-Window GUI: arrangement of basic widgets (#1621)) +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def SetStatusText(self, *args): """Override SbMain statusbar method""" self.statusbar.SetStatusText(*args) @@ -1636,6 +1648,7 @@ def _createMainNotebook(self): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) @@ -1807,6 +1820,8 @@ def SetStatusText(self, *args): ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def _createMapNotebook(self): """Create Map Display notebook""" # create the notebook off-window to avoid flicker @@ -1833,6 +1848,7 @@ def _createMapNotebook(self): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> osgeo-main @@ -2018,6 +2034,11 @@ def _createMapNotebook(self): ======= >>>>>>> 5871ca876b (wxGUI/Single-Window GUI: arrangement of basic widgets (#1621)) >>>>>>> cc1e106d6d (wxGUI/Single-Window GUI: arrangement of basic widgets (#1621)) +======= + self.mapnotebook.SetArtProvider(aui.AuiDefaultTabArt()) + +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 2126e07d57 (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) @@ -2141,6 +2162,7 @@ def _createPythonShell(self, parent): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> main ======= @@ -2247,6 +2269,10 @@ def _createPythonShell(self, parent): >>>>>>> f4f8e0d593 (Add Binder badge/button to readme (#1628)) ======= >>>>>>> cc1e106d6d (wxGUI/Single-Window GUI: arrangement of basic widgets (#1621)) +======= +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 2126e07d57 (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() @@ -2284,6 +2310,7 @@ def NewDisplay(self, name=None, show=True): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> main ======= @@ -2357,6 +2384,8 @@ def NewDisplay(self, name=None, show=True): ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) # create display toolbar dmgrToolbar = DisplayPanelToolbar(guiparent=self.pg_panel, parent=self) @@ -2431,6 +2460,7 @@ def CreateNewMapDisplay(giface, layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> ebc6d3f683 (wxpyimgview: explicit conversion to int (#2704)) ======= @@ -2559,6 +2589,12 @@ def CreateNewMapDisplay(giface, layertree): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= + self.notebookLayers.AddPage(page=self.pg_panel, text=name, select=True) + self.currentPage = self.notebookLayers.GetCurrentPage() + self.currentPageNum = self.notebookLayers.GetSelection() + +>>>>>>> 2126e07d57 (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 @@ -2587,6 +2623,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD >>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) @@ -2663,6 +2700,9 @@ def CreateNewMapDisplay(layertree): ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> osgeo-main +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) id=wx.ID_ANY, tree=layertree, lmgr=self, @@ -2681,6 +2721,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -2771,6 +2812,11 @@ def CreateNewMapDisplay(layertree): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= + dockable=True, +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) title=name, size=globalvar.MAP_WINDOW_SIZE, ) @@ -2788,6 +2834,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD self.mapnotebook.AddPage(mapdisplay, name) self.mapnotebook.SetSelection(self.currentPageNum) @@ -2826,6 +2873,8 @@ def CreateNewMapDisplay(layertree): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self.mainnotebook.AddPage(mapdisplay, name) ======= self.mapnotebook.AddPage(mapdisplay, name) @@ -2842,6 +2891,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> a2d9fb4362 (wxpyimgview: explicit conversion to int (#2704)) ======= @@ -2915,6 +2965,8 @@ def CreateNewMapDisplay(layertree): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) # set map display properties self._setUpMapDisplay(mapdisplay) @@ -2961,6 +3013,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> main cb_boxsizer.Add(dmgrToolbar, proportion=0, flag=wx.EXPAND) @@ -3109,6 +3162,11 @@ def CreateNewMapDisplay(layertree): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= + cb_boxsizer.Add(dmgrToolbar, proportion=0, flag=wx.EXPAND) +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 2126e07d57 (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()) @@ -3128,6 +3186,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -3163,6 +3222,8 @@ def CreateNewMapDisplay(layertree): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) # Repaint Layers pane map display toolbar widget on the wxMac self._repaintLayersPaneMapDisplayToolbar() ======= @@ -3178,6 +3239,7 @@ def CreateNewMapDisplay(layertree): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) <<<<<<< HEAD @@ -3235,6 +3297,8 @@ def CreateNewMapDisplay(layertree): ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self.displayIndex += 1 @@ -3263,6 +3327,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> main ======= @@ -3358,6 +3423,8 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (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. @@ -3571,6 +3638,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> ebc6d3f683 (wxpyimgview: explicit conversion to int (#2704)) ======= @@ -3687,6 +3755,8 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (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) @@ -3709,6 +3779,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> main ======= @@ -3753,6 +3824,8 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) return pgnum_dict return None @@ -3774,6 +3847,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= return pgnum_dict >>>>>>> 6cf60c76a4 (wxpyimgview: explicit conversion to int (#2704)) @@ -3835,6 +3909,8 @@ def CanCloseDisplay(askIfSaveWorkspace): return pgnum_dict >>>>>>> 6cf60c76a4 (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) return None mapdisplay.canCloseDisplayCallback = CanCloseDisplay @@ -3852,6 +3928,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> d7075af684 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ======= @@ -3880,6 +3957,8 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) mapdisplay.Bind( wx.EVT_ACTIVATE, lambda event, page=self.currentPage: self._onMapDisplayFocus(page), @@ -3895,6 +3974,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> 2a3f5af732 (wxGUI/Single-Window: New change page event for AuiNotebook (#1780)) ======= @@ -4047,6 +4127,8 @@ def CanCloseDisplay(askIfSaveWorkspace): ======= >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ) mapdisplay.starting3dMode.connect( @@ -4069,6 +4151,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD mapdisplay.closingDisplay.connect(self._closePageNoEvent) ======= @@ -4162,6 +4245,11 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +======= + mapdisplay.closingDisplay.connect(self._closePageNoEvent) +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) # set default properties mapdisplay.SetProperties( @@ -4195,6 +4283,7 @@ def CanCloseDisplay(askIfSaveWorkspace): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD ======= @@ -4230,6 +4319,8 @@ def CanCloseDisplay(askIfSaveWorkspace): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def BuildPanes(self): """Build panes - toolbars as well as panels""" @@ -5585,17 +5676,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), @@ -5637,8 +5730,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( @@ -6142,6 +6235,7 @@ def AddNvizTools(self, firstTime): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD <<<<<<< HEAD @@ -6178,10 +6272,13 @@ def AddNvizTools(self, firstTime): ======= >>>>>>> osgeo-main ======= +======= +>>>>>>> 2126e07d57 (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() @@ -6249,6 +6346,9 @@ def AddNvizTools(self, firstTime): ======= >>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) >>>>>>> osgeo-main +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self._auimgr.GetPane("nviz").Show() self._auimgr.Update() @@ -6452,6 +6552,7 @@ def OnCBPageChanged(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD >>>>>>> main @@ -6483,6 +6584,8 @@ def OnCBPageChanged(self, event): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) if hasattr(self.currentPage, "maptree") and self.mainnotebook.GetCurrentPage(): self.mainnotebook.SetSelectionToMainPage(self.GetMapDisplay()) @@ -6498,6 +6601,7 @@ def OnCBPageChanged(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD >>>>>>> main @@ -6528,6 +6632,8 @@ def OnCBPageChanged(self, event): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) try: self.mapnotebook.SetSelection(self.GetMapDisplayIndex()) except Exception: @@ -6544,6 +6650,7 @@ def OnCBPageChanged(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= <<<<<<< HEAD >>>>>>> main @@ -6578,6 +6685,9 @@ def OnCBPageChanged(self, event): ======= >>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) >>>>>>> osgeo-main +======= +>>>>>>> 523219d6d4 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) event.Skip() @@ -6754,6 +6864,7 @@ def OnCBPageClosing(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD self.mapnotebook.DeletePage(self.GetMapDisplayIndex()) ======= @@ -6791,6 +6902,8 @@ def OnCBPageClosing(self, event): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self.mainnotebook.DeleteMainPage(self.GetMapDisplay()) ======= self.mapnotebook.DeletePage(self.GetMapDisplayIndex()) @@ -6806,6 +6919,7 @@ def OnCBPageClosing(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= self.mapnotebook.DeletePage(self.GetMapDisplayIndex()) >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) @@ -6874,6 +6988,8 @@ def OnCBPageClosing(self, event): self.mapnotebook.DeletePage(self.GetMapDisplayIndex()) >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) maptree.Close(True) self.currentPage = None @@ -6898,6 +7014,7 @@ def OnCBPageClosing(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> main ======= @@ -6942,6 +7059,8 @@ def OnCBPageClosing(self, event): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) def _renamePageNoEvent(self, pgnum_dict, is_docked, text): if is_docked: self.mainnotebook.SetMainPageText( @@ -6967,6 +7086,7 @@ def _closePageNoEvent(self, page_index): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= >>>>>>> ebc6d3f683 (wxpyimgview: explicit conversion to int (#2704)) ======= @@ -7234,6 +7354,8 @@ def FocusPage(self, page_text): ======= >>>>>>> 6cf60c76a4 (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (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 @@ -8107,6 +8229,7 @@ def OnRenameDisplay(self, event): <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD self.mapnotebook.SetPageText(page_idx=self.GetMapDisplayIndex(), text=name) ======= @@ -8144,6 +8267,8 @@ def OnRenameDisplay(self, event): >>>>>>> osgeo-main ======= >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (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) @@ -8159,6 +8284,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)) @@ -8227,6 +8353,8 @@ def OnRenameDisplay(self, event): self.mapnotebook.SetPageText(page_idx=self.GetMapDisplayIndex(), text=name) >>>>>>> 8422103f4c (wxpyimgview: explicit conversion to int (#2704)) >>>>>>> osgeo-main +======= +>>>>>>> 2126e07d57 (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 6cca1341147..54148aa369d 100644 --- a/python/grass/jupyter/display.py +++ b/python/grass/jupyter/display.py @@ -27,6 +27,7 @@ <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD import shutil ======= <<<<<<< HEAD @@ -152,9 +153,18 @@ import tempfile >>>>>>> osgeo-main ======= +======= +>>>>>>> 2126e07d57 (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 >>>>>>> f4219c860c (libpython: Save and load benchmark results (#1711)) +======= +import tempfile +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) import grass.script as gs @@ -302,10 +312,13 @@ 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)) +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) self, height=400, width=600, @@ -314,6 +327,7 @@ def __init__( text_size=12, renderer="cairo", <<<<<<< HEAD +<<<<<<< HEAD <<<<<<< HEAD ): <<<<<<< HEAD @@ -442,10 +456,29 @@ def __init__( >>>>>>> osgeo-main ======= self, env=None, width=600, height=400, filename="map.png", text_size=12 +======= +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) ): +<<<<<<< HEAD """Initiates an instance of the GrassRenderer class.""" +======= +<<<<<<< HEAD >>>>>>> f4219c860c (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 +>>>>>>> 2126e07d57 (r.in.pdal: info.cpp also needs PDALCPPFLAGS (#1768)) if env: self._env = env.copy() else: @@ -463,6 +496,7 @@ def __init__( <<<<<<< HEAD <<<<<<< HEAD <<<<<<< HEAD +<<<<<<< HEAD ======= ======= >>>>>>> osgeo-main @@ -671,16 +705,40 @@ def __init__( >>>>>>> 033a57360f (libpython: Save and load benchmark results (#1711)) ======= +======= + # Environment Settings +>>>>>>> 2126e07d57 (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 >>>>>>> f4219c860c (libpython: Save and load benchmark results (#1711)) self._filename = filename @@ -718,6 +776,8 @@ def __init__( >>>>>>> osgeo-main ======= >>>>>>> f4219c860c (libpython: Save and load benchmark results (#1711)) +======= +>>>>>>> 2126e07d57 (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 324fd643726..b362348a5f7 100644 --- a/raster/r.in.pdal/Makefile +++ b/raster/r.in.pdal/Makefile @@ -230,6 +230,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))