Index: src/Actions/FillAction/FillVolumeAction.cpp
===================================================================
--- src/Actions/FillAction/FillVolumeAction.cpp	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ src/Actions/FillAction/FillVolumeAction.cpp	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,225 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2014 Frederik Heber. All rights reserved.
+ * 
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * FillVolumeAction.cpp
+ *
+ *  Created on: Sep 03, 2014
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "Actions/UndoRedoHelpers.hpp"
+#include "Atom/atom.hpp"
+#include "Atom/AtomicInfo.hpp"
+#include "Atom/CopyAtoms/CopyAtoms_withBonds.hpp"
+#include "Bond/BondInfo.hpp"
+#include "CodePatterns/Log.hpp"
+#include "Descriptors/MoleculeOrderDescriptor.hpp"
+#include "Filling/Cluster.hpp"
+#include "Filling/Filler.hpp"
+#include "Filling/Preparators/ShapeVolumeFillerPreparator.hpp"
+#include "molecule.hpp"
+#include "MoleculeListClass.hpp"
+#include "Parser/FormatParserInterface.hpp"
+#include "Parser/FormatParserStorage.hpp"
+#include "Shapes/Shape.hpp"
+#include "Shapes/ShapeRegistry.hpp"
+#include "Shapes/ShapeType.hpp"
+#include "World.hpp"
+
+#include <algorithm>
+#include <iostream>
+#include <string>
+#include <vector>
+
+#include "Actions/FillAction/FillVolumeAction.hpp"
+
+using namespace MoleCuilder;
+
+// and construct the stuff
+#include "FillVolumeAction.def"
+#include "Action_impl_pre.hpp"
+/** =========== define the function ====================== */
+ActionState::ptr FillVolumeAction::performCall() {
+  typedef std::vector<atom*> AtomVector;
+
+  // get the filler molecule
+  std::vector<AtomicInfo> movedatoms;
+  const std::vector< molecule *> molecules = World::getInstance().getSelectedMolecules();
+  if (molecules.size() != 1) {
+    STATUS("No exactly one molecule selected, aborting,");
+    return Action::failure;
+  }
+  molecule *filler = *(molecules.begin());
+  for(molecule::const_iterator iter = filler->begin(); iter != filler->end(); ++iter)
+    movedatoms.push_back( AtomicInfo(*(*iter)) );
+  LOG(1, "INFO: Chosen molecule has " << filler->size() << " atoms.");
+
+  // center filler's tip at origin
+  filler->CenterEdge();
+
+  // prepare the filler preparator
+  if (ShapeRegistry::getInstance().countSelectedShapes() != (size_t)1) {
+    STATUS("Not exactly one shape selected.");
+    return Action::failure;
+  }
+  const std::vector<Shape*> shapes = ShapeRegistry::getInstance().getSelectedShapes();
+  const Shape &shape = **shapes.begin();
+
+  // hard check whether shape is of allowed type, not all are implemented
+  // but these only fail with an assertion, hence not with disable-debug
+  switch (shape.getType()) {
+    case NowhereType:
+    case EverywhereType:
+    case SphereType:
+    case CuboidType:
+      STATUS("The shape type "+toString(shape.getType())+" is currently not supported.");
+      return Action::failure;
+      break;
+    default:
+      break;
+  }
+
+  ShapeVolumeFillerPreparator filler_preparator(filler);
+  if (params.SphereRadius.get() != 0.) {
+    if (World::getInstance().beginAtomSelection() == World::getInstance().endAtomSelection()) {
+      STATUS("You have given a sphere radius "+toString(params.SphereRadius.get())
+          +" != 0, but have not select any atoms.");
+      return Action::failure;
+    }
+    std::vector<atom*> atoms(World::getInstance().getSelectedAtoms());
+    filler_preparator.addSurfacePredicate(
+        params.SphereRadius.get(),
+        atoms);
+  }
+  filler_preparator.addVoidPredicate(params.mindistance.get());
+  filler_preparator.addRandomInserter(
+      params.RandAtomDisplacement.get(),
+      params.RandMoleculeDisplacement.get(),
+      params.DoRotate.get());
+  filler_preparator.addShapeMesh(
+      shape,
+      params.N.get());
+  if (!filler_preparator()) {
+    STATUS("Filler was not fully constructed.");
+    return Action::failure;
+  }
+
+  // use filler
+  bool successflag = false;
+  FillVolumeState *UndoState = NULL;
+  {
+    // fill
+    Filler *fillerFunction = filler_preparator.obtainFiller();
+    // TODO: When molecule::getBoundingSphere() does not use a sphere anymore,
+    // we need to check whether we rotate the molecule randomly. For this to
+    // work we need a sphere!
+    const Shape s = filler->getBoundingSphere(params.RandAtomDisplacement.get());
+    ClusterInterface::Cluster_impl cluster( new Cluster(filler->getAtomIds(), s) );
+    CopyAtoms_withBonds copyMethod;
+    Filler::ClusterVector_t ClonedClusters;
+    successflag = (*fillerFunction)(copyMethod, cluster, ClonedClusters);
+    delete fillerFunction;
+
+    // append each cluster's atoms to clonedatoms (however not selected ones)
+    std::vector<const atom *> clonedatoms;
+    std::vector<AtomicInfo> clonedatominfos;
+    for (Filler::ClusterVector_t::const_iterator iter = ClonedClusters.begin();
+        iter != ClonedClusters.end(); ++iter) {
+      const AtomIdSet &atoms = (*iter)->getAtomIds();
+      clonedatoms.reserve(clonedatoms.size()+atoms.size());
+      for (AtomIdSet::const_iterator atomiter = atoms.begin(); atomiter != atoms.end(); ++atomiter)
+        if (!filler->containsAtom(*atomiter)) {
+          clonedatoms.push_back( *atomiter );
+          clonedatominfos.push_back( AtomicInfo(*(*atomiter)) );
+        }
+    }
+    std::vector< BondInfo > clonedbonds;
+    StoreBondInformationFromAtoms(clonedatoms, clonedbonds);
+    LOG(2, "DEBUG: There are " << clonedatominfos.size() << " newly created atoms.");
+
+    if (!successflag) {
+      STATUS("Insertion failed, removing inserted clusters, translating original one back");
+      RemoveAtomsFromAtomicInfo(clonedatominfos);
+      clonedatoms.clear();
+      SetAtomsFromAtomicInfo(movedatoms);
+    } else {
+      std::vector<Vector> MovedToVector(filler->size(), zeroVec);
+      std::transform(filler->begin(), filler->end(), MovedToVector.begin(),
+          boost::bind(&AtomInfo::getPosition, _1) );
+      UndoState = new FillVolumeState(clonedatominfos,clonedbonds,movedatoms,MovedToVector,params);
+    }
+  }
+
+  if (successflag)
+    return ActionState::ptr(UndoState);
+  else {
+    return Action::failure;
+  }
+}
+
+ActionState::ptr FillVolumeAction::performUndo(ActionState::ptr _state) {
+  FillVolumeState *state = assert_cast<FillVolumeState*>(_state.get());
+
+  // remove all created atoms
+  RemoveAtomsFromAtomicInfo(state->clonedatoms);
+  // add the original cluster
+  SetAtomsFromAtomicInfo(state->movedatoms);
+
+  return ActionState::ptr(_state);
+}
+
+ActionState::ptr FillVolumeAction::performRedo(ActionState::ptr _state){
+  FillVolumeState *state = assert_cast<FillVolumeState*>(_state.get());
+
+  // place filler cluster again at new spot
+  ResetAtomPosition(state->movedatoms, state->MovedToVector);
+
+  // re-create all clusters
+  bool statusflag = AddAtomsFromAtomicInfo(state->clonedatoms);
+
+  // re-create the bonds
+  if (statusflag)
+    AddBondsFromBondInfo(state->clonedbonds);
+  if (statusflag)
+    return ActionState::ptr(_state);
+  else {
+    STATUS("Failed re-adding filled in atoms.");
+    return Action::failure;
+  }
+}
+
+bool FillVolumeAction::canUndo() {
+  return true;
+}
+
+bool FillVolumeAction::shouldUndo() {
+  return true;
+}
+/** =========== end of function ====================== */
Index: src/Actions/FillAction/FillVolumeAction.def
===================================================================
--- src/Actions/FillAction/FillVolumeAction.def	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ src/Actions/FillAction/FillVolumeAction.def	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,52 @@
+/*
+ * FillVolumeAction.def
+ *
+ *  Created on: Sep 03, 2014
+ *      Author: heber
+ */
+
+// all includes and forward declarations necessary for non-integral types below
+#include <vector>
+#include "Atom/AtomicInfo.hpp"
+#include "Bond/BondInfo.hpp"
+#include "types.hpp"
+
+#include "LinearAlgebra/defs.hpp"
+#include "Parameters/Validators/DummyValidator.hpp"
+#include "Parameters/Validators/Specific/BoxLengthValidator.hpp"
+#include "Parameters/Validators/Specific/VectorZeroOneComponentsValidator.hpp"
+
+// 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 (NOPARAM_DEFAULT) for each (undefined) default value
+#define paramtypes (unsigned int)(double)(double)(double)(double)(bool)
+#define paramtokens ("count")("min-distance")("tesselation-radius")("random-atom-displacement")("random-molecule-displacement")("DoRotate")
+#define paramdescriptions ("number of insertion points")("Minimum distance to other atoms")("radius of rolling sphere in tesselating selected molecule's surfaces")("magnitude of random atom displacement")("magnitude of random molecule displacement")("whether to rotate or not")
+#define paramdefaults (PARAM_DEFAULT(12))(PARAM_DEFAULT(1.))(PARAM_DEFAULT(0.))(PARAM_DEFAULT(0.))(PARAM_DEFAULT(0.))(PARAM_DEFAULT(false))
+#define paramreferences (N)(mindistance)(SphereRadius)(RandAtomDisplacement)(RandMoleculeDisplacement)(DoRotate)
+#define paramvalids \
+(DummyValidator< unsigned int >()) \
+(BoxLengthValidator()) \
+(BoxLengthValidator()) \
+(BoxLengthValidator()) \
+(BoxLengthValidator()) \
+(DummyValidator< bool >())
+
+#define statetypes (std::vector<AtomicInfo>)(std::vector<BondInfo>)(std::vector<AtomicInfo>)(std::vector<Vector>)
+#define statereferences (clonedatoms)(clonedbonds)(movedatoms)(MovedToVector)
+
+// some defines for all the names, you may use ACTION, STATE and PARAMS
+#define CATEGORY Fill
+#define MENUNAME "fill"
+#define MENUPOSITION 3
+#define ACTIONNAME Volume
+#define TOKEN "fill-volume"
+
+
+// finally the information stored in the ActionTrait specialization
+#define DESCRIPTION "\
+fill volume of the currently selected shape with a given number of insertion \
+points with the currently selected molecule. If atoms are selected, too, \
+they are surrounded by a tesselated surface and only outside of the tesselation \
+is filled."
+#undef SHORTFORM
Index: src/Actions/FillAction/FillVolumeAction.hpp
===================================================================
--- src/Actions/FillAction/FillVolumeAction.hpp	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ src/Actions/FillAction/FillVolumeAction.hpp	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,22 @@
+/*
+ * FillVolumeAction.hpp
+ *
+ *  Created on: Sep 03, 2014
+ *      Author: heber
+ */
+
+#ifndef FILLVOLUMEACTION_HPP
+#define FILLVOLUMEACTION_HPP
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include "Actions/Action.hpp"
+
+#include "FillVolumeAction.def"
+#include "Action_impl_header.hpp"
+
+#endif // FILLVOLUMEACTION_HPP
Index: src/Actions/GlobalListOfActions.hpp
===================================================================
--- src/Actions/GlobalListOfActions.hpp	(revision 36f45c7566bcbd1eab7647b44689588ab0fb839c)
+++ src/Actions/GlobalListOfActions.hpp	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -50,4 +50,5 @@
   (FillRegularGrid) \
   (FillSurface) \
