Index: src/Actions/AnalysisAction/CalculateBoundingBoxAction.cpp
===================================================================
--- src/Actions/AnalysisAction/CalculateBoundingBoxAction.cpp	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
+++ src/Actions/AnalysisAction/CalculateBoundingBoxAction.cpp	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -0,0 +1,63 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * CalculateBoundingBoxAction.cpp
+ *
+ *  Created on: Nov 02, 2011
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "CodePatterns/Log.hpp"
+
+#include "Box.hpp"
+#include "CodePatterns/Assert.hpp"
+#include "LinearAlgebra/Plane.hpp"
+#include <vector>
+#include <utility>
+#include "World.hpp"
+
+#include <iostream>
+#include <string>
+
+#include "CalculateBoundingBoxAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "CalculateBoundingBoxAction.def"
+#include "Reaction_impl_pre.hpp"
+
+#include "Reaction_impl.hpp"
+
+/** =========== define the function ====================== */
+doubleVec * AnalysisCalculateBoundingBoxAction::doCalc() {
+  typedef std::pair<Plane,Plane> PairOfPlanes;
+  typedef std::vector<PairOfPlanes> PairOfPlanesVector;
+  const PairOfPlanesVector planes = World::getInstance().getDomain().getBoundingPlanes();
+  doubleVec returnvalues;
+  for (PairOfPlanesVector::const_iterator iter = planes.begin();
+    iter != planes.end(); ++iter) {
+    returnvalues.push_back(fabs(iter->first.getOffset()));
+    returnvalues.push_back(fabs(iter->second.getOffset()));
+  }
+  ASSERT( returnvalues.size() == (size_t)6,
+      "AnalysisCalculateBoundingBoxAction::doCalc() - returnvalues should be of length 6 but is "
+      +toString(returnvalues.size())+".");
+
+  LOG(0, "RESULT: The current bounding box is " << returnvalues << ".");
+
+  return (new doubleVec(returnvalues));
+}
+/** =========== end of function ====================== */
Index: src/Actions/AnalysisAction/CalculateBoundingBoxAction.def
===================================================================
--- src/Actions/AnalysisAction/CalculateBoundingBoxAction.def	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
+++ src/Actions/AnalysisAction/CalculateBoundingBoxAction.def	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -0,0 +1,34 @@
+/*
+ * CalculateBoundingBoxAction.def
+ *
+ *  Created on: Nov 02, 2011
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include <vector>
+typedef std::vector<double> doubleVec;
+
+// i.e. there is an integer with variable name Z that can be found in
+// ValueStorage by the token "Z" -> first column: int, Z, "Z"
+// "undefine" if no parameters are required, use (NODEFAULT) for each (undefined) default value
+#undef paramtypes
+#undef paramreferences
+#undef paramtokens
+#undef paramdescriptions
+#undef paramdefaults
+
+// Reaction cannot be undone, hence no state
+
+#define returntype doubleVec
+
+// some defines for all the names, you may use REACTION and PARAMS
+#define CATEGORY Analysis
+#define MENUNAME "analysis"
+#define MENUPOSITION 3
+#define ACTIONNAME CalculateBoundingBox
+#define TOKEN "calculate-bounding-box"
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "Calculates the cuboid bounding box of the current domain"
+#undef SHORTFORM
Index: src/Actions/AnalysisAction/CalculateBoundingBoxAction.hpp
===================================================================
--- src/Actions/AnalysisAction/CalculateBoundingBoxAction.hpp	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
+++ src/Actions/AnalysisAction/CalculateBoundingBoxAction.hpp	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -0,0 +1,22 @@
+/*
+ * CalculateBoundingBoxAction.hpp
+ *
+ *  Created on: Nov 02, 2011
+ *      Author: heber
+ */
+
+#ifndef CALCULATEBOUNDINGBOXACTION_HPP_
+#define CALCULATEBOUNDINGBOXACTION_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Reaction.hpp"
+
+#include "CalculateBoundingBoxAction.def"
+#include "Reaction_impl_header.hpp"
+
+#endif /* CALCULATEBOUNDINGBOXACTION_HPP_ */
Index: src/Actions/GlobalListOfActions.hpp
===================================================================
--- src/Actions/GlobalListOfActions.hpp	(revision 55f299a96cda2fac6f625bb867138422ecaec949)
+++ src/Actions/GlobalListOfActions.hpp	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -48,4 +48,5 @@
 	(ParserSetParserParameters) \
 	(ParserSetOutputFormats) \
