[GRASS-SVN] r36221 - in
grass/branches/releasebranch_6_4/gui/wxpython: nviz vdigit
svn_grass at osgeo.org
svn_grass at osgeo.org
Fri Mar 6 18:14:47 EST 2009
Author: martinl
Date: 2009-03-06 18:14:47 -0500 (Fri, 06 Mar 2009)
New Revision: 36221
Added:
grass/branches/releasebranch_6_4/gui/wxpython/nviz/setup.py
grass/branches/releasebranch_6_4/gui/wxpython/vdigit/setup.py
Modified:
grass/branches/releasebranch_6_4/gui/wxpython/nviz/nviz.h
grass/branches/releasebranch_6_4/gui/wxpython/vdigit/digit.cpp
grass/branches/releasebranch_6_4/gui/wxpython/vdigit/driver.h
grass/branches/releasebranch_6_4/gui/wxpython/vdigit/driver_draw.cpp
grass/branches/releasebranch_6_4/gui/wxpython/vdigit/message.cpp
Log:
wxGUI osgeo4w patch applied (by jef)
http://trac.osgeo.org/grass/ticket/519
(merge from devbr6, r36220)
Modified: grass/branches/releasebranch_6_4/gui/wxpython/nviz/nviz.h
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/nviz/nviz.h 2009-03-06 22:53:41 UTC (rev 36220)
+++ grass/branches/releasebranch_6_4/gui/wxpython/nviz/nviz.h 2009-03-06 23:14:47 UTC (rev 36221)
@@ -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/branches/releasebranch_6_4/gui/wxpython/nviz/setup.py (from rev 36220, grass/branches/develbranch_6/gui/wxpython/nviz/setup.py)
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/nviz/setup.py (rev 0)
+++ grass/branches/releasebranch_6_4/gui/wxpython/nviz/setup.py 2009-03-06 23:14:47 UTC (rev 36221)
@@ -0,0 +1,24 @@
+# currently used only for osgeo4w
+# TODO: use instead of Makefile
+from distutils.core import setup, Extension
+
+setup(
+ ext_modules= [
+ Extension(
+ '_grass6_wxnviz',
+ sources=[
+ "grass6_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/branches/releasebranch_6_4/gui/wxpython/vdigit/digit.cpp
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/vdigit/digit.cpp 2009-03-06 22:53:41 UTC (rev 36220)
+++ grass/branches/releasebranch_6_4/gui/wxpython/vdigit/digit.cpp 2009-03-06 23:14:47 UTC (rev 36221)
@@ -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/branches/releasebranch_6_4/gui/wxpython/vdigit/driver.h
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/vdigit/driver.h 2009-03-06 22:53:41 UTC (rev 36220)
+++ grass/branches/releasebranch_6_4/gui/wxpython/vdigit/driver.h 2009-03-06 23:14:47 UTC (rev 36221)
@@ -24,6 +24,7 @@
#include <Python.h>
#include "pseudodc.h"
+#include <wx/gdicmn.h>
extern "C" {
#include <grass/gis.h>
Modified: grass/branches/releasebranch_6_4/gui/wxpython/vdigit/driver_draw.cpp
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/vdigit/driver_draw.cpp 2009-03-06 22:53:41 UTC (rev 36220)
+++ grass/branches/releasebranch_6_4/gui/wxpython/vdigit/driver_draw.cpp 2009-03-06 23:14:47 UTC (rev 36221)
@@ -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/branches/releasebranch_6_4/gui/wxpython/vdigit/message.cpp
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/vdigit/message.cpp 2009-03-06 22:53:41 UTC (rev 36220)
+++ grass/branches/releasebranch_6_4/gui/wxpython/vdigit/message.cpp 2009-03-06 23:14:47 UTC (rev 36221)
@@ -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/branches/releasebranch_6_4/gui/wxpython/vdigit/setup.py (from rev 36220, grass/branches/develbranch_6/gui/wxpython/vdigit/setup.py)
===================================================================
--- grass/branches/releasebranch_6_4/gui/wxpython/vdigit/setup.py (rev 0)
+++ grass/branches/releasebranch_6_4/gui/wxpython/vdigit/setup.py 2009-03-06 23:14:47 UTC (rev 36221)
@@ -0,0 +1,27 @@
+# currently used only for osgeo4w
+# TODO: use instead of Makefile
+from distutils.core import setup, Extension
+
+setup(
+ ext_modules= [
+ Extension(
+ '_grass6_wxvdigit',
+ sources=[
+ "grass6_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