libmoldeo (Moldeo 1.0 Core)  1.0
libmoldeo is the group of objects and functions that executes the basic operations of Moldeo 1.0 Platform.
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
moMathManager.h
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moMathManager.h
4 
5  ****************************************************************************
6  * *
7  * This source is free software; you can redistribute it and/or modify *
8  * it under the terms of the GNU General Public License as published by *
9  * the Free Software Foundation; either version 2 of the License, or *
10  * (at your option) any later version. *
11  * *
12  * This code is distributed in the hope that it will be useful, but *
13  * WITHOUT ANY WARRANTY; without even the implied warranty of *
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU *
15  * General Public License for more details. *
16  * *
17  * A copy of the GNU General Public License is available on the World *
18  * Wide Web at <http://www.gnu.org/copyleft/gpl.html>. You can also *
19  * obtain it by writing to the Free Software Foundation, *
20  * Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
21  * *
22  ****************************************************************************
23 
24  Copyright(C) 2006 Fabricio Costa
25 
26  Authors:
27  Fabricio Costa
28  Andrés Colubri
29 
30 *******************************************************************************/
31 
32 #ifndef __MO_MATHMANAGER_H__
33 #define __MO_MATHMANAGER_H__
34 
35 #include "moTypes.h"
36 #include "moText.h"
37 #include "moConfig.h"
38 #include "moLock.h"
39 #include "moResourceManager.h"
40 #include "moMath.h"
41 #include "moMathFunction.h"
42 
47 {
48 public:
52  moMathManager();
56  virtual ~moMathManager();
57 
62  virtual MOboolean Init();
67  virtual MOboolean Finish();
68 
74  moMathFunction* GetFunction(MOuint p_idx);
80  MOint GetFunctionIdx(const moText& p_expr);
89  MOint AddFunction(const moText& p_expr, MOboolean p_force_new = false, moMoldeoObject* p_pMOB = NULL );
90 
97  double EvalFunction(MOuint p_idx, double x0);
105  double EvalFunction(MOuint p_idx, double x0, double x1);
114  double EvalFunction(MOuint p_idx, double x0, double x1, double x2);
115 
121  void SetFunctionParam(MOuint p_idx, double s0);
128  void SetFunctionParam(MOuint p_idx, double s0, double s1);
136  void SetFunctionParam(MOuint p_idx, double s0, double s1, double s2);
137 
144  return m_functions[p_idx] != NULL;
145  }
146 
153  double operator () (MOuint p_idx, double x0) { return EvalFunction(p_idx, x0); }
161  double operator () (MOuint p_idx, double x0, double x1) { return EvalFunction(p_idx, x0, x1); }
170  double operator () (MOuint p_idx, double x0, double x1, double x2) { return EvalFunction(p_idx, x0, x1, x2); }
171 
177  moMathFunction* operator [] (MOuint p_idx) { return GetFunction(p_idx); }
178 
179  static moMathd* mathfd;
180 protected:
181  moMathFunctionArray m_functions;
182 };
183 
184 #endif
185 
Recurso ( objeto para cargar y manipular objetos físicos de datos de imágenes, audio, video, 3d, 2d, fuentes, shaders y de cualquier otro tipo extendible por un plugin )
#define MOboolean
Definition: moTypes.h:385
#define LIBMOLDEO_API
Definition: moTypes.h:180
virtual MOboolean Init()
clase de para manejar textos
Definition: moText.h:75
#define MOint
Definition: moTypes.h:388
Clase Base para Objetos Moldeo ( moEffect, moIODevice, moResource, moConsole )
virtual MOboolean Finish()
static moMathd * mathfd
MOboolean ValidFunction(MOuint p_idx)
Definition: moMath.h:64
#define MOuint
Definition: moTypes.h:387
moMathFunctionArray m_functions
Real operator()(int iRow, int iCol) const
moMathFunction
const Real * operator[](int iRow) const