noisebas.h

Go to the documentation of this file.
00001 // $Id: noisebas.h 751 2006-03-31 15:43:49Z alex $
00002 // noisebas.h
00003 //
00004 // Author  : Mike
00005 // Purpose : base class for fundemental noise generators.
00006 // Version : 1.0
00007 // Started : 30/11/95
00008 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00009 ================================XARAHEADERSTART===========================
00010  
00011                Xara LX, a vector drawing and manipulation program.
00012                     Copyright (C) 1993-2006 Xara Group Ltd.
00013        Copyright on certain contributions may be held in joint with their
00014               respective authors. See AUTHORS file for details.
00015 
00016 LICENSE TO USE AND MODIFY SOFTWARE
00017 ----------------------------------
00018 
00019 This file is part of Xara LX.
00020 
00021 Xara LX is free software; you can redistribute it and/or modify it
00022 under the terms of the GNU General Public License version 2 as published
00023 by the Free Software Foundation.
00024 
00025 Xara LX and its component source files are distributed in the hope
00026 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00027 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00028 See the GNU General Public License for more details.
00029 
00030 You should have received a copy of the GNU General Public License along
00031 with Xara LX (see the file GPL in the root directory of the
00032 distribution); if not, write to the Free Software Foundation, Inc., 51
00033 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00034 
00035 
00036 ADDITIONAL RIGHTS
00037 -----------------
00038 
00039 Conditional upon your continuing compliance with the GNU General Public
00040 License described above, Xara Group Ltd grants to you certain additional
00041 rights. 
00042 
00043 The additional rights are to use, modify, and distribute the software
00044 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00045 library and any other such library that any version of Xara LX relased
00046 by Xara Group Ltd requires in order to compile and execute, including
00047 the static linking of that library to XaraLX. In the case of the
00048 "CDraw" library, you may satisfy obligation under the GNU General Public
00049 License to provide source code by providing a binary copy of the library
00050 concerned and a copy of the license accompanying it.
00051 
00052 Nothing in this section restricts any of the rights you have under
00053 the GNU General Public License.
00054 
00055 
00056 SCOPE OF LICENSE
00057 ----------------
00058 
00059 This license applies to this program (XaraLX) and its constituent source
00060 files only, and does not necessarily apply to other Xara products which may
00061 in part share the same code base, and are subject to their own licensing
00062 terms.
00063 
00064 This license does not apply to files in the wxXtra directory, which
00065 are built into a separate library, and are subject to the wxWindows
00066 license contained within that directory in the file "WXXTRA-LICENSE".
00067 
00068 This license does not apply to the binary libraries (if any) within
00069 the "libs" directory, which are subject to a separate license contained
00070 within that directory in the file "LIBS-LICENSE".
00071 
00072 
00073 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00074 ----------------------------------------------
00075 
00076 Subject to the terms of the GNU Public License (see above), you are
00077 free to do whatever you like with your modifications. However, you may
00078 (at your option) wish contribute them to Xara's source tree. You can
00079 find details of how to do this at:
00080   http://www.xaraxtreme.org/developers/
00081 
00082 Prior to contributing your modifications, you will need to complete our
00083 contributor agreement. This can be found at:
00084   http://www.xaraxtreme.org/developers/contribute/
00085 
00086 Please note that Xara will not accept modifications which modify any of
00087 the text between the start and end of this header (marked
00088 XARAHEADERSTART and XARAHEADEREND).
00089 
00090 
00091 MARKS
00092 -----
00093 
00094 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00095 designs are registered or unregistered trademarks, design-marks, and/or
00096 service marks of Xara Group Ltd. All rights in these marks are reserved.
00097 
00098 
00099       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00100                         http://www.xara.com/
00101 
00102 =================================XARAHEADEREND============================
00103  */
00104 
00105 #ifndef INC_NOISEBASE
00106 #define INC_NOISEBASE
00107 
00108 #define NOISE1D(v,s) NoiseGen()->VNoise1D(v,s)
00109 #define NOISE2D(v) NoiseGen()->VNoise2D(v)
00110 #define NOISE3D(v) NoiseGen()->VNoise3D(v)
00111 #define SEEDTABLE(v) NoiseGen()->SeedTable(v)
00112 
00113 #include "vector3d.h"
00114 
00115 /**************************************************************************************
00116 
00117 >   class NoiseBase
00118 
00119     Aurthor:    Mike
00120     Created:    07/07/96
00121     Notes:      The base class noise function generator. There are several derived
00122                 classes from this which generate different forms of noise. Each of
00123                 these classes 
00124 
00125 ***************************************************************************************/
00126 
00127 class NoiseBase
00128 {
00129     friend class NoiseMan;
00130 
00131     public:
00132         NoiseBase();
00133         virtual ~NoiseBase();
00134 
00135     // you should write your own versions of these noise functions
00136     // in your derived noise class.
00137         
00138         virtual BOOL     Initialise()=0;
00139         virtual double   VNoise1D(const Vector3D &v, double s)=0;
00140     //  virtual POINT    VNoise2D(const Vector3D &v)=0;
00141         virtual Vector3D VNoise3D(const Vector3D &v)=0;
00142         virtual void     SeedTable(UINT32 seed)=0;
00143 
00144     // the following function make full use of the above
00145     // noise generators, however the derived creates its noise.
00146 };
00147 
00148 
00149 /**************************************************************************************
00150 
00151 >   class NoiseMan
00152 
00153     Aurthor:    Mike
00154     Created:    07/07/96
00155     Notes:      The class which builds a version of noisebase.
00156 
00157 ***************************************************************************************/
00158 
00159 class NoiseMan
00160 {
00161     public:
00162          NoiseMan();
00163         ~NoiseMan();
00164 
00165         BOOL Initialise();
00166         void Destroy();
00167 
00168         NoiseBase* NoiseGen();
00169 
00170     private:
00171         NoiseBase* pNoise;
00172 };
00173 
00174 
00175 #endif

Generated on Sat Nov 10 03:46:11 2007 for Camelot by  doxygen 1.4.4