Index: src/Filling/Makefile.am
===================================================================
--- src/Filling/Makefile.am	(revision 83fd7d028ca39a4cd002c097850aa966f267121e)
+++ src/Filling/Makefile.am	(revision 7adddc77959cfcd6ae003aa73f30942d2e1c3c35)
@@ -6,4 +6,5 @@
 	Filling/Predicates/FillPredicate.cpp \
 	Filling/Predicates/IsInsideDomain_FillPredicate.cpp \
+	Filling/Predicates/IsInsideSurface_FillPredicate.cpp \
 	Filling/Predicates/IsValidInDomain_FillPredicate.cpp \
 	Filling/Predicates/IsVoidNode_FillPredicate.cpp \
@@ -17,4 +18,5 @@
 	Filling/Predicates/FillPredicate_impl.hpp \
 	Filling/Predicates/IsInsideDomain_FillPredicate.hpp \
+	Filling/Predicates/IsInsideSurface_FillPredicate.hpp \
 	Filling/Predicates/IsValidInDomain_FillPredicate.hpp \
 	Filling/Predicates/IsVoidNode_FillPredicate.hpp \
Index: src/Filling/Predicates/IsInsideSurface_FillPredicate.cpp
===================================================================
--- src/Filling/Predicates/IsInsideSurface_FillPredicate.cpp	(revision 7adddc77959cfcd6ae003aa73f30942d2e1c3c35)
+++ src/Filling/Predicates/IsInsideSurface_FillPredicate.cpp	(revision 7adddc77959cfcd6ae003aa73f30942d2e1c3c35)
@@ -0,0 +1,36 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IsInsideSurface_FillPredicate.cpp
+ *
+ *  Created on: Jan 16, 2012
+ *      Author: heber
+ */
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "CodePatterns/MemDebug.hpp"
+
+#include <boost/bind.hpp>
+
+#include "IsInsideSurface_FillPredicate.hpp"
+
+#include "AnyFillPredicate.hpp"
+#include "FillPredicate.hpp"
+#include "Tesselation/tesselation.hpp"
+
+FillPredicate IsInsideSurface_FillPredicate(const Tesselation &_tess, const LinkedCell_deprecated &_LC)
+{
+  AnyFillPredicate::FillPredicator function = boost::bind(&Tesselation::IsInnerPoint, &_tess, _1, &_LC);
+  FillPredicate::impl_ptr impl(new AnyFillPredicate(function));
+  return FillPredicate(impl);
+}
Index: src/Filling/Predicates/IsInsideSurface_FillPredicate.hpp
===================================================================
--- src/Filling/Predicates/IsInsideSurface_FillPredicate.hpp	(revision 7adddc77959cfcd6ae003aa73f30942d2e1c3c35)
+++ src/Filling/Predicates/IsInsideSurface_FillPredicate.hpp	(revision 7adddc77959cfcd6ae003aa73f30942d2e1c3c35)
@@ -0,0 +1,25 @@
+/*
+ * IsInsideSurface_FillPredicate.hpp
+ *
+ *  Created on: Jan 16, 2012
+ *      Author: heber
+ */
+
+#ifndef ISINSIDESURFACE_FILLPREDICATE_HPP_
+#define ISINSIDESURFACE_FILLPREDICATE_HPP_
+
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include "FillPredicate.hpp"
+
+class LinkedCell_deprecated;
+class Tesselation;
+
+
+FillPredicate IsInsideSurface_FillPredicate(const Tesselation &_tess, const LinkedCell_deprecated &_LC);
+
+#endif /* ISINSIDESURFACE_FILLPREDICATE_HPP_ */
Index: src/Filling/unittests/IsInsideSurface_FillPredicateUnitTest.cpp
===================================================================
--- src/Filling/unittests/IsInsideSurface_FillPredicateUnitTest.cpp	(revision 7adddc77959cfcd6ae003aa73f30942d2e1c3c35)
+++ src/Filling/unittests/IsInsideSurface_FillPredicateUnitTest.cpp	(revision 7adddc77959cfcd6ae003aa73f30942d2e1c3c35)
@@ -0,0 +1,129 @@
+/*
+ * Project: MoleCuilder
+ * Description: creates and alters molecular systems
+ * Copyright (C)  2010-2012 University of Bonn. All rights reserved.
+ * Please see the LICENSE file or "Copyright notice" in builder.cpp for details.
+ */
+
+/*
+ * IsInsideSurface_FillPredicateUnitTest.cpp
+ *
+ *  Created on: Jan 18, 2012
+ *      Author: heber
+ */
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+#include <cppunit/CompilerOutputter.h>
+#include <cppunit/extensions/TestFactoryRegistry.h>
+#include <cppunit/ui/text/TestRunner.h>
+
+#include "CodePatterns/Assert.hpp"
+#include "CodePatterns/Log.hpp"
+
+#include "Atom/TesselPoint.hpp"
+#include "LinkedCell/PointCloudAdaptor.hpp"
+#include "Filling/Predicates/IsInsideSurface_FillPredicate.hpp"
+#include "Filling/NodeTypes.hpp"
+#include "LinearAlgebra/Vector.hpp"
+#include "Tesselation/BoundaryLineSet.hpp"
+#include "Tesselation/BoundaryTriangleSet.hpp"
+#include "Tesselation/CandidateForTesselation.hpp"
+#include "Tesselation/tesselation.hpp"
+
+#include "IsInsideSurface_FillPredicateUnitTest.hpp"
+
+#ifdef HAVE_TESTRUNNER
+#include "UnitTestMain.hpp"
+#endif /*HAVE_TESTRUNNER*/
+
+const double IsInsideSurface_FillPredicateTest::SPHERERADIUS=2.;
+
+/********************************************** Test classes **************************************/
+
+// Registers the fixture into the 'registry'
+CPPUNIT_TEST_SUITE_REGISTRATION( IsInsideSurface_FillPredicateTest );
+
+
+void IsInsideSurface_FillPredicateTest::setUp()
+{
+  // failing asserts should be thrown
+  ASSERT_DO(Assert::Throw);
+
+  // create corners
+  class TesselPoint *Walker;
+  Walker = new TesselPoint;
+  Walker->setPosition(Vector(1., 0., -1.));
+  Walker->setName("1");
+  Walker->setNr(1);
+  Corners.push_back(Walker);
+  Walker = new TesselPoint;
+  Walker->setPosition(Vector(-1., 1., -1.));
+  Walker->setName("2");
+  Walker->setNr(2);
+  Corners.push_back(Walker);
+  Walker = new TesselPoint;
+  Walker->setPosition(Vector(-1., -1., -1.));
+  Walker->setName("3");
+  Walker->setNr(3);
+  Corners.push_back(Walker);
+  Walker = new TesselPoint;
+  Walker->setPosition(Vector(-1., 0., 1.));
+  Walker->setName("4");
+  Walker->setNr(4);
+  Corners.push_back(Walker);
+
+  // create linkedcell
+  PointCloudAdaptor<TesselPointSTLList> cloud(&Corners, "TesselPointSTLList");
+  LinkedList = new LinkedCell_deprecated(cloud, 2.*SPHERERADIUS);
+
+  // create tesselation
+  TesselStruct = new Tesselation;
+  (*TesselStruct)(cloud, SPHERERADIUS);
+
+  // create predicate
+  predicate = new FillPredicate(IsInsideSurface_FillPredicate(*TesselStruct, *LinkedList));
+}
+
+
+void IsInsideSurface_FillPredicateTest::tearDown()
+{
+  delete predicate;
+
+  delete(LinkedList);
+  delete(TesselStruct);
+  for (TesselPointSTLList::iterator Runner = Corners.begin(); Runner != Corners.end(); Runner++)
+    delete(*Runner);
+  Corners.clear();
+  logger::purgeInstance();
+  errorLogger::purgeInstance();
+
+}
+
+/** Test whether operator() returns as desired
+ *
+ */
+void IsInsideSurface_FillPredicateTest::operatorTest()
+{
+  Node center(0.,0.,0.);
+  Node corner(1.,0.,-1.);
+  Node outside(2.,0.,0.);
+
+  {
+    // center is inside
+    CPPUNIT_ASSERT( (*predicate)(center) );
+  }
+
+  {
+    // corner is inside
+    CPPUNIT_ASSERT( (*predicate)(corner) );
+  }
+
+  {
+    // outside is outside
+    CPPUNIT_ASSERT( !(*predicate)(outside) );
+  }
+}
Index: src/Filling/unittests/IsInsideSurface_FillPredicateUnitTest.hpp
===================================================================
--- src/Filling/unittests/IsInsideSurface_FillPredicateUnitTest.hpp	(revision 7adddc77959cfcd6ae003aa73f30942d2e1c3c35)
+++ src/Filling/unittests/IsInsideSurface_FillPredicateUnitTest.hpp	(revision 7adddc77959cfcd6ae003aa73f30942d2e1c3c35)
@@ -0,0 +1,47 @@
+/*
+ * IsInsideSurface_FillPredicateUnitTest.hpp
+ *
+ *  Created on: Jan 18, 2012
+ *      Author: heber
+ */
+
+#ifndef ISINSIDESURFACE_FILLPREDICATEUNITTEST_HPP_
+#define ISINSIDESURFACE_FILLPREDICATEUNITTEST_HPP_
+
+// include config.h
+#ifdef HAVE_CONFIG_H
+#include <config.h>
+#endif
+
+
+#include <cppunit/extensions/HelperMacros.h>
+
+#include "LinkedCell/linkedcell.hpp"
+
+class FillPredicate;
+class LinkedCell_deprecated;
+class Tesselation;
+
+/********************************************** Test classes **************************************/
+
+class IsInsideSurface_FillPredicateTest : public CppUnit::TestFixture
+{
+    CPPUNIT_TEST_SUITE( IsInsideSurface_FillPredicateTest) ;
+    CPPUNIT_TEST ( operatorTest );
+    CPPUNIT_TEST_SUITE_END();
+
+public:
+      void setUp();
+      void tearDown();
+      void operatorTest();
+
+private:
+      static const double SPHERERADIUS;
+
+      TesselPointSTLList Corners;
+      Tesselation *TesselStruct;
+      LinkedCell_deprecated *LinkedList;
+      FillPredicate *predicate;
+};
+
+#endif /* ISINSIDESURFACE_FILLPREDICATEUNITTEST_HPP_ */
Index: src/Filling/unittests/Makefile.am
===================================================================
--- src/Filling/unittests/Makefile.am	(revision 83fd7d028ca39a4cd002c097850aa966f267121e)
+++ src/Filling/unittests/Makefile.am	(revision 7adddc77959cfcd6ae003aa73f30942d2e1c3c35)
@@ -4,4 +4,5 @@
 FILLINGTESTSSOURCES = \
   ../Filling/unittests/IsInsideDomain_FillPredicateUnitTest.cpp \