+	(AnalysisCalculateBoundingBox) \
 	(AnalysisCalculateCellVolume) \
 	(AnalysisCalculateMolarMass) \
Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision 55f299a96cda2fac6f625bb867138422ecaec949)
+++ src/Actions/Makefile.am	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -87,4 +87,5 @@
 
 ANALYSISACTIONSOURCE = \
+  Actions/AnalysisAction/CalculateBoundingBoxAction.cpp \
   Actions/AnalysisAction/CalculateCellVolumeAction.cpp \
   Actions/AnalysisAction/CalculateMolarMassAction.cpp \
@@ -97,4 +98,5 @@
   Actions/AnalysisAction/SurfaceCorrelationAction.cpp
 ANALYSISACTIONHEADER = \
+  Actions/AnalysisAction/CalculateBoundingBoxAction.hpp \
   Actions/AnalysisAction/CalculateCellVolumeAction.hpp \
   Actions/AnalysisAction/CalculateMolarMassAction.hpp \
@@ -107,4 +109,5 @@
   Actions/AnalysisAction/SurfaceCorrelationAction.hpp
 ANALYSISACTIONDEFS = \
+  Actions/AnalysisAction/CalculateBoundingBoxAction.def \
   Actions/AnalysisAction/CalculateCellVolumeAction.def \
   Actions/AnalysisAction/CalculateMolarMassAction.def \
Index: src/Actions/pyMoleCuilder.cpp
===================================================================
--- src/Actions/pyMoleCuilder.cpp	(revision 55f299a96cda2fac6f625bb867138422ecaec949)
+++ src/Actions/pyMoleCuilder.cpp	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -61,6 +61,41 @@
 }
 
+} /* namespace detail */
+
+namespace PythonTypes {
+
+inline void IndexError(){
+    PyErr_SetString(PyExc_IndexError, "Index out of range");
+    boost::python::throw_error_already_set();
+}
+
+template<class T>
+struct vec_item{
+    typedef typename T::value_type V;
+    static V& get(T& x, int i){
+        static V nothing;
+        if(i < 0) i += x.size();
+        if(i >= 0 && i < int(x.size())) return x[i];
+        IndexError();
+        return nothing;
+    }
+    static void set(T& x, int i, V const& v){
+        if(i < 0) i += x.size();
+        if(i >= 0 && i < int(x.size())) x[i] = v;
+        else IndexError();
+    }
+    static void del(T& x, int i){
+        if(i < 0) i += x.size();
+        if(i >= 0 && i < int(x.size())) x.erase(x.begin() + i);
+        else IndexError();
+    }
+    static void add(T& x, V const& v){
+        x.push_back(v);
+    }
+};
+
+
+} /* namespace PythonTypes */
 } /* namespace MoleCuilder */
-} /* namespace detail */
 
 BOOST_PYTHON_MODULE(pyMoleCuilder)
@@ -77,4 +112,21 @@
 
   boost::python::def("reinit", MoleCuilder::detail::module_reinit, "Reinitializes the internal state of the python module as if it had been freshly imported, saves all input files beforehand.");
+
+  // STL Vectors:
+  // doubleVec
+  boost::python::class_< std::vector< double > >("PythonType_doubleVec")
+      .def("__len__", &std::vector< double >::size)
+      .def("clear", &std::vector< double >::clear)
+      .def("append", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::add,
+            boost::python::with_custodian_and_ward<1, 2>()) // let container keep value
+      .def("__getitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::get,
+           boost::python::return_value_policy<boost::python::copy_non_const_reference>())
+      .def("__setitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::set,
+           boost::python::with_custodian_and_ward<1,2>()) // to let container keep value
+      .def("__delitem__", &MoleCuilder::PythonTypes::vec_item< std::vector< double > >::del)
+      .def("__iter__", boost::python::iterator< std::vector< double > >())
+  ;
+
+
 #define export_print(z,n,list) \
 	BOOST_PP_CAT(export_, BOOST_PP_SEQ_ELEM(n, list))();
