[cig-commits] r13866 - in short/3D/PyLith/trunk/playpen/swigtest: applications libsrc modulesrc

brad at geodynamics.org brad at geodynamics.org
Tue Jan 13 15:10:37 PST 2009


Author: brad
Date: 2009-01-13 15:10:37 -0800 (Tue, 13 Jan 2009)
New Revision: 13866

Modified:
   short/3D/PyLith/trunk/playpen/swigtest/applications/testswig.cc
   short/3D/PyLith/trunk/playpen/swigtest/libsrc/Scene.cc
   short/3D/PyLith/trunk/playpen/swigtest/libsrc/Scene.hh
   short/3D/PyLith/trunk/playpen/swigtest/modulesrc/Makefile.am
Log:
Added Scene::printData() to test passing array. Cleaned up Makefile.

Modified: short/3D/PyLith/trunk/playpen/swigtest/applications/testswig.cc
===================================================================
--- short/3D/PyLith/trunk/playpen/swigtest/applications/testswig.cc	2009-01-13 21:53:04 UTC (rev 13865)
+++ short/3D/PyLith/trunk/playpen/swigtest/applications/testswig.cc	2009-01-13 23:10:37 UTC (rev 13866)
@@ -35,6 +35,10 @@
   scene.sphere(&sphere);
   scene.view();
 
+  const double data[] = { 1.1, 2.2, 3.3, 4.4 };
+  const int size = 4;
+  scene.printData(data, size);
+
   return 0;
 }
 

Modified: short/3D/PyLith/trunk/playpen/swigtest/libsrc/Scene.cc
===================================================================
--- short/3D/PyLith/trunk/playpen/swigtest/libsrc/Scene.cc	2009-01-13 21:53:04 UTC (rev 13865)
+++ short/3D/PyLith/trunk/playpen/swigtest/libsrc/Scene.cc	2009-01-13 23:10:37 UTC (rev 13866)
@@ -44,6 +44,14 @@
 }
 
 void
+geometry::Scene::printData(const double* values,
+			   const int size) const {
+  std::cout << "Data\n";
+  for (int i=0; i < size; ++i)
+    std::cout << "  " << values[i] << "\n";
+}
+
+void
 geometry::Scene::view(void) const {
   std::cout << "Scene:\n";
   if (0 != _bar)

Modified: short/3D/PyLith/trunk/playpen/swigtest/libsrc/Scene.hh
===================================================================
--- short/3D/PyLith/trunk/playpen/swigtest/libsrc/Scene.hh	2009-01-13 21:53:04 UTC (rev 13865)
+++ short/3D/PyLith/trunk/playpen/swigtest/libsrc/Scene.hh	2009-01-13 23:10:37 UTC (rev 13866)
@@ -33,6 +33,9 @@
   void sphere(Sphere* const value);
   const Sphere* sphere(void) const;
 
+  void printData(const double* values,
+		 const int size) const;
+
   void view(void) const;
 
 private :

Modified: short/3D/PyLith/trunk/playpen/swigtest/modulesrc/Makefile.am
===================================================================
--- short/3D/PyLith/trunk/playpen/swigtest/modulesrc/Makefile.am	2009-01-13 21:53:04 UTC (rev 13865)
+++ short/3D/PyLith/trunk/playpen/swigtest/modulesrc/Makefile.am	2009-01-13 23:10:37 UTC (rev 13866)
@@ -15,6 +15,8 @@
 _geometrymodule_la_LDFLAGS = -module -avoid-version \
 	$(AM_LDFLAGS) $(PYTHON_LA_LDFLAGS)
 
+pkgpyexec_PYTHON = geometry.py
+
 swig_sources = \
 	geometry.i \
 	Bar.i \
@@ -22,13 +24,13 @@
 	Sphere.i \
 	Scene.i
 
-dist__geometrymodule_la_SOURCES = $(swig_sources)
+swig_generated = \
+	geometry.py \
+	geometry_wrap.h \
+	geometry_wrap.cxx
 
-pkgpyexec_PYTHON = geometry.py
+dist__geometrymodule_la_SOURCES = $(swig_sources) $(swig_generated)
 
-_geometrymodule_la_SOURCES = \
-	geometry_wrap.cxx
-
 _geometrymodule_la_LIBADD = \
 	$(top_builddir)/libsrc/libswigtest.la
 if NO_UNDEFINED
@@ -42,7 +44,10 @@
 	$(SWIG) -Wall -c++ -python $<
 
 
-CLEANFILES = $(srcdir)/geometry_wrap.cxx $(srcdir)/geometry.py
+MAINTAINERCLEANFILES = \
+	$(srcdir)/geometry_wrap.h \
+	$(srcdir)/geometry_wrap.cxx \
+	$(srcdir)/geometry.py
 
 
 # End of file 



More information about the CIG-COMMITS mailing list