瀏覽代碼

wxGUI osgeo4w patch applied (by jef) - trac https://trac.osgeo.org/grass/ticket/519
(merge from devbr6, https://trac.osgeo.org/grass/changeset/36220)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@36246 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 年之前
父節點
當前提交
c8576679cf

+ 3 - 2
gui/wxpython/nviz/nviz.h

@@ -1,6 +1,9 @@
 #ifndef WXNVIZ_H
 #define WXNVIZ_H
 
+// For compilers that support precompilation, includes "wx.h".
+#include <wx/wxprec.h>
+
 #include <vector>
 
 extern "C" {
@@ -10,8 +13,6 @@ extern "C" {
 #include <grass/gstypes.h>
 }
 
-// For compilers that support precompilation, includes "wx.h".
-#include <wx/wxprec.h>
 
 #ifdef __BORLANDC__
 #pragma hdrstop

+ 24 - 0
gui/wxpython/nviz/setup.py

@@ -0,0 +1,24 @@
+# currently used only for osgeo4w
+# TODO: use instead of Makefile
+from distutils.core import setup, Extension
+
+setup(
+	ext_modules= [
+		Extension(
+			'_grass7_wxnviz',
+			sources=[
+				"grass7_wxnviz.i",
+				"change_view.cpp",
+				"draw.cpp",
+				"init.cpp",
+				"lights.cpp",
+				"load.cpp",
+				"surface.cpp",
+				"vector.cpp",
+				"volume.cpp",
+				],
+			swig_opts=['-c++','-shadow'],
+			libraries=['grass_gis','grass_nviz','grass_ogsf','grass_g3d']
+		)
+	]
+)

+ 6 - 0
gui/wxpython/vdigit/digit.cpp

@@ -15,6 +15,12 @@
 #include "driver.h"
 #include "digit.h"
 
+#ifdef _WIN32
+#ifndef _CPPRTTI
+#error "compile with /GR!"
+#endif
+#endif
+
 /**
    \brief Initialize digit interface used by SWIG
 

+ 1 - 0
gui/wxpython/vdigit/driver.h

@@ -24,6 +24,7 @@
 
 #include <Python.h>
 #include "pseudodc.h"
+#include <wx/gdicmn.h>
 
 extern "C" {
 #include <grass/gis.h>

+ 11 - 6
gui/wxpython/vdigit/driver_draw.cpp

@@ -19,6 +19,7 @@
 
 #include "driver.h"
 
+
 /**
    \brief Draw content of the vector map to device
    
@@ -193,7 +194,7 @@ int DisplayDriver::DrawArea(const line_pnts* points)
     double x, y, z;
 
     // convert EN -> xy
-    wxPoint wxPoints[points->n_points];
+    wxPoint *wxPoints = new wxPoint[points->n_points];
 
     for (int i = 0; i < points->n_points; i++) {
 	Cell2Pixel(points->x[i], points->y[i], points->z[i],
@@ -204,6 +205,8 @@ int DisplayDriver::DrawArea(const line_pnts* points)
     // draw polygon
     dc->DrawPolygon(points->n_points, wxPoints);
 
+    delete [] wxPoints;
+
     return 1;
 }
 
@@ -352,7 +355,7 @@ int DisplayDriver::DrawLine(int line)
 		}
 	    }
 	    else {
-		wxPoint wxPoints[pointsScreen->GetCount()];
+		wxPoint *wxPoints = new wxPoint[pointsScreen->GetCount()];
 		for (size_t i = 0; i < pointsScreen->GetCount(); i++) {
 		    wxPoint *point_beg = (wxPoint *) pointsScreen->Item(i)->GetData();
 		    wxPoints[i] = *point_beg;
@@ -360,6 +363,8 @@ int DisplayDriver::DrawLine(int line)
 		
 		pdc->DrawLines(pointsScreen->GetCount(), wxPoints);
 
+		delete [] wxPoints;
+
 		if (!IsSelected(line) && settings.direction.enabled) {
 		    DrawDirectionArrow();
 		    // restore pen
@@ -679,13 +684,13 @@ int DisplayDriver::DrawArrow(double x0, double y0,
     double angle_symb;
 
     angle_symb = angle - M_PI / 2.;
-    x = x1 + size * std::cos(angle_symb);
-    y = y1 - size * std::sin(angle_symb);
+    x = x1 + size * cos(angle_symb);
+    y = y1 - size * sin(angle_symb);
     dc->DrawLine((wxCoord) x, (wxCoord) y, (wxCoord) x0, (wxCoord) y0);
     
     angle_symb = M_PI / 2. + angle;
-    x = x1 + size * std::cos(angle_symb);
-    y = y1 - size * std::sin(angle_symb);
+    x = x1 + size * cos(angle_symb);
+    y = y1 - size * sin(angle_symb);
     dc->DrawLine((wxCoord) x0, (wxCoord) y0, (wxCoord) x, (wxCoord) y);
 
     return 1;

+ 1 - 2
gui/wxpython/vdigit/message.cpp

@@ -91,8 +91,7 @@ void DisplayDriver::DeadLineMsg(int line)
 void DisplayDriver::BackgroundMapMsg(const char *bgmap)
 {
     wxString msg;
-    msg.Printf(_("Unable to open background vector map <%s>. "
-		 "Please check digitizer settings."),
+    msg.Printf(_("Unable to open background vector map <%s>. Please check digitizer settings."),
 	       wxString (bgmap, wxConvUTF8).c_str());
     wxMessageDialog dlg(parentWin, msg,
 			msgCaption, wxOK | wxICON_ERROR | wxCENTRE);

+ 27 - 0
gui/wxpython/vdigit/setup.py

@@ -0,0 +1,27 @@
+# currently used only for osgeo4w
+# TODO: use instead of Makefile
+from distutils.core import setup, Extension
+
+setup(
+	ext_modules= [
+		Extension(
+			'_grass7_wxvdigit',
+			sources=[
+				"grass7_wxvdigit.i",
+				"cats.cpp",
+				"driver.cpp",
+				"driver_draw.cpp",
+				"driver_select.cpp",
+				"line.cpp",
+				"message.cpp",
+				"select.cpp",
+				"undo.cpp",
+				"vertex.cpp",
+				"pseudodc.cpp",
+				"digit.cpp"
+				],
+			swig_opts=['-c++','-shadow'],
+			libraries=['grass_dbmibase', 'grass_dbmiclient', 'grass_vect','grass_gis','grass_vedit','gdal_i', 'wxbase28u', 'wxmsw28u_core']
+		)
+	]
+)