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
moParam.cpp
Go to the documentation of this file.
1 /*******************************************************************************
2 
3  moParam.cpp
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 
29 
30 *******************************************************************************/
31 
32 #include "moParam.h"
33 #include <tinyxml.h>
34 #include "moDebugManager.h"
35 #include "moArray.h"
36 
37 moDefineDynamicArray(moParamDefinitions)
38 moDefineDynamicArray(moParams)
39 moDefineDynamicArray( moParamIndexes )
40 
41 //================================================================
42 // moParamDefinition
43 //================================================================
44 
46  m_Name = moText("");
47  m_Index = -1;
48  m_Type = MO_PARAM_UNDEFINED;
49  m_Property = "";
50  m_OptionsStr = "";
51 }
52 
54  *this = src;
55 }
56 
58  m_Name = p_name;
59  m_Type = p_type;
60  m_Index = -1;
61  m_Property = "";
62  m_OptionsStr = "";
63 }
64 
67 
68  moParamType p_Type;
69 
70  if ( p_type == moText("ALPHA") ) {
71  p_Type = MO_PARAM_ALPHA;
72  } else
73  if ( p_type == moText("COLOR") ) {
74  p_Type = MO_PARAM_COLOR;
75  } else
76  if ( p_type == moText("BLENDING") ) {
77  p_Type = MO_PARAM_BLENDING;
78  } else
79  if ( p_type == moText("POLYGONMODE") ) {
80  p_Type = MO_PARAM_POLYGONMODE;
81  } else
82  if ( p_type == moText("SYNC") ) {
83  p_Type = MO_PARAM_SYNC;
84  } else
85  if ( p_type == moText("PHASE") ) {
86  p_Type = MO_PARAM_PHASE;
87  } else
88  if ( p_type == moText("TEXT") ) {
89  p_Type = MO_PARAM_TEXT;
90  } else
91  if ( p_type == moText("TEXTURE") ) {
92  p_Type = MO_PARAM_TEXTURE;
93  } else
94  if ( p_type == moText("TEXTUREFOLDER") ) {
95  p_Type = MO_PARAM_TEXTUREFOLDER;
96  } else
97  if ( p_type == moText("FONT") ) {
98  p_Type = MO_PARAM_FONT;
99  } else
100  if ( p_type == moText("3DMODEL") ) {
101  p_Type = MO_PARAM_3DMODEL;
102  } else
103  if ( p_type == moText("MOLDEOOBJECT") ) {
104  p_Type = MO_PARAM_MOLDEO_OBJECT;
105  } else
106  if ( p_type == moText("OBJECT") ) {
107  p_Type = MO_PARAM_OBJECT;
108  } else
109  if ( p_type == moText("VIDEO") ) {
110  p_Type = MO_PARAM_VIDEO;
111  } else
112  if ( p_type == moText("FILTER") ) {
113  p_Type = MO_PARAM_FILTER;
114  } else
115  if ( p_type == moText("SOUND") ) {
116  p_Type = MO_PARAM_SOUND;
117  } else
118  if ( p_type == moText("NUM") ) {
119  p_Type = MO_PARAM_NUMERIC;
120  } else
121  if ( p_type == moText("FUNCTION") ) {
122  p_Type = MO_PARAM_FUNCTION;
123  } else
124  if ( p_type == moText("TRANSLATEX") ) {
125  p_Type = MO_PARAM_TRANSLATEX;
126  } else
127  if ( p_type == moText("TRANSLATEY") ) {
128  p_Type = MO_PARAM_TRANSLATEY;
129  } else
130  if ( p_type == moText("TRANSLATEZ") ) {
131  p_Type = MO_PARAM_TRANSLATEZ;
132  } else
133  if ( p_type == moText("SCALEX") ) {
134  p_Type = MO_PARAM_SCALEX;
135  } else
136  if ( p_type == moText("SCALEY") ) {
137  p_Type = MO_PARAM_SCALEY;
138  } else
139  if ( p_type == moText("SCALEZ") ) {
140  p_Type = MO_PARAM_SCALEZ;
141  } else
142  if ( p_type == moText("ROTATEX") ) {
143  p_Type = MO_PARAM_ROTATEX;
144  } else
145  if ( p_type == moText("ROTATEY") ) {
146  p_Type = MO_PARAM_ROTATEY;
147  } else
148  if ( p_type == moText("ROTATEZ") ) {
149  p_Type = MO_PARAM_ROTATEZ;
150  } else
151  if ( p_type == moText("SCRIPT") ) {
152  p_Type = MO_PARAM_SCRIPT;
153  } else
154  if ( p_type == moText("COMPOSE") ) {
155  p_Type = MO_PARAM_COMPOSE;
156  } else
157  if ( p_type == moText("VECTOR") ) {
158  p_Type = MO_PARAM_VECTOR;
159  } else
160  if ( p_type == moText("INLET") ) {
161  p_Type = MO_PARAM_INLET;
162  } else
163  if ( p_type == moText("OUTLET") ) {
164  p_Type = MO_PARAM_OUTLET;
165  } else
166  if ( p_type == moText("UNDEFINED") ) {
167  p_Type = MO_PARAM_UNDEFINED;
168  }
169 
170  return p_Type;
171 
172 }
173 
174 bool
176  return (m_Type!=MO_PARAM_UNDEFINED);
177 }
178 /*
179 MO_PARAM_ALPHA, //value type: NUM or FUNCTION
180  MO_PARAM_COLOR, //value type: NUM[4] or FUNCTION[4] or
181  MO_PARAM_SYNC, //value type: NUM or FUNCTION
182  MO_PARAM_TEXT, //value type: TXT or LNK
183  MO_PARAM_TEXTURE, //value type: TXT or LNK
184  MO_PARAM_FONT, //value type: TXT or LNK
185  MO_PARAM_VIDEO, //value type: TXT or LNK
186  MO_PARAM_SOUND, //value type: TXT or LNK
187  MO_PARAM_FUNCTION, //value type: NUM or FUNCTION
188  MO_PARAM_SCRIPT, //value type: TXT or LNK
189  MO_PARAM_TRA, //value type: NUM[3] or FUNCTION[3]
190  MO_PARAM_ROT, //value type: NUM[3] or FUNCTION[3]
191  MO_PARAM_SCA //value type: NUM[3] or FUNCTION[3]
192  MO_PARAM_INLET, //value type: TXT or LNK
193  MO_PARAM_OUTLET //value type: TXT or LNK
194 */
196  const moText& p_type,
197  const moText& p_property,
198  const moText& p_group,
199  const moText& p_interpolation,
200  const moText& p_duration,
201  const moText& p_optionsstr ) {
202 
203  m_Name = p_name;
204 
205  m_Property = p_property;
206  m_Group = p_group;
207 
208  bool valid_interpolation = false;
209  if ( p_type == moText("ALPHA") ) {
210  m_Type = MO_PARAM_ALPHA;
211  valid_interpolation = true;
212  } else
213  if ( p_type == moText("COLOR") ) {
214  m_Type = MO_PARAM_COLOR;
215  valid_interpolation = false;// TODO: do it!
216  } else
217  if ( p_type == moText("BLENDING") ) {
218  m_Type = MO_PARAM_BLENDING;
219  } else
220  if ( p_type == moText("POLYGONMODE") ) {
221  m_Type = MO_PARAM_POLYGONMODE;
222  } else
223  if ( p_type == moText("SYNC") ) {
224  m_Type = MO_PARAM_SYNC;
225  valid_interpolation = true;
226  } else
227  if ( p_type == moText("PHASE") ) {
228  m_Type = MO_PARAM_PHASE;
229  valid_interpolation = true;
230  } else
231  if ( p_type == moText("TEXT") ) {
232  m_Type = MO_PARAM_TEXT;
233  } else
234  if ( p_type == moText("TEXTURE") ) {
235  m_Type = MO_PARAM_TEXTURE;
236  } else
237  if ( p_type == moText("TEXTUREFOLDER") ) {
238  m_Type = MO_PARAM_TEXTUREFOLDER;
239  } else
240  if ( p_type == moText("FONT") ) {
241  m_Type = MO_PARAM_FONT;
242  } else
243  if ( p_type == moText("3DMODEL") ) {
244  m_Type = MO_PARAM_3DMODEL;
245  } else
246  if ( p_type == moText("MOLDEOOBJECT") ) {
247  m_Type = MO_PARAM_MOLDEO_OBJECT;
248  } else
249  if ( p_type == moText("OBJECT") ) {
250  m_Type = MO_PARAM_OBJECT;
251  } else
252  if ( p_type == moText("VIDEO") ) {
253  m_Type = MO_PARAM_VIDEO;
254  } else
255  if ( p_type == moText("FILTER") ) {
256  m_Type = MO_PARAM_FILTER;
257  } else
258  if ( p_type == moText("SOUND") ) {
259  m_Type = MO_PARAM_SOUND;
260  } else
261  if ( p_type == moText("NUM") ) {
262  m_Type = MO_PARAM_NUMERIC;
263  valid_interpolation = true;
264  } else
265  if ( p_type == moText("FUNCTION") ) {
266  m_Type = MO_PARAM_FUNCTION;
267  valid_interpolation = true;
268  } else
269  if ( p_type == moText("TRANSLATEX") ) {
270  m_Type = MO_PARAM_TRANSLATEX;
271  valid_interpolation = true;
272  } else
273  if ( p_type == moText("TRANSLATEY") ) {
274  m_Type = MO_PARAM_TRANSLATEY;
275  valid_interpolation = true;
276  } else
277  if ( p_type == moText("TRANSLATEZ") ) {
278  m_Type = MO_PARAM_TRANSLATEZ;
279  valid_interpolation = true;
280  } else
281  if ( p_type == moText("SCALEX") ) {
282  m_Type = MO_PARAM_SCALEX;
283  valid_interpolation = true;
284  } else
285  if ( p_type == moText("SCALEY") ) {
286  m_Type = MO_PARAM_SCALEY;
287  valid_interpolation = true;
288  } else
289  if ( p_type == moText("SCALEZ") ) {
290  m_Type = MO_PARAM_SCALEZ;
291  valid_interpolation = true;
292  } else
293  if ( p_type == moText("ROTATEX") ) {
294  m_Type = MO_PARAM_ROTATEX;
295  valid_interpolation = true;
296  } else
297  if ( p_type == moText("ROTATEY") ) {
298  m_Type = MO_PARAM_ROTATEY;
299  valid_interpolation = true;
300  } else
301  if ( p_type == moText("ROTATEZ") ) {
302  m_Type = MO_PARAM_ROTATEZ;
303  valid_interpolation = true;
304  } else
305  if ( p_type == moText("SCRIPT") ) {
306  m_Type = MO_PARAM_SCRIPT;
307  } else
308  if ( p_type == moText("COMPOSE") ) {
309  m_Type = MO_PARAM_COMPOSE;
310  } else
311  if ( p_type == moText("VECTOR") ) {
312  m_Type = MO_PARAM_VECTOR;
313  } else
314  if ( p_type == moText("INLET") ) {
315  m_Type = MO_PARAM_INLET;
316  } else
317  if ( p_type == moText("OUTLET") ) {
318  m_Type = MO_PARAM_OUTLET;
319  } else
320  if ( p_type == moText("UNDEFINED") ) {
321  m_Type = MO_PARAM_UNDEFINED;
322  }
323 
324  m_Index = -1;
325 
326  moParamInterpolation paraminter;
327  if (valid_interpolation) {
328  //cout << " moParamDefinition(..): function: " << p_interpolation << " duration: " << p_duration << endl;
329  if ( p_interpolation == "linear" ) {
330  //cout << " moParamDefinition(..): interpolation recognized: [" << p_interpolation << "]";
331  paraminter.SetInterpolation( MO_INTERPOLATION_LINEAR, p_duration );
332  //cout << " saved as:" << paraminter.GetFunctionToText() << endl;
333  m_Interpolation = paraminter;
334  } else if (p_interpolation==moText("easeinoutquad") ) {
335  paraminter.SetInterpolation( MO_INTERPOLATION_EASEINOUTQUAD, p_duration );
336  m_Interpolation = paraminter;
337  } else if (p_interpolation==moText("easeinoutsin") ) {
338  paraminter.SetInterpolation( MO_INTERPOLATION_EASEINOUTSIN, p_duration );
339  m_Interpolation = paraminter;
340  } else {
341  //cout << " moParamDefinition(..): interpolation unrecognized: [" << p_interpolation << "]" << endl;
342  paraminter.SetInterpolation( MO_INTERPOLATION_NONE, "0" );
343  m_Interpolation = paraminter;
344  //cout << "NO INTERPOLATION PARAMETERS: [" << p_interpolation << "] [" << p_duration << "]" << endl;
345  }
346  }// else cout << "INVALID type of parameter: " << p_type << endl;
347 
348  if ( p_optionsstr.Length() > 0 ) {
349  m_OptionsStr = p_optionsstr;
350  m_Options = p_optionsstr.Explode(moText(","));
351  }
352 
353 }
354 
356  const moText& p_type,
357  const moText& p_property,
358  const moText& p_group,
359  const moText& p_interpolation,
360  const moText& p_duration,
361  const moTextArray& p_Options ) {
362  (*this) = moParamDefinition(p_name,p_type,p_property,p_group,p_interpolation,p_duration);
363  m_Options = p_Options;
364 }
365 
366 
368 }
369 
371 {
372  m_Name = src.m_Name;
373  m_Type = src.m_Type;
374  m_Index = src.m_Index;
375  m_DefaultValue = src.m_DefaultValue;
376  m_Interpolation = src.m_Interpolation;
377  m_Property = src.m_Property;
378  m_Group = src.m_Group;
379  m_OptionsStr = src.m_OptionsStr;
380  m_Options = src.m_Options;
381  return *this;
382 }
383 
384 
385 moText
387  switch(m_Type) {
388  case MO_PARAM_UNDEFINED:
389  return moText("UNDEFINED");
390  break;
391  case MO_PARAM_ALPHA:
392  return moText("ALPHA");
393  break;
394  case MO_PARAM_COLOR:
395  return moText("COLOR");
396  break;
397  case MO_PARAM_BLENDING:
398  return moText("BLENDING");
399  break;
401  return moText("POLYGONMODE");
402  break;
403  case MO_PARAM_SYNC:
404  return moText("SYNC");
405  break;
406  case MO_PARAM_PHASE:
407  return moText("PHASE");
408  break;
409  case MO_PARAM_TEXT:
410  return moText("TEXT");
411  break;
412  case MO_PARAM_TEXTURE:
413  return moText("TEXTURE");
414  break;
416  return moText("TEXTUREFOLDER");
417  break;
418  case MO_PARAM_FONT:
419  return moText("FONT");
420  break;
421  case MO_PARAM_3DMODEL:
422  return moText("3DMODEL");
423  break;
425  return moText("MOLDEOOBJECT");
426  break;
427  case MO_PARAM_OBJECT:
428  return moText("OBJECT");
429  break;
430  case MO_PARAM_FILTER:
431  return moText("FILTER");
432  break;
433  case MO_PARAM_NUMERIC:
434  return moText("NUM");
435  break;
436  case MO_PARAM_FUNCTION:
437  return moText("FUNCTION");
438  break;
439  case MO_PARAM_TRANSLATEX:
440  return moText("TRANSLATEX");
441  break;
442  case MO_PARAM_TRANSLATEY:
443  return moText("TRANSLATEY");
444  break;
445  case MO_PARAM_TRANSLATEZ:
446  return moText("TRANSLATEZ");
447  break;
448  case MO_PARAM_SCALEX:
449  return moText("SCALEX");
450  break;
451  case MO_PARAM_SCALEY:
452  return moText("SCALEY");
453  break;
454  case MO_PARAM_SCALEZ:
455  return moText("SCALEZ");
456  break;
457  case MO_PARAM_ROTATEX:
458  return moText("ROTATEX");
459  break;
460  case MO_PARAM_ROTATEY:
461  return moText("ROTATEY");
462  break;
463  case MO_PARAM_ROTATEZ:
464  return moText("ROTATEZ");
465  break;
466  case MO_PARAM_SCRIPT:
467  return moText("SCRIPT");
468  break;
469  case MO_PARAM_SOUND:
470  return moText("SOUND");
471  break;
472  case MO_PARAM_VIDEO:
473  return moText("VIDEO");
474  break;
475  case MO_PARAM_COMPOSE:
476  return moText("COMPOSE");
477  break;
478  case MO_PARAM_VECTOR:
479  return moText("VECTOR");
480  break;
481  case MO_PARAM_INLET:
482  return moText("INLET");
483  break;
484  case MO_PARAM_OUTLET:
485  return moText("OUTLET");
486  break;
487  case MO_PARAM_FILE:
488  return moText("FILE");
489  break;
490  default:
491  break;
492  }
493  return moText("UNDEFINED");
494 }
495 
496 
497 void
499 
500  m_Type = p_ParamType;
501 
502 }
503 
504 void
505 moParamDefinition::SetDefault( const moValue& p_defaultvalue ) {
506 
507  moValue Default = p_defaultvalue;
508  m_DefaultValue = p_defaultvalue;
509 
510  if ( Default.GetSubValue().GetType()==MO_VALUE_UNDEFINED ) {
511  switch ( GetType() ) {
512 
513  case MO_PARAM_TEXT:
514  case MO_PARAM_TEXTURE:
516  case MO_PARAM_FILTER:
517  case MO_PARAM_VIDEO:
518  case MO_PARAM_SOUND:
519  case MO_PARAM_FILE:
520  case MO_PARAM_SCRIPT:
521  case MO_PARAM_OBJECT:
522  case MO_PARAM_3DMODEL:
523  m_DefaultValue = moValue( "", "TXT" );
524  break;
525 
528  m_DefaultValue.RemoveSubValues();
529  break;
530 
531  case MO_PARAM_INLET:
532  m_DefaultValue = moValue( "VARIABLE1", "TXT", "NUMERIC", "TXT" );
533  break;
534 
535  case MO_PARAM_FONT:
536  m_DefaultValue = moValue( "", "TXT", "", "TXT", "", "TXT" );
537  break;
538 
539  case MO_PARAM_PHASE:
540  case MO_PARAM_ROTATEX:
541  case MO_PARAM_ROTATEY:
542  case MO_PARAM_ROTATEZ:
543  case MO_PARAM_TRANSLATEX:
544  case MO_PARAM_TRANSLATEY:
545  case MO_PARAM_TRANSLATEZ:
546  case MO_PARAM_FUNCTION:
547  m_DefaultValue = moValue( "0.0", "FUNCTION" ).Ref();
548  break;
549 
550  case MO_PARAM_ALPHA:
551  case MO_PARAM_SYNC:
552  case MO_PARAM_SCALEX:
553  case MO_PARAM_SCALEY:
554  case MO_PARAM_SCALEZ:
555  m_DefaultValue = moValue( "1.0", "FUNCTION" ).Ref();
556  break;
557 
559  case MO_PARAM_BLENDING:
560  m_DefaultValue = moValue( "0", "INT" );
561  break;
562  case MO_PARAM_COLOR:
563  m_DefaultValue = moValue( "1.0", "FUNCTION","1.0", "FUNCTION","1.0", "FUNCTION","1.0", "FUNCTION" );
564  break;
565  case MO_PARAM_COMPOSE:
566  m_DefaultValue = moValue( "composed by", "TXT","1.0", "FUNCTION","<nada></nada>", "XML","12345", "INT" );
567  break;
568  case MO_PARAM_VECTOR:
569  m_DefaultValue = moValue( "1.0", "FUNCTION","2.0", "FUNCTION","3.0", "FUNCTION","4.0", "FUNCTION" );
570  break;
571  case MO_PARAM_NUMERIC:
572  m_DefaultValue = moValue( "0", "NUM" );
573  break;
574  case MO_PARAM_UNDEFINED:
575  m_DefaultValue = moValue( "INVALID", MO_VALUE_UNDEFINED );
576  break;
577  default:
578  break;
579  };
580  }
581 
582 }
583 
584 
585 void
586 moParamDefinition::SetOptions( const moTextArray& p_options ) {
587  m_Options = p_options;
588  m_OptionsStr = "";
589  moText comma = "";
590  for(int i=0; i<(int)m_Options.Count(); i++ ) {
591  m_OptionsStr+= comma + m_Options[i];
592  comma = ",";
593  }
594 }
595 
596 void
597 moParamDefinition::SetOptions( const moText& p_OptionsStr ) {
598  m_OptionsStr = p_OptionsStr;
599  m_Options = m_OptionsStr.Explode(moText(","));
600 }
601 
602 
603 
604 const moText&
606  moText fieldseparation = ",";
607 
608  m_FullJSON = "{";
609  m_FullJSON+= "'name': '"+ GetName()+"'";
610  m_FullJSON+= fieldseparation + "'t': '"+ GetTypeStr()+"'";
611  m_FullJSON+= fieldseparation + "'id': '"+ IntToStr(GetIndex())+"'";
612  m_FullJSON+= fieldseparation + "'pr': '"+ GetProperty()+"'";
613  m_FullJSON+= fieldseparation + "'gr': '"+ GetGroup()+"'";
614  m_FullJSON+= fieldseparation + "'it': "+ GetInterpolation().ToJSON();
615  m_FullJSON+= fieldseparation + "'op': [";
616  fieldseparation = "";
617  for(int i=0; i<(int)m_Options.Count(); i++ ) {
618  moText ostr( m_Options[ i ] );
619  ostr.Replace( "'","&apos;" );
620  //std::string option_str = (char*)m_Options[ i ];
621  //option_str.replace( option_str.begin(), option_str.end(), "\'", "&apos;" );
622  //option_str.replace( option_str.begin(), option_str.end(), "\"", "&quot;" );
623  //moText ostr( option_str.c_str());
624  m_FullJSON+= fieldseparation + "'"+ostr+"'";
625  fieldseparation = ",";
626  }
627  m_FullJSON+= "]";
628 
629  m_FullJSON+= "}";
630 
631  return m_FullJSON;
632 }
633 
634 const moText&
636  moText fieldseparation = " ";
637 
638  m_FullXML = "<moParamDefinition ";
639  m_FullXML+= "name='"+ GetName()+"'";
640  m_FullXML+= fieldseparation + "type='"+ GetTypeStr()+"'";
641  m_FullXML+= fieldseparation + "index='"+ IntToStr(GetIndex())+"'";
642  m_FullXML+= fieldseparation + "property='"+ GetProperty()+"'";
643  m_FullXML+= fieldseparation + "options='"+ GetOptionsStr()+"'";
644  m_FullXML+= fieldseparation + "group='"+ GetGroup()+"'";
645  m_FullXML+= fieldseparation + "interpolation='"+ GetInterpolation().GetFunctionToText()+"'";
646  m_FullXML+= fieldseparation + "duration='"+ IntToStr(GetInterpolation().GetDuration())+"' >";
647  m_FullXML+= "</moParamDefinition>";
648 
649  return m_FullXML;
650 }
651 
652 int
653 moParamDefinition::Set( const moText& p_XmlText ) {
654  TiXmlDocument m_XMLDoc;
655  //TiXmlHandle xmlHandle( &m_XMLDoc );
656  TiXmlEncoding xencoding = TIXML_ENCODING_LEGACY;
657 
658  m_XMLDoc.Parse((const char*) p_XmlText, 0, xencoding );
660  //TiXmlElement* rootKey = m_XMLDoc.FirstChildElement( "D" );
661  TiXmlElement* definitionNode = m_XMLDoc.FirstChildElement("moParamDefinition");
662 
663  //if (rootKey) {
664 
665  //TiXmlElement* sceneStateNode = rootKey->FirstChildElement("moSceneState");
666  if (definitionNode) {
667  m_Name = moText( definitionNode->Attribute("name") );
668  m_Type = ParamTypeFromStr( moText(definitionNode->Attribute("type")) );
669  m_Index = atoi(moText( definitionNode->Attribute("index") ));
670  m_Property = moText( definitionNode->Attribute("property") );
671  m_OptionsStr = moText( definitionNode->Attribute("options") );
672  m_Group = moText( definitionNode->Attribute("group") );
673  m_Interpolation.SetInterpolation( moText( definitionNode->Attribute("interpolation")), moText( definitionNode->Attribute("duration")) );
674  return 0;
675  } else moDebugManager::Log( "No XML moEffectState in: " + p_XmlText );
676 
677  //} else moDebugManager::Error();
678  return -1;
679 }
680 
681 //================================================================
682 // moParamInterpolation
683 //================================================================
684 
685 
687  m_bIsOn(false), m_Duration(0), m_Function(MO_INTERPOLATION_NONE)
688 {
689 }
690 
692  *this = src;
693 }
694 
696 
697 }
698 
701  m_bIsOn = src.m_bIsOn;
702  m_DataIn = src.m_DataIn;
703  m_DataOut = src.m_DataOut;
704  m_DataInterpolated = src.m_DataInterpolated;
705 
706  m_Timer = (moTimer&)src.m_Timer;
707  m_Duration = src.m_Duration;
708  m_Function = src.m_Function;
709 
710  return(*this);
711 }
712 
713 void
714 moParamInterpolation::StartInterpolation( const moData& p_data_in, const moData& p_data_out ) {
715  m_DataIn = p_data_in;
716  m_DataOut = p_data_out;
717  m_DataIn.Eval();
718  m_DataOut.Eval();
719  m_DataInterpolated = p_data_in;
720  m_Timer.Start();
721 }
722 
723 void
724 moParamInterpolation::StartInterpolation( const moValue& p_value_in, const moValue& p_value_out ) {
725  m_ValueIn = p_value_in;
726  m_ValueOut = p_value_out;
727  //m_ValueIn.Eval();
729  m_ValueInterpolated = m_ValueIn;
730  m_Timer.Start();
731 }
732 
733 void
735  m_Duration = p_fun_duration;
736 }
737 
738 MOlong
740  return m_Duration;
741 }
742 
743 void
745  m_Timer.Stop();
746 }
747 
748 void
750  SetInterpolation( p_interpol_fun, IntToStr(GetDuration()) );
751 }
752 
753 
754 void
756  const moText& p_fun_duration,
757  const moText& p_fun_expression) {
758  if ( p_interpol_fun == "linear" ) {
759  SetInterpolation( MO_INTERPOLATION_LINEAR, p_fun_duration, p_fun_expression );
760 
761  } else if (p_interpol_fun==moText("ease") ) {
762  SetInterpolation( MO_INTERPOLATION_EASE, p_fun_duration, p_fun_expression );
763 
764  } else if (p_interpol_fun==moText("easein") ) {
765  SetInterpolation( MO_INTERPOLATION_EASE, p_fun_duration, p_fun_expression );
766 
767  } else if (p_interpol_fun==moText("easeout") ) {
768  SetInterpolation( MO_INTERPOLATION_EASE, p_fun_duration, p_fun_expression );
769 
770  } else if (p_interpol_fun==moText("easeinout") ) {
771  SetInterpolation( MO_INTERPOLATION_EASEINOUT, p_fun_duration, p_fun_expression );
772 
773  } else if (p_interpol_fun==moText("stepstart") ) {
774  SetInterpolation( MO_INTERPOLATION_STEPSTART, p_fun_duration, p_fun_expression );
775 
776  } else if (p_interpol_fun==moText("stepend") ) {
777  SetInterpolation( MO_INTERPOLATION_STEPEND, p_fun_duration, p_fun_expression );
778 
779  } else if (p_interpol_fun==moText("expression") ) {
780  SetInterpolation( MO_INTERPOLATION_EXPRESSION, p_fun_duration, p_fun_expression );
781 
782  } else if (p_interpol_fun==moText("easeinoutquad") ) {
783  SetInterpolation( MO_INTERPOLATION_EASEINOUTQUAD, p_fun_duration, p_fun_expression );
784 
785  } else if (p_interpol_fun==moText("easeinoutsin") ) {
786  SetInterpolation( MO_INTERPOLATION_EASEINOUTSIN, p_fun_duration, p_fun_expression );
787 
788  } else if (p_interpol_fun==moText("easeinoutcubic") ) {
789  SetInterpolation( MO_INTERPOLATION_EASEINOUTCUBIC, p_fun_duration, p_fun_expression );
790 
791  } else {
792  SetInterpolation( MO_INTERPOLATION_NONE, "0", p_fun_expression );
793  }
794 
795 }
796 
797 
798 moText
800  switch(m_Function) {
802  return moText("none");
803  break;
805  return moText("linear");
806  break;
808  return moText("ease");
809  break;
811  return moText("easein");
812  break;
814  return moText("easeout");
815  break;
817  return moText("easeinout");
818  break;
820  return moText("cubicbezer");
821  break;
823  return moText("easeinoutcubic");
824  break;
826  return moText("stepstart");
827  break;
829  return moText("stepend");
830  break;
832  return moText("easeinoutquad");
833  break;
835  return moText("expression");
836  break;
838  return moText("easeinoutsin");
839  break;
840  default:
841  return moText("");
842  break;
843  }
844  return moText("");
845 
846 }
847 
848 void
850  const moText& p_fun_duration,
851  const moText& p_fun_expression) {
852 
853  if (p_fun_expression!=moText("")) {
854  cout << "p_fun_expression: " << p_fun_expression << endl;
855  }
856 
857  if (p_fun_duration!="") {
858  moParserFunction mp_dur;
859  mp_dur.Init( p_fun_duration );
860  m_Duration = mp_dur.Eval();
861  }
862  /* moParserFunction mp_exp;*/
863  //moParserFunction* mp_exp = new moParserFunction();
864  /*mp_exp.Init( p_fun_expression );*/
865  //setting
866  m_Function = p_interpol_fun;
867 // cout << "SetInterpolation: settting duration: " << p_fun_duration << " is finally m_Duration:" << m_Duration << endl;
868 // cout << " p_fun_expression:" << p_fun_expression << endl;
869  Activate();
870 // cout << "SetInterpolation: Activated: " << IsOn() << endl;
871 }
872 
873 bool
875  return m_bIsOn;
876 }
877 
878 void
880  m_bIsOn = true;
881 }
882 
883 
884 const moTimer&
886  return m_Timer;
887 }
888 
889 
890 
891 /*
892 
893 Easing functions in c++
894 
895 http://www.gizma.com/easing/#l
896 
897 */
898 
899 double moParamInterpolation::bezier_x( double t, double Ax, double Bx, double Cx) {
900  return t * (Cx + t * (Bx + t * Ax));
901 }
902 
903 double moParamInterpolation::bezier_y( double t, double Ay, double By, double Cy) {
904  return t * (Cy + t * (By + t * Ay));
905 }
906 
907 double moParamInterpolation::bezier_x_der( double t, double Ax, double Bx, double Cx) {
908  return Cx + t * (2*Bx + 3*Ax * t);
909 }
910 
911 double moParamInterpolation::find_x_for( double t, double Ax, double Bx, double Cx ) {
912 
913  double x=t, i=0, z;
914 
915  while (i < 5) { // making 5 iterations max
916  z = bezier_x(x, Ax, Bx, Cx) - t;
917 
918  if ( fabs(z) < 0.001) break; // if already got close enough
919 
920  x = x - z/bezier_x_der(x, Ax, Bx, Cx);
921  i++;
922  }
923 //xx
924  return x;
925 }
926 
927 double moParamInterpolation::cubic_bezier( double t, double p1, double p2, double p3, double p4 ) {
928 
929  double Cx = 3 * p1;
930  double Bx = 3 * (p3 - p1) - Cx;
931  double Ax = 1 - Cx - Bx;
932 
933  double Cy = 3 * p2;
934  double By = 3 * (p4 - p2) - Cy;
935  double Ay = 1 - Cy - By;
936 
937  return bezier_y( find_x_for( t, Ax, Bx, Cx ), Ay, By, Cy );
938 }
939 
940 moData*
942 
943  if (m_Function==MO_INTERPOLATION_NONE) return &pParamData;
944 
945  //FIRST treat the UNDEFINED... starting
946  if ( m_DataIn.Type() == MO_DATA_UNDEFINED
947  || m_DataOut.Type() == MO_DATA_UNDEFINED ) {
949  //no in or out are set...
951  //set them...
952  StartInterpolation( pParamData, pParamData );
953  } else {
954 
955  //RUNNING; NEW DATA COMING!!
956 
957  //it target is different just set with it the new Out
958  if ( m_DataOut.ToText() != pParamData.ToText() ) {
960  StartInterpolation( m_DataInterpolated, pParamData );
962  }
963 
964  m_DataIn.Eval();//so it records last val
965  m_DataOut.Eval();//so it records his last val
966  //cout << "m_DataIn: " << m_DataIn.LastEval() << " --> TO --> m_DataOut: " << m_DataOut.LastEval() << endl;
967 
968  double RDouble;
969  //double differential = 1.0f* m_Timer.Duration() / (1.0f*m_Duration);
970 
971  //process here with some function
972  double c = (double) ( m_DataOut.LastEval() - m_DataIn.LastEval() );
973  double t = (double) m_Timer.Duration();
974  double d = (double) m_Duration;
975  double b = (double) m_DataIn.LastEval();
976 
977 
978 
979  if (d>=0.0f && t<=d && t>=0.0f) {
980  switch(m_Function) {
981 
982  //cases based on http://www.gizma.com/easing/
983 
985  RDouble = c * t/d + b;
986  break;
987 
989  RDouble = c* cubic_bezier( t/d, 0.42, 0.0, 0.58, 1.0 ) + b;
990  break;
991 
993  RDouble = -c/2 * ( moMathd::Cos( moMathd::PI*t/d) - 1) + b;
994  break;
996  break;
997  default:
998  cout << "moParamInterpolation::InterpolateData > nterpolation function doesn't exists for " << m_Function << endl;
999  break;
1000  }
1001  } else {
1002  RDouble = m_DataOut.LastEval();
1003  }
1004  m_DataInterpolated.SetDouble(RDouble);
1005 
1006  }
1007 
1008  return &m_DataInterpolated;
1009 
1010 }
1011 
1012 moValue*
1014 
1015  if (m_Function==MO_INTERPOLATION_NONE) return &pParamValue;
1016 
1017  return &m_ValueInterpolated;
1018 
1019 }
1020 
1021 
1022 
1023 //================================================================
1024 // moParam
1025 //================================================================
1026 
1027 
1029  m_CurrentIndexValue = 0;
1030  m_bExternDataUpdated = false;
1031  m_pExternData = NULL;
1032 }
1033 
1035  *this = src;
1036 }
1037 
1038 moParam::moParam( moParamDefinition &p_paramdefinition) {
1039  m_CurrentIndexValue = 0;
1040  m_bExternDataUpdated = false;
1041  m_pExternData = NULL;
1042  m_ParamDefinition = p_paramdefinition;
1043 
1044 }
1045 
1047 
1048 }
1049 
1051  m_bExternDataUpdated = src.m_bExternDataUpdated;
1052  m_pExternData = src.m_pExternData;
1053  m_ParamDefinition = src.m_ParamDefinition;
1054  m_Values = src.m_Values;
1055  m_CurrentIndexValue = src.m_CurrentIndexValue;
1056  return *this;
1057 }
1058 
1059 moValues&
1061  return m_Values;
1062 }
1063 
1064 MOuint
1066  return m_Values.Count();
1067 }
1068 
1069 
1070 void
1072  m_Values.Add( value );
1073 }
1074 
1075 
1076 void
1078  m_Values.Remove(i);
1079 }
1080 
1082 
1083  //atencion: siempre setear el tipo despues de pasar el valor del texto...
1084  if (this->GetValuesCount()==0) {
1085  moValue xvalue;
1086  moValueBase valuebase;
1087 
1088  switch( (int)m_ParamDefinition.GetType() ) {
1089  case MO_PARAM_COLOR:
1090  valuebase.SetText( "1.0" );
1091  valuebase.SetType( MO_VALUE_FUNCTION );
1092  xvalue.AddSubValue( valuebase );
1093  xvalue.AddSubValue( valuebase );
1094  xvalue.AddSubValue( valuebase );
1095  xvalue.AddSubValue( valuebase );
1096  break;
1097  case MO_PARAM_BLENDING:
1098  case MO_PARAM_POLYGONMODE:
1099  valuebase.SetText( "0" );
1100  valuebase.SetInt(0);
1101  valuebase.SetType( MO_VALUE_NUM );
1102  xvalue.AddSubValue( valuebase );
1103  break;
1104  case MO_PARAM_ALPHA:
1105  case MO_PARAM_SYNC:
1106  case MO_PARAM_SCALEX:
1107  case MO_PARAM_SCALEY:
1108  case MO_PARAM_SCALEZ:
1109  valuebase.SetText( "1.0" );
1110  valuebase.SetType( MO_VALUE_FUNCTION );
1111  xvalue.AddSubValue( valuebase );
1112  break;
1113 
1114  case MO_PARAM_FUNCTION:
1115  case MO_PARAM_PHASE:
1116  case MO_PARAM_TRANSLATEX:
1117  case MO_PARAM_TRANSLATEY:
1118  case MO_PARAM_TRANSLATEZ:
1119  case MO_PARAM_ROTATEX:
1120  case MO_PARAM_ROTATEY:
1121  case MO_PARAM_ROTATEZ:
1122  valuebase.SetText( "0.0" );
1123  valuebase.SetType( MO_VALUE_FUNCTION );
1124  xvalue.AddSubValue( valuebase );
1125  break;
1126 
1127  case MO_PARAM_TEXTURE:
1128  valuebase.SetText( "default" );
1129  valuebase.SetType( MO_VALUE_TXT );
1130  xvalue.AddSubValue( valuebase );
1131  break;
1132  case MO_PARAM_3DMODEL:
1133  case MO_PARAM_OBJECT:
1134  case MO_PARAM_VIDEO:
1136  case MO_PARAM_SOUND:
1137  case MO_PARAM_SCRIPT:
1138  case MO_PARAM_TEXT:
1139  if ( GetParamDefinition().GetName()=="effect"
1140  ||
1141  GetParamDefinition().GetName()=="preeffect"
1142  ||
1143  GetParamDefinition().GetName()=="posteffect"
1144  ||
1145  GetParamDefinition().GetName()=="mastereffect"
1146  ||
1147  GetParamDefinition().GetName()=="devices"
1148  ||
1149  GetParamDefinition().GetName()=="resources" ) {
1150  return;
1151  }
1152  valuebase.SetText( "" );
1153  valuebase.SetType( MO_VALUE_TXT );
1154  xvalue.AddSubValue( valuebase );
1155  break;
1157  return;
1158  break;
1159  case MO_PARAM_FONT:
1160  valuebase.SetText( "fonts/Tuffy.ttf" );
1161  valuebase.SetType( MO_VALUE_TXT );
1162  xvalue.AddSubValue( valuebase );
1163  break;
1164  case MO_PARAM_FILTER:
1165  valuebase.SetText( "" );
1166  valuebase.SetType( MO_VALUE_TXT );
1167  xvalue.AddSubValue( valuebase );
1168  xvalue.AddSubValue( valuebase );
1169  xvalue.AddSubValue( valuebase );
1170  xvalue.AddSubValue( valuebase );
1171  break;
1172  case MO_PARAM_INLET:
1173  case MO_PARAM_OUTLET:
1174  //valuebase.SetText( "" );
1175  //valuebase.SetType( MO_VALUE_TXT );
1176  //xvalue.AddSubValue( valuebase );
1177  break;
1178  case MO_PARAM_NUMERIC:
1179  valuebase.SetText( "" );
1180  valuebase.SetType( MO_VALUE_NUM );
1181  valuebase.SetInt(0);
1182  break;
1183  case MO_PARAM_COMPOSE:
1184  valuebase.SetText( "" );
1185  valuebase.SetType( MO_VALUE_TXT );
1186  xvalue.AddSubValue( valuebase );
1187  xvalue.AddSubValue( valuebase );
1188  xvalue.AddSubValue( valuebase );
1189  break;
1190  case MO_PARAM_VECTOR:
1191  valuebase.SetText( "0.0" );
1192  valuebase.SetType( MO_VALUE_NUM_FLOAT );
1193  xvalue.AddSubValue( valuebase );
1194  xvalue.AddSubValue( valuebase );
1195  break;
1196 
1197  }
1198 
1199  AddValue(xvalue);
1200  }
1201 }
1202 
1203 moValue&
1205 //TODO: apply interpolation if needed
1206  if ( i == -1 )
1207  i = m_CurrentIndexValue;
1208 
1209  if (0<=i && i<(MOint)m_Values.Count() )
1210  return m_Values[i];
1211  else
1212  return m_Values[m_CurrentIndexValue];
1213 }
1214 
1215 void
1216 moParam::SetIndexValue( int indexvalue ) {
1217 
1218  if (0<=indexvalue && indexvalue<(MOint)m_Values.Count() ) {
1219  m_CurrentIndexValue = indexvalue;
1220  m_bExternDataUpdated = false;
1221  }
1222 
1223 }
1224 
1225 
1226 int
1228 
1229  return m_CurrentIndexValue;
1230 
1231 }
1232 
1233 void
1235  if ( m_Values.Count() > 0 ) {
1236  m_bExternDataUpdated = false;
1237  if ( m_CurrentIndexValue < ((MOint)m_Values.Count()-1) ) {
1238  m_CurrentIndexValue++;
1239  }
1240  } else m_CurrentIndexValue = -1;
1241 }
1242 
1243 void
1245  if ( m_Values.Count() > 0 ) {
1246  m_bExternDataUpdated = false;
1247  if ( m_CurrentIndexValue > 0 ) {
1248  m_CurrentIndexValue--;
1249  }
1250  } else m_CurrentIndexValue = -1;
1251 }
1252 
1253 void
1255  if (m_Values.Count() > 0) {
1256  m_bExternDataUpdated = false;
1257  m_CurrentIndexValue = 0;
1258  } else m_CurrentIndexValue = -1;
1259 }
1260 
1261 void
1263  m_ParamDefinition = p_paramdefinition;
1264 }
1265 
1266 
1269 
1270  return m_ParamDefinition;
1271 
1272 }
1273 
1274 moParam*
1276  return (this);
1277 }
1278 
1279 void
1281  if (m_pExternData)
1282  m_bExternDataUpdated = true;
1283 }
1284 
1285 moData*
1287 
1288  moData* pReturnData = NULL;
1289 
1291  if (m_pExternData && m_bExternDataUpdated) {
1292  pReturnData = m_pExternData;
1294  if (GetParamDefinition().GetName()=="control_roll_angle" ) {
1296  }
1297  } else {
1298  //only work for single data values: FUNCTION > float evaluation
1299  pReturnData = GetValue().GetSubValue().GetData();
1300  }
1301 
1303  if ( m_ParamDefinition.GetInterpolation().IsOn() && pReturnData ) {
1304 
1306  pReturnData->Eval();
1308  pReturnData = m_ParamDefinition.GetInterpolation().InterpolateData( *pReturnData );
1309  }
1310 
1311  return pReturnData;
1312 }
1313 
1314 void
1315 moParam::SetExternData( moData* p_pExternData) {
1316  m_pExternData = p_pExternData;
1317 }
1318 
1319 bool
1321  unsigned int v = 0, s = 0;
1322  bool result = true;
1323  if ( p_NewType == MO_PARAM_UNDEFINED ) {
1324 
1326  result = true;
1327 
1328  }
1329  else
1331  if (p_NewType==MO_PARAM_FUNCTION) {
1332 
1333  switch( m_ParamDefinition.GetType() ) {
1334 
1335  case MO_PARAM_NUMERIC:
1336  m_ParamDefinition.SetType(p_NewType);
1337 
1338  for( v = 0; v<this->m_Values.Count() ; v++ ) {
1339 
1340  moValue& pValue( this->m_Values.GetRef( v ) );
1341  for( s = 0; s< pValue.GetSubValueCount(); s++ ) {
1342  moValueBase& vBase( pValue.GetSubValue(s) );
1343  result = result && vBase.FixType( MO_VALUE_FUNCTION );
1344  }
1345 
1346  }
1347  break;
1348 
1349  default:
1350  break;
1351 
1352  }
1353  }
1354 
1355 
1356  return result;
1357 }
1358 
1359 bool
1360 moParam::FixOptions( moTextArray& p_NewOptions ) {
1361 
1362  m_ParamDefinition.SetOptions( p_NewOptions );
1363  return m_ParamDefinition.GetOptions().Count()==p_NewOptions.Count();
1364 }
1365 
1366 
1367 const moText&
1369 
1370  moText fieldSeparation = ",";
1371  m_fullJSON = "{";
1372  m_fullJSON+= "'pdef': " + GetParamDefinition().ToJSON();
1373  m_fullJSON+= fieldSeparation + "'pid': " + IntToStr(this->GetIndexValue());
1374  m_fullJSON+= fieldSeparation + "'pvals': [";
1375 
1376  fieldSeparation = "";
1377  for( int vi = 0; vi < (int)m_Values.Count(); vi++ ) {
1378  m_fullJSON+= fieldSeparation + m_Values[vi].ToJSON();
1379  fieldSeparation = ",";
1380  }
1381  m_fullJSON+= "]";
1382  m_fullJSON+= "}";
1383  return m_fullJSON;
1384 
1385 }
1386 
1387 
1388 
value type: TXT or LNK
Definition: moParam.h:69
double bezier_y(double t, double Ay, double By, double Cy)
Definition: moParam.cpp:903
Valor de un Parámetro.
Definition: moValue.h:501
bool FixType(moParamType m_NewType=MO_PARAM_UNDEFINED)
Definition: moParam.cpp:1320
value type: TXT or LNK
Definition: moParam.h:74
moParamInterpolationFunction
Definition: moParam.h:159
value type: NUM
Definition: moParam.h:58
void SetText(moText ptext)
Definition: moValue.cpp:158
MOdouble Eval()
Definition: moValue.cpp:424
moTextArray & GetOptions()
Definition: moParam.h:317
void SetOptions(const moTextArray &p_options)
Definition: moParam.cpp:586
value type: NUM or FUNCTION
Definition: moParam.h:59
double cubic_bezier(double t, double p1, double p2, double p3, double p4)
Definition: moParam.cpp:927
moParamType
Definition: moParam.h:40
moTextArray Explode(char *separator) const
Definition: moText.cpp:655
virtual void Start()
Inicia el temporizador.
Definition: moTimer.cpp:196
void SetIndexValue(int indexvalue)
Definition: moParam.cpp:1216
moValueBase & GetSubValue(MOint p_indexsubvalue=0)
Definition: moValue.h:539
virtual long Duration()
Devuelve el valor del reloj del temporizador.
Definition: moTimer.cpp:211
moValue & Ref()
Definition: moValue.h:548
value type: NUM or FUNCTION
Definition: moParam.h:66
value type: NUM or FUNCTION
Definition: moParam.h:47
virtual ~moParam()
Definition: moParam.cpp:1046
void SetDouble(MOdouble pdouble)
Definition: moValue.cpp:172
value type: NUM or FUNCTION
Definition: moParam.h:65
value type: TXT or LNK
Definition: moParam.h:56
MOdouble LastEval() const
Definition: moValue.cpp:449
const moText & GetProperty() const
Definition: moParam.h:291
moText ToText() const
Definition: moValue.cpp:707
value type: NUM or FUNCTION
Definition: moParam.h:60
MOint GetIndex() const
Definition: moParam.h:284
void SetParamDefinition(moParamDefinition &p_paramdefinition)
Definition: moParam.cpp:1262
value type: NUM or FUNCTION
Definition: moParam.h:68
value type: NUM or FUNCTION
Definition: moParam.h:64
void StartInterpolation(const moData &p_data_in, const moData &p_data_out)
Definition: moParam.cpp:714
const moText & ToJSON()
Definition: moParam.cpp:605
void SetInterpolation(const moText &p_interpol_fun, const moText &p_fun_duration=moText(1000), const moText &p_fun_expression=moText())
Definition: moParam.cpp:755
const moText & GetGroup() const
Definition: moParam.h:299
void Replace(const moText0 &target, const moText0 &replacement)
Definition: moText.cpp:729
value type: NUM or FUNCTION
Definition: moParam.h:46
void SetType(moParamType p_paramType)
Definition: moParam.cpp:498
moParam * GetPtr()
Definition: moParam.cpp:1275
value type: TXT or LNK, or XML
Definition: moParam.h:54
virtual ~moParamDefinition()
Definition: moParam.cpp:367
moDataType Type() const
Definition: moValue.cpp:940
void AddSubValue(const moText &strvalue, moValueType p_valuetype)
Definition: moValue.cpp:1707
virtual ~moParamInterpolation()
Definition: moParam.cpp:695
value type: TXT or LNK
Definition: moParam.h:70
int Set(const moText &p_XmlText)
Definition: moParam.cpp:653
void SetExternData(moData *p_pExternData)
Definition: moParam.cpp:1315
bool IsValid() const
Definition: moParam.cpp:175
const moText & GetName() const
Definition: moParam.h:266
void SetDuration(MOlong p_fun_duration)
Definition: moParam.cpp:734
value type: TXT or LNK, or XML
Definition: moParam.h:55
value type: TXT or LNK
Definition: moParam.h:57
void StopInterpolation()
Definition: moParam.cpp:744
clase de para manejar textos
Definition: moText.h:75
moValue * InterpolateValue(moValue &pParamValue)
Definition: moParam.cpp:1013
bool FixType(moValueType p_ValueType)
Definition: moValue.cpp:1461
const moText & ToJSON()
Definition: moParam.cpp:1368
#define MOlong
Definition: moTypes.h:391
void Stop()
Detiene el temporizador.
Definition: moTimer.h:219
int GetIndexValue() const
Definition: moParam.cpp:1227
void SetInterpolationFunction(const moText &p_interpol_fun)
Definition: moParam.cpp:749
vector of one type
Definition: moParam.h:72
virtual MOboolean Init(const moText &p_Expression, moMoldeoObject *p_pMOB=NULL)
double find_x_for(double t, double Ax, double Bx, double Cx)
Definition: moParam.cpp:911
static void Log(moText p_text)
Escribe un mensaje en el archivo de registro (log)
void SetDefaultValue()
Definition: moParam.cpp:1081
moText0 moText
Definition: moText.h:291
any composition of types
Definition: moParam.h:71
#define MOint
Definition: moTypes.h:388
void SetInt(MOint pint)
Definition: moValue.cpp:180
value type: TXT or LNK
Definition: moParam.h:49
void SetType(moValueType p_type)
Fija el tipo de valor, esta función se implementa sólo como atajo a ciertos datos de la definición ...
Definition: moValue.cpp:1457
MOlong GetDuration()
Definition: moParam.cpp:739
value type: NUM[4] or FUNCTION[4] or
Definition: moParam.h:43
double bezier_x_der(double t, double Ax, double Bx, double Cx)
Definition: moParam.cpp:907
static moParamType ParamTypeFromStr(const moText &p_type)
Definition: moParam.cpp:66
void DeleteValue(MOint i)
Definition: moParam.cpp:1077
void RemoveSubValues(bool leavefirstone=true)
Definition: moValue.cpp:1691
void PrevValue()
Definition: moParam.cpp:1244
bool IsOn() const
Definition: moParam.cpp:874
MOuint Length() const
Definition: moText.cpp:347
moParam & operator=(const moParam &src)
Definition: moParam.cpp:1050
moParamInterpolation & operator=(const moParamInterpolation &src)
Definition: moParam.cpp:700
moParamInterpolation & GetInterpolation()
Definition: moParam.h:329
bool FixOptions(moTextArray &m_NewOptions)
Definition: moParam.cpp:1360
moParamType GetType() const
Definition: moParam.h:277
value type: TXT or LNK
Definition: moParam.h:50
moData * InterpolateData(moData &pParamData)
Definition: moParam.cpp:941
const moTimer & GetTimer() const
Definition: moParam.cpp:885
value type: NUM or FUNCTION
Definition: moParam.h:42
static double Cos(doublefValue)
Definition: moMath.h:160
value type: NUM or FUNCTION
Definition: moParam.h:63
value type: NUM or FUNCTION
Definition: moParam.h:61
moValues & GetValues()
Definition: moParam.cpp:1060
const moText & ToXML()
Definition: moParam.cpp:635
virtual double Eval()
void AddValue(moValue &value)
Definition: moParam.cpp:1071
moValue & GetValue(MOint i=-1)
Definition: moParam.cpp:1204
value type: NUM or FUNCTION
Definition: moParam.h:67
moDefineDynamicArray(moParamDefinitions) moDefineDynamicArray(moParams) moDefineDynamicArray(moParamIndexes) moParamDefinition
Definition: moParam.cpp:37
value type: NUM or TEXT ( 0:FILL 1:LINE 2:POINT)
Definition: moParam.h:45
void Update()
Definition: moParam.cpp:1280
Clase para el control de un temporizador (relativo) con identificación
Definition: moTimer.h:321
moText GetFunctionToText()
Definition: moParam.cpp:799
value type: TXT or LNK
Definition: moParam.h:51
moText GetTypeStr() const
Definition: moParam.cpp:386
moParamDefinition & GetParamDefinition()
Definition: moParam.cpp:1268
const moText & ToJSON()
Definition: moParam.h:209
void SetDefault(const moValue &p_defaultvalue)
Definition: moParam.cpp:505
#define MOuint
Definition: moTypes.h:387
LIBMOLDEO_API moText0 IntToStr(int a)
Definition: moText.cpp:1070
static const double PI
Definition: moMath.h:826
moData * GetData()
Definition: moValue.cpp:945
value type: TXT or LNK
Definition: moParam.h:52
void FirstValue()
Definition: moParam.cpp:1254
moData * GetData()
Definition: moParam.cpp:1286
void NextValue()
Definition: moParam.cpp:1234
MOuint GetValuesCount() const
Definition: moParam.cpp:1065
value type: TXT or LNK
Definition: moParam.h:73
double bezier_x(double t, double Ax, double Bx, double Cx)
Definition: moParam.cpp:899
moValueType GetType() const
Devuelve el tipo de valor ,esta función se implementa sólo como atajo a ciertos datos de la definición ...
Definition: moValue.cpp:1498
value type: TXT or LNK
Definition: moParam.h:53
const moText & GetOptionsStr()
Definition: moParam.h:321
value type: NUM or FUNCTION
Definition: moParam.h:62
value type: NUM or TEXT (to script or shader for chroma???)
Definition: moParam.h:44
value type: TXT or LNK
Definition: moParam.h:48
moParamDefinition & operator=(const moParamDefinition &src)
Definition: moParam.cpp:370