cstool/noise/model/line.h
00001 // line.h 00002 // 00003 // Copyright (C) 2004 Keith Davies 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 00020 #ifndef NOISE_MODEL_LINE_H 00021 #define NOISE_MODEL_LINE_H 00022 00023 #include <assert.h> 00024 #include <math.h> 00025 #include <stdlib.h> 00026 #include "../module/modulebase.h" 00027 00028 namespace CS { 00029 namespace Math { 00030 namespace Noise { 00031 namespace Model { 00032 00035 00038 00052 class CS_CRYSTALSPACE_EXPORT Line 00053 { 00054 00055 public: 00056 00058 Line (); 00059 00064 Line (const CS::Math::Noise::Module::Module& module); 00065 00073 bool GetAttenuate () const 00074 { 00075 return m_attenuate; 00076 } 00077 00084 const CS::Math::Noise::Module::Module& GetModule () const 00085 { 00086 assert (m_pModule != NULL); 00087 return *m_pModule; 00088 } 00089 00110 double GetValue (double p) const; 00111 00117 void SetAttenuate (bool att) 00118 { 00119 m_attenuate = att; 00120 } 00121 00128 void SetEndPoint (double x, double y, double z) 00129 { 00130 m_x1 = x; 00131 m_y1 = y; 00132 m_z1 = z; 00133 } 00134 00142 void SetModule (const CS::Math::Noise::Module::Module& module) 00143 { 00144 m_pModule = &module; 00145 } 00146 00153 void SetStartPoint (double x, double y, double z) 00154 { 00155 m_x0 = x; 00156 m_y0 = y; 00157 m_z0 = z; 00158 } 00159 00160 private: 00161 00164 bool m_attenuate; 00165 00167 const CS::Math::Noise::Module::Module* m_pModule; 00168 00170 double m_x0; 00171 00173 double m_x1; 00174 00176 double m_y0; 00177 00179 double m_y1; 00180 00182 double m_z0; 00183 00185 double m_z1; 00186 00187 }; 00188 00190 00192 00193 } // namespace Model 00194 } // namespace Noise 00195 } // namespace Math 00196 } // namespace CS 00197 00198 #endif
Generated for Crystal Space 2.1 by doxygen 1.6.1
