GlsAnimation Library  1.0.6
Provides classes and functions to support animating GL Studio objects programmatically or with script files
gls_animation.cpp
Go to the documentation of this file.
1 
41 #include "gls_animation.h"
42 
43 #ifdef WIN32
44 #pragma warning(push)
45 #pragma warning( disable: 4512 ) // assignment operator could not be generated
46 #endif
47 #include "display_frame.h"
48 #ifdef WIN32
49 #pragma warning(pop)
50 #endif
51 #include "disti_assert.h"
52 #include "gls_resources.h"
53 #include "group.h"
54 
55 #include <algorithm>
56 #include <limits>
57 #include <sstream>
58 
59 #if GLS_VERSION_MAJOR < 4
60 # error GlsAnimation not tested with older versions of GL Studio. Use 4.x or higher.
61 #endif
62 
63 namespace disti
64 {
65  // Static data
67 
69  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<double>* keyframeCurve )
70  : GlsAnimation( name )
71  , _propertyName( propertyName )
72  , _attr( 0 )
73  , _object( 0 )
74  , _key( Detail::g_nan )
75  , _doubleCurve( keyframeCurve )
76  , _baseCurve( keyframeCurve )
77  {
78  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
79  }
80 
82  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<Vector>* keyframeCurve )
83  : GlsAnimation( name )
84  , _propertyName( propertyName )
85  , _attr( 0 )
86  , _object( 0 )
87  , _key( Detail::g_nan )
88  , _vectorCurve( keyframeCurve )
89  , _baseCurve( keyframeCurve )
90  {
91  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
92  }
93 
95  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<GlsQuaternionD>* keyframeCurve )
96  : GlsAnimation( name )
97  , _propertyName( propertyName )
98  , _attr( 0 )
99  , _object( 0 )
100  , _key( Detail::g_nan )
101  , _quaternionCurve( keyframeCurve )
102  , _baseCurve( keyframeCurve )
103  {
104  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
105  }
106 
108  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<std::string>* keyframeCurve )
109  : GlsAnimation( name )
110  , _propertyName( propertyName )
111  , _attr( 0 )
112  , _object( 0 )
113  , _key( Detail::g_nan )
114  , _stringCurve( keyframeCurve )
115  , _baseCurve( keyframeCurve )
116  {
117  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
118  }
119 
121  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<glsColor>* keyframeCurve )
122  : GlsAnimation( name )
123  , _propertyName( propertyName )
124  , _attr( 0 )
125  , _object( 0 )
126  , _key( Detail::g_nan )
127  , _colorCurve( keyframeCurve )
128  , _baseCurve( keyframeCurve )
129  {
130  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
131  }
132 
134  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<double>::PtrConst& keyframeCurve )
135  : GlsAnimation( name )
136  , _propertyName( propertyName )
137  , _attr( 0 )
138  , _object( 0 )
139  , _key( Detail::g_nan )
140  , _doubleCurve( keyframeCurve )
141  , _baseCurve( keyframeCurve.get() )
142  {
143  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
144  }
145 
147  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<Vector>::PtrConst& keyframeCurve )
148  : GlsAnimation( name )
149  , _propertyName( propertyName )
150  , _attr( 0 )
151  , _object( 0 )
152  , _key( Detail::g_nan )
153  , _vectorCurve( keyframeCurve )
154  , _baseCurve( keyframeCurve.get() )
155  {
156  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
157  }
158 
160  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<GlsQuaternionD>::PtrConst& keyframeCurve )
161  : GlsAnimation( name )
162  , _propertyName( propertyName )
163  , _attr( 0 )
164  , _object( 0 )
165  , _key( Detail::g_nan )
166  , _quaternionCurve( keyframeCurve )
167  , _baseCurve( keyframeCurve.get() )
168  {
169  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
170  }
171 
173  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<std::string>::PtrConst& keyframeCurve )
174  : GlsAnimation( name )
175  , _propertyName( propertyName )
176  , _attr( 0 )
177  , _object( 0 )
178  , _key( Detail::g_nan )
179  , _stringCurve( keyframeCurve )
180  , _baseCurve( keyframeCurve.get() )
181  {
182  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
183  }
184 
186  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<glsColor>::PtrConst& keyframeCurve )
187  : GlsAnimation( name )
188  , _propertyName( propertyName )
189  , _attr( 0 )
190  , _object( 0 )
191  , _key( Detail::g_nan )
192  , _colorCurve( keyframeCurve )
193  , _baseCurve( keyframeCurve.get() )
194  {
195  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
196  }
197 
199  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<double>::Ptr& keyframeCurve )
200  : GlsAnimation( name )
201  , _propertyName( propertyName )
202  , _attr( 0 )
203  , _object( 0 )
204  , _key( Detail::g_nan )
205  , _doubleCurve( keyframeCurve )
206  , _baseCurve( keyframeCurve.get() )
207  {
208  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
209  }
210 
212  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<Vector>::Ptr& keyframeCurve )
213  : GlsAnimation( name )
214  , _propertyName( propertyName )
215  , _attr( 0 )
216  , _object( 0 )
217  , _key( Detail::g_nan )
218  , _vectorCurve( keyframeCurve )
219  , _baseCurve( keyframeCurve.get() )
220  {
221  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
222  }
223 
225  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<GlsQuaternionD>::Ptr& keyframeCurve )
226  : GlsAnimation( name )
227  , _propertyName( propertyName )
228  , _attr( 0 )
229  , _object( 0 )
230  , _key( Detail::g_nan )
231  , _quaternionCurve( keyframeCurve )
232  , _baseCurve( keyframeCurve.get() )
233  {
234  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
235  }
236 
238  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<std::string>::Ptr& keyframeCurve )
239  : GlsAnimation( name )
240  , _propertyName( propertyName )
241  , _attr( 0 )
242  , _object( 0 )
243  , _key( Detail::g_nan )
244  , _stringCurve( keyframeCurve )
245  , _baseCurve( keyframeCurve.get() )
246  {
247  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
248  }
249 
251  GlsKeyframeAnimation::GlsKeyframeAnimation( const std::string& name, const std::string& propertyName, const GlsKeyframeCurve<glsColor>::Ptr& keyframeCurve )
252  : GlsAnimation( name )
253  , _propertyName( propertyName )
254  , _attr( 0 )
255  , _object( 0 )
256  , _key( Detail::g_nan )
257  , _colorCurve( keyframeCurve )
258  , _baseCurve( keyframeCurve.get() )
259  {
260  DistiAssert( keyframeCurve->GetKeyframeCount() > 0 );
261  }
262 
265  {
266  const KeyPair minMax = GetMinMaxKeys();
267  return minMax.second - minMax.first;
268  }
269 
272  {
273  return _baseCurve->GetMinMaxKeys();
274  }
275 
278  {
279  return _key;
280  }
281 
283  void GlsKeyframeAnimation::SetKey( const Key& key )
284  {
285  if( !IsReadyToAnimate() )
286  {
287  #ifdef GLS_DEBUG
288  std::cout << "Warning -- GlsKeyframeAnimation ('" << _propertyName << "'): DisplayFrame was not set or properties were not found. Ignoring call to SetKey().\n";
289  #endif
290  return;
291  }
292 
293  // Cache the value
294  _key = key;
295 
296  // Write to the resource
297  if( _doubleCurve )
298  {
299  (*_attr) << _doubleCurve->Interpolate( key );
300  }
301  else if( _vectorCurve )
302  {
303  const Vector vec = _vectorCurve->Interpolate( key );
304  #if GLS_VERSION_MAJOR == 4 && GLS_VERSION_MINOR < 5
305  if( _object )
306  {
307  // Handle a special case since GLS 4.5 fixed a bug with dynamic translate and scale
308  if( _isDynamicTranslate )
309  {
310  _object->DynamicTranslate( vec );
311  }
312  else
313  {
314  _object->DynamicScale( vec );
315  }
316  }
317  else
318  #endif // GLS Version < 4.5
319  {
320  // Normal processing
321  (*_attr) << vec;
322  }
323  }
324  else if( _stringCurve )
325  {
326  (*_attr) << _stringCurve->Interpolate( key );
327  }
328  else if( _colorCurve )
329  {
330  // Handle a special case since we can't access the fill color from the Resources API
331  const glsColor color = _colorCurve->Interpolate( key );
332  if( _object )
333  {
334  _object->SetFillColor( color );
335  }
336  else
337  {
338  // Normal processing
339  (*_attr) << color;
340  }
341  }
342  else
343  {
344  (*_attr) << _quaternionCurve->Interpolate( key );
345  }
346  }
347 
350  {
351  _key = Detail::g_nan;
352  }
353 
355  std::vector<std::string> GlsKeyframeAnimation::GetPropertyNames() const
356  {
357  return std::vector<std::string>( &_propertyName, &_propertyName + 1 );
358  }
359 
361  void GlsKeyframeAnimation::RetargetPropertyNames( const std::vector<std::string>& propertyNames )
362  {
363  if( propertyNames.size() > 0 )
364  {
365  _propertyName = propertyNames[ 0 ];
366  if( _displayFrame != NULL )
367  {
368  // Re-do lookup with the new property names
370  }
371  }
372  }
373 
375  void GlsKeyframeAnimation::RetargetPropertyNames( const std::string& findStr, const std::string& replaceStr )
376  {
377  std::size_t startPos = 0;
378  while( (startPos = _propertyName.find(findStr, startPos) ) != std::string::npos )
379  {
380  _propertyName.replace(startPos, findStr.length(), replaceStr);
381  startPos += replaceStr.length();
382  }
383  if( _displayFrame != NULL )
384  {
385  // Re-do lookup with the new property names
387  }
388  }
389 
391  {
392  return 1;
393  }
394 
396  bool GlsKeyframeAnimation::HandleSpecialCases( DisplayFrame* const displayFrame )
397  {
398  // Special case for fill color, which is not easily accessible via the Resources API
399  if( _colorCurve )
400  {
401  // Watch for invalid entries like "FillColor", ".Blah", and "Blah."
402  const std::size_t lastDotPos = _propertyName.rfind('.');
403  if( lastDotPos != std::string::npos && lastDotPos != 0 && lastDotPos != _propertyName.size() - 1 )
404  {
405  const std::string prop = _propertyName.substr( lastDotPos + 1 );
406  if( prop == "FillColor" )
407  {
408  const std::string objName = _propertyName.substr( 0, lastDotPos );
409  // GLS-5297: Fix the FillColor property. (This is a little hacky.)
410  _object = displayFrame->objects->FindByNameSameFrame( objName.c_str() );
411  if( !_object )
412  {
413  _object = displayFrame->objects->FindByName( objName.c_str() );
414  }
415  #ifdef GLS_DEBUG
416  if( !_object )
417  {
418  std::cout << "Warning -- GlsKeyframeAnimation: '" << objName << "' was not found for FillColor pseudo-property. (Is the object name correct?)\n";
419  }
420  #endif
421  return true;
422  }
423  }
424  }
425  #if GLS_VERSION_MAJOR == 4 && GLS_VERSION_MINOR < 5
426  // Handle a special case since GLS 4.5 fixed a bug with dynamic translate and scale
427  else if( _vectorCurve )
428  {
429  // Watch for invalid entries like "FillColor", ".Blah", and "Blah."
430  const std::size_t lastDotPos = _propertyName.rfind('.');
431  if( lastDotPos != std::string::npos && lastDotPos != 0 && lastDotPos != _propertyName.size() - 1 )
432  {
433  const std::string prop = _propertyName.substr( lastDotPos + 1 );
434  _isDynamicTranslate = (prop == "DynamicTranslate");
435  if( _isDynamicTranslate || prop == "DynamicScale" )
436  {
437  const std::string objName = _propertyName.substr( 0, lastDotPos );
438  _object = displayFrame->objects->FindByNameSameFrame( objName.c_str() );
439  if( !_object )
440  {
441  _object = displayFrame->objects->FindByName( objName.c_str() );
442  }
443  #ifdef GLS_DEBUG
444  if( !_object )
445  {
446  std::cout << "Warning -- GlsKeyframeAnimation: '" << objName << "' was not found for " << prop << " property. (Is the object name correct?)\n";
447  }
448  #endif
449  // This special case only applies to groups
450  if( dynamic_cast<Group*>( _object ) )
451  {
452  return true;
453  }
454  _object = 0;
455  }
456  }
457  }
458  #endif // GLS Version < 4.5
459  return false;
460  }
461 
463  bool GlsKeyframeAnimation::SetDisplayFrame( DisplayFrame* const displayFrame )
464  {
465  DistiAssert( displayFrame );
466  _displayFrame = displayFrame;
467  if( HandleSpecialCases( displayFrame ) )
468  {
469  return true;
470  }
471 
472  // Get the resource attribute
473  _attr = &displayFrame->Resource( _propertyName.c_str() );
474 
475  // If we can cast to the ampty attribute, then the attribute did not exist.
476  if( dynamic_cast<DistiEmptyAttribute*>( _attr ) )
477  {
478  #ifdef GLS_DEBUG
479  std::cout << "Warning -- GlsKeyframeAnimation: '" << _propertyName << "' was not found. (Does the property exist? Do you need to enable Runtime Attributes in the GL Studio Resources window?)\n";
480  #endif
481  _attr = 0; // Set back to no good
482  return false;
483  }
484  return true;
485  }
486 
489  {
490  // True if either our normal case or our special case for fill color is set
491  return _attr || _object;
492  }
493 
496  {
497  return GlsAnimation::Ptr( new GlsKeyframeAnimation( *this ) );
498  }
499 
501  GlsAnimationCollection::GlsAnimationCollection( const std::string& name, GlsAnimation* animation /*= 0*/ )
502  : GlsAnimation( name )
503  , _key( Detail::g_nan )
504  , _minKey( std::numeric_limits<Key>::infinity() )
505  , _maxKey( -std::numeric_limits<Key>::infinity() )
506  {
507  if( animation )
508  {
509  Add( animation );
510  }
511  }
512 
514  GlsAnimationCollection::GlsAnimationCollection( const std::string& name, const GlsAnimation::Ptr& animation )
515  : GlsAnimation( name )
516  , _key( Detail::g_nan )
517  , _minKey( std::numeric_limits<Key>::infinity() )
518  , _maxKey( -std::numeric_limits<Key>::infinity() )
519  {
520  DistiAssert( animation );
521  Add( animation );
522  }
523 
525  void GlsAnimationCollection::Add( GlsAnimation* const animation )
526  {
527  Add( GlsAnimation::Ptr( animation ) );
528  }
529 
532  {
533  // Check preconditions
534  DistiAssert( animation );
535  DistiAssert( !Detail::IsNaN( animation->GetKeyRange() ) );
536  DistiAssert( Detail::IsNaN( _key ) && "This animation has already been started. Cannot add to it now." );
537 
538  // Add to our list
539  _animationList.push_back( animation );
540 
541  // Update min and max keys
542  const KeyPair minMax = animation->GetMinMaxKeys();
543  _minKey = (std::min)( _minKey, minMax.first );
544  _maxKey = (std::max)( _maxKey, minMax.second );
545  }
546 
549  {
550  if( _animationList.empty() )
551  {
552  return Detail::g_nan;
553  }
554  return _maxKey - _minKey;
555  }
556 
559  {
560  if( _animationList.empty() )
561  {
563  }
564  return KeyPair( _minKey, _maxKey );
565  }
566 
568  bool GlsAnimationCollection::SetDisplayFrame( DisplayFrame* const displayFrame )
569  {
570  // Preconditions
571  DistiAssert( displayFrame );
572  bool allPropsFound = true;
573  _displayFrame = displayFrame;
574  for( AnimationIter it = _animationList.begin(), end = _animationList.end(); it != end; ++it )
575  {
576  const bool thisPropFound = (*it)->SetDisplayFrame( displayFrame );
577  allPropsFound = allPropsFound && thisPropFound;
578  }
579  return allPropsFound;
580  }
581 
584  {
585  if( _animationList.empty() )
586  {
587  return false;
588  }
589 
590  for( AnimationIter it = _animationList.begin(), end = _animationList.end(); it != end; ++it )
591  {
592  if( !(*it)->IsReadyToAnimate() )
593  {
594  return false;
595  }
596  }
597  return true;
598  }
599 
602  {
603  DistiAssert( !Detail::IsNaN( key ) );
604  _key = key;
605  for( AnimationIter it = _animationList.begin(), end = _animationList.end(); it != end; ++it )
606  {
607  (*it)->SetKey( key );
608  }
609  }
610 
612  //bool GlsAnimationCollection::HasEnded( const double direction ) const
613  //{
614  // if( direction > 0 ) // Moving forward
615  // {
616  // return (_key > _maxKey || Equal( _key, _maxKey )) // Greater-than-or-float-equal
617  // && !Detail::IsNaN( _key ); // AND has key been set
618  // }
619  // else // Moving backward or not at all
620  // {
621  // return (_key < _minKey || Equal( _key, _minKey )) // Less-than-or-float-equal
622  // && !Detail::IsNaN( _key ); // AND has key been set
623  // }
624  //}
625 
628  {
629  _key = Detail::g_nan;
630  for( AnimationIter it = _animationList.begin(), end = _animationList.end(); it != end; ++it )
631  {
632  (*it)->Reset();
633  }
634  }
635 
637  std::vector<std::string> GlsAnimationCollection::GetPropertyNames() const
638  {
639  std::vector<std::string> nameList;
640  nameList.reserve( _animationList.size() );
641  for( AnimationIter it = _animationList.begin(), end = _animationList.end(); it != end; ++it )
642  {
643  const std::vector<std::string> childNames = (*it)->GetPropertyNames();
644  nameList.insert( nameList.end(), childNames.begin(), childNames.end() );
645  }
646  return nameList;
647  }
648 
650  void GlsAnimationCollection::RetargetPropertyNames( const std::vector<std::string>& propertyNames )
651  {
652  Size i=0;
653  for( AnimationIter it = _animationList.begin(), end = _animationList.end(); it != end; ++it )
654  {
655  if( i < propertyNames.size() )
656  {
657  std::vector<std::string> collectedNames;
658  Size j;
659  for(j = 0; j < (*it)->CountPropertyNames(); ++j)
660  {
661  collectedNames.push_back(propertyNames[ i ]);
662  i++;
663  }
664 
665  (*it)->RetargetPropertyNames(collectedNames);
666  }
667  else
668  {
669  #ifdef GLS_DEBUG
670  std::cout << "Warning -- GlsKeyframeAnimation: More objects than names. \n";
671  #endif
672  break;
673  }
674  }
675  if( i < propertyNames.size() )
676  {
677  #ifdef GLS_DEBUG
678  std::cout << "Warning -- GlsKeyframeAnimation: More names than objects. \n";
679  #endif
680  }
681  }
682 
684  void GlsAnimationCollection::RetargetPropertyNames( const std::string& findStr, const std::string& replaceStr )
685  {
686  for( AnimationIter it = _animationList.begin(), end = _animationList.end(); it != end; ++it )
687  {
688  (*it)->RetargetPropertyNames( findStr, replaceStr );
689  }
690  }
691 
694  {
695  Size sum = 0;
696  //for everything in the animation list (collection or animation)
697  for( AnimationIter it = _animationList.begin(), end = _animationList.end(); it != end; ++it )
698  {
699  sum += (*it)->CountPropertyNames();
700  }
701  return sum;
702  }
703 
706  {
708  for( AnimationIter it = _animationList.begin(), end = _animationList.end(); it != end; ++it )
709  {
710  clone->Add( (*it)->Clone() );
711  }
712  return clone;
713  }
714 
716  void SetGlsAnimationParentChildRelationship( DisplayObject* const parent, DisplayObject* const child )
717  {
718  Group* const parentsGroup = parent->ParentGroup();
719  Group* const childsGroup = child->ParentGroup();
720 
721  int pos = parentsGroup->Position( parent );
722 
723  parentsGroup->DeleteObject( parent );
724  childsGroup->DeleteObject( child );
725 
726  const std::string name = parent->InstanceName();
727  parent->InstanceName( (name + "_Parent").c_str() );
728 
729  Group* group = new Group();
730  group->InstanceName( name.c_str() );
731  group->InsertObject( parent );
732  group->InsertObject( child );
733  group->SetAvailableAttributes( unsigned( DisplayObject::GLS_ATTRIBUTES_ALL ) );
734  parentsGroup->InsertObject( group, true, true, pos );
735  group->WorldRotationPoint( parent->WorldRotationPoint() );
736  }
737 
739  void DumpResourceNames( DisplayFrame* const displayFrame, std::ostream& stream )
740  {
741  DistiAssert( displayFrame );
742  GlsResourceFilter filter;
743  filter.NamesOnly( true );
744  filter.GroupLevelsDown( -1 );
745  displayFrame->GetResources( stream, &filter );
746  }
747 } // namespace disti
static const KeyPair s_nanPair
Default value for remapping constructor parameter.
Size CountPropertyNames() const
Override from GlsAnimation.
stdortr1::shared_ptr< GlsAnimationCollection > Ptr
Alias for easier reading.
std::vector< std::string > GetPropertyNames() const
Override from GlsAnimation.
GlsKeyframeCurveBase::Key Key
Alias for easier reading.
void SetKey(const Key &key)
Override from GlsAnimation.
bool IsReadyToAnimate() const
Override from GlsAnimation.
GlsAnimation::Ptr Clone() const
Override from GlsAnimation.
GlsKeyframeCurveBase::Key Key
Alias for easier reading.
Definition: gls_animation.h:61
void Reset()
Override from GlsAnimation.
GlsAnimationCollection(const std::string &name, GlsAnimation *animation=0)
bool IsReadyToAnimate() const
Override from GlsAnimation.
KeyPair GetMinMaxKeys() const
Override from GlsAnimation.
stdortr1::shared_ptr< GlsAnimation > Ptr
Alias for easier reading.
Definition: gls_animation.h:60
GlsKeyframeCurveBase::Size Size
Alias for easier reading.
Definition: gls_animation.h:63
GlsKeyframeAnimation(const std::string &name, const std::string &propertyName, const GlsKeyframeCurve< double > *keyframeCurve)
void SetGlsAnimationParentChildRelationship(DisplayObject *const parent, DisplayObject *const child)
Establishes a parent-child relationship like that in Adobe After Effects that does not exist in the G...
bool SetDisplayFrame(DisplayFrame *displayFrame)
GlsKeyframeCurveBase::KeyPair KeyPair
Alias for easier reading.
void DumpResourceNames(DisplayFrame *const displayFrame, std::ostream &stream)
void RetargetPropertyNames(const std::vector< std::string > &propertyNames)
Override from GlsAnimation.
Key GetKeyRange() const
Override from GlsAnimation.
bool SetDisplayFrame(DisplayFrame *displayFrame)
GlsAnimation::Ptr Clone() const
Override from GlsAnimation.
void SetKey(const Key &key)
Override from GlsAnimation.
DisplayFrame * _displayFrame
The display frame used for retargeting.
GlsKeyframeCurveBase::KeyPair KeyPair
Alias for easier reading.
Definition: gls_animation.h:62
Base class for all animations.
Definition: gls_animation.h:57
Key GetKeyRange() const
Override from GlsAnimation.
void RetargetPropertyNames(const std::vector< std::string > &propertyNames)
Override from GlsAnimation.
const GlsKeyframeCurveBase::Key g_nan
Constant for not-a-number (NaN) for easier reading.
KeyPair GetMinMaxKeys() const
Override from GlsAnimation.
void Reset()
Override from GlsAnimation.
The GL Studio animation classes.
Value Interpolate(const Key &key) const
void Add(GlsAnimation *animation)
const std::string & GetName() const
Returns the given name of this animation sequence.
Key GetKey() const
Override from GlsAnimation.
Size GetKeyframeCount() const
Override from GlsKeyframeCurveBase.
Size CountPropertyNames() const
Override from GlsAnimation.
bool IsNaN(const double d)
Detects not-a-number (NaN)
virtual KeyPair GetMinMaxKeys() const =0
std::vector< std::string > GetPropertyNames() const
Override from GlsAnimation.