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