LOTAnimatorNode.h 2.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263
  1. //
  2. // LOTAnimatorNode.h
  3. // Pods
  4. //
  5. // Created by brandon_withrow on 6/27/17.
  6. //
  7. //
  8. #import <Foundation/Foundation.h>
  9. #import "LOTPlatformCompat.h"
  10. #import "LOTBezierPath.h"
  11. #import "LOTKeypath.h"
  12. #import "LOTValueDelegate.h"
  13. extern NSInteger indentation_level;
  14. @interface LOTAnimatorNode : NSObject
  15. /// Initializes the node with and optional input node and keyname.
  16. - (instancetype _Nonnull)initWithInputNode:(LOTAnimatorNode *_Nullable)inputNode
  17. keyName:(NSString *_Nullable)keyname;
  18. /// A dictionary of the value interpolators this node controls
  19. @property (nonatomic, readonly, strong) NSDictionary * _Nullable valueInterpolators;
  20. /// The keyname of the node. Used for dynamically setting keyframe data.
  21. @property (nonatomic, readonly, strong) NSString * _Nullable keyname;
  22. /// The current time in frames
  23. @property (nonatomic, readonly, strong) NSNumber * _Nullable currentFrame;
  24. /// The upstream animator node
  25. @property (nonatomic, readonly, strong) LOTAnimatorNode * _Nullable inputNode;
  26. /// This nodes path in local object space
  27. @property (nonatomic, strong) LOTBezierPath * _Nonnull localPath;
  28. /// The sum of all paths in the tree including this node
  29. @property (nonatomic, strong) LOTBezierPath * _Nonnull outputPath;
  30. /// Returns true if this node needs to update its contents for the given frame. To be overwritten by subclasses.
  31. - (BOOL)needsUpdateForFrame:(NSNumber *_Nonnull)frame;
  32. /// Sets the current frame and performs any updates. Returns true if any updates were performed, locally or upstream.
  33. - (BOOL)updateWithFrame:(NSNumber *_Nonnull)frame;
  34. - (BOOL)updateWithFrame:(NSNumber *_Nonnull)frame
  35. withModifierBlock:(void (^_Nullable)(LOTAnimatorNode * _Nonnull inputNode))modifier
  36. forceLocalUpdate:(BOOL)forceUpdate;
  37. - (void)forceSetCurrentFrame:(NSNumber *_Nonnull)frame;
  38. @property (nonatomic, assign) BOOL pathShouldCacheLengths;
  39. /// Update the local content for the frame.
  40. - (void)performLocalUpdate;
  41. /// Rebuild all outputs for the node. This is called after upstream updates have been performed.
  42. - (void)rebuildOutputs;
  43. - (void)logString:(NSString *_Nonnull)string;
  44. - (void)searchNodesForKeypath:(LOTKeypath * _Nonnull)keypath;
  45. - (void)setValueDelegate:(id<LOTValueDelegate> _Nonnull)delegate
  46. forKeypath:(LOTKeypath * _Nonnull)keypath;
  47. @end