00001 /* ************************************************************************* 00002 pattern.h - description 00003 ------------------- 00004 begin : Fri Oct 18 2002 00005 copyright : (C) 2002 by Micha Riser 00006 email : mriser@gmx.net 00007 00008 $Id: pattern_8h-source.html,v 1.1 2005/02/04 21:02:27 micha Exp $ 00009 00010 ************************************************************************* */ 00011 00012 /* ************************************************************************* 00013 * * 00014 * This program is free software; you can redistribute it and/or modify * 00015 * it under the terms of the GNU General Public License as published by * 00016 * the Free Software Foundation; either version 2 of the License, or * 00017 * (at your option) any later version. * 00018 * * 00019 ************************************************************************* */ 00020 00021 #ifndef PATTERN_H 00022 #define PATTERN_H 00023 00024 #include "function.h" 00025 #include "types.h" 00026 #include "vector.h" 00027 00028 template<class D, class R> class Noise; 00029 00030 namespace pattern { 00031 00036 class Pattern: public Function<Vector3,FLT> { 00037 public: // Constructor and destructor 00038 Pattern() {} 00039 virtual ~Pattern() {} 00040 00041 public: // Pure virtual functions 00042 virtual Pattern* copy() const = 0; 00043 00044 protected: // Constants 00045 static const DBL SPACE_EPSILON; 00046 00047 }; 00048 00049 00054 class Checker: public Pattern { 00055 00056 public: // Public methods 00057 00058 //Inherited form Pattern 00059 FLT evaluateAt(const Vector3& v) const; 00060 Pattern* copy() const; 00061 00062 }; 00063 00064 00068 class Gradient: public Pattern { 00069 public: // Constructor and destructor 00070 Gradient(const Vector3& g): gradient(g) {} 00071 public: // Public methods 00072 //Inherited form Pattern 00073 FLT evaluateAt(const Vector3& v) const; 00074 Pattern* copy() const; 00075 private: // Private attributes 00076 Vector3 gradient; 00077 }; 00078 00079 00082 class Dents: public Pattern { 00083 public: // Constructor and destructor 00084 Dents(const Noise<Vector3,DBL>* n): noisegen(n) {} 00085 public: // Public methods 00086 //Inherited form Pattern 00087 FLT evaluateAt(const Vector3& v) const; 00088 Pattern* copy() const; 00089 private: // Private attributes 00090 const Noise<Vector3,DBL>* noisegen; 00091 }; 00092 00095 class Granite: public Pattern { 00096 public: // Constructor and destructor 00097 Granite(const Noise<Vector3,DBL>* n): noisegen(n) {} 00098 public: // Public methods 00099 //Inherited form Pattern 00100 FLT evaluateAt(const Vector3& v) const; 00101 Pattern* copy() const; 00102 private: // Private attributes 00103 const Noise<Vector3,DBL>* noisegen; 00104 }; 00105 00108 class Wrinkles: public Pattern { 00109 public: // Constructor and destructor 00110 Wrinkles(const Noise<Vector3,DBL>* n): noisegen(n) {} 00111 public: // Public methods 00112 //Inherited form Pattern 00113 FLT evaluateAt(const Vector3& v) const; 00114 Pattern* copy() const; 00115 private: // Private attributes 00116 const Noise<Vector3,DBL>* noisegen; 00117 }; 00118 00119 00120 } // end of namespace 00121 00122 #endif
1.3.8