Index: tests/regression/Analysis/CalculateBoundingBox/testsuite-analysis-calculate-bounding-box.at
===================================================================
--- tests/regression/Analysis/CalculateBoundingBox/testsuite-analysis-calculate-bounding-box.at	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
+++ tests/regression/Analysis/CalculateBoundingBox/testsuite-analysis-calculate-bounding-box.at	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -0,0 +1,21 @@
+### calculate bounding box
+
+AT_SETUP([Analysis - Calculate bounding box])
+AT_KEYWORDS([analysis reaction calculate-bounding-box])
+
+# default domain
+AT_CHECK([../../molecuilder --calculate-bounding-box], 0, [stdout], [stderr])
+AT_CHECK([egrep "RESULT" stdout], 0, [ignore], [ignore])
+AT_CHECK([egrep "bounding box is .*0; 20; 0; 20; 0; 20" stdout], 0, [ignore], [ignore])
+
+# specific box
+AT_CHECK([../../molecuilder -B "10,0,12,0,0,14" --calculate-bounding-box], 0, [stdout], [stderr])
+AT_CHECK([egrep "RESULT" stdout], 0, [ignore], [ignore])
+AT_CHECK([egrep "bounding box is .*0; 10; 0; 12; 0; 14" stdout], 0, [ignore], [ignore])
+
+# special domain
+AT_CHECK([../../molecuilder -B "10,2,10,4,6,10" --calculate-bounding-box], 0, [stdout], [stderr])
+AT_CHECK([egrep "RESULT" stdout], 0, [ignore], [ignore])
+AT_CHECK([egrep "bounding box is .*0; 7.660.*; 0; 5.421.*; 0; 4.755.*;" stdout], 0, [ignore], [ignore])
+
+AT_CLEANUP
Index: tests/regression/Analysis/testsuite-analysis.at
===================================================================
--- tests/regression/Analysis/testsuite-analysis.at	(revision 55f299a96cda2fac6f625bb867138422ecaec949)
+++ tests/regression/Analysis/testsuite-analysis.at	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -30,2 +30,5 @@
 # calculates molar mass
 m4_include([Analysis/CalculateMolarMass/testsuite-analysis-calculate-molar-mass.at])
+
+# calculates bounding box
+m4_include([Analysis/CalculateBoundingBox/testsuite-analysis-calculate-bounding-box.at])
Index: tests/regression/Makefile.am
===================================================================
--- tests/regression/Makefile.am	(revision 55f299a96cda2fac6f625bb867138422ecaec949)
+++ tests/regression/Makefile.am	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -34,4 +34,5 @@
 	$(srcdir)/Atoms/Translation/testsuite-atoms-translation.at \
 	$(srcdir)/Analysis/testsuite-analysis.at \
+	$(srcdir)/Analysis/CalculateBoundingBox/testsuite-analysis-calculate-bounding-box.at \
 	$(srcdir)/Analysis/CalculateCellVolume/testsuite-analysis-calculate-cell-volume.at \
 	$(srcdir)/Analysis/CalculateMolarMass/testsuite-analysis-calculate-molar-mass.at \
Index: tests/regression/Python/AllActions/listcmds.py
===================================================================
--- tests/regression/Python/AllActions/listcmds.py	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
+++ tests/regression/Python/AllActions/listcmds.py	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -0,0 +1,19 @@
+#!/usr/bin/python
+#
+# gathers all Actions in pyMoleCuilder module and tests them with some default
+# values.
+#
+# date: Oct 5, 2011
+# author: Gregor Bollerhey
+
+import pyMoleCuilder as mol
+import sys
+
+cmds =  filter(lambda s: s[0] != '_' and s[:10] != 'PythonType', dir(mol))
+
+for value in cmds:
+  sys.stdout.write(value+"\t")
+sys.stdout.write("\n")
+
+sys.exit(0)
+
Index: tests/regression/Python/AllActions/moltest.py
===================================================================
--- tests/regression/Python/AllActions/moltest.py	(revision 55f299a96cda2fac6f625bb867138422ecaec949)
+++ tests/regression/Python/AllActions/moltest.py	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -10,5 +10,10 @@
 import sys, re, subprocess
 
