[GRASS-SVN] r31739 - in grass-addons/visualization/nviz2/wxpython:
. nviz
svn_grass at osgeo.org
svn_grass at osgeo.org
Wed Jun 18 06:18:11 EDT 2008
Author: martinl
Date: 2008-06-18 06:18:11 -0400 (Wed, 18 Jun 2008)
New Revision: 31739
Added:
grass-addons/visualization/nviz2/wxpython/nviz/
grass-addons/visualization/nviz2/wxpython/nviz/Makefile
grass-addons/visualization/nviz2/wxpython/nviz/dig_types.i
grass-addons/visualization/nviz2/wxpython/nviz/init.cpp
grass-addons/visualization/nviz2/wxpython/nviz/nviz.h
grass-addons/visualization/nviz2/wxpython/nviz/nviz.i
Log:
nviz2/wx: various updates, directory for 'wxnviz' Python extension added
Added: grass-addons/visualization/nviz2/wxpython/nviz/Makefile
===================================================================
--- grass-addons/visualization/nviz2/wxpython/nviz/Makefile (rev 0)
+++ grass-addons/visualization/nviz2/wxpython/nviz/Makefile 2008-06-18 10:18:11 UTC (rev 31739)
@@ -0,0 +1,40 @@
+# MODULE_TOPDIR = ../../..
+MODULE_TOPDIR = $(HOME)/src/grass6_devel
+
+include $(MODULE_TOPDIR)/include/Make/Lib.make
+
+LIB_NAME = grass6_wxnviz
+SOURCES := $(wildcard *.cpp) $(LIB_NAME)_wrap.cpp
+SHLIB_OBJS := $(patsubst %.cpp, $(OBJDIR)/%.o, $(SOURCES))
+
+EXTRA_CFLAGS = $(SHLIB_CFLAGS) $(GDALCFLAGS) $(PYTHONCFLAGS) $(WXWIDGETSCXXFLAGS)
+EXTRA_LIBS = $(VECTLIB) $(GISLIB) $(GDALLIBS) $(VEDITLIB) $(WXWIDGETSLIB) $(PYTHONLDFLAGS)
+
+LOCAL_HEADERS = nviz.h
+
+ETCDIR = $(ETC)/wxpython
+
+SHLIB = $(OBJDIR)/_$(LIB_NAME).so
+
+EXTRA_CLEAN_FILES = $(SHLIB) $(LIB_NAME).i $(LIB_NAME).py $(LIB_NAME)_wrap.cpp
+
+default: install_nviz
+
+$(LIB_NAME).i: nviz.i dig_types.i nviz.h
+ cat nviz.i dig_types.i > $(LIB_NAME).i
+ echo "/* auto-generated swig typedef file */" >> $(LIB_NAME).i
+ cat nviz.h >> $(LIB_NAME).i
+
+$(LIB_NAME).py $(LIB_NAME)_wrap.cpp: $(LIB_NAME).i
+ $(SWIG) -c++ -python -shadow -o $(LIB_NAME)_wrap.cpp $<
+
+$(SHLIB): $(SHLIB_OBJS)
+ifeq ($(findstring darwin,$(ARCH)),darwin)
+ $(CXX) -o $@ $(LDFLAGS) $^ $(EXTRA_LIBS)
+else
+ $(SHLIB_LD) -o $@ $(LDFLAGS) $^ $(EXTRA_LIBS)
+endif
+
+install_nviz: $(SHLIB) $(LIB_NAME).py
+ $(INSTALL) $(SHLIB) $(ETCDIR)/nviz
+ $(INSTALL_DATA) $(LIB_NAME).py $(ETCDIR)/nviz
Added: grass-addons/visualization/nviz2/wxpython/nviz/dig_types.i
===================================================================
--- grass-addons/visualization/nviz2/wxpython/nviz/dig_types.i (rev 0)
+++ grass-addons/visualization/nviz2/wxpython/nviz/dig_types.i 2008-06-18 10:18:11 UTC (rev 31739)
@@ -0,0 +1,15 @@
+/* extracted from include/vect/dig_defines.h */
+
+#define GV_POINT 0x01
+#define GV_LINE 0x02
+#define GV_BOUNDARY 0x04
+#define GV_CENTROID 0x08
+#define GV_FACE 0x10
+#define GV_KERNEL 0x20
+#define GV_AREA 0x40
+#define GV_VOLUME 0x80
+
+#define GV_POINTS (GV_POINT | GV_CENTROID )
+#define GV_LINES (GV_LINE | GV_BOUNDARY )
+
+#define PORT_DOUBLE_MAX 1.7976931348623157e+308
Added: grass-addons/visualization/nviz2/wxpython/nviz/init.cpp
===================================================================
--- grass-addons/visualization/nviz2/wxpython/nviz/init.cpp (rev 0)
+++ grass-addons/visualization/nviz2/wxpython/nviz/init.cpp 2008-06-18 10:18:11 UTC (rev 31739)
@@ -0,0 +1,38 @@
+/**
+ \file init.cpp
+
+ \brief Experimental C++ wxWidgets Nviz prototype -- initialization
+
+ Used by wxGUI Nviz extension.
+
+ Copyright: (C) by the GRASS Development Team
+
+ This program is free software under the GNU General Public
+ License (>=v2). Read the file COPYING that comes with GRASS
+ for details.
+
+ \author Martin Landa <landa.martin gmail.com> (Google SoC 2008)
+
+ \date 2008
+*/
+
+#include "nviz.h"
+
+/*!
+ \brief Initialize Nviz class
+*/
+Nviz::Nviz()
+{
+ GS_libinit();
+ /* GVL_libinit(); TODO */
+
+ //GS_set_swap_func(swap_gl);
+}
+
+/*!
+ \brief Swap GL buffers
+*/
+void Nviz::swap_gl()
+{
+ return;
+}
Added: grass-addons/visualization/nviz2/wxpython/nviz/nviz.h
===================================================================
--- grass-addons/visualization/nviz2/wxpython/nviz/nviz.h (rev 0)
+++ grass-addons/visualization/nviz2/wxpython/nviz/nviz.h 2008-06-18 10:18:11 UTC (rev 31739)
@@ -0,0 +1,19 @@
+#ifndef __NVIZ_H__
+#define __NVIZ_H__
+
+extern "C" {
+#include <grass/gsurf.h>
+#include <grass/gstypes.h>
+}
+
+class Nviz
+{
+private:
+ void swap_gl();
+
+public:
+ /* constructor */
+ Nviz();
+};
+
+#endif /* __NVIZ_H__ */
Added: grass-addons/visualization/nviz2/wxpython/nviz/nviz.i
===================================================================
--- grass-addons/visualization/nviz2/wxpython/nviz/nviz.i (rev 0)
+++ grass-addons/visualization/nviz2/wxpython/nviz/nviz.i 2008-06-18 10:18:11 UTC (rev 31739)
@@ -0,0 +1,19 @@
+/* File: nviz.i */
+
+%module grass6_wxnviz
+%{
+#include <grass/gsurf.h>
+#include <grass/gstypes.h>
+#include "nviz.h"
+%}
+
+%include "std_vector.i"
+namespace std {
+ %template(IntVector) vector<int>;
+ %template(DoubleVector) vector<double>;
+}
+%include "std_map.i"
+namespace std {
+ %template(IntVecIntMap) map<int, vector<int> >;
+}
+%include "nviz.h"
More information about the grass-commit
mailing list