HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CH_Filters.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: CH_Filters.h (CH Library, C++)
7  *
8  * COMMENTS:
9  */
10 
11 #ifndef __CH_FILTERS_H_INCLUDED__
12 #define __CH_FILTERS_H_INCLUDED__
13 
14 #include "CH_API.h"
15 #include <SYS/SYS_Types.h>
16 
17 class CH_Channel;
18 class CH_Segment;
19 
20 // How to Bake CHOP Exports
21 // When baking a new channel is created and it overrides the channel animation on the parm.
22 // It won't override CHOP Clips.
24 {
25  CH_BAKECHOP_NONE, // Don't bake CHOP exports on channels.
26  CH_BAKECHOP_KEEP_EXPORT_FLAG, // Bake but leave the export flag on. You'll have to manually toggle the chop export flag.
27  CH_BAKECHOP_DISABLE_EXPORT_FLAG, // Bake and disable the CHOP export flags. This won't work properly if you work on a subset of the exports as it will disable all.
28  CH_BAKECHOP_CREATE_DELETE_CHOP, // Bake and create a Delete CHOP node after the CHOP export node. This enables you to bake a single channel.
29  CH_BAKECHOP_EXPRESSIONS, // Bake expression even if there is no CHOP export.
30 };
31 
32 // Builder for ranges of selected segments
33 // Abstracts the use of JIVE_Iterators/Script glob in order to reuse the
34 // code for scripting
36 {
37 public:
38  virtual ~CH_FilterRangeBuilder();
39 
40  // Reset Channel and Segments
41  virtual void resetChannel() = 0;
42  virtual void resetSegment() = 0;
43 
44  //Iterate over Channels and Segments
45  virtual CH_Channel *nextChannel() = 0;
46  virtual CH_Segment *nextSegment(bool &is_selected) = 0;
47 
48  // External Undo
49  virtual void undoStart() = 0;
50  virtual void undoChannel( CH_Channel *chp) = 0;
51  virtual void undoEnd() = 0;
52 
53  // Callback to copy a dummy Chop channel back as a real channel
54  virtual void beginCopyChopChannels(CH_BakeChop mode) = 0;
55  virtual void copyChopChannel(CH_Channel *chp, fpreal global_start, fpreal global_end) = 0;
56  virtual void endCopyChopChannels() = 0;
57 };
58 
59 struct chRefitChannels;
60 
62 {
63 public:
64  CH_Filters();
65 
66  // Performs a Refitting operation to simplify the channels.
67  // This can be used to bake channel expressions.
68  // This can be used on channels with cycle extrapolation to bake the cycles.
69  void applyRefitFilter(
70  CH_FilterRangeBuilder *builder, // range builder to extract the channels and the time ranges
71 
72  bool refit_on, // perform the cubic refitting using CH_Channel::refit()
73  fpreal refit_tol, // refitting tolerance in abs value.
74  bool refit_preserve_extrema, // refitting preserves extremas
75  bool refit_bezier, // set the new keyframes to bezier instead of cubic.
76 
77  bool resample_on, // do resampling before doing the refitting.
78  fpreal resample_rate, // resample rate in frames
79  fpreal resample_tol, // resample tolerance to avoid adding samples in frames.
80 
81  bool range_on, // force a global frame range, on top of the extracted ranges.
82  fpreal range_start, // start frame
83  fpreal range_end, // end frame.
84 
85  CH_BakeChop bake_chop=CH_BAKECHOP_NONE // See CH_BakeChop for description of the modes.
86  );
87 
88  // Performs only a Refitting operation to simplify the channels.
89  void applyRefitFilter(
90  CH_FilterRangeBuilder *builder, // range builder to extract the channels and the time ranges
91 
92  fpreal refit_tol, // refitting tolerance in abs value.
93  bool refit_preserve_extrema, // refitting preserves extremas
94  bool refit_bezier, // set the new keyframes to bezier instead of cubic.
95 
96  bool range_on, // force a global frame range, on top of the extracted ranges.
97  fpreal range_start, // start frame
98  fpreal range_end // end frame.
99  );
100 
101  // Performs a Resample operation to bake channel expressions.
102  void applyResampleFilter(
103  CH_FilterRangeBuilder *builder, // range builder to extract the channels and the time ranges
104 
105  fpreal resample_rate, // resample rate in frames
106  fpreal resample_tol, // resample tolerance to avoid adding samples in frames.
107 
108  bool range_on, // force a global frame range, on top of the extracted ranges.
109  fpreal range_start, // start frame
110  fpreal range_end // end frame.
111  );
112 
113  // Performs a Extend operation to turn channel extrapolation into real keyframes.
114  void applyExtendFilter(
115  CH_FilterRangeBuilder *builder, // range builder to extract the channels and the time ranges
116  fpreal range_start, // start frame
117  fpreal range_end // end frame.
118  );
119 
120  // Make a copy of the dummy CHOP channels on the real param
121  void applyCopyChopFilter(
122  CH_FilterRangeBuilder *builder, // range builder to extract the channels and the time ranges
123  bool range_on, // force a global frame range, on top of the extracted ranges.
124  fpreal range_start, // start frame
125  fpreal range_end, // end frame.
126  CH_BakeChop bake_chop=CH_BAKECHOP_NONE // See CH_BakeChop for description of the modes.
127  );
128 
129 private:
130 
131  bool myFirst; // Flag to do proper undo/redo when applyRefitFilter calls the other methods
132  chRefitChannels *myRanges;
133 };
134 
135 #endif
CH_BakeChop
Definition: CH_Filters.h:23
GLenum mode
Definition: glcorearb.h:98
double fpreal
Definition: SYS_Types.h:270
#define CH_API
Definition: CH_API.h:10