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