Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Shapes/Shape_impl.hpp

    re09b70 rcfda65  
    1010
    1111#include "Shapes/Shape.hpp"
     12#include "vector.hpp"
    1213
    1314class Shape_impl {
     
    1617  virtual ~Shape_impl(){};
    1718  virtual bool isInside(const Vector &point)=0;
     19  virtual bool isOnSurface(const Vector &point)=0;
     20  virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException)=0;
     21  virtual std::string toString()=0;
    1822};
    1923
     
    2327    return true;
    2428  }
     29  virtual bool isOnSurface(const Vector &point){
     30    return false;
     31  }
     32  virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException){
     33    throw NotOnSurfaceException(__FILE__,__LINE__);
     34  }
     35  virtual std::string toString(){
     36    return "Everywhere()";
     37  }
    2538};
    2639
     
    2841  virtual bool isInside(const Vector &point){
    2942    return false;
     43  }
     44  virtual bool isOnSurface(const Vector &point){
     45    return false;
     46  }
     47  virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException){
     48    throw NotOnSurfaceException(__FILE__,__LINE__);
     49  }
     50  virtual std::string toString(){
     51    return "Nowhere()";
    3052  }
    3153};
     
    3658  virtual ~AndShape_impl();
    3759  virtual bool isInside(const Vector &point);
     60  virtual bool isOnSurface(const Vector &point);
     61  virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException);
     62  virtual std::string toString();
    3863private:
    3964  Shape::impl_ptr lhs;
     
    4671  virtual ~OrShape_impl();
    4772  virtual bool isInside(const Vector &point);
     73  virtual bool isOnSurface(const Vector &point);
     74  virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException);
     75  virtual std::string toString();
    4876private:
    4977  Shape::impl_ptr lhs;
     
    5684  virtual ~NotShape_impl();
    5785  virtual bool isInside(const Vector &point);
     86  virtual bool isOnSurface(const Vector &point);
     87  virtual Vector getNormal(const Vector &point) throw(NotOnSurfaceException);
     88  virtual std::string toString();
    5889private:
    5990  Shape::impl_ptr arg;
Note: See TracChangeset for help on using the changeset viewer.