Changes in src/Shapes/Shape_impl.hpp [cfda65:e09b70]
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/Shapes/Shape_impl.hpp
rcfda65 re09b70 10 10 11 11 #include "Shapes/Shape.hpp" 12 #include "vector.hpp"13 12 14 13 class Shape_impl { … … 17 16 virtual ~Shape_impl(){}; 18 17 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;22 18 }; 23 19 … … 27 23 return true; 28 24 } 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 }38 25 }; 39 26 … … 41 28 virtual bool isInside(const Vector &point){ 42 29 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()";52 30 } 53 31 }; … … 58 36 virtual ~AndShape_impl(); 59 37 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();63 38 private: 64 39 Shape::impl_ptr lhs; … … 71 46 virtual ~OrShape_impl(); 72 47 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();76 48 private: 77 49 Shape::impl_ptr lhs; … … 84 56 virtual ~NotShape_impl(); 85 57 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();89 58 private: 90 59 Shape::impl_ptr arg;
Note:
See TracChangeset
for help on using the changeset viewer.