Navigation menu |
A portable, open-source, coherent noise-generating library for C++ |
voronoi.h00001 // voronoi.h 00002 // 00003 // Copyright (C) 2003, 2004 Jason Bevins 00004 // 00005 // This library is free software; you can redistribute it and/or modify it 00006 // under the terms of the GNU Lesser General Public License as published by 00007 // the Free Software Foundation; either version 2.1 of the License, or (at 00008 // your option) any later version. 00009 // 00010 // This library is distributed in the hope that it will be useful, but WITHOUT 00011 // ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 00012 // FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public 00013 // License (COPYING.txt) for more details. 00014 // 00015 // You should have received a copy of the GNU Lesser General Public License 00016 // along with this library; if not, write to the Free Software Foundation, 00017 // Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00018 // 00019 // The developer's email is jlbezigvins@gmzigail.com (for great email, take 00020 // off every 'zig'.) 00021 // 00022 00023 #ifndef NOISE_MODULE_VORONOI_H 00024 #define NOISE_MODULE_VORONOI_H 00025 00026 #include "modulebase.h" 00027 00028 namespace noise 00029 { 00030 00031 namespace module 00032 { 00033 00036 00039 00042 00045 const double DEFAULT_VORONOI_DISPLACEMENT = 1.0; 00046 00049 const double DEFAULT_VORONOI_FREQUENCY = 1.0; 00050 00053 const int DEFAULT_VORONOI_SEED = 0; 00054 00090 class Voronoi: public Module 00091 { 00092 00093 public: 00094 00105 Voronoi (); 00106 00119 void EnableDistance (bool enable = true) 00120 { 00121 m_enableDistance = enable; 00122 } 00123 00132 double GetDisplacement () const 00133 { 00134 return m_displacement; 00135 } 00136 00143 double GetFrequency () const 00144 { 00145 return m_frequency; 00146 } 00147 00148 virtual int GetSourceModuleCount () const 00149 { 00150 return 0; 00151 } 00152 00160 int GetSeed () const 00161 { 00162 return m_seed; 00163 } 00164 00175 bool IsDistanceEnabled () const 00176 { 00177 return m_enableDistance; 00178 } 00179 00180 virtual double GetValue (double x, double y, double z) const; 00181 00190 void SetDisplacement (double displacement) 00191 { 00192 m_displacement = displacement; 00193 } 00194 00201 void SetFrequency (double frequency) 00202 { 00203 m_frequency = frequency; 00204 } 00205 00213 void SetSeed (int seed) 00214 { 00215 m_seed = seed; 00216 } 00217 00218 protected: 00219 00221 double m_displacement; 00222 00225 bool m_enableDistance; 00226 00228 double m_frequency; 00229 00232 int m_seed; 00233 00234 }; 00235 00237 00239 00241 00242 } 00243 00244 } 00245 00246 #endif |
|
© 2003-2005 Jason Bevins
|