[GRASS-SVN] r36246 - in grass/trunk/gui/wxpython: nviz vdigit
svn_grass at osgeo.org
svn_grass at osgeo.org
Sun Mar 8 07:53:00 EDT 2009
Author: martinl
Date: 2009-03-08 07:53:00 -0400 (Sun, 08 Mar 2009)
New Revision: 36246
Added:
grass/trunk/gui/wxpython/nviz/setup.py
grass/trunk/gui/wxpython/vdigit/setup.py
Modified:
grass/trunk/gui/wxpython/nviz/nviz.h
grass/trunk/gui/wxpython/vdigit/digit.cpp
grass/trunk/gui/wxpython/vdigit/driver.h
grass/trunk/gui/wxpython/vdigit/driver_draw.cpp
grass/trunk/gui/wxpython/vdigit/message.cpp
Log:
wxGUI osgeo4w patch applied (by jef) - trac #519
(merge from devbr6, r36220)
Modified: grass/trunk/gui/wxpython/nviz/nviz.h
===================================================================
--- grass/trunk/gui/wxpython/nviz/nviz.h 2009-03-08 08:49:11 UTC (rev 36245)
+++ grass/trunk/gui/wxpython/nviz/nviz.h 2009-03-08 11:53:00 UTC (rev 36246)
@@ -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 @@
#include <grass/gstypes.h>
}
-// For compilers that support precompilation, includes "wx.h".
-#include <wx/wxprec.h>
#ifdef __BORLANDC__
#pragma hdrstop
Copied: grass/trunk/gui/wxpython/nviz/setup.py (from rev 36220, grass/branches/develbranch_6/gui/wxpython/nviz/setup.py)
===================================================================
--- grass/trunk/gui/wxpython/nviz/setup.py (rev 0)
+++ grass/trunk/gui/wxpython/nviz/setup.py 2009-03-08 11:53:00 UTC (rev 36246)
@@ -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']
+ )
+ ]
+)
Modified: grass/trunk/gui/wxpython/vdigit/digit.cpp
===================================================================
--- grass/trunk/gui/wxpython/vdigit/digit.cpp 2009-03-08 08:49:11 UTC (rev 36245)
+++ grass/trunk/gui/wxpython/vdigit/digit.cpp 2009-03-08 11:53:00 UTC (rev 36246)
@@ -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
Modified: grass/trunk/gui/wxpython/vdigit/driver.h
===================================================================
--- grass/trunk/gui/wxpython/vdigit/driver.h 2009-03-08 08:49:11 UTC (rev 36245)
+++ grass/trunk/gui/wxpython/vdigit/driver.h 2009-03-08 11:53:00 UTC (rev 36246)
@@ -24,6 +24,7 @@
#include <Python.h>
#include "pseudodc.h"
+#include <wx/gdicmn.h>
extern "C" {
#include <grass/gis.h>
Modified: grass/trunk/gui/wxpython/vdigit/driver_draw.cpp
===================================================================
--- grass/trunk/gui/wxpython/vdigit/driver_draw.cpp 2009-03-08 08:49:11 UTC (rev 36245)
+++ grass/trunk/gui/wxpython/vdigit/driver_draw.cpp 2009-03-08 11:53:00 UTC (rev 36246)
@@ -19,6 +19,7 @@
#include "driver.h"
+
/**
\brief Draw content of the vector map to device
@@ -193,7 +194,7 @@
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 @@
// draw polygon
dc->DrawPolygon(points->n_points, wxPoints);
+ delete [] wxPoints;
+
return 1;
}
@@ -352,7 +355,7 @@
}
}
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 @@
pdc->DrawLines(pointsScreen->GetCount(), wxPoints);
+ delete [] wxPoints;
+
if (!IsSelected(line) && settings.direction.enabled) {
DrawDirectionArrow();
// restore pen
@@ -679,13 +684,13 @@
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;
Modified: grass/trunk/gui/wxpython/vdigit/message.cpp
===================================================================
--- grass/trunk/gui/wxpython/vdigit/message.cpp 2009-03-08 08:49:11 UTC (rev 36245)
+++ grass/trunk/gui/wxpython/vdigit/message.cpp 2009-03-08 11:53:00 UTC (rev 36246)
@@ -91,8 +91,7 @@
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);
Copied: grass/trunk/gui/wxpython/vdigit/setup.py (from rev 36220, grass/branches/develbranch_6/gui/wxpython/vdigit/setup.py)
===================================================================
--- grass/trunk/gui/wxpython/vdigit/setup.py (rev 0)
+++ grass/trunk/gui/wxpython/vdigit/setup.py 2009-03-08 11:53:00 UTC (rev 36246)
@@ -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']
+ )
+ ]
+)
More information about the grass-commit
mailing list