/* * Shape.hpp * * Created on: Jun 18, 2010 * Author: crueger */ #ifndef SHAPE_HPP_ #define SHAPE_HPP_ // include config.h #ifdef HAVE_CONFIG_H #include #endif #include #include #include "Shapes/ShapeExceptions.hpp" #include "Shapes/ShapeType.hpp" #include class Vector; class Shape_impl; class LineSegmentSet; class Line; class ShapeFactoryTest; class Shape { public: typedef boost::shared_ptr impl_ptr; friend impl_ptr getShapeImpl(const Shape&); friend class ShapeFactoryTest; Shape(impl_ptr); Shape(const Shape&); virtual ~Shape(); bool isInside(const Vector &point) const; bool isOnSurface(const Vector &point) const; Vector getNormal(const Vector &point) const throw(NotOnSurfaceException); Vector getCenter() const; double getRadius() const; double getVolume() const; double getSurfaceArea() const; LineSegmentSet getLineIntersections(const Line&) const; std::vector getHomogeneousPointsOnSurface(const size_t N) const; std::vector getHomogeneousPointsInVolume(const size_t N) const; Shape &operator=(const Shape& rhs); bool operator==(const Shape &rhs) const; std::string toString() const; enum ShapeType getType() const; 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&); std::ostream &operator<<(std::ostream&,const Shape&); #endif /* SHAPE_HPP_ */