-cmds =  filter(lambda s: s[0] != '_', dir(mol))
+# cmd given?
+if len(sys.argv) < 1:
+  sys.stderr.write("Usage: "+sys.argv[0]+" <cmd>\n")
+  sys.exit(255)
+
+cmd = sys.argv[1]
 
 # options.dat einlesen
@@ -47,29 +52,30 @@
     return result
 
-for cmd in cmds:
-    doc = eval('mol.%s.__doc__' % cmd)
-    params = ParseParameters(doc)
-    
-    print '--BEGIN-- %s mit %s --------' % (cmd, params)
+doc = eval('mol.%s.__doc__' % cmd)
+params = ParseParameters(doc)
+
+print '--BEGIN-- %s mit %s --------' % (cmd, params)
    
-    # write command to file
-    output=open("test.py", "w")
-    output.write('import pyMoleCuilder as mol\nparams = %s\nmol.%s(*params)\n' % (params, cmd))
-    output.close()
-    # call python externally on this file and catch retcode
-    p = subprocess.Popen(["python", "test.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
-    stdout, stderr = p.communicate()
-    print ' --- STDOUT ---'
-    print ' %s ' % (stdout)
-    print ' --- STDERR ---'
-    print ' %s ' % (stderr)
-    retcode = p.returncode
-    if retcode == 134 or retcode == 0:
-      print ' ---- ok ----'
-    else:
-      print ' -- FAILED with %s --' % (retcode)
-    #exec('mol.%s(*params)' % cmd)
-    
-    print '---END--- %s mit %s --------' % (cmd, params)
+# write command to file
+output=open("test.py", "w")
+output.write('import pyMoleCuilder as mol\nparams = %s\nmol.%s(*params)\n' % (params, cmd))
+output.close()
+# call python externally on this file and catch retcode
+p = subprocess.Popen(["python", "test.py"], stdout=subprocess.PIPE, stderr=subprocess.PIPE)
+stdout, stderr = p.communicate()
+print ' --- STDOUT ---'
+print ' %s ' % (stdout)
+print ' --- STDERR ---'
+print ' %s ' % (stderr)
+retcode = p.returncode
+if retcode == 134 or retcode == 0:
+  print ' ---- ok ----'
+else:
+  print ' -- FAILED with %s --' % (retcode)
+#  if retcode == 1:
+#    sys.exit(1)
+#exec('mol.%s(*params)' % cmd)
+
+print '---END--- %s mit %s --------' % (cmd, params)
 
 sys.exit(0)
Index: tests/regression/Python/AllActions/options.dat
===================================================================
--- tests/regression/Python/AllActions/options.dat	(revision 55f299a96cda2fac6f625bb867138422ecaec949)
+++ tests/regression/Python/AllActions/options.dat	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -33,4 +33,5 @@
 bond-file	"bond.dat"
 bond-table	"table.dat"
+calculate-bounding-box	""
 calculate-molar-mass	""
 center-in-box	"10 0 0 10 0 10"
Index: tests/regression/Python/AllActions/testsuite-python-allactions.at
===================================================================
--- tests/regression/Python/AllActions/testsuite-python-allactions.at	(revision 55f299a96cda2fac6f625bb867138422ecaec949)
+++ tests/regression/Python/AllActions/testsuite-python-allactions.at	(revision f89b45ee33bbea1e1d6d5257495f6e87aeb29aeb)
@@ -9,5 +9,10 @@
 AT_CHECK([../../Python/run test.py], 1, [ignore], [stderr])
 AT_CHECK([fgrep "object has no attribute" stderr], 0, [ignore], [ignore])
+AT_CHECK([../../Python/run ${abs_top_srcdir}/tests/regression/Python/AllActions/listcmds.py], 0, [stdout], [ignore])
 AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Python/AllActions/options.dat .],  0, [ignore], [ignore])
-AT_CHECK([../../Python/run ${abs_top_srcdir}/tests/regression/Python/AllActions/moltest.py], 0, [stdout], [ignore])
+for cmd in `head -n 1 stdout`
+do
+	AT_CHECK([echo "Checking presence of $cmd ..."], 0, [ignore], [ignore])
+	AT_CHECK([../../Python/run ${abs_top_srcdir}/tests/regression/Python/AllActions/moltest.py $cmd], 0, [stdout], [ignore])
+done
 AT_CLEANUP
