Index: src/Shapes/Shape.cpp
===================================================================
--- src/Shapes/Shape.cpp	(revision 997784156d1dc26d2ac261687508df7c71e2a7b7)
+++ src/Shapes/Shape.cpp	(revision 997784156d1dc26d2ac261687508df7c71e2a7b7)
@@ -0,0 +1,99 @@
+/*
+ * Shape.cpp
+ *
+ *  Created on: Jun 18, 2010
+ *      Author: crueger
+ */
+
+#include "Shape.hpp"
+#include "Shape_impl.hpp"
+
+Shape::Shape(const Shape& src) :
+  impl(src.getImpl())
+{}
+
+Shape::~Shape(){}
+
+bool Shape::isInside(const Vector &point){
+  return impl->isInside(point);
+}
+
+Shape::Shape(Shape::impl_ptr _impl) :
+    impl(_impl)
+{}
+
+Shape &Shape::operator=(const Shape& rhs){
+  if(&rhs!=this){
+    impl=rhs.getImpl();
+  }
+  return *this;
+}
+
+Shape::impl_ptr Shape::getImpl() const{
+  return impl;
+}
+
+/***************************** Some simple Shapes ***************************/
+
+Shape Everywhere(){
+  static Shape::impl_ptr impl = Shape::impl_ptr(new Everywhere_impl());
+  return Shape(impl);
+}
+
+Shape Nowhere(){
+  static Shape::impl_ptr impl = Shape::impl_ptr(new Nowhere_impl());
+  return Shape(impl);
+}
+
+/****************************** Operators ***********************************/
+
+// AND
+
+AndShape_impl::AndShape_impl(const Shape::impl_ptr &_lhs, const Shape::impl_ptr &_rhs) :
+  lhs(_lhs),rhs(_rhs)
+{}
+
+AndShape_impl::~AndShape_impl(){}
+
+bool AndShape_impl::isInside(const Vector &point){
+  return lhs->isInside(point) && rhs->isInside(point);
+}
+
+Shape operator&&(const Shape &lhs,const Shape &rhs){
+  Shape::impl_ptr newImpl = Shape::impl_ptr(new AndShape_impl(lhs.getImpl(),rhs.getImpl()));
+  return Shape(newImpl);
+}
+
+// OR
+
+OrShape_impl::OrShape_impl(const Shape::impl_ptr &_lhs, const Shape::impl_ptr &_rhs) :
+  lhs(_lhs),rhs(_rhs)
+{}
+
+OrShape_impl::~OrShape_impl(){}
+
+bool OrShape_impl::isInside(const Vector &point){
+  return rhs->isInside(point) || lhs->isInside(point);
+}
+
+Shape operator||(const Shape &lhs,const Shape &rhs){
+  Shape::impl_ptr newImpl = Shape::impl_ptr(new OrShape_impl(lhs.getImpl(),rhs.getImpl()));
+  return Shape(newImpl);
+}
+
+// NOT
+
+NotShape_impl::NotShape_impl(const Shape::impl_ptr &_arg) :
+  arg(_arg)
+{}
+
+NotShape_impl::~NotShape_impl(){}
+
+bool NotShape_impl::isInside(const Vector &point){
+  return !arg->isInside(point);
+}
+
+Shape operator!(const Shape &arg){
+  Shape::impl_ptr newImpl = Shape::impl_ptr(new NotShape_impl(arg.getImpl()));
+  return Shape(newImpl);
+}
Index: src/Shapes/Shape.hpp
===================================================================
--- src/Shapes/Shape.hpp	(revision 997784156d1dc26d2ac261687508df7c71e2a7b7)
+++ src/Shapes/Shape.hpp	(revision 997784156d1dc26d2ac261687508df7c71e2a7b7)
@@ -0,0 +1,46 @@
+/*
+ * Shape.hpp
+ *
+ *  Created on: Jun 18, 2010
+ *      Author: crueger
+ */
+
+#ifndef SHAPE_HPP_
+#define SHAPE_HPP_
+
+#include <boost/shared_ptr.hpp>
+
+class Vector;
+class Shape_impl;
+
+class Shape
+{
+friend Shape operator&&(const Shape&,const Shape&);
+friend Shape operator||(const Shape&,const Shape&);
+friend Shape operator!(const Shape&);
+public:
+  typedef boost::shared_ptr<Shape_impl> impl_ptr;
+
+  Shape(impl_ptr);
+  Shape(const Shape&);
+  virtual ~Shape();
+
+  bool isInside(const Vector &point);
+
+  Shape &operator=(const Shape& rhs);
+
+protected:
+  impl_ptr getImpl() const;
+
+private:
+  impl_ptr impl;
+};
+
+Shape Everywhere();
+Shape Nowhere();
+
+Shape operator&&(const Shape&,const Shape&);
+Shape operator||(const Shape&,const Shape&);
+Shape operator!(const Shape&);
+
+#endif /* SHAPE_HPP_ */
Index: src/Shapes/Shape_impl.hpp
===================================================================
--- src/Shapes/Shape_impl.hpp	(revision 997784156d1dc26d2ac261687508df7c71e2a7b7)
+++ src/Shapes/Shape_impl.hpp	(revision 997784156d1dc26d2ac261687508df7c71e2a7b7)
@@ -0,0 +1,60 @@
+/*
+ * Shape_impl.hpp
+ *
+ *  Created on: Jun 18, 2010
+ *      Author: crueger
+ */
+
+#ifndef SHAPE_IMPL_HPP_
+#define SHAPE_IMPL_HPP_
+
+#include "Shapes/Shape.hpp"
+
+class Shape_impl {
+public:
+  virtual bool isInside(const Vector &point)=0;
+};
+
+class Everywhere_impl : public Shape_impl {
+public:
+  virtual bool isInside(const Vector &point){
+    return true;
+  }
+};
+
+class Nowhere_impl : public Shape_impl {
+  virtual bool isInside(const Vector &point){
+    return false;
+  }
+};
+
+class AndShape_impl : public Shape_impl {
+public:
+  AndShape_impl(const Shape::impl_ptr&, const Shape::impl_ptr&);
+  virtual ~AndShape_impl();
+  virtual bool isInside(const Vector &point);
+private:
+  Shape::impl_ptr lhs;
+  Shape::impl_ptr rhs;
+};
+
+class OrShape_impl : public Shape_impl {
+public:
+  OrShape_impl(const Shape::impl_ptr&, const Shape::impl_ptr&);
+  virtual ~OrShape_impl();
+  virtual bool isInside(const Vector &point);
+private:
+  Shape::impl_ptr lhs;
+  Shape::impl_ptr rhs;
+};
+
+class NotShape_impl : public Shape_impl {
+public:
+  NotShape_impl(const Shape::impl_ptr&);
+  virtual ~NotShape_impl();
+  virtual bool isInside(const Vector &point);
+private:
+  Shape::impl_ptr arg;
+};
+
+#endif /* SHAPE_IMPL_HPP_ */
