Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/Shapes/Shape_impl.hpp

    rcfda65 re09b70  
    1010
    1111#include "Shapes/Shape.hpp"
    12 #include "vector.hpp"
    1312
    1413class Shape_impl {
     
    1716  virtual ~Shape_impl(){};
    1817  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;
    2218};
    2319
     
    2723    return true;
    2824  }
    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   }
    3825};
    3926
     
    4128  virtual bool isInside(const Vector &point){
    4229    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()";
    5230  }
    5331};
     
    5836  virtual ~AndShape_impl();
    5937  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();
    6338private:
    6439  Shape::impl_ptr lhs;
     
    7146  virtual ~OrShape_impl();
    7247  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();
    7648private:
    7749  Shape::impl_ptr lhs;
     
    8456  virtual ~NotShape_impl();
    8557  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();
    8958private:
    9059  Shape::impl_ptr arg;
Note: See TracChangeset for help on using the changeset viewer.