+  (FillVolume) \
   (FragmentationAnalyseFragmentationResults) \
   (FragmentationClearFragmentationResults) \
Index: src/Actions/Makefile.am
===================================================================
--- src/Actions/Makefile.am	(revision 36f45c7566bcbd1eab7647b44689588ab0fb839c)
+++ src/Actions/Makefile.am	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -215,11 +215,14 @@
 FILLACTIONSOURCE = \
 	Actions/FillAction/FillRegularGridAction.cpp \
-	Actions/FillAction/FillSurfaceAction.cpp
+	Actions/FillAction/FillSurfaceAction.cpp \
+	Actions/FillAction/FillVolumeAction.cpp
 FILLACTIONHEADER = \
 	Actions/FillAction/FillRegularGridAction.hpp \
-	Actions/FillAction/FillSurfaceAction.hpp
+	Actions/FillAction/FillSurfaceAction.hpp \
+	Actions/FillAction/FillVolumeAction.hpp
 FILLACTIONDEFS = \
 	Actions/FillAction/FillRegularGridAction.def \
-	Actions/FillAction/FillSurfaceAction.def
+	Actions/FillAction/FillSurfaceAction.def \
+	Actions/FillAction/FillVolumeAction.def
 
 
Index: src/Filling/Makefile.am
===================================================================
--- src/Filling/Makefile.am	(revision 36f45c7566bcbd1eab7647b44689588ab0fb839c)
+++ src/Filling/Makefile.am	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -21,5 +21,6 @@
 	Filling/Predicates/Ops_FillPredicate.cpp \
 	Filling/Preparators/BaseFillerPreparator.cpp \
