HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CH_BatchModifyScope.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_BatchModifyScope.h (CH Library, C++)
7  *
8  * COMMENTS: Scoped batch modification of a CH_Channel.
9  */
10 
11 #ifndef __CH_BatchModifyScope_h__
12 #define __CH_BatchModifyScope_h__
13 
14 #include "CH_API.h"
15 #include "CH_EventManager.h"
16 
17 #include <UT/UT_Array.h>
18 #include <UT/UT_Assert.h>
19 #include <UT/UT_NonCopyable.h>
20 
21 #include <SYS/SYS_Types.h>
22 
23 #include <tuple>
24 
25 class CH_Channel;
26 
28 {
29 public:
31  CH_Channel *chp,
32  CH_CHANGE_TYPE notify_type,
33  bool verify_tied_values = true);
34 
36  {
37  finish();
38  }
39 
41 
42  // If you call setChannelStart(), then it needs to adjust everything,
43  // so the adjust range will be ignored.
44  void setChannelStart(fpreal new_global_start)
45  {
46  myChannelStart = new_global_start;
47  myChannelStartChanged = true;
48  }
49  // Only used if setChannelStart() has not been called
50  void setAdjustRange(int beg, int end)
51  {
52  myAdjustBeg = beg;
53  myAdjustEnd = end;
54  }
55 
57  fpreal global_time, fpreal delta, bool value_changed)
58  {
59  mySmoothAutoSlopes.emplace_back(global_time, delta, value_changed);
60  }
61 
62  void finish();
63 
64 private:
65  // Do all pending smooth auto slopes. This is a modified version of
66  // CH_Channel::smoothAutoSlopes(fpreal, fpreal, bool) which does the
67  // same thing for one key.
68  void smoothAutoSlopes();
69 
70  CH_Channel * myCh;
71  CH_CHANGE_TYPE myNotifyType;
73  int myAdjustBeg;
74  int myAdjustEnd;
75  fpreal myChannelStart;
76  bool myChannelStartChanged;
77 #if (UT_ASSERT_LEVEL >= UT_ASSERT_LEVEL_PARANOID)
78  bool myVerifyTiedValues;
79 #endif
80 };
81 
82 #endif
void
Definition: png.h:1083
CH_CHANGE_TYPE
GLuint GLuint end
Definition: glcorearb.h:475
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
void setAdjustRange(int beg, int end)
void deferredSmoothAutoSlopes(fpreal global_time, fpreal delta, bool value_changed)
fpreal64 fpreal
Definition: SYS_Types.h:283
#define CH_API
Definition: CH_API.h:10