+  ../Filling/unittests/IsInsideSurface_FillPredicateUnitTest.cpp \
   ../Filling/unittests/IsValidInDomain_FillPredicateUnitTest.cpp \
   ../Filling/unittests/IsVoidNode_FillPredicateUnitTest.cpp \
@@ -10,4 +11,5 @@
 FILLINGTESTSHEADERS = \
   ../Filling/unittests/IsInsideDomain_FillPredicateUnitTest.hpp \
+  ../Filling/unittests/IsInsideSurface_FillPredicateUnitTest.hpp \
   ../Filling/unittests/IsValidInDomain_FillPredicateUnitTest.hpp \
   ../Filling/unittests/IsVoidNode_FillPredicateUnitTest.hpp \
@@ -16,4 +18,5 @@
 FILLINGTESTS = \
   IsInsideDomain_FillPredicateUnitTest \
+  IsInsideSurface_FillPredicateUnitTest \
   IsValidInDomain_FillPredicateUnitTest \
   IsVoidNode_FillPredicateUnitTest \
@@ -30,4 +33,15 @@
 	../Filling/unittests/IsInsideDomain_FillPredicateUnitTest.hpp
 IsInsideDomain_FillPredicateUnitTest_LDADD = \
+	../libMolecuilderFilling.la \
+	../libMolecuilderUI.la \
+	../libMolecuilder.la \
+	$(top_builddir)/LinearAlgebra/src/LinearAlgebra/libLinearAlgebra.la \
+	${CodePatterns_LIBS} \
+	$(BOOST_LIBS)
+
+IsInsideSurface_FillPredicateUnitTest_SOURCES = $(top_srcdir)/src/unittests/UnitTestMain.cpp \
+	../Filling/unittests/IsInsideSurface_FillPredicateUnitTest.cpp \
+	../Filling/unittests/IsInsideSurface_FillPredicateUnitTest.hpp
+IsInsideSurface_FillPredicateUnitTest_LDADD = \
 	../libMolecuilderFilling.la \
 	../libMolecuilderUI.la \