-	Filling/Preparators/BoxFillerPreparator.cpp
+	Filling/Preparators/BoxFillerPreparator.cpp \
+	Filling/Preparators/ShapeVolumeFillerPreparator.cpp
 	
 FILLINGHEADER = \
@@ -48,5 +49,6 @@
 	Filling/Predicates/Ops_FillPredicate_impl.hpp \
 	Filling/Preparators/BaseFillerPreparator.hpp \
-	Filling/Preparators/BoxFillerPreparator.hpp
+	Filling/Preparators/BoxFillerPreparator.hpp \
+	Filling/Preparators/ShapeVolumeFillerPreparator.hpp
 
 noinst_LTLIBRARIES += libMolecuilderFilling.la
Index: src/Filling/Mesh/MeshAdaptor.hpp
===================================================================
--- src/Filling/Mesh/MeshAdaptor.hpp	(revision 36f45c7566bcbd1eab7647b44689588ab0fb839c)
+++ src/Filling/Mesh/MeshAdaptor.hpp	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -18,4 +18,5 @@
 
 #include "Filling/NodeTypes.hpp"
+#include "Filling/Mesh/Mesh.hpp"
 
 class MeshAdaptor : public Mesh
Index: src/Filling/Preparators/ShapeVolumeFillerPreparator.cpp
===================================================================
--- src/Filling/Preparators/ShapeVolumeFillerPreparator.cpp	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ src/Filling/Preparators/ShapeVolumeFillerPreparator.cpp	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,64 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2014 Frederik Heber. All rights reserved.
+ *
+ *
+ *   This file is part of MoleCuilder.
+ *
+ *    MoleCuilder is free software: you can redistribute it and/or modify
+ *    it under the terms of the GNU General Public License as published by
+ *    the Free Software Foundation, either version 2 of the License, or
+ *    (at your option) any later version.
+ *
+ *    MoleCuilder is distributed in the hope that it will be useful,
+ *    but WITHOUT ANY WARRANTY; without even the implied warranty of
+ *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+ *    GNU General Public License for more details.
+ *
+ *    You should have received a copy of the GNU General Public License
+ *    along with MoleCuilder.  If not, see <http://www.gnu.org/licenses/>.
+ */
+
+/*
+ * ShapeVolumeFillerPreparator.cpp
+ *
+ *  Created on: Sep 3, 2014
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include "ShapeVolumeFillerPreparator.hpp"
+
+#include <boost/bind.hpp>
+#include <boost/function.hpp>
+
+#include "Filling/Mesh/Mesh.hpp"
+#include "Filling/Mesh/MeshAdaptor.hpp"
+#include "Shapes/Shape.hpp"
+
+ShapeVolumeFillerPreparator::ShapeVolumeFillerPreparator(molecule *_filler) :
+  BaseFillerPreparator(_filler)
+{}
+
+ShapeVolumeFillerPreparator::~ShapeVolumeFillerPreparator()
+{}
+
+void ShapeVolumeFillerPreparator::addShapeMesh(
+    const Shape &_shape,
+    const unsigned int _nodes)
+{
+
+  MeshAdaptor::function_t fct =
+      boost::bind(&Shape::getHomogeneousPointsInVolume,
+          boost::cref(_shape),
+          _nodes);
+  mesh = new MeshAdaptor(fct);
+}
+
Index: src/Filling/Preparators/ShapeVolumeFillerPreparator.hpp
===================================================================
--- src/Filling/Preparators/ShapeVolumeFillerPreparator.hpp	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ src/Filling/Preparators/ShapeVolumeFillerPreparator.hpp	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,37 @@
+/*
+ * ShapeVolumeFillerPreparator.hpp
+ *
+ *  Created on: Sep 3, 2014
+ *      Author: heber
+ */
+
+#ifndef SHAPEVOLUMEFILLERPREPARATOR_HPP_
+#define SHAPEVOLUMEFILLERPREPARATOR_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "BaseFillerPreparator.hpp"
+
+class Shape;
+
+/** ShapeVolumeFillerPreparator takes a shape and uses Shape::getHomogeneousPointsInVolume()
+ * to create a specific number of nodes inside this Shape for filling.
+ *
+ */
+class ShapeVolumeFillerPreparator :
+  public BaseFillerPreparator
+{
+public:
+    ShapeVolumeFillerPreparator(molecule *_filler);
+    ~ShapeVolumeFillerPreparator();
+
+    void addShapeMesh(
+        const Shape &_shape,
+        const unsigned int _nodes);
+
+};
+
+#endif /* SHAPEVOLUMEFILLERPREPARATOR_HPP_ */
Index: tests/regression/Filling/FillVolume/post/water_cylinder.xyz
===================================================================
--- tests/regression/Filling/FillVolume/post/water_cylinder.xyz	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ tests/regression/Filling/FillVolume/post/water_cylinder.xyz	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,14 @@
+12
+	Created by molecuilder on Wed Sep  3 23:17:13 2014, time step 0
+O	8	5	2.50428
+H	8.7586	5	3.00857
+H	8.7586	5	2
+O	5	8	2.50428
+H	5.7586	8	3.00857
+H	5.7586	8	2
+O	2	5	2.50428
+H	2.7586	5	3.00857
+H	2.7586	5	2
+O	5	2	2.50428
+H	5.7586	2	3.00857
+H	5.7586	2	2
Index: tests/regression/Filling/FillVolume/post/water_undo.xyz
===================================================================
--- tests/regression/Filling/FillVolume/post/water_undo.xyz	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ tests/regression/Filling/FillVolume/post/water_undo.xyz	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,5 @@
+3
+	Created by molecuilder on Wed Sep  3 23:24:49 2014, time step 0
+O	0	0	0
+H	0.758602	0	0.504284
+H	0.758602	0	-0.504284
Index: tests/regression/Filling/FillVolume/pre/water.xyz
===================================================================
--- tests/regression/Filling/FillVolume/pre/water.xyz	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ tests/regression/Filling/FillVolume/pre/water.xyz	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,5 @@
+3
+ # test configuration, created by molecuilder test suite
+O       0.      0.      0.
+H       0.758602 0.     0.504284 
+H       0.758602 0.     -0.504284 
Index: tests/regression/Filling/FillVolume/testsuite-fill-volume-cube.at
===================================================================
--- tests/regression/Filling/FillVolume/testsuite-fill-volume-cube.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ tests/regression/Filling/FillVolume/testsuite-fill-volume-cube.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,43 @@
+#
+#    MoleCuilder - creates and alters molecular systems
+#    Copyright (C) 2014 Frederik Heber
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+### filling various shapes
+
+# cuboid_impl::getHomogeneousPointsInVolume() is not implemented
+AT_SETUP([Filling - filling cube's volume])
+AT_KEYWORDS([filling fill-volume cube])
+AT_XFAIL_IF([/bin/true])
+
+file=water_cube.xyz
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Filling/FillVolume/pre/water.xyz water.xyz], 0)
+AT_CHECK([
+	../../molecuilder \
+		-i $file \
+		-o xyz \
+		-l water.xyz \
+		--select-all-molecules \
+		--create-shape \
+			--shape-name "cube" \
+			--shape-type cube \
+			--translation 5,5,5 \
+			--stretch 3,3,3 \
+		--select-shape-by-name "cube" \
+		--fill-volume \
+			--count 12], 0, [stdout], [stderr])
+#AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Filling/FillVolume/post/$file], 0, [ignore], [ignore])
+
+AT_CLEANUP
Index: tests/regression/Filling/FillVolume/testsuite-fill-volume-cylinder.at
===================================================================
--- tests/regression/Filling/FillVolume/testsuite-fill-volume-cylinder.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ tests/regression/Filling/FillVolume/testsuite-fill-volume-cylinder.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,92 @@
+#
+#    MoleCuilder - creates and alters molecular systems
+#    Copyright (C) 2014 Frederik Heber
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+### filling various shapes
+
+AT_SETUP([Filling - filling cylinder's volume])
+AT_KEYWORDS([filling fill-volume cylinder])
+
+file=water_cylinder.xyz
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Filling/FillVolume/pre/water.xyz water.xyz], 0)
+AT_CHECK([
+	../../molecuilder \
+		-i $file \
+		-o xyz \
+		-l water.xyz \
+		--select-all-molecules \
+		--create-shape \
+			--shape-name "cylinder" \
+			--shape-type cylinder \
+			--translation 5,5,5 \
+			--stretch 3,3,3 \
+		--select-shape-by-name "cylinder" \
+		--fill-volume \
+			--count 12], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Filling/FillVolume/post/$file], 0, [ignore], [ignore])
+
+AT_CLEANUP
+
+
+AT_SETUP([Filling - filling cylinder's volume with undo])
+AT_KEYWORDS([filling fill-volume cylinder undo])
+
+file=water_cylinder.xyz
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Filling/FillVolume/pre/water.xyz water.xyz], 0)
+AT_CHECK([
+	../../molecuilder \
+		-i $file \
+		-o xyz \
+		-l water.xyz \
+		--select-all-molecules \
+		--create-shape \
+			--shape-name "cylinder" \
+			--shape-type cylinder \
+			--translation 5,5,5 \
+			--stretch 3,3,3 \
+		--select-shape-by-name "cylinder" \
+		--fill-volume \
+			--count 12 \
+		--undo], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Filling/FillVolume/post/water_undo.xyz], 0, [ignore], [ignore])
+
+AT_CLEANUP
+
+
+AT_SETUP([Filling - filling cylinder's volume with redo])
+AT_KEYWORDS([filling fill-volume cylinder undo redo])
+
+file=water_cylinder.xyz
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Filling/FillVolume/pre/water.xyz water.xyz], 0)
+AT_CHECK([
+	../../molecuilder \
+		-i $file \
+		-o xyz \
+		-l water.xyz \
+		--select-all-molecules \
+		--create-shape \
+			--shape-name "cylinder" \
+			--shape-type cylinder \
+			--translation 5,5,5 \
+			--stretch 3,3,3 \
+		--select-shape-by-name "cylinder" \
+		--fill-volume \
+			--count 12 \
+		--undo \
+		--redo], 0, [stdout], [stderr])
+AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Filling/FillVolume/post/$file], 0, [ignore], [ignore])
+
+AT_CLEANUP
Index: tests/regression/Filling/FillVolume/testsuite-fill-volume-everywhere.at
===================================================================
--- tests/regression/Filling/FillVolume/testsuite-fill-volume-everywhere.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ tests/regression/Filling/FillVolume/testsuite-fill-volume-everywhere.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,43 @@
+#
+#    MoleCuilder - creates and alters molecular systems
+#    Copyright (C) 2014 Frederik Heber
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+### filling various shapes
+
+# everywhere_impl::getHomogeneousPointsInVolume() not implemented, then it would just fail
+AT_SETUP([Filling - filling everywhere's volume fails])
+AT_KEYWORDS([filling fill-volume everywhere])
+
+file=water_nowhere.xyz
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Filling/FillVolume/pre/water.xyz water.xyz], 0)
+AT_CHECK([
+	../../molecuilder \
+		-i $file \
+		-o xyz \
+		-l water.xyz \
+		--select-all-molecules \
+		--create-shape \
+			--shape-name "everywhere" \
+			--shape-type everywhere \
+			--translation 5,5,5 \
+			--stretch 3,3,3 \
+		--select-shape-by-name "everywhere" \
+		--fill-volume \
+			--count 12], 5, [stdout], [stderr])
+#AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Filling/FillVolume/post/$file], 0, [ignore], [ignore])
+
+
+AT_CLEANUP
Index: tests/regression/Filling/FillVolume/testsuite-fill-volume-nowhere.at
===================================================================
--- tests/regression/Filling/FillVolume/testsuite-fill-volume-nowhere.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ tests/regression/Filling/FillVolume/testsuite-fill-volume-nowhere.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,42 @@
+#
+#    MoleCuilder - creates and alters molecular systems
+#    Copyright (C) 2014 Frederik Heber
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+### filling various shapes
+
+# nowhere fails because there are no points
+AT_SETUP([Filling - filling nowhere's volume fails])
+AT_KEYWORDS([filling fill-volume nowhere])
+
+file=water_nowhere.xyz
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Filling/FillVolume/pre/water.xyz water.xyz], 0)
+AT_CHECK([
+	../../molecuilder \
+		-i $file \
+		-o xyz \
+		-l water.xyz \
+		--select-all-molecules \
+		--create-shape \
+			--shape-name "nowhere" \
+			--shape-type nowhere \
+			--translation 5,5,5 \
+			--stretch 3,3,3 \
+		--select-shape-by-name "nowhere" \
+		--fill-volume \
+			--count 12], 5, [stdout], [stderr])
+#AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Filling/FillVolume/post/$file], 0, [ignore], [ignore])
+
+AT_CLEANUP
Index: tests/regression/Filling/FillVolume/testsuite-fill-volume-sphere.at
===================================================================
--- tests/regression/Filling/FillVolume/testsuite-fill-volume-sphere.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
+++ tests/regression/Filling/FillVolume/testsuite-fill-volume-sphere.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -0,0 +1,43 @@
+#
+#    MoleCuilder - creates and alters molecular systems
+#    Copyright (C) 2014 Frederik Heber
+#
+#    This program is free software: you can redistribute it and/or modify
+#    it under the terms of the GNU General Public License as published by
+#    the Free Software Foundation, either version 3 of the License, or
+#    (at your option) any later version.
+#
+#    This program is distributed in the hope that it will be useful,
+#    but WITHOUT ANY WARRANTY; without even the implied warranty of
+#    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
+#    GNU General Public License for more details.
+#
+#    You should have received a copy of the GNU General Public License
+#    along with this program.  If not, see <http://www.gnu.org/licenses/>.
+#
+### filling various shapes
+
+# sphere_impl::getHomogeneousPointsInVolume() is not implemented
+AT_SETUP([Filling - filling sphere's volume])
+AT_KEYWORDS([filling fill-volume sphere])
+AT_XFAIL_IF([/bin/true])
+
+file=water_sphere.xyz
+AT_CHECK([/bin/cp -f ${abs_top_srcdir}/tests/regression/Filling/FillVolume/pre/water.xyz water.xyz], 0)
+AT_CHECK([
+	../../molecuilder \
+		-i $file \
+		-o xyz \
+		-l water.xyz \
+		--select-all-molecules \
+		--create-shape \
+			--shape-name "sphere" \
+			--shape-type sphere \
+			--translation 5,5,5 \
+			--stretch 3,3,3 \
+		--select-shape-by-name "sphere" \
+		--fill-volume \
+			--count 12], 0, [stdout], [stderr])
+#AT_CHECK([diff -I '.*reated by molecuilder.*' $file ${abs_top_srcdir}/tests/regression/Filling/FillVolume/post/$file], 0, [ignore], [ignore])
+
+AT_CLEANUP
Index: tests/regression/Filling/testsuite-filling.at
===================================================================
--- tests/regression/Filling/testsuite-filling.at	(revision 36f45c7566bcbd1eab7647b44689588ab0fb839c)
+++ tests/regression/Filling/testsuite-filling.at	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -37,2 +37,8 @@
 m4_include([Filling/RegularGrid/testsuite-fill-regular-grid-with-surface.at])
 
+# filling shape's volumes
+m4_include(Filling/FillVolume/testsuite-fill-volume-cube.at)
+m4_include(Filling/FillVolume/testsuite-fill-volume-cylinder.at)
+m4_include(Filling/FillVolume/testsuite-fill-volume-everywhere.at)
+m4_include(Filling/FillVolume/testsuite-fill-volume-nowhere.at)
+m4_include(Filling/FillVolume/testsuite-fill-volume-sphere.at)
Index: tests/regression/Makefile.am
===================================================================
--- tests/regression/Makefile.am	(revision 36f45c7566bcbd1eab7647b44689588ab0fb839c)
+++ tests/regression/Makefile.am	(revision 6801f4f3b7ed127fa9a9c8afe64f82d34df963d2)
@@ -65,4 +65,9 @@
 	$(srcdir)/Filling/FillVoidWithMolecule/testsuite-fill-void-with-molecule.at \
 	$(srcdir)/Filling/FillVoidWithMolecule/testsuite-fill-void-with-tenside-molecule.at \
+	$(srcdir)/Filling/FillVolume/testsuite-fill-volume-cube.at \
+	$(srcdir)/Filling/FillVolume/testsuite-fill-volume-cylinder.at \
+	$(srcdir)/Filling/FillVolume/testsuite-fill-volume-everywhere.at \
+	$(srcdir)/Filling/FillVolume/testsuite-fill-volume-nowhere.at \
+	$(srcdir)/Filling/FillVolume/testsuite-fill-volume-sphere.at \
 	$(srcdir)/Filling/FillWithMolecule/testsuite-fill-with-molecule.at \
 	$(srcdir)/Filling/RegularGrid/testsuite-fill-regular-grid.at \
