HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CH_Manager.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 library (C++)
7  *
8  * COMMENTS: Manager of all channels for a world.
9  *
10  */
11 
12 #ifndef __CH_Manager_h__
13 #define __CH_Manager_h__
14 
15 #include "CH_API.h"
16 #include "CH_Bookmark.h"
18 #include "CH_ChannelRef.h"
19 #include "CH_EvalContextFwd.h"
20 #include "CH_ExprLanguage.h"
21 #include "CH_KeyState.h"
22 #include "CH_Tweener.h"
23 #include "CH_Types.h"
24 
25 #include <DEP/DEP_ContextOptions.h>
26 #include <DEP/DEP_MicroNode.h>
27 #include <UT/UT_Assert.h>
28 #include <UT/UT_Color.h>
29 #include <UT/UT_Function.h>
30 #include <UT/UT_IntArray.h>
31 #include <UT/UT_JSONParser.h>
32 #include <UT/UT_JSONWriter.h>
33 #include <UT/UT_Lock.h>
34 #include <UT/UT_Map.h>
35 #include <UT/UT_NonCopyable.h>
36 #include <UT/UT_ScopeExit.h>
37 #include <UT/UT_Set.h>
38 #include <UT/UT_String.h>
39 #include <UT/UT_StringArray.h>
40 #include <UT/UT_StringMap.h>
41 #include <UT/UT_SuperInterval.h>
42 #include <UT/UT_TBBSpinLock.h>
43 #include <UT/UT_Thread.h>
45 #include <UT/UT_UniquePtr.h>
46 #include <UT/UT_ValArray.h>
47 #include <SYS/SYS_Floor.h>
48 #include <SYS/SYS_Hash.h>
49 #include <SYS/SYS_Inline.h>
50 #include <SYS/SYS_Math.h>
51 #include <SYS/SYS_Types.h>
52 #include <iosfwd>
53 
54 class CH_Channel;
55 class CH_ChannelRef;
56 class CH_Collection;
57 class CH_ExprDefine;
58 class CH_Group;
59 class CH_LocalVariable;
60 class CH_Manager;
61 class CH_Bookmark;
62 class chParamData;
63 class CH_ScopedChannels;
64 class CH_ScriptAccessManager;
65 class CH_Segment;
66 class CH_TimeGroup;
67 class CH_ScopeUndo;
68 class CH_UndoScopeChannels;
69 class UT_WorkBuffer;
70 
71 typedef bool (*CH_StringVarEvalFunc)(UT_String &val, int varid, int thread);
72 typedef bool (*CH_FloatVarEvalFunc)(fpreal &val, int varid, int thread);
73 typedef bool (*CH_IntVarEvalFunc)(int &val, int varid, int thread);
76 
78 {
79 public:
83 
84  virtual UT_Color getChannelColor(const CH_Channel *channel) = 0;
85  virtual UT_Color getChannelColor(const CH_ChannelRef &channel_ref) = 0;
86 };
87 
89 {
90 public:
92  virtual ~CH_ChannelChanged(){}
93  UT_NON_COPYABLE(CH_ChannelChanged)
94 
95  virtual void changed() = 0;
96 };
97 
99 {
100 public:
107 };
108 
109 // CH_ScopedChannelsBase holds the scope/display/layer/pinned flags
110 // for all the channels.
112 {
113 public:
115 
116  // these next two methods can be used to manipulate channel scope state
117  // using the full path of the channel. The correct behaviour will take
118  // place if the channel doesn't yet exist and so forth.
119  bool scopeChannelInternal(const CH_Channel *chp, bool on_off);
120  bool scopeChannelInternal(const CH_ChannelRef &chref, bool on_off);
121  void scopeChannel(const CH_ChannelRef &chref, bool on_off);
122  void scopeChannel(const char *full_chan_path, bool on_off);
123  void unscopeChannelsWithNodeId(int node_id, bool force=false);
124 
125  // this function should only be used by CH_Channel, CH_Collection, and here
126  void scopeChanged( unsigned flags, bool propagate=true );
127  void scopeChanged(unsigned flags, bool propagate,
128  const int &reason);
129 
130  // these functions can be used by anyone
131  bool isChannelScoped(CH_Channel *chp) const;
132  bool isChannelScoped(const char *full_chan_path) const;
133  bool isChannelScoped(const CH_ChannelRef &chref) const;
134 
135  //
136  // Displayed Channels (within the scoped channels)
137  //
138  bool isChannelDisplayed(CH_Channel *chp) const;
139  bool isChannelDisplayed( const CH_ChannelRef &chref ) const;
140  bool isChannelDisplayed( const char *full_chan_path ) const;
141  void clearDisplayedChannels( bool propagate = true );
142  void displayAllScopedChannels( bool propagate = true );
143  void displaySelectedScopedChannels( bool propagate = true );
144 
145  void displayChannel( const CH_ChannelRef &chref,
146  bool propagate = true );
147  void displayChannel( const char *full_chan_path,
148  bool propagate = true );
149  void undisplayChannel( const CH_ChannelRef &chref,
150  bool propagate = true );
151  void undisplayChannel( const char *full_chan_path,
152  bool propagate = true );
153  void undisplayChannelsWithNodeId(int node_id, bool force=false);
154  //
155  // Selected Channels (within the scoped channels)
156  //
157  bool isChannelSelected( const CH_ChannelRef &chref ) const;
158  bool isChannelSelected( const char *full_chan_path ) const;
159  void clearSelectedChannels( bool propagate = true );
160  void selectAllScopedChannels(bool propagate = true );
161 
162  void selectChannel( const CH_ChannelRef &chref,
163  bool propagate = true );
164  void selectChannel( const char *full_chan_path,
165  bool propagate = true );
166  void deselectChannel( const CH_ChannelRef &chref,
167  bool propagate = true );
168  void deselectChannel( const char *full_chan_path,
169  bool propagate = true );
170 
171  //
172  // Pinned Channels (within the scoped channels)
173  //
174  void togglePinAllScopedChannels();
175  void togglePinScopedChannels( const CH_ChannelRefList &chanrefs );
176  void pinAllScopedChannels( bool propagate = true );
177  void unpinAllScopedChannels( bool propagate = true );
178  void pinSelectedChannels( bool propagate = true,
179  int operate_on = CH_SELECTED );
180  void unpinSelectedChannels( bool propagate = true,
181  int operate_on = CH_SELECTED );
182  void pinChannels( const CH_ChannelRefList &chanrefs,
183  bool propagate = true );
184  void unpinChannels( const CH_ChannelRefList &chanrefs,
185  bool propagate = true );
186  void pinChannel( const CH_ChannelRef &ref,
187  bool propagate = true );
188  void unpinChannel( const CH_ChannelRef &ref,
189  bool propagate = true );
190  void unpinChannelsWithNodeId(int node_id, bool force=false);
191  void clearPinnedChannels( bool propagate = true );
192 
193  //
194  // Scopped Layers
195  //
196  void clearLayerScope();
197  bool isLayerScoped(CH_Channel *chp) const;
198  bool isLayerScoped(const char *full_chan_path) const;
199  bool isLayerScoped(const CH_ChannelRef &chref) const;
200  void scopeLayer(const CH_ChannelRef &chref, bool on_off);
201  void scopeLayer(const char *full_chan_path, bool on_off);
202  bool scopeLayerInternal(CH_Channel *chp, bool on_off);
203  bool scopeLayerInternal(const CH_ChannelRef &chref, bool on_off);
204 
205  //
206  // Selected Layers (within the scoped layers)
207  //
208  bool isLayerSelected(const CH_ChannelRef &chref) const;
209  bool isLayerSelected(const char *full_chan_path) const;
210  void clearSelectedLayers(bool propagate = true);
211  void selectAllScopedLayers(bool propagate = true);
212 
213  void selectLayer(const CH_ChannelRef &chref, bool propagate=true);
214  void selectLayer(const char *full_chan_path, bool propagate=true);
215  void deselectLayer(const CH_ChannelRef &chref, bool propagate=true);
216  void deselectLayer(const char *full_chan_path, bool propagate=true);
217 
218  //
219  // Pinned Layers (within the scoped layers)
220  //
221  void togglePinAllScopedLayers();
222  void togglePinScopedLayers( const CH_ChannelRefList& chanrefs );
223  void pinAllScopedLayers( bool propagate = true );
224  void unpinAllScopedLayers( bool propagate = true );
225  void pinSelectedLayers( bool propagate = true,
226  int operate_on = CH_LAYER_SELECTED );
227  void unpinSelectedLayers( bool propagate = true,
228  int operate_on = CH_LAYER_SELECTED );
229  void pinLayer( const CH_ChannelRef& ref,
230  bool propagate = true );
231  void unpinLayer( const CH_ChannelRef& ref,
232  bool propagate = true );
233  void pinLayers( const CH_ChannelRefList& chanrefs,
234  bool propagate = true );
235  void unpinLayers( const CH_ChannelRefList& chanrefs,
236  bool propagate = true );
237  void clearPinnedLayers( bool propagate = true );
238 
239  //
240  // Displayed Layers (within the scoped layers)
241  bool isLayerDisplayed(CH_Channel *chp) const;
242  bool isLayerDisplayed( const CH_ChannelRef &chref ) const;
243  bool isLayerDisplayed( const char *full_chan_path ) const;
244  void clearDisplayedLayers( bool propagate = true );
245  void displayAllScopedLayers( bool propagate = true );
246  void displaySelectedScopedLayers( bool propagate = true );
247 
248  void displayLayer( const CH_ChannelRef &chref,
249  bool propagate = true );
250  void displayLayer( const char *full_chan_path,
251  bool propagate = true );
252  void undisplayLayer( const CH_ChannelRef &chref,
253  bool propagate = true );
254  void undisplayLayer( const char *full_chan_path,
255  bool propagate = true );
256 
257  // Graph Selected flag
258  bool isGraphSelected(CH_Channel *chp) const;
259  bool isGraphSelected( const CH_ChannelRef &chref ) const;
260  bool isGraphSelected( const char *full_chan_path ) const;
261  void clearGraphSelected( bool propagate = true );
262  void selectGraph( const CH_ChannelRef &chref,
263  bool propagate = true );
264  void selectGraph( const char *full_chan_path,
265  bool propagate = true );
266  void deselectGraph( const CH_ChannelRef &chref,
267  bool propagate = true );
268  void deselectGraph( const char *full_chan_path,
269  bool propagate = true );
270 
271  //
272  // Generic channel flag manipulation methods
273  //
274 
275  // Toggles on or off the bits active in flags argument.
276  void setChannelFlags( const CH_ChannelRef &chref,
277  unsigned flags,
278  bool on_off,
279  bool propagate = true );
280 
281  // Sets the flags unsigned value to flags argument.
282  void setAllChannelFlags( const CH_ChannelRef &chref,
283  unsigned flags,
284  bool propagate = true );
285 
286  // Returns the channel flags of chref.
287  unsigned getChannelFlags( const CH_ChannelRef &chref ) const;
288 
289  //
290  // Scoping functions
291  //
292  void clearChannelScope( bool clear_all_tables=false);
293 
294  // Returns scoped channels only (not scoped parameters)
295  void getScopedChannels(CH_ChannelList &channels, bool sorted=false);
296 
297  // Returns count of scoped channels AND scoped parameters
298  int getNumScopedChanRefs();
299 
300  // Returns count of scoped channels AND scoped parameters filtered or not
301  int getNumScopedChanRefs(bool filtered);
302 
303  // mask corresponds to flags in CH_ScopeMasks. Use 0 for mask to mean all
304  // scoped channel refs.
305  // Returns scoped channel AND scoped parameter refs
306  void getScopedChanRefs(CH_ChannelRefList &chanrefs,
307  unsigned mask = 0,
308  bool sorted=false) const;
309  void getSelectedScopedChanRefs(CH_ChannelRefList &chanrefs,
310  bool sorted=false, int operate_on=CH_SELECTED);
311 
312  void getScopedChannelsKeyFrames( UT_IntArray &frames,
313  int minframe, int maxframe);
314 
315  bool hasScopedChannels();
316 
318  { return myKeepChannelSelection; }
320  { myKeepChannelSelection = b;}
321 
323  {
324  FilterChannels = 0,
325  FilterAnimationLayers = 1,
326  };
327  enum
328  {
329  NumFilterType = 2,
330  };
331 
332  void setEnableFilter( FilterType filter_type, bool b)
333  { myEnableFilter[filter_type] = b; }
334  bool getEnableFilter( FilterType filter_type ) const
335  { return myEnableFilter[filter_type]; }
336 
337  void setFilter( FilterType filter_type, const UT_StringHolder &f)
338  { myFilter[filter_type] = f;}
339  const UT_StringHolder& getFilter(FilterType filter_type) const
340  { return myFilter[filter_type]; }
341 
342  void setFilterTranslates( bool b)
343  { myFilterTranlates = b;}
344  bool getFilterTranslates() const
345  { return myFilterTranlates; }
346 
347  void setFilterRotates( bool b)
348  { myFilterRotates = b;}
349  bool getFilterRotates() const
350  { return myFilterRotates; }
351 
352  void setFilterScales( bool b)
353  { myFilterScales = b;}
354  bool getFilterScales() const
355  { return myFilterScales; }
356 
357  void setFilterParmLabels( FilterType filter_type, bool b)
358  { myFilterParmLabels[filter_type] = b;}
359  bool getFilterParmLabels(FilterType filter_type ) const
360  { return myFilterParmLabels[filter_type]; }
361 
362  void setFilterFullNames( FilterType filter_type, bool b)
363  { myFilterFullNames[filter_type] = b;}
364  bool getFilterFullNames(FilterType filter_type) const
365  { return myFilterFullNames[filter_type]; }
366 
367  void setFilterDirty(FilterType filter_type);
368 
369  void setAllowExternal(bool allow) { myAllowExternal = allow; }
370  bool getAllowExternal() const { return myAllowExternal; }
371 
372  bool hasFilter() const;
373 
374  void clearInvalidChannels();
375 
376  void dirtySort();
377 
378 protected:
380  CH_Manager * ourManager() const { return myManager; }
381 
382 private:
383  friend class CH_Manager;
384 
385  // Filtering functions
386  void filterChannels(CH_ChannelList &chns, FilterType filter_type) const;
387  void filterChannelRefs(CH_ChannelRefList &refs, FilterType filter_type) const;
388  void setupFilter(UT_String &ret, UT_StringArray &filter_tokens, FilterType filter_type) const;
389  bool filterChannelRef( const CH_ChannelRef &chref, FilterType filter_type, const UT_String &prefilter, const UT_StringArray &filter_tokens ) const;
390 
391  CH_ChannelRefTable myTable;
392  CH_ChannelRefTable myTableDisplayed;
393  CH_ChannelList mySorted;
394  bool myIsSorted;
395  bool myKeepChannelSelection;
396  mutable int myNumScopedChannels;
397  mutable int myTotalScopedChannels; // Unfiltered
398 
399  // This wrapper is necessary to avoid gcc errors due to UT_Array having
400  // an explicit copy constructor and gcc seems to erroneously use copy-
401  // initialization instead of direct-initialization when synthesizing
402  // CH_ScopedChannelsBase's copy ctor.
403  struct ChannelListWrap
404  {
405  CH_ChannelList myList;
406  };
407 
408  // Filter for Channels and Animation Layers
409  ChannelListWrap myFiltered[NumFilterType];
410  UT_StringHolder myFilter[NumFilterType];
411  bool myEnableFilter[NumFilterType];
412  bool myFilterParmLabels[NumFilterType];
413  bool myFilterFullNames[NumFilterType];
414  bool myIsFiltered[NumFilterType];
415  bool myFilterTranlates;
416  bool myFilterRotates;
417  bool myFilterScales;
418 
419  // Note that we used to assert channels weren't external in most
420  // of the CH_ScopedChannelsBase methods, as they wouldn't work properly
421  // with building channel refs etc.
422  // Now, with geometry channels/channel primitives, we
423  // sometimes want to be able to scope these as external channels.
424  // We now check against this flag only when initially scoping channels.
425  // Other methods (isChannelScoped etc), no longer need to check whether the
426  // input is external or not, as buildChanRef and the remainder of the
427  // method will work as expected.
428  // This flag should be toggled on when first scoping external
429  // channels, then toggled back off afterwards. This ensures we don't
430  // globally scope external channels we don't mean to, such
431  // as the CHOPs fitCollection.
432  bool myAllowExternal;
433 
434  CH_Manager *myManager;
435 };
436 
437 // CH_ScopedChannels holds the scope/display/layer/pinned flags
438 // for all the channels.
439 // The CH_Manager holds a list of scoped channels and we refer to that list
440 // as the Global Scoped Channels.
441 // The Animation Editor can pin its state to create and act on a disconnected
442 // list of channels.
444 {
445 public:
446  CH_ScopedChannels(CH_Manager *mgr, bool global=false);
448 
449  // For some unfathomable reason, gcc will error out if the copy operators
450  // are not defined within the class
452  : CH_ScopedChannelsBase(src)
453  , myIsGlobal(src.myIsGlobal)
454  {
455  addInterest();
456  }
457 
458  // For some unfathomable reason, gcc will error out if the copy operators
459  // are not defined within the class
461  {
462  if (this != &src)
463  {
464  bool do_interest = (ourManager() != src.ourManager());
465  if (do_interest)
466  removeInterest();
468  if (do_interest)
469  addInterest()
470  );
471 
473  myIsGlobal = src.myIsGlobal;
474  }
475  return *this;
476  }
477 
479  CH_ScopedChannels &operator=(CH_ScopedChannels &&src) noexcept;
480 
481  void saveForUndo();
482 
483 private:
484  void removeInterest();
485  void addInterest();
486 private:
487  bool myIsGlobal;
488 };
489 
491 {
492 public:
493  typedef enum {
494  //CH_ON_COLLISION_FAIL,
498  CH_ON_COLLISION_ASSERT
499  } CollisionBehaviour;
500 
501  typedef enum {
502  CH_EXPANSION_TYPE_EXPRESSION = 1, // backtick expr expansions
503  CH_EXPANSION_TYPE_VARIABLE = 1 << 1, // $ variable expansions
504  CH_EXPANSION_TYPE_TILDE = 1 << 2, // ~ -> home directory
505  CH_EXPANSION_TYPE_NO_COMMENTS = 1 << 3, // No expand in // or /*
506  CH_EXPANSION_TYPE_NO_RAWSTRINGS = 1 << 4, // No expand in r"..."
507  CH_EXPANSION_TYPE_DEFAULT = CH_EXPANSION_TYPE_EXPRESSION |
508  CH_EXPANSION_TYPE_VARIABLE |
509  CH_EXPANSION_TYPE_TILDE,
510  } ExpansionType;
511 
512  typedef enum {
516  } SlopeMode;
517 
518  static constexpr int CH_SCOPE_REPLACED = 0;
519  static constexpr int CH_SCOPE_FILTERED = 1;
520 
521  typedef CollisionBehaviour (*CBCallback)( CH_Group *source,
522  CH_Group *target );
523 
524  CH_Manager(bool init_the_expression_library = true);
525  virtual ~CH_Manager();
526 
527  UT_NON_COPYABLE(CH_Manager)
528 
529  /// @private
530  /// Called just before the CH_Manger will be deleted
531  virtual void aboutToDelete();
532 
533  // The following method is used to set the context to this manager.
534  static CH_Manager *getContext()
535  {
536  UT_ASSERT( theManager );
537  return theManager;
538  }
539  static bool getContextExists() { return (bool)theManager; }
540  virtual void setContext();
541 
542  int condenseCommon(UT_String &path);
543 
544  void resetPlayback();
545 
546  void resetChannelOptions(bool notify = true);
547  bool loadChannelOptions( const char *filename );
548  bool saveChannelOptions( const char *filename );
549 
550  void setDefaultExpression(const char *s, bool notify = false);
551 
552  const char *getDefaultExpression() const
553  { return (const char *)myDefaultExpression; }
555  { return myShouldShowFakeAccelHandles; }
556  void setDefaultRotationExpression(const char *s)
557  {
558  if (s)
559  myDefaultRotationExpression.harden(s);
560  }
561  const char *getDefaultRotationExpression() const
562  { return (const char *)myDefaultRotationExpression;}
564  { myAutoSlope = m; }
566  { return myAutoSlope; }
568  { myDefaultSlope = slope; }
570  { return myDefaultSlope; }
571  void setAutoSplit(bool onoff);
572  bool getAutoSplit() const
573  { return myAutoSplit; }
574  void setDefaultSplitExpression(const char *expr);
575 
576  const char *getDefaultSplitExpression() const
577  { return (const char *)myDefaultSplitExpression; }
578 
579  void setHoldLastKey(bool onoff)
580  { myHoldLastKey = onoff; }
581  int getHoldLastKey() const
582  { return myHoldLastKey; }
583  const char *getChanCreateKeyExpression() const
584  { return (const char *)myChanCreateKeyExpression; }
585  void setChanCreateKeyExpression(const char *s)
586  { myChanCreateKeyExpression.harden(s ? s : ""); }
588  { return myAlwaysCommitKey; }
589  void setAlwaysCommitKeyChange( bool onoff )
590  { myAlwaysCommitKey = onoff; }
591 
592  // Scoping functions
593  // Deprecated and moved to CH_ScopedChannels
594  // With H16, we introduced the ability to lock animation editor scoped
595  // channels. The embedded animation layers and scoped channel listers can
596  // take a copy of CH_ScopedChannels and acts independtly of the global
597  // list. ChgetScopedChannels() returns the list of globally scoped
598  // channels.
599  SYS_DEPRECATED(16.0)
600  void clearChannelScope();
601 
602  // Returns scoped channels only (not scoped parameters)
603  SYS_DEPRECATED(16.0)
604  void getScopedChannels(CH_ChannelList &channels, bool sorted=false);
605 
606  // Returns count of scoped channels AND scoped parameters
607  SYS_DEPRECATED(16.0)
608  int getNumScopedChanRefs()
609  { return myScopedChannels.getNumScopedChanRefs(); }
610 
611  // mask corresponds to flags in CH_ScopeMasks. Use 0 for mask to mean all
612  // scoped channel refs.
613  // Returns scoped channel AND scoped parameter refs
614  SYS_DEPRECATED(16.0)
615  void getScopedChanRefs(CH_ChannelRefList &chanrefs,
616  unsigned mask = 0,
617  bool sorted=false) const;
618  SYS_DEPRECATED(16.0)
619  void getSelectedScopedChanRefs(CH_ChannelRefList &chanrefs,
620  bool sorted=false, int operate_on=CH_SELECTED);
621 
622  // utility functions for getting keyframe numbers:
623  // they return array of keyframes in the or scoped channes
624  // between minframe and maxframe, indexed relative to the start index
625  // The frames are unique and sorted in a ascending order.
626  SYS_DEPRECATED(16.0)
627  void getScopedChannelsKeyFrames( UT_IntArray &frames,
628  int minframe, int maxframe);
629 
630  // Useful method to group multiple scope change event notifications
631  // together.
632  void blockModifyScope(int on_off);
633 
634  // these next two methods can be used to manipulate channel scope state
635  // using the full path of the channel. The correct behaviour will take
636  // place if the channel doesn't yet exist and so forth.
637  SYS_DEPRECATED(16.0)
638  void scopeChannel(const CH_ChannelRef &chref, bool on_off);
639  SYS_DEPRECATED(16.0)
640  void scopeChannel(const char *full_chan_path, bool on_off);
641  SYS_DEPRECATED(16.0)
642  bool scopeChannelInternal(const CH_Channel *chp, bool on_off);
643  SYS_DEPRECATED(16.0)
644  bool scopeChannelInternal(const CH_ChannelRef &chref, bool on_off);
645 
646  virtual void getChannelsWithNodeId(CH_ChannelList &chans, int node_id) const;
647 
648  // this function should only be used by CH_Channel, CH_Collection, and here
649  SYS_DEPRECATED(16.0)
650  void scopeChanged( unsigned flags, bool propagate=true );
651 
652  // these functions can be used by anyone
653  SYS_DEPRECATED(16.0)
654  bool isChannelScoped(CH_Channel *chp) const;
655  SYS_DEPRECATED(16.0)
656  bool isChannelScoped(const char *full_chan_path) const;
657  SYS_DEPRECATED(16.0)
658  bool isChannelScoped(const CH_ChannelRef &chref) const;
659 
660  //
661  // Pending Channels
662  //
663  void clearPendingChannels();
664  void getPendingChannels(CH_ChannelList &channels) const;
665  bool hasPendingChannels() const;
666 
667  // addPendingChannel is intended to be used by CH_Channel/CH_Collection!
668  void addPendingChannel( CH_Channel *chp );
669  void removePendingChannel( CH_Channel *chp );
670 
671  //
672  // Displayed Channels (within the scoped channels)
673  //
674  SYS_DEPRECATED(16.0)
675  bool isChannelDisplayed(CH_Channel *chp) const;
676  SYS_DEPRECATED(16.0)
677  bool isChannelDisplayed( const CH_ChannelRef &chref ) const;
678  SYS_DEPRECATED(16.0)
679  bool isChannelDisplayed( const char *full_chan_path ) const;
680  SYS_DEPRECATED(16.0)
681  void clearDisplayedChannels( bool propagate = true );
682  SYS_DEPRECATED(16.0)
683  void displayAllScopedChannels( bool propagate = true );
684  SYS_DEPRECATED(16.0)
685  void displaySelectedScopedChannels( bool propagate = true );
686 
687  SYS_DEPRECATED(16.0)
688  void displayChannel( const CH_ChannelRef &chref,
689  bool propagate = true );
690  SYS_DEPRECATED(16.0)
691  void displayChannel( const char *full_chan_path,
692  bool propagate = true );
693  SYS_DEPRECATED(16.0)
694  void undisplayChannel( const CH_ChannelRef &chref,
695  bool propagate = true );
696  SYS_DEPRECATED(16.0)
697  void undisplayChannel( const char *full_chan_path,
698  bool propagate = true );
699 
700  //
701  // Selected Channels (within the scoped channels)
702  //
703  SYS_DEPRECATED(16.0)
704  bool isChannelSelected( const CH_ChannelRef &chref ) const;
705  SYS_DEPRECATED(16.0)
706  bool isChannelSelected( const char *full_chan_path ) const;
707  SYS_DEPRECATED(16.0)
708  void clearSelectedChannels( bool propagate = true );
709  SYS_DEPRECATED(16.0)
710  void selectAllScopedChannels(bool propagate = true );
711 
712  SYS_DEPRECATED(16.0)
713  void selectChannel( const CH_ChannelRef &chref,
714  bool propagate = true );
715  SYS_DEPRECATED(16.0)
716  void selectChannel( const char *full_chan_path,
717  bool propagate = true );
718  SYS_DEPRECATED(16.0)
719  void deselectChannel( const CH_ChannelRef &chref,
720  bool propagate = true );
721  SYS_DEPRECATED(16.0)
722  void deselectChannel( const char *full_chan_path,
723  bool propagate = true );
724 
725  //
726  // Pinned Channels (within the scoped channels)
727  //
728  SYS_DEPRECATED(16.0)
729  void togglePinAllScopedChannels();
730  SYS_DEPRECATED(16.0)
731  void togglePinScopedChannels( const CH_ChannelRefList &chanrefs );
732  SYS_DEPRECATED(16.0)
733  void pinAllScopedChannels( bool propagate = true );
734  SYS_DEPRECATED(16.0)
735  void unpinAllScopedChannels( bool propagate = true );
736  SYS_DEPRECATED(16.0)
737  void pinSelectedChannels( bool propagate = true,
738  int operate_on = CH_SELECTED );
739  SYS_DEPRECATED(16.0)
740  void unpinSelectedChannels( bool propagate = true,
741  int operate_on = CH_SELECTED );
742  SYS_DEPRECATED(16.0)
743  void pinChannels( const CH_ChannelRefList &chanrefs,
744  bool propagate = true );
745  SYS_DEPRECATED(16.0)
746  void unpinChannels( const CH_ChannelRefList &chanrefs,
747  bool propagate = true );
748  //
749  // Scopped Layers
750  //
751  SYS_DEPRECATED(16.0)
752  void clearLayerScope();
753  SYS_DEPRECATED(16.0)
754  bool isLayerScoped(CH_Channel *chp) const;
755  SYS_DEPRECATED(16.0)
756  bool isLayerScoped(const char *full_chan_path) const;
757  SYS_DEPRECATED(16.0)
758  bool isLayerScoped(const CH_ChannelRef &chref) const;
759  SYS_DEPRECATED(16.0)
760  void scopeLayer(const CH_ChannelRef &chref, bool on_off);
761  SYS_DEPRECATED(16.0)
762  void scopeLayer(const char *full_chan_path, bool on_off);
763  SYS_DEPRECATED(16.0)
764  bool scopeLayerInternal(CH_Channel *chp, bool on_off);
765  SYS_DEPRECATED(16.0)
766  bool scopeLayerInternal(const CH_ChannelRef &chref, bool on_off);
767 
768  //
769  // Selected Layers (within the scoped layers)
770  //
771  SYS_DEPRECATED(16.0)
772  bool isLayerSelected( const CH_ChannelRef &chref ) const;
773  SYS_DEPRECATED(16.0)
774  bool isLayerSelected( const char *full_chan_path ) const;
775  SYS_DEPRECATED(16.0)
776  void clearSelectedLayers( bool propagate = true );
777  SYS_DEPRECATED(16.0)
778  void selectAllScopedLayers(bool propagate = true );
779 
780  SYS_DEPRECATED(16.0)
781  void selectLayer( const CH_ChannelRef &chref, bool propagate = true );
782  SYS_DEPRECATED(16.0)
783  void selectLayer( const char *full_chan_path, bool propagate = true );
784  SYS_DEPRECATED(16.0)
785  void deselectLayer( const CH_ChannelRef &chref, bool propagate = true );
786  SYS_DEPRECATED(16.0)
787  void deselectLayer( const char *full_chan_path, bool propagate = true );
788 
789  //
790  // Pinned Layers (within the scoped layers)
791  //
792  SYS_DEPRECATED(16.0)
793  void togglePinAllScopedLayers();
794  SYS_DEPRECATED(16.0)
795  void togglePinScopedLayers( const CH_ChannelRefList &chanrefs );
796  SYS_DEPRECATED(16.0)
797  void pinAllScopedLayers( bool propagate = true );
798  SYS_DEPRECATED(16.0)
799  void unpinAllScopedLayers( bool propagate = true );
800  SYS_DEPRECATED(16.0)
801  void pinSelectedLayers( bool propagate = true, int operate_on = CH_LAYER_SELECTED );
802  SYS_DEPRECATED(16.0)
803  void unpinSelectedLayers( bool propagate = true, int operate_on = CH_LAYER_SELECTED );
804  SYS_DEPRECATED(16.0)
805  void pinLayers( const CH_ChannelRefList &chanrefs, bool propagate = true );
806  SYS_DEPRECATED(16.0)
807  void unpinLayers( const CH_ChannelRefList &chanrefs, bool propagate = true );
808 
809  //
810  // Displayed Layers (within the scoped layers)
811  SYS_DEPRECATED(16.0)
812  bool isLayerDisplayed(CH_Channel *chp) const;
813  SYS_DEPRECATED(16.0)
814  bool isLayerDisplayed( const CH_ChannelRef &chref ) const;
815  SYS_DEPRECATED(16.0)
816  bool isLayerDisplayed( const char *full_chan_path ) const;
817  SYS_DEPRECATED(16.0)
818  void clearDisplayedLayers( bool propagate = true );
819  SYS_DEPRECATED(16.0)
820  void displayAllScopedLayers( bool propagate = true );
821  SYS_DEPRECATED(16.0)
822  void displaySelectedScopedLayers( bool propagate = true );
823 
824  SYS_DEPRECATED(16.0)
825  void displayLayer( const CH_ChannelRef &chref,
826  bool propagate = true );
827  SYS_DEPRECATED(16.0)
828  void displayLayer( const char *full_chan_path,
829  bool propagate = true );
830  SYS_DEPRECATED(16.0)
831  void undisplayLayer( const CH_ChannelRef &chref,
832  bool propagate = true );
833  SYS_DEPRECATED(16.0)
834  void undisplayLayer( const char *full_chan_path,
835  bool propagate = true );
836  // Generic channel flag manipulation methods
837  SYS_DEPRECATED(16.0)
838  void setChannelFlags( const CH_ChannelRef &chref,
839  unsigned flags,
840  bool on_off,
841  bool propagate = true );
842  SYS_DEPRECATED(16.0)
843  unsigned getChannelFlags( const CH_ChannelRef &chref ) const;
844 
845  // Expand a string given a specific channel set (for locals). It's
846  // possible that the channel collection can be null, meaning local
847  // variables won't be picked up. The input string is expected to be an
848  // unexpanded string value using the old improper expression syntax. The
849  // method returns a mask with CH_EXPRTIME set if the string uses time
850  // dependent variables.
851  int expandString(const char *string, UT_String &expanded,
852  fpreal time, CH_Collection *local = nullptr,
853  int thread = 0,
854  int expansion_type = CH_EXPANSION_TYPE_DEFAULT,
856  context_options_stack = nullptr,
857  DEP_ContextOptionsReadHandle context_options =
859 
860  void buildStringOpDependencies( const char *str, void *ref_id,
861  CH_Collection *locals, int thread );
862 
863  /// Return true if the variable exists in the given string. The variable
864  /// may be in the form @c "$NAME" or "NAME". If @c expand_expressions is
865  /// true, any back-tick expressions will be expanded and the result scanned
866  /// for the variable.
867  bool scanForVariableInString(const char *variable,
868  const char *string) const;
869  bool changeStringOpRef( UT_String &str,
870  const char *new_fullpath,
871  const char *old_fullpath,
872  const char *old_cwd,
873  const char *chan_name,
874  const char *old_chan_name,
875  CH_Collection *locals,
876  int thread );
877 
878  // These functions evaluate expressions that have been specified using the
879  // old proper expression syntax.
880  fpreal evaluate(const char *expr, fpreal now,
881  CH_Collection *local=nullptr, int *frame_dep=nullptr,
882  int thread = 0,
885  context_options_stack = nullptr,
886  DEP_ContextOptionsReadHandle context_options =
887  DEP_ContextOptionsReadHandle());
888  int evaluateString(const char *expr, UT_String &result,
889  fpreal now, CH_Collection *local=nullptr,
890  int thread = 0,
891  CH_ExprLanguage language = CH_OLD_EXPR_LANGUAGE,
893  context_options_stack = nullptr,
894  DEP_ContextOptionsReadHandle context_options =
895  DEP_ContextOptionsReadHandle());
896 
897  // Issue an expression evaluation error. 'err' is an index used for
898  // ev_GetErrorText(). NOTE: This will call ev_SetErrNo(EV_NOERROR, thread)!
899  static void evaluationError(int err, int thread, const char *path);
900 
901  // Global parameter management
902 
903  // This function tells us if we are in the process of setting a global
904  // param value. This is useful for differentiating between real node
905  // change events, and apparent node changes caused by setting a global
906  // param.
907  // If add_dependencies is set, the currently evaluating operator will have
908  // dependencies added for the global parameter. Disable this if you're
909  // just getting values for push/pop of values.
910  bool getIsSettingGlobalParam() const
911  { return (mySettingGlobalParam > 0); }
912  void getGlobalParamF(const char *token, CH_Collection *scope,
913  fpreal &result, fpreal def, int thread,
914  bool add_dependencies /*=true*/);
915  void getGlobalParamS(const char *token, CH_Collection *scope,
916  UT_String &result, const char *def,
917  int thread, bool add_dependencies /*=true*/);
918 
919  /// The AnyScope variants will start at the given scope and work upwards
920  /// until a global parameter is found. If none is found, they will
921  /// act like getGlobalParamF on the root scope.
922  void getGlobalParamAnyScopeF(const char *token, CH_Collection *scope,
923  fpreal &result, fpreal def, int thread,
924  bool add_dependencies /*=true*/);
925  void getGlobalParamAnyScopeS(const char *token, CH_Collection *scope,
926  UT_String &result, const char *def,
927  int thread, bool add_dependencies /*=true*/);
928 
929  int setGlobalFloatParam(const char *token,
930  fpreal val,
931  CH_Collection *&owner);
932  int setGlobalStringParam(const char *token,
933  const char *strval,
934  CH_Collection *&owner);
935 
936  int removeGlobalParamOwner(CH_Collection *owner);
937  void dumpGlobalParams(std::ostream &out) const;
938 
939  // The optional dependents set, if specified, will be populated with
940  // a set of the dependent CH_Collection(s).
941  void dirtyOrphanGlobalParamDependents(const char *token,
942  CH_Collection *scope,
943  bool recurse,
944  UT_Set<CH_Collection *> *dependents);
945 
946  // Like global params, simulation guide parameters need a flag so we
947  // know not to destroy interests and extra inputs when they are changed.
949  { return (mySettingGuideParam > 0); }
950 
951  static CH_KeyState getKeyState(fpreal gtime,
952  const CH_ChannelList &channels,
953  bool loose=false);
954 
955  // Channel Group Management
956  CH_Group *getTopGroup() const;
957  CH_Group *findGroup(const char *const_path, bool create = false,
958  CH_Group *head = nullptr);
959  void findGroups( CH_GroupList &groups,
960  const char *pattern, bool minimal );
961  void findChannelsFromGroups( CH_ChannelList &channels,
962  const char *pattern );
963  void findChanRefsFromGroups( CH_ChannelRefList &chanrefs,
964  const char *pattern );
965  static bool makeGroupPathValid( UT_String &path );
966  static bool makeGroupNameValid( UT_String &path );
967 
968  CH_GroupList getSelectedGroups();
969  CH_Group *getCurrentGroup();
970  void updateGroupSelection(const CH_GroupList &groups,
971  void *by,
972  bool propagate = true);
973  void updateGroupSelectionFromScoped(void *by,
974  bool propagate = true);
975  void updateCurrentGroup(CH_Group *group,
976  void *by,
977  bool propagate = true);
978  void enforceLeafOnlyChannels(CH_Group *group,
979  const char *name="new_group");
980 
981  // RMB Group functions
982  CH_Group *createGroup(const char *const_path,
983  bool do_rename = true,
984  CH_Group *head = nullptr);
985  void renameGroup(CH_Group *group, const char *newname);
986  void deleteGroup(CH_Group *group);
987 
988  // RMB Group* functions
989  void extractGroup( CH_Group *group, CollisionBehaviour cb );
990  CH_Group *collapseGroups( CH_GroupList const& groups,
991  const char *name );
992  void collapseChildren( CH_Group *parent );
993 
994  // TODO merge selected
995 
996  // Group -> Group functions
997  void copyIntoGroup( CH_Group *source, CH_Group *target,
998  CollisionBehaviour cb,
999  const char *new_name = nullptr );
1000  void moveIntoGroup( CH_Group *source, CH_Group *target,
1001  CollisionBehaviour cb,
1002  const char *new_name = nullptr );
1003  void addToGroup( CH_Group *source, CH_Group *target,
1004  CollisionBehaviour cb );
1005  void mergeWithGroup( CH_Group *source, CH_Group *target,
1006  CollisionBehaviour cb );
1007  // TODO remove shared channels?
1008  // TODO replace group?
1009 
1010  // Channels -> Group functions implemented via G -> G
1011  void channelCreated( const CH_Channel *chp );
1012  void channelDeleted( const CH_Channel *chp );
1013 
1014  // save, load functions
1015  void saveGroup(CH_Group *g, std::ostream &os, int binary);
1016  CH_Group *loadGroup(UT_IStream &is);
1017 
1018  bool saveBookmarks(UT_JSONWriter &w,
1019  bool include_temporary=false);
1020  bool saveBookmarks(UT_JSONWriter &w,
1021  const UT_Array<CH_Bookmark *> &bookmarks);
1022  bool loadBookmarks(UT_JSONParser &w,
1023  bool remove_existing = true);
1024 
1025 
1026  // Returns true if there exists a situation in which the string can
1027  // be expanded. Returns false if there is nothing in the string that
1028  // indicates that it could be expanded.
1029  static bool couldExpandString(const char *str);
1030 
1031  // Gets/Sets the default expression language.
1033  { return myDefaultExprLanguage; }
1035  { myDefaultExprLanguage = language; }
1036 
1037  // Checks if the given scoped channels list is the global one
1039  { return p == &myScopedChannels; }
1040 
1041  // Access the global scoped channels
1043  { return myScopedChannels; }
1045  { return myScopedChannels; }
1046 
1047  bool hasExternalCollection(const CH_Collection *collection) const;
1048  /// Scope an existing external collection. Must have been
1049  /// previously added to the channel manager.
1050  void scopeExternalCollection(CH_Collection *collection, bool on_off = true);
1051 
1052  /// Return a pointer to the external collection, or nullptr
1053  /// if the associated collection doesn't exist/hasn't been
1054  /// added
1055  CH_Collection *getExternalCollection(const UT_StringHolder &name) const;
1056 
1057  /// Returns an external channel given a collection and a channel name.
1058  CH_Channel *getExternalChannel(const char *collection,
1059  const char *name) const;
1060 
1061  /// Returns an external channel from a collection name and channel name
1062  /// separated by a '/'.
1063  CH_Channel *findExternalChannel(const UT_StringHolder &path);
1064 
1065  /// Appends channels the channel list when the full path matches the pattern.
1066  /// The pattern must have a '/' to separate the collection matching and the
1067  /// channel name matching. Use "*/*" to get everything, "_Base/*" for all the
1068  /// channels of the _Base collection.
1069  /// Returns the number of entries added.
1070  exint globExternalChannels(
1071  const UT_StringHolder &pattern,
1072  CH_ChannelList &chans);
1073 
1075  const
1076  { return myExternalCollections; }
1077 
1078  // Time Group Management
1079  void timeGroupsChanged();
1080  void addTimeGroup(CH_TimeGroup *group,
1081  bool do_rename=true,
1082  bool force=false);
1083  void destroyTimeGroup(const CH_TimeGroup *group);
1084  void destroyTimeGroup(int i);
1085  void renameTimeGroup(CH_TimeGroup *group,
1086  const char *newname,
1087  bool force=false);
1088  int getNTimeGroups() const {return myTimeGroups.entries();}
1089  CH_TimeGroup *getTimeGroup(int i) { return myTimeGroups(i); }
1090  const CH_TimeGroup *getTimeGroup(int i) const { return myTimeGroups(i); }
1091  CH_TimeGroup *getTimeGroup(const char *name);
1092  const CH_TimeGroup *getTimeGroup(const char *name) const;
1093  int getTimeGroupIdx( const char *name ) const;
1094 
1095 
1096  // Bookmark Management
1097  void bookmarksChanged(
1098  CH_BookmarkEvent action,
1099  int64 bookmark_id);
1100 
1102  { return myBookmarksMicroNode; }
1103  /// Add a new bookmark, returning the index at which it was added
1104  /// If create is true, creates an undo block. This should only be set to
1105  int addBookmark(UT_UniquePtr<CH_Bookmark> &&bookmark,
1106  bool create = true);
1107 
1108  /// Moves the given bookmark to be sorted within the bookmark array.
1109  /// Assumes that the given bookmark is already in the array, and
1110  /// that all other bookmarks are already sorted
1111  /// @param bookmark Bookmark to be sorted
1112  /// @paaram notify If true, and the bookmark changed, sets
1113  /// myBookmarksMicroNode to dirty
1114  int sortBookmark(CH_Bookmark *bookmark,
1115  bool notify = true);
1116 
1117  void destroyBookmark(int index, bool create_undo = true,
1118  bool notify = true);
1119  void destroyBookmarks(
1120  const UT_Array<CH_Bookmark *> &bookmarks,
1121  bool create_undo = true,
1122  bool notify = true);
1123 
1124  void destroyBookmark(CH_Bookmark *bookmark,
1125  bool create_undo = true,
1126  bool notify = true);
1127 
1128  /// Adjust the sample range to match that of the given bookmark
1129  /// If store_previous_range is true, stores the current sample range
1130  /// so that it can be restored later.
1131  void frameBookmark(int index,
1132  bool store_previous_range = true);
1133 
1134  void frameBookmark(CH_Bookmark *bookmark,
1135  bool store_previous_range = true);
1136 
1137  void clearBookmarks();
1138 
1139  CH_Bookmark *getMostRecentBookmark() const;
1140  CH_Bookmark *getLeastRecentBookmark() const;
1141  /// Marks the given bookmark as most recently used, bumping it to the
1142  /// end of the most-recently-used array
1143  void setMostRecentBookmark(CH_Bookmark *bookmark);
1144  /// Marks the given bookmark as least recently used, bumping it to the
1145  /// start of the most-recently-used array
1146  void setLeastRecentBookmark(CH_Bookmark *bookmark);
1147 
1148  /// If there is an actively framed bookmark
1149  /// (sample range == bookmark range), returns the index of that bookmark,
1150  /// otherwise, returns -1
1151  CH_Bookmark *getFramedBookmark() const;
1152  int getFramedBookmarkIndex() const;
1153  int getNBookmarks() const { return myBookmarks.entries(); }
1154  /// Given a bookmark, return its index in the bookmark list, or -1 if
1155  /// the bookmark is not in the list
1156  int getBookmarkIndex(CH_Bookmark *bookmark);
1157  CH_Bookmark *getBookmark(int i) { return myBookmarks(i).get(); }
1158  const CH_Bookmark *getBookmark(int i) const
1159  { return myBookmarks(i).get(); }
1160 
1161  CH_Bookmark *getBookmarkBySessionId(int64 bookmark_id) const;
1162 
1163  /// Given an input array of bookmark session ids, returns
1164  /// an array of matching bookmark objects. Any invalid ids will be returned
1165  /// as nullptr in the output array.
1166  UT_Array<CH_Bookmark *> getBookmarksBySessionIds(
1167  const UT_Array<int64> &ids) const;
1168 
1170  { return myRecentBookmarks; }
1171 
1172  /// Utility function to make a floating point number "nice" - i.e. only /
1173  /// use N decimal places after the decimal point.
1174  /// Should only be used for frames/samples (not time in seconds).
1175  static inline fpreal niceNumber(fpreal num, int digits=6);
1176 
1177  // Utility function to find a frame separation that is an intelligent
1178  // multiple/subdivision of the current frame rate, close to the
1179  // initialSep parameter.
1180  int niceFrameSeparation(fpreal initial_sep,
1181  int minimum_sep = 1) const;
1182 
1183  // Stretching collections will stretch every channel of every collection
1184  // based on the old time passed to us.
1185  // The channels will be stretched to fit the new time
1186  void stretchCollections(CH_Collection *from, fpreal ostart,
1187  fpreal oend);
1188 
1189  /// Updates start and end time of collections to preserve key frames based
1190  /// on the previous fps
1191  void preserveCollectionKeyframes(CH_Collection *grp, fpreal old_fps);
1192 
1193  /// Shifts all collections by the given time_delta
1194  void shiftCollections(CH_Collection *grp, fpreal time_delta);
1195 
1196  static fpreal getDefaultFPS();
1197  static fpreal getDefaultLength(fpreal fps);
1198  static fpreal getDefaultLengthFrames(fpreal fps);
1199  static int getDefaultChopMotionSamples();
1200 
1201  fpreal getNumSamples() const { return mySampleCount; }
1202  void setRawNumSamples(int n, bool notify = true);
1203  fpreal getSamplesPerSec() const { return myFPS; }
1204  void setSamplesPerSec(fpreal fps, bool notify = true);
1205  fpreal getSecsPerSample() const { return 1.0 / myFPS; }
1206  void setRawSamplesPerSec(fpreal fps, bool notify = true);
1207  int getChopMotionSamples() const { return myChopMotionSamples; }
1208  void setChopMotionSamples(int n, bool notify = true);
1209 
1210  fpreal getGlobalStart() const { return myStart; }
1211  fpreal getGlobalEnd() const { return myEnd; }
1213  { return getFrame( myStart ); }
1214  int getGlobalEndFrame() const
1215  { return getFrame( myEnd ); }
1216 
1217  void setGlobalTime(fpreal start, fpreal end, bool notify = true);
1218  /// Set the start time directly. End time will be adjusted according to the
1219  /// sample count and fps
1220  void setGlobalStart(fpreal start, bool notify = true);
1221 
1222  void setRawInterpolation(int state) { myRawInterpFlag = state; }
1223  int getRawInterpolation() { return myRawInterpFlag; }
1224 
1225  // CONVERSION
1226  fpreal getTolerance() const { return myTimeTolerance; }
1227  fpreal getFrameTolerance() const { return 1.0F / fpreal(CH_SAMPLES_PER_FRAME); }
1228  // sample -> time
1229  fpreal getTime(fpreal sample) const
1230  {
1231  return ((sample-1.0)/myFPS);
1232  }
1233  // time -> sample (for calculation)
1235  {
1236  return t*myFPS+1.0;
1237  }
1238  // time -> sample (for display)
1240  {
1241  return niceNumber(getSampleRaw(t));
1242  }
1243  // time -> sample (integer)
1244  int getFrame(fpreal t) const
1245  {
1246  return (int)SYSfloor(getSampleRaw(t+getTolerance()));
1247  }
1248  // sample-delta -> time-delta
1249  fpreal getTimeDelta(fpreal sample_delta) const
1250  {
1251  return sample_delta/myFPS;
1252  }
1253  // time-delta -> sample-delta
1254  fpreal getSampleDelta(fpreal time_delta) const
1255  {
1256  return time_delta*myFPS;
1257  }
1258  // time -> time (snapped to an integer frame)
1260  {
1261  return getTime( SYSrint( getSampleRaw(t) ) );
1262  }
1263 
1264  // time -> time (snapped to a subframe)
1266  {
1267  return getTime(getSnapSubsample(getSampleRaw(t)));
1268  }
1269 
1270  // frame -> frame (snapped to an integer frame)
1271  // see also SI_Dopesheet::getSnapSample()
1273  {
1274  return SYSrint(frame);
1275  }
1276 
1277  /// Snaps a frame to aligns with the sample step
1278  /// (taking the start frame into account)
1279  // see also SI_Dopesheet::getSnapSubsample()
1281  {
1282  return SYSrint((frame - getGlobalStartFrame())
1283  * (1.0 / mySampleStep))
1284  * mySampleStep + getGlobalStartFrame();
1285  }
1286  // say you have a key at frame 0.6 (base_time) and you are moving it with
1287  // snap to frame on, so you want to snap the amount you move the key so
1288  // that the key lands on the nearest frame. In this example, time_delta
1289  // would be rounded to numbers like: -1.6, -0.6, 0.4, 1.4. This function
1290  // does this. Note that the parameters and return value are in time not
1291  // frames as they were in the example.
1292  fpreal getSnapToFrameDelta(fpreal base_time, fpreal time_delta) const;
1293  // time -> bool (true if time is at an integer frame boundary)
1294  bool getIsAtFrame(fpreal t) const
1295  {
1296  fpreal snaptime;
1297 
1298  snaptime = getSnapToFrameTime( t );
1299  return SYSisEqual(t, snaptime, getTolerance());
1300  }
1301 
1302  // Get code in buf
1303  void getTimeCode(char *buf, fpreal t);
1304  // Return time from buf
1305  int setTimeCode(const char *buf, fpreal &t);
1306 
1307  void setTimeCodeOffset(fpreal t) { myTimeCodeOffset = t; }
1308  fpreal getTimeCodeOffset(fpreal ) const { return myTimeCodeOffset; }
1309 
1310  int getIntegerFrameFlag() const { return myIntegerFrames; }
1311  void setIntegerFrameFlag(int flag, bool notify = true);
1312 
1313  int getRestrictRangeFlag() const { return myRestrictRange; }
1314  void setRestrictRangeFlag(int flag, bool notify = true);
1315 
1316  int getShowRangeFlag() const { return myShowRange; }
1317  void setShowRangeFlag(int flag, bool notify = true);
1318 
1319  int getShowTicksFlag() const { return myShowTicks; }
1320  void setShowTicksFlag(int flag, bool notify = true);
1321 
1322  int getShowAudioFlag() const { return myShowAudio; }
1323  void setShowAudioFlag(int flag, bool notify = true);
1324 
1325  int getShowKeysFlag() const { return myShowKeys; }
1326  void setShowKeysFlag(int flag, bool notify = true);
1327 
1328  int getShowBookmarksFlag() const { return myShowBookmarks; }
1329  void setShowBookmarksFlag(int flag, bool notify = true);
1330 
1331  int getShowSimCacheFlag() const { return myShowSimCache; }
1332  void setShowSimCacheFlag(int flag, bool notify = true);
1333 
1334  int getShowAnimBarFlag() const { return myShowAnimBar; }
1335  void setShowAnimBarFlag(int flag, bool notify = true);
1336 
1337  fpreal getAudioLevel() const { return myAudioLevel; }
1338  void setAudioLevel(fpreal lvl) { myAudioLevel = lvl; }
1339 
1340  fpreal getUnitLength() const { return myUnitLength; }
1341  void setUnitLength(fpreal unitlength){ myUnitLength = unitlength; }
1342  fpreal getUnitMass() const { return myUnitMass; }
1343  void setUnitMass(fpreal unitmass) { myUnitMass = unitmass; }
1344  void parseUnitsString(const char *units,
1345  fpreal &distexp,
1346  fpreal &massexp) const;
1347  fpreal scaleToMKS(const char *fromunits) const;
1348  fpreal scaleFromMKS(const char *tounits) const;
1349 
1350  int getRealTimeFlag() const { return myRealTimePlay; }
1351  void setRealTimeFlag(int flag, bool notify = true);
1352  fpreal getRealTimeFactor() const { return myRealTimeFactor; }
1353  void setRealTimeFactor(fpreal f, bool notify = true);
1354  bool getRealTimeDisableSkip() const { return myRealTimeDisableSkip; }
1355  void setRealTimeDisableSkip(bool b, bool notify = true);
1356  fpreal getSampleStep() const { return mySampleStep; }
1357  void setSampleStep(fpreal s, bool notify = true);
1358 
1360  {
1361  start = myRangeStart;
1362  end = myRangeEnd;
1363  }
1364  void setSampleRange(fpreal start, fpreal end, bool notify = true);
1365 
1366  int getHoldFlag() const { return myHoldFlag; }
1367  void setHoldFlag( int flag ) { myHoldFlag = flag; }
1368 
1369  // I/O methods
1370  int saveChannels(const char *filename, bool binary, bool compiled,
1371  const CH_ChannelList &channels,
1372  bool displayed = false) const;
1373  int loadChannels(const char *filename,
1374  const char *src_pattern,
1375  const char *dest_pattern,
1376  bool use_range,
1377  const fpreal *tstart,
1378  const fpreal *tend,
1379  CH_CollectionList &parents,
1380  bool delete_keys = false,
1381  CH_ChannelRefList *displayed_parms = nullptr);
1382  static bool readCHNFileHeader(UT_IStream &is, bool quiet,
1383  fpreal32 &version, int &binary,
1384  bool &is_fp64,
1385  fpreal64 &tstart, fpreal64 &tend);
1386  static bool skipCHNFileHeaderForCollection(UT_IStream &is, bool &is_fp64);
1387  static bool getFileType( const char *filename, int &raw, int &binary );
1388  static bool printFileInfo(std::ostream &os, const char *filename,
1389  CH_Collection *load_coll,
1390  bool print_segments=true );
1391 
1392  // Expression glue. Only call this if you know what you're really doing.
1393  void addExpressionDefine(CH_ExprDefine *def);
1394 
1395  // The following method should only be called by CH_Collection, so please
1396  // don't mess me up.
1398  {
1399  // We use thread-local storage for the eval
1400  // collection. This isn't because two
1401  // different collections can be evaluating
1402  // paramaters in different threads at the same
1403  // time, though it would be nice for that to be
1404  // possible one day. Instead, it's so that if
1405  // Houdini is evaluating a parameter at the
1406  // same time as a python script is running code
1407  // that checks for the currently evaluating
1408  // parameter (so it can add the appropriate
1409  // parm interests), that we don't add parm
1410  // interests when we shouldn't.
1411  evalContext(thread).myCollection = g;
1412  // Reset the other members to avoid stale ptrs
1413  evalContext(thread).myChannel = nullptr;
1414  evalContext(thread).mySegment = nullptr;
1415  evalContext(thread).myChannelName = nullptr;
1416  }
1417  // TODO: Make getEvalCollection() return a const pointer
1419  {
1420  // We use thread-local storage the eval
1421  // collection.
1422  //
1423  // If this is the first time this thread has
1424  // accessed the pointer it will be null.
1425  // That's exactly the behaviour we want.
1426  return evalContext(thread).myCollection;
1427  }
1428 
1429  // The CH_Manager needs a pointer to the channel collection for the
1430  // OP_Director. This is used to trigger events when channel and time
1431  // groups are modified.
1433  { myRootCollection = root; }
1435  { return myRootCollection; }
1436 
1437  virtual CH_ScriptAccessManager *getAccessManager(int /*thread*/)
1438  { return nullptr; }
1439 
1440  inline const CH_EvalContext &
1441  evalContext(int thread) const
1442  { return myEvalContext.getValueForThread(thread); }
1443 
1444  inline CH_EvalContext &
1446  { return myEvalContext.getValueForThread(thread); }
1447 
1448  inline const CH_Channel *getEvalChannel(int thread) const
1449  { return evalContext(thread).myChannel; }
1450  inline const CH_Segment *getEvalSegment(int thread) const
1451  { return evalContext(thread).mySegment; }
1452  inline const char *getEvalChannelName(int thread) const
1453  { return evalContext(thread).myChannelName; }
1454  inline const DEP_ContextOptionsStack *
1456  { return evalContext(thread).myContextOptionsStack; }
1459  { return evalContext(thread).myContextOptions; }
1460 
1461  /// Functions for obtaining and setting the current evaluation time
1462  // @{
1463  inline fpreal getEvaluateTime(int thread) const
1464  { return evalContext(thread).time(); }
1465  inline void setEvaluateTime(fpreal time, int thread)
1466  { evalContext(thread).setTime(time); }
1467  inline void setEvaluateTime(SYS_Flicks fl, int thread)
1468  { evalContext(thread).setFlicks(fl); }
1469  // @}
1470 
1471  /// The following function only remains for backwards compatibility of
1472  /// HDK users. Calls to this function should be replaced with one of the
1473  /// following forms:
1474  /// getEvaluateTime(context.getThread()) -> inside cooking code path
1475  /// getEvaluateTime(thread) -> in expression functions
1476  /// CHgetEvalTime() -> else without thread variable
1477  SYS_DEPRECATED(11.1) fpreal getEvaluateTime() const
1478  { return getEvaluateTime(SYSgetSTID()); }
1479 
1480  //
1481  // These methods are usually only used by CH_Collection to evaluate
1482  // variables belonging to me...
1483  CH_LocalVariable *getLocalVariableTable() const;
1484  bool getVariableValue(UT_String &str, int i,
1485  int thread) const;
1486  bool getVariableValue(fpreal &val, int i,
1487  int thread) const;
1488 
1489  // Should only be called if the variable has flagged as CH_VARIABLE_INTVAL
1490  bool getVariableValue(int &val, int i, int thread) const;
1491 
1492  // getVariableString should really be protected, but can't do it.
1493  virtual bool getVariableString(const char *name,
1494  UT_String &value,
1495  int &time_depend,
1496  int thread);
1497 
1498  // Function for adding new global variables with the HDK.
1499  int addVariable(const CH_LocalVariable &var,
1500  CH_StringVarEvalFunc strfunc,
1501  CH_FloatVarEvalFunc floatfunc,
1502  CH_IntVarEvalFunc intfunc) const;
1503 
1504  static void lookupVariable(const char *name, UT_String &val,
1505  int thread);
1506  static void lookupVariableNoThread(const char *name,
1507  UT_String &val);
1508  static void lookupExpression(const char *name, UT_String &val,
1509  int thread);
1510  static void lookupExpressionNoThread(const char *name,
1511  UT_String &val);
1512 
1513  // This should only be called by CH_Collection
1514  void removeParamDependency(CH_Collection *coll);
1515 
1516  /// Use this method to translate a channel reference to a channel pointer.
1517  /// May return NULL if the channel reference does not reference a valid
1518  /// channel.
1519  virtual CH_Channel *getChRefChannel(const CH_ChannelRef &r) const;
1520 
1521  /// Use this method to determine if the owner of the channel reference
1522  /// is exposed or not.
1523  virtual bool isOwnerExposed(const CH_ChannelRef &r) const;
1524 
1525  /// Use this method to build a channel reference from a channel pointer.
1526  virtual bool buildChanRef(CH_ChannelRef &r,
1527  const CH_Channel *chp) const;
1528 
1529  /// Use this method to build a channel reference from a channel path.
1530  virtual bool buildChanRef(CH_ChannelRef &r,
1531  const char *path) const;
1532 
1533  bool buildChannelRefs( CH_ChannelRefList &reflist,
1534  const CH_ChannelList &chlist );
1535 
1536  bool buildChannelRefs( CH_ChannelRefList &reflist,
1537  const UT_StringArray &chlist );
1538 
1539  /// Returns 0 if r1 and r2 are equal, returns -1 if r1 < r2 and
1540  /// returns 1 if r1 > r2.
1541  virtual int compareChanRefs(const CH_ChannelRef &r1,
1542  const CH_ChannelRef &r2) const;
1543 
1544  /// Returns 0 if r1 and r2 are equal, returns -1 if r1 < r2 and
1545  /// returns 1 if r1 > r2.
1546  virtual int compareLayerRefs(const CH_ChannelRef &r1,
1547  const CH_ChannelRef &r2) const;
1548 
1549  /// Use this method to get the full path of the channel referenced by r.
1550  virtual void getChanRefPath(const CH_ChannelRef &r,
1551  UT_String &path,
1552  bool use_alias=false) const;
1553 
1554  virtual bool isChanRefValid( const CH_ChannelRef &chref) const;
1555 
1556  void changeReferencesToNodeId(int old_id, int new_id);
1557 
1558  /// This method will remove all references that this manager knows about
1559  /// channels belonging to node 'node_id'. After this method, scoped
1560  /// channels belonging to node_id will be removed, as will such channels
1561  /// in channel groups.
1562  void removeReferencesToNodeId(int node_id);
1563 
1564  void displayScope() const;
1565 
1566  // Find ChannelRef export location
1567  // Channel CHOP nodes have inputs that match directly to the exported
1568  // tracks. Given a Channel CHOP value param and index, find the export
1569  // location in the scene and return its ChannelRef If the input 'r' channel
1570  // ref is from a CHOP Channel Node, return the corresponding export in
1571  // 'out_export'.
1572  // Returns true if a valid Export was found
1573  virtual bool resolveChanRefExport(const CH_ChannelRef& r,
1574  CH_ChannelRef& out_export );
1575 
1576  /// Auto-Key all Tuples is a preference to key tuples together.
1577  bool getAutoKeyTuples() const
1578  { return myAutoKeyTuples; }
1579  void setAutoKeyTuples(bool b)
1580  { myAutoKeyTuples=b; }
1581 
1582  /// Auto-Scope when Creating Channel is a preference to set the auto-scope
1583  /// flag when creating a channel.
1585  { return mySetAutoScopeOnChannelCreate; }
1587  { mySetAutoScopeOnChannelCreate=b; }
1588 
1589  /// Include all the Animated Channels when building the scoped parameter
1590  /// list from selection
1592  { return myAutoScopeIncludeAnimated; }
1594  { myAutoScopeIncludeAnimated=b; }
1595 
1596  ///
1598  { return myFollowScopedChannelReferences; }
1600  { myFollowScopedChannelReferences=b; }
1601 
1602 
1603  //
1604  // Animation functions.
1605  //
1606  fpreal evalBezierFunc(int thread);
1607  fpreal evalConstantFunc(int thread);
1608  fpreal evalCubicFunc(int thread);
1609  fpreal evalCycleFunc(fpreal start_frame, fpreal end_frame,
1610  int thread);
1611  fpreal evalCycletFunc(fpreal start_frame, fpreal end_frame,
1612  int thread);
1613  fpreal evalCycleOffsetFunc(
1614  fpreal start_frame, fpreal end_frame, int thread);
1615  fpreal evalCycleOffsettFunc(
1616  fpreal start_frame, fpreal end_frame, int thread);
1617  fpreal evalEaseFunc(int thread);
1618  fpreal evalEaseinFunc(int thread);
1619  fpreal evalEaseinpFunc(fpreal ease_speed, int thread);
1620  fpreal evalEaseoutFunc(int thread);
1621  fpreal evalEaseoutpFunc(fpreal ease_speed, int thread);
1622  fpreal evalEasepFunc(fpreal ease_speed, int thread);
1623  fpreal evalLinearFunc(int thread);
1624  fpreal evalMatchFunc(int thread);
1625  fpreal evalMatchinFunc(int thread);
1626  fpreal evalMatchoutFunc(int thread);
1627  fpreal evalQcubicFunc(int thread);
1628  fpreal evalQlinearFunc(int thread);
1629  fpreal evalQuinticFunc(int thread);
1630  fpreal evalRepeatFunc(fpreal start_frame, fpreal end_frame,
1631  int thread);
1632  fpreal evalRepeattFunc(fpreal start_frame, fpreal end_frame,
1633  int thread);
1634  fpreal evalSplineFunc(int thread);
1635  fpreal evalVmatchFunc(int thread);
1636  fpreal evalVmatchinFunc(int thread);
1637  fpreal evalVmatchoutFunc(int thread);
1638 
1639  /// Include all the Child nodes when building the scoped parameter list
1640  /// from selection
1642  { return myAutoScopeIncludeChild; }
1644  { myAutoScopeIncludeChild=b; }
1645 
1646  /// Include all the Constraints nodes when building the scoped parameter
1647  /// list from selection
1649  { return myAutoScopeIncludeConstraints; }
1651  { myAutoScopeIncludeConstraints=b; }
1652 
1653  // Functions for accessing and controlling the default context option
1654  // values. These values are used by all OP_Context objects unless a
1655  // value is explicitly overridden on that context object. These functions
1656  // also manage the associated micro nodes and send notifications as
1657  // appropriate.
1659  { return myDefaultContextOptions; }
1660  DEP_MicroNode &getDefaultContextOptionMicroNode(
1661  const UT_StringHolder &opt);
1662  void setDefaultContextOption(
1663  const UT_StringHolder &opt,
1664  const UT_StringHolder &value,
1665  bool create_undo);
1666  void setDefaultContextOption(
1667  const UT_StringHolder &opt,
1668  fpreal64 value,
1669  bool create_undo);
1670  const UT_StringHolder &getDefaultContextOptionUiConfig(
1671  const UT_StringHolder &opt) const;
1672  void setDefaultContextOptionUiConfig(
1673  const UT_StringHolder &opt,
1674  const UT_StringHolder &ui_config);
1675  void removeDefaultContextOption(
1676  const UT_StringHolder &opt,
1677  bool create_undo);
1678  void clearDefaultContextOptions(bool create_undo);
1679  bool saveDefaultContextOptions(std::ostream &os) const;
1680  bool loadDefaultContextOptions(UT_IStream &is);
1681  int addDefaultContextOptionCallback(
1683  void removeDefaultContextOptionCallback(int id);
1684  bool isAutomaticContextOption(
1685  const UT_StringHolder &opt) const;
1686  bool isAutomaticContextOptionOverridden(
1687  const UT_StringHolder &opt) const;
1688  void pushRopCookContextOptions();
1689  void pushRopCookContextOptions(bool ropcook,
1690  fpreal fstart,
1691  fpreal fend,
1692  fpreal finc,
1693  const UT_StringHolder &ropname,
1694  const UT_StringHolder &roppath);
1695  void resetRopCookContextOptions();
1696  void updateRopCookContextOptions(bool ropcook,
1697  fpreal fstart,
1698  fpreal fend,
1699  fpreal finc,
1700  const UT_StringHolder &ropname,
1701  const UT_StringHolder &roppath);
1702  void popRopCookContextOptions();
1703 
1704  void setChannelColorManager( CH_ChannelColorManager *mgr );
1705  CH_ChannelColorManager *channelColorManager();
1706 
1707  void setChannelChanged( CH_ChannelChanged *mgr );
1708  CH_ChannelChanged *getChannelChanged();
1709  void triggerChannelChanged();
1710 
1711  CH_Tweener *getChannelTweener() { return &myChannelTweener; }
1712 
1713  virtual bool getChannelAutoSelect(const CH_ChannelRef &chref) const
1714  { return true; }
1715 
1716  // Resolve channel labels and node path without exposing OP_Node*
1717  virtual bool getChRefLabelForUI(const CH_ChannelRef &r, UT_String &ret) const;
1718  virtual bool getChRefAlias(const CH_ChannelRef &r, UT_String &ret) const;
1719  virtual bool getChRefNodePath(const CH_ChannelRef &r, UT_String &ret) const;
1720 
1722  { return myIgnoreUpdateScopeFlag; }
1723  void setIgnoreUpdateScopeFlag( bool onoff )
1724  { myIgnoreUpdateScopeFlag = onoff; }
1725 
1726  static int getSimpleSegmentTypeFromExpression(const char *expr);
1727 
1728  // The following four methods are overridden by the OP_CommandManager,
1729  // and allow for tracking when channels are being actively modified
1730  // (such as by dragging in the animation editor).
1731  // See the comment in OP_CommandManager for more info.
1732  virtual void beginChannelChanges() {}
1733  virtual void channelsChanged() {}
1734  virtual void endChannelChanges() {}
1735  virtual bool channelsBeingChanged() { return false; }
1736 
1737 protected:
1738  void setTolerance(fpreal tol);
1739 
1740  void initExpressionLibrary();
1741 
1742  // Since this is possibly a base class, the library glue initialization has
1743  // to be done after the construction
1744  void initLibraryGlue();
1745 
1746  /// Add and take ownership of an external channel collection, such
1747  /// as geometry channels passed in by the MOT_GeometryChannelsManager
1748  /// Returns a pointer to the added collection.
1749  /// Should only be called by the OP_CommandManager
1750  CH_Collection *addExternalCollection(
1751  UT_UniquePtr<CH_Collection> &&collection);
1752 
1753  void destroyExternalCollection(
1754  const UT_StringHolder &name);
1755 
1756 private:
1757  friend CH_ScopedChannelsBase;
1758  friend CH_ScopedChannels;
1759 
1760  void internalScopeChanged(unsigned flags,
1761  bool propagate=true,
1762  const int &reason = CH_SCOPE_REPLACED);
1763 
1764  void playbackChanged();
1765 
1766  void handleGroupCollision(CH_Group *new_group,
1767  CH_Group *existing,
1768  CollisionBehaviour cb );
1769 
1770  void destroyContents();
1771  int internalSetGlobalParam(const char *token,
1772  fpreal val, const char *strval,
1773  CH_Collection *&owner);
1774  int setSingleGlobalParam(const char *token,
1775  fpreal val, const char *strvel,
1776  CH_Collection *&owner, CH_Collection *scope);
1777  void internalDirtyOrphanGlobalParamDependents(
1778  const char *token, CH_Collection *scope,
1779  UT_Set<CH_Collection *> *dependents);
1780  void stretchCollection(CH_Collection *grp,
1781  fpreal os, fpreal ns, fpreal stretch);
1782  void propagateDefaultContextOptionDirtied(
1783  const UT_StringHolder &opt);
1784 
1785  static char *chExprExpander(const char *str, int thread);
1786 
1787  class chParamKey
1788  {
1789  public:
1790  chParamKey(const UT_StringRef &token, CH_Collection *scope);
1791  bool operator==(const chParamKey &key) const;
1792  bool operator!=(const chParamKey &key) const
1793  { return !operator==(key); }
1794  SYS_HashType hash() const;
1795  const char *getToken() const
1796  { return myToken; }
1797  CH_Collection *getScope() const
1798  { return myScope; }
1799 
1800  struct Hasher
1801  {
1802  SYS_HashType operator()(const chParamKey &key) const
1803  { return key.hash(); }
1804  };
1805  private:
1806  UT_StringRef myToken;
1807  CH_Collection *myScope;
1808  };
1809 
1811 
1812  // Default Context Options for cooking nodes.
1813  DEP_ContextOptionsHandle myDefaultContextOptions;
1814  UT_StringMap<DEP_MicroNode *> myDefaultContextOptionMicroNodes;
1815  UT_TBBSpinLock myDefaultContextOptionMicroNodesLock;
1816  UT_StringMap<UT_StringHolder> myDefaultContextOptionUIs;
1817 
1818  CH_Group *myTopGroup;
1819  UT_StringArray mySelectedGroupPaths;
1820  UT_String myCurrentGroupPath;
1821  UT_ValArray<CH_TimeGroup *> myTimeGroups;
1822 
1823  // List of bookmarks, sorted by start time.
1824  // NOTE that any operation that changes this array, or the order of it
1825  // MUST also update the myRecentBookmarks array
1827 
1828  // Bookmarks sorted by least to most recently used/interacted with,
1829  // as indices into the myBookmarks list
1830  UT_Array<exint> myRecentBookmarks;
1831 
1832  // Stored frame range to restore after zooming in/out from a bookmark
1833  fpreal myStoredStart;
1834  fpreal myStoredEnd;
1835 
1836  DEP_MicroNode myBookmarksMicroNode;
1837 
1838  UT_StringMap<UT_UniquePtr<CH_Collection>> myExternalCollections;
1839 
1840  CH_Collection *myRootCollection;
1841  fpreal mySampleCount;
1842  fpreal myFPS;
1843  fpreal myStart, myEnd;
1844 
1845  fpreal myRangeStart;
1846  fpreal myRangeEnd;
1847  fpreal myRealTimeFactor;
1848  fpreal mySampleStep;
1849  fpreal myTimeTolerance;
1850  fpreal myTimeCodeOffset;
1851 
1852  chParamData *findGlobalParam(const char *token,
1853  CH_Collection *scope);
1854  chParamData *findOrCreateGlobalParam(
1855  const char *token, CH_Collection *scope,
1856  fpreal fval, const char *sval);
1858  chParamData *myLastGlobalParam;
1859  int mySettingGlobalParam;
1860 
1861  int mySettingGuideParam;
1862 
1863  int myChopMotionSamples;
1864 
1865  unsigned myGroupsSorted:1,
1866  myIntegerFrames:1,
1867  myRealTimePlay:1,
1868  myRealTimeDisableSkip:1,
1869  myHoldFlag:1,
1870  myRestrictRange:1,
1871  myShowRange:1,
1872  myShowTicks:1,
1873  myShowAudio:1,
1874  myShowKeys:1,
1875  myShowBookmarks:1,
1876  myShowSimCache:1,
1877  myShowAnimBar:1,
1878  myAutoKeyTuples:1,
1879  mySetAutoScopeOnChannelCreate:1,
1880  myAutoScopeIncludeAnimated:1,
1881  myFollowScopedChannelReferences:1,
1882  myAutoScopeIncludeChild:1,
1883  myAutoScopeIncludeConstraints:1;
1884 
1885  short myRawInterpFlag;
1886 
1887  UT_String myDefaultExpression;
1888  bool myShouldShowFakeAccelHandles;
1889  UT_String myDefaultRotationExpression;
1890  bool myAutoSplit;
1891  UT_String myDefaultSplitExpression;
1892  SlopeMode myAutoSlope;
1893  fpreal myDefaultSlope;
1894  bool myHoldLastKey;
1895  // auto-commit value change when we are on a keyframe
1896  bool myAlwaysCommitKey;
1897  UT_String myChanCreateKeyExpression;
1898  fpreal myAudioLevel;
1899  fpreal myUnitLength;
1900  fpreal myUnitMass;
1901 
1902  CH_ScopedChannels myScopedChannels;
1903  UT_Array<CH_ScopedChannels*> myPinnedScopedChannels;
1904 
1905  UT_Set<CH_Channel *> myPendingChannelsTable;
1906 
1907  CH_ExprLanguage myDefaultExprLanguage;
1908 
1909  int myBlockModifyScope;
1910  unsigned myPendingScopeChange;
1911  bool myPendingChannelChanged;
1912 
1913  CH_ChannelColorManager *myChannelColorsManager;
1914  CH_ChannelChanged *myChannelChanged;
1915 
1916  CH_Tweener myChannelTweener;
1917 
1919  myDefaultContextOptionCallbacks;
1920  int myNextDefaultContextOptionCallbackId;
1921 
1922  bool myIgnoreUpdateScopeFlag;
1923 
1924  mutable UT_Lock myPendingChannelsLock;
1925 
1926  static CH_Manager *theManager;
1927 
1928  // Drives the precision of floating point times. 1000 means a frame can be
1929  // split into 1000 sub frames. Before H15.0, it was set to 100. This was
1930  // problematic when refitting curves with a very high sampling rate.
1931  static constexpr exint CH_SAMPLES_PER_FRAME = 1000;
1932 
1935  friend class CH_UndoScopeChannels;
1936  friend class CH_ScopeUndo;
1937 };
1938 
1939 /// Push & restore the evaluation time (and optionally a channel collection)
1941 {
1942 public:
1944  int thread,
1945  fpreal time,
1946  CH_Collection *ch = nullptr,
1947  const DEP_ContextOptionsStack *context_options_stack = nullptr,
1948  DEP_ContextOptionsReadHandle context_options =
1950  : myContext(chman.evalContext(thread))
1951  , myCollection(nullptr)
1952  , myPopCollection(false)
1953  , myPopContextOptions(false)
1954  {
1955 #if defined(CH_USE_FLICKS)
1956  myFlicks = myContext.flicks();
1957 #else
1958  mySeconds = myContext.time();
1959 #endif
1960  myContext.setTime(time);
1961  if (ch)
1962  {
1963  myPopCollection = true;
1964  myCollection = myContext.myCollection;
1965  myContext.myCollection = ch;
1966  }
1967  if (!context_options.isNull())
1968  {
1969  myPopContextOptions = true;
1970  myContextOptionsStack = myContext.myContextOptionsStack;
1971  myContext.myContextOptionsStack = context_options_stack;
1972  myContextOptions = myContext.myContextOptions;
1973  myContext.myContextOptions = context_options;
1974  }
1975  }
1976 
1978  {
1979 #if defined(CH_USE_FLICKS)
1980  myContext.setFlicks(myFlicks);
1981 #else
1982  myContext.setTime(mySeconds);
1983 #endif
1984  if (myPopCollection)
1985  myContext.myCollection = myCollection;
1986  if (myPopContextOptions)
1987  {
1988  myContext.myContextOptionsStack = myContextOptionsStack;
1989  myContext.myContextOptions = myContextOptions;
1990  }
1991  }
1992 
1994 
1995 private:
1996  CH_EvalContext &myContext;
1997  CH_Collection *myCollection;
1998  const DEP_ContextOptionsStack *myContextOptionsStack;
1999  DEP_ContextOptionsReadHandle myContextOptions;
2000 #if defined(CH_USE_FLICKS)
2001  SYS_Flicks myFlicks;
2002 #else
2003  fpreal64 mySeconds;
2004 #endif
2005  bool myPopCollection;
2006  bool myPopContextOptions;
2007 
2008  friend class CH_Manager;
2009 };
2010 
2011 /// Push & restore a channel collection only. If the given collection is NULL,
2012 /// then the eval context is not modified.
2014 {
2015 public:
2016  CH_AutoEvalCollection(int thread, CH_Collection *collection = nullptr)
2017  : myContext(CH_Manager::getContext()->evalContext(thread))
2018  {
2019  myCollection = myContext.myCollection;
2020  if (collection)
2021  myContext.myCollection = collection;
2022  }
2024  {
2025  return myContext.myCollection;
2026  }
2027  void set(CH_Collection *collection)
2028  {
2029  UT_ASSERT(collection);
2030  myContext.myCollection = collection;
2031  }
2033  {
2034  myContext.myCollection = myCollection;
2035  }
2036 
2038 
2039 private:
2040  CH_EvalContext &myContext;
2041  CH_Collection *myCollection;
2042 };
2043 
2044 // Small utility class to set the active layer contribution and reset it
2045 // The animation layer value and weight comes from CHOP_Layer extra tracks.
2046 // The active_layer_value and active_layer_weight tracks are used correctly
2047 // reapply values on the active layer channels.
2049 {
2050 public:
2051  CH_ActiveLayerContrib();
2052  ~CH_ActiveLayerContrib();
2053 
2054  UT_NON_COPYABLE(CH_ActiveLayerContrib)
2055 
2056  // set the layer contribution for the lifespan of the object.
2057  void set(fpreal layer_value, fpreal layer_weight);
2058 
2059  // Apply the active layer contribution to input
2060  void apply(fpreal& v);
2061 
2062 private:
2063  bool myReset;
2064 };
2065 
2067 {
2068 public:
2071 
2073 
2074 private:
2075  bool myRestore;
2076 };
2077 
2078 
2079 // Single Parm Vec undo information
2081 {
2082 public:
2084  : myOwner(owner), myChanRef(ref), myFlags(flags)
2085  {}
2086 
2087  // Check if the owner pointer is still valid.
2088  bool checkPtr() const;
2089 
2090  // Apply the flags to the owner
2091  void applyFlags();
2092 
2093  // Query the CH_Manager global and pinned channels lists for undo information
2094  // about a parameter. vec_index must match the CH_ChannelRef.
2095  static void appendScopeUndo(UT_Array<CH_ScopeUndo> &undos, const CH_ChannelRef &ref);
2096 
2099  unsigned myFlags;
2100 };
2101 
2104 CH_API void CHsortChannelPaths( UT_StringArray &channel_paths );
2106 
2108  CH_CollectionList &collections );
2109 
2110 inline
2112 {
2113  return CH_Manager::getContext();
2114 }
2115 
2116 inline fpreal
2118 {
2119  fpreal scale = SYSpow(fpreal(10.0), fpreal(digits));
2120  return (SYSrint(num * scale) / scale);
2121 }
2122 
2123 inline
2125 {
2127 }
2128 
2130 {
2132 }
2133 
2134 inline fpreal CHgetEvalTime(int thread)
2135 {
2136  return CH_Manager::getContext()->getEvaluateTime(thread);
2137 }
2138 
2139 CH_API extern fpreal CHgetTimeFromFrame(fpreal frame);
2140 CH_API extern int CHgetFrameFromTime(fpreal time);
2142 CH_API extern void CHbuildRange(int start, int end, UT_SuperIntervalR &r);
2143 
2144 /// The CHoutputChannelList functions output a formatted string
2145 /// representing the given channels. One version of the function takes a
2146 /// list of channels while the other takes a string array of full paths
2147 /// to channels. The given arrays may be modified (they might need sorting).
2148 CH_API extern void CHoutputChannelList(UT_WorkBuffer &info,
2150 CH_API extern void CHoutputChannelList(UT_WorkBuffer &info,
2151  UT_StringArray &channel_paths);
2152 
2153 CH_API extern void CHdisplayFlags( unsigned flags, std::ostream &s );
2154 
2155 #endif
fpreal getSampleDelta(fpreal time_delta) const
Definition: CH_Manager.h:1254
CH_ScopedChannelsBase(CH_Manager *mgr)
fpreal getRealTimeFactor() const
Definition: CH_Manager.h:1352
void setFilterRotates(bool b)
Definition: CH_Manager.h:347
CH_API void CHsortChannelRefs(CH_ChannelRefList &channels)
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glcorearb.h:2540
GLbitfield flags
Definition: glcorearb.h:1596
DEP_ContextOptionsHandle getDefaultContextOptions() const
Definition: CH_Manager.h:1658
Definition: UT_Set.h:58
fpreal getSnapToSubframeTime(fpreal t) const
Definition: CH_Manager.h:1265
GT_API const UT_StringHolder filename
bool getAutoScopeIncludeConstraints() const
Definition: CH_Manager.h:1648
#define UT_AT_SCOPE_EXIT(...)
Definition: UT_ScopeExit.h:95
const char * getEvalChannelName(int thread) const
Definition: CH_Manager.h:1452
fpreal getSnapToFrameTime(fpreal t) const
Definition: CH_Manager.h:1259
fpreal getSecsPerSample() const
Definition: CH_Manager.h:1205
CH_ScopedChannels(const CH_ScopedChannels &src)
Definition: CH_Manager.h:451
CH_API fpreal CHgetTimeFromFrame(fpreal frame)
bool isGlobalScopedChannels(CH_ScopedChannelsBase *p)
Definition: CH_Manager.h:1038
#define SYS_DEPRECATED(__V__)
void setAutoScopeOnChannelCreate(bool b)
Definition: CH_Manager.h:1586
CH_API fpreal CHgetSampleFromTime(fpreal time)
SYS_FORCE_INLINE CH_Manager * ourManager() const
Definition: CH_Manager.h:380
virtual ~CH_ChannelColorManager()
Definition: CH_Manager.h:81
void setAutoScopeIncludeChild(bool b)
Definition: CH_Manager.h:1643
*get result *(waiting if necessary)*A common idiom is to fire a bunch of sub tasks at the and then *wait for them to all complete We provide a helper class
Definition: thread.h:623
CH_ExprLanguage
const DEP_ContextOptionsStack * getEvalChannelContextOptionsStack(int thread) const
Definition: CH_Manager.h:1455
friend class CH_Manager
Definition: CH_Manager.h:383
void setEnableFilter(FilterType filter_type, bool b)
Definition: CH_Manager.h:332
void
Definition: png.h:1083
void setAutoScopeIncludeConstraints(bool b)
Definition: CH_Manager.h:1650
fpreal getUnitLength() const
Definition: CH_Manager.h:1340
GT_API const UT_StringHolder time
const GLdouble * v
Definition: glcorearb.h:837
bool(* CH_StringVarEvalFunc)(UT_String &val, int varid, int thread)
Definition: CH_Manager.h:71
#define checkPtr(ptr, msg)
Definition: CE_VDBCreate.h:49
UT_StringArray JOINTS head
void setHoldFlag(int flag)
Definition: CH_Manager.h:1367
GLuint start
Definition: glcorearb.h:475
bool(* CH_IntVarEvalFunc)(int &val, int varid, int thread)
Definition: CH_Manager.h:73
const GLuint GLenum const void * binary
Definition: glcorearb.h:1924
GLsizei const GLchar *const * path
Definition: glcorearb.h:3341
void setFilterParmLabels(FilterType filter_type, bool b)
Definition: CH_Manager.h:357
const UT_StringMap< UT_UniquePtr< CH_Collection > > & getExternalCollections() const
Definition: CH_Manager.h:1074
GLboolean GLboolean g
Definition: glcorearb.h:1222
bool getAutoScopeOnChannelCreate() const
Definition: CH_Manager.h:1584
int64 exint
Definition: SYS_Types.h:125
fpreal getSampleRaw(fpreal t) const
Definition: CH_Manager.h:1234
fpreal64 file_end
Definition: CH_Manager.h:105
const CH_TimeGroup * getTimeGroup(int i) const
Definition: CH_Manager.h:1090
GLdouble s
Definition: glad.h:3009
std::size_t SYS_HashType
Define the type for hash values.
Definition: SYS_Hash.h:19
fpreal getSnapSample(fpreal frame) const
Definition: CH_Manager.h:1272
void setEvalCollection(CH_Collection *g, int thread)
Definition: CH_Manager.h:1397
int getShowSimCacheFlag() const
Definition: CH_Manager.h:1331
bool getFilterFullNames(FilterType filter_type) const
Definition: CH_Manager.h:364
CH_KeyState
Definition: CH_KeyState.h:15
JSON reader class which handles parsing of JSON or bJSON files.
Definition: UT_JSONParser.h:87
CH_API void CHsortChannelPaths(UT_StringArray &channel_paths)
CH_API void CHoutputChannelList(UT_WorkBuffer &info, CH_ChannelList &channels)
bool getKeepChannelListSelection() const
Definition: CH_Manager.h:317
void setFilterScales(bool b)
Definition: CH_Manager.h:352
bool getAutoScopeIncludeChild() const
Definition: CH_Manager.h:1641
Selectively extract and filter point data using a custom filter operator.
CH_API void CHbuildRange(int start, int end, UT_SuperIntervalR &r)
Class which writes ASCII or binary JSON streams.
Definition: UT_JSONWriter.h:37
fpreal getTimeDelta(fpreal sample_delta) const
Definition: CH_Manager.h:1249
fpreal getTimeCodeOffset(fpreal) const
Definition: CH_Manager.h:1308
CH_Tweener * getChannelTweener()
Definition: CH_Manager.h:1711
void setFilter(FilterType filter_type, const UT_StringHolder &f)
Definition: CH_Manager.h:337
**But if you need a result
Definition: thread.h:613
bool getEnableFilter(FilterType filter_type) const
Definition: CH_Manager.h:334
bool getIsSettingGuideParam() const
Definition: CH_Manager.h:948
int getRealTimeFlag() const
Definition: CH_Manager.h:1350
CH_ScopeUndo(CH_ScopedChannels *owner, const CH_ChannelRef &ref, unsigned flags)
Definition: CH_Manager.h:2083
UT_Function< void(const UT_StringHolder &)> CH_DefaultContextOptionCallback
Definition: CH_Manager.h:75
fpreal64 load_end
Definition: CH_Manager.h:103
fpreal getSnapSubsample(fpreal frame) const
Definition: CH_Manager.h:1280
bool shouldShowFakeAccelHandles() const
Definition: CH_Manager.h:554
float fpreal32
Definition: SYS_Types.h:200
const CH_EvalContext & evalContext(int thread) const
Definition: CH_Manager.h:1441
int getHoldLastKey() const
Definition: CH_Manager.h:581
void setAutoScopeIncludeAnimated(bool b)
Definition: CH_Manager.h:1593
int getShowKeysFlag() const
Definition: CH_Manager.h:1325
virtual void beginChannelChanges()
Definition: CH_Manager.h:1732
fpreal getUnitMass() const
Definition: CH_Manager.h:1342
static bool getContextExists()
Definition: CH_Manager.h:539
void setUnitMass(fpreal unitmass)
Definition: CH_Manager.h:1343
bool getRealTimeDisableSkip() const
Definition: CH_Manager.h:1354
SlopeMode getAutoSlope() const
Definition: CH_Manager.h:565
virtual void channelsChanged()
Definition: CH_Manager.h:1733
DEP_MicroNode & getBookmarksMicroNode()
Definition: CH_Manager.h:1101
void setChanCreateKeyExpression(const char *s)
Definition: CH_Manager.h:585
std::unique_ptr< T, Deleter > UT_UniquePtr
A smart pointer for unique ownership of dynamically allocated objects.
Definition: UT_UniquePtr.h:39
void setFollowScopedChannelReferences(bool b)
Definition: CH_Manager.h:1599
CH_ChannelRef myChanRef
Definition: CH_Manager.h:2098
double fpreal64
Definition: SYS_Types.h:201
CH_AutoEvalCollection(int thread, CH_Collection *collection=nullptr)
Definition: CH_Manager.h:2016
int getGlobalEndFrame() const
Definition: CH_Manager.h:1214
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
virtual void endChannelChanges()
Definition: CH_Manager.h:1734
GA_API const UT_StringHolder scale
bool getFollowScopedChannelReferences() const
Definition: CH_Manager.h:1597
int getNTimeGroups() const
Definition: CH_Manager.h:1088
CH_Bookmark * getBookmark(int i)
Definition: CH_Manager.h:1157
void getSampleRange(fpreal &start, fpreal &end)
Definition: CH_Manager.h:1359
GLdouble n
Definition: glcorearb.h:2008
int getFrame(fpreal t) const
Definition: CH_Manager.h:1244
GLfloat f
Definition: glcorearb.h:1926
fpreal getSampleStep() const
Definition: CH_Manager.h:1356
CH_API void CHsortLayerRefs(CH_ChannelRefList &channels)
int getShowBookmarksFlag() const
Definition: CH_Manager.h:1328
bool getAutoScopeIncludeAnimated() const
Definition: CH_Manager.h:1591
int getRawInterpolation()
Definition: CH_Manager.h:1223
CH_AutoEvaluateTime(CH_Manager &chman, int thread, fpreal time, CH_Collection *ch=nullptr, const DEP_ContextOptionsStack *context_options_stack=nullptr, DEP_ContextOptionsReadHandle context_options=DEP_ContextOptionsReadHandle())
Definition: CH_Manager.h:1943
CH_Manager * CHgetManager()
Definition: CH_Manager.h:2111
fpreal getGlobalStart() const
Definition: CH_Manager.h:1210
fpreal getSample(fpreal t) const
Definition: CH_Manager.h:1239
CH_ScopedChannels & operator=(const CH_ScopedChannels &src)
Definition: CH_Manager.h:460
int getIntegerFrameFlag() const
Definition: CH_Manager.h:1310
GLint ref
Definition: glcorearb.h:124
const CH_Segment * getEvalSegment(int thread) const
Definition: CH_Manager.h:1450
bool getAutoKeyTuples() const
Auto-Key all Tuples is a preference to key tuples together.
Definition: CH_Manager.h:1577
DEP_ContextOptionsReadHandle getEvalChannelContextOptions(int thread) const
Definition: CH_Manager.h:1458
void setRootCollection(CH_Collection *root)
Definition: CH_Manager.h:1432
fpreal getSamplesPerSec() const
Definition: CH_Manager.h:1203
const CH_Bookmark * getBookmark(int i) const
Definition: CH_Manager.h:1158
int getRestrictRangeFlag() const
Definition: CH_Manager.h:1313
void setDefaultSlope(fpreal slope)
Definition: CH_Manager.h:567
unsigned myFlags
Definition: CH_Manager.h:2099
int getNBookmarks() const
Definition: CH_Manager.h:1153
GLuint GLuint end
Definition: glcorearb.h:475
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
void setEvaluateTime(SYS_Flicks fl, int thread)
Functions for obtaining and setting the current evaluation time.
Definition: CH_Manager.h:1467
void setAllowExternal(bool allow)
Definition: CH_Manager.h:369
CH_EvalContext & evalContext(int thread)
Definition: CH_Manager.h:1445
CH_API void CHchannelsToCollections(CH_ChannelList const &channels, CH_CollectionList &collections)
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
GLint GLuint mask
Definition: glcorearb.h:124
const CH_Channel * getEvalChannel(int thread) const
Definition: CH_Manager.h:1448
fpreal64 load_start
Definition: CH_Manager.h:102
void setRawInterpolation(int state)
Definition: CH_Manager.h:1222
CH_API void CHdisplayFlags(unsigned flags, std::ostream &s)
void setFilterFullNames(FilterType filter_type, bool b)
Definition: CH_Manager.h:362
long long int64
Definition: SYS_Types.h:116
GLenum target
Definition: glcorearb.h:1667
fpreal getGlobalEnd() const
Definition: CH_Manager.h:1211
void setDefaultExprLanguage(CH_ExprLanguage language)
Definition: CH_Manager.h:1034
bool getIgnoreUpdateScopeFlag() const
Definition: CH_Manager.h:1721
SYS_API fpreal32 SYSfloor(fpreal32 val)
fpreal CHgetEvalTime()
Definition: CH_Manager.h:2129
fpreal getAudioLevel() const
Definition: CH_Manager.h:1337
GLuint const GLchar * name
Definition: glcorearb.h:786
CH_Collection * collection() const
Definition: CH_Manager.h:2023
CH_API int CHgetFrameFromTime(fpreal time)
void setAudioLevel(fpreal lvl)
Definition: CH_Manager.h:1338
GLushort pattern
Definition: glad.h:2583
CH_ExprLanguage getDefaultExprLanguage()
Definition: CH_Manager.h:1032
const UT_StringHolder & getFilter(FilterType filter_type) const
Definition: CH_Manager.h:339
void setAutoSlope(SlopeMode m)
Definition: CH_Manager.h:563
std::function< T > UT_Function
Definition: UT_Function.h:37
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1222
bool getAllowExternal() const
Definition: CH_Manager.h:370
SYS_FORCE_INLINE UT_StringHolder getToken(Add enum_value)
Definition: SOP_Add.proto.h:35
fpreal32 SYSrint(fpreal32 val)
Definition: SYS_Floor.h:163
fpreal getDefaultSlope() const
Definition: CH_Manager.h:569
static CH_Manager * getContext()
Definition: CH_Manager.h:534
int getShowAnimBarFlag() const
Definition: CH_Manager.h:1334
GLdouble t
Definition: glad.h:2397
int getShowAudioFlag() const
Definition: CH_Manager.h:1322
bool getIsAtFrame(fpreal t) const
Definition: CH_Manager.h:1294
int getShowRangeFlag() const
Definition: CH_Manager.h:1316
const char * getDefaultExpression() const
Definition: CH_Manager.h:552
GT_API const UT_StringHolder version
void setDefaultRotationExpression(const char *s)
Definition: CH_Manager.h:556
util::flicks SYS_Flicks
Definition: SYS_Flicks.h:17
GLfloat units
Definition: glcorearb.h:408
const CH_ScopedChannels & getGlobalScopedChannels() const
Definition: CH_Manager.h:1044
bool full_replace
Definition: CH_Manager.h:106
CH_ScopedChannels * myOwner
Definition: CH_Manager.h:2097
fpreal getEvaluateTime(int thread) const
Functions for obtaining and setting the current evaluation time.
Definition: CH_Manager.h:1463
CH_Collection * getEvalCollection(int thread) const
Definition: CH_Manager.h:1418
**Note that the tasks the is the thread number *for the or if it s being executed by a non pool thread(this *can happen in cases where the whole pool is occupied and the calling *thread contributes to running the work load).**Thread pool.Have fun
void setUnitLength(fpreal unitlength)
Definition: CH_Manager.h:1341
bool getFilterTranslates() const
Definition: CH_Manager.h:344
UT_COWReadHandle< DEP_ContextOptions > DEP_ContextOptionsReadHandle
static fpreal niceNumber(fpreal num, int digits=6)
Definition: CH_Manager.h:2117
void setAutoKeyTuples(bool b)
Definition: CH_Manager.h:1579
Push & restore the evaluation time (and optionally a channel collection)
Definition: CH_Manager.h:1940
SYS_API int SYSgetSTID()
int getChopMotionSamples() const
Definition: CH_Manager.h:1207
CH_ScopedChannels & getGlobalScopedChannels()
Definition: CH_Manager.h:1042
SIM_API const UT_StringHolder force
const char * getDefaultRotationExpression() const
Definition: CH_Manager.h:561
void setKeepChannelListSelection(bool b)
Definition: CH_Manager.h:319
virtual ~CH_ChannelChanged()
Definition: CH_Manager.h:92
fpreal64 fpreal
Definition: SYS_Types.h:277
#define CH_API
Definition: CH_API.h:10
SYS_HashType operator()(const chParamKey &key) const
Definition: CH_Manager.h:1802
LeafData & operator=(const LeafData &)=delete
void setAlwaysCommitKeyChange(bool onoff)
Definition: CH_Manager.h:589
bool getAutoSplit() const
Definition: CH_Manager.h:572
GLuint index
Definition: glcorearb.h:786
void setHoldLastKey(bool onoff)
Definition: CH_Manager.h:579
bool getFilterRotates() const
Definition: CH_Manager.h:349
GLuint GLfloat * val
Definition: glcorearb.h:1608
fpreal getNumSamples() const
Definition: CH_Manager.h:1201
virtual CH_ScriptAccessManager * getAccessManager(int)
Definition: CH_Manager.h:1437
void setTimeCodeOffset(fpreal t)
Definition: CH_Manager.h:1307
bool use_load_range
Definition: CH_Manager.h:101
bool getAlwaysCommitKeyChange() const
Definition: CH_Manager.h:587
void set(CH_Collection *collection)
Definition: CH_Manager.h:2027
virtual bool channelsBeingChanged()
Definition: CH_Manager.h:1735
virtual bool getChannelAutoSelect(const CH_ChannelRef &chref) const
Definition: CH_Manager.h:1713
CH_TimeGroup * getTimeGroup(int i)
Definition: CH_Manager.h:1089
CH_Collection * getRootCollection() const
Definition: CH_Manager.h:1434
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857
bool getFilterParmLabels(FilterType filter_type) const
Definition: CH_Manager.h:359
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:156
Definition: core.h:1131
GLboolean r
Definition: glcorearb.h:1222
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:165
fpreal getFrameTolerance() const
Definition: CH_Manager.h:1227
bool getFilterScales() const
Definition: CH_Manager.h:354
const UT_Array< exint > & getBookmarksOrderByRecentUsage()
Definition: CH_Manager.h:1169
int getHoldFlag() const
Definition: CH_Manager.h:1366
bool SYSisEqual(const UT_Vector2T< T > &a, const UT_Vector2T< T > &b, S tol=SYS_FTOLERANCE)
Componentwise equality.
Definition: UT_Vector2.h:674
const char * getDefaultSplitExpression() const
Definition: CH_Manager.h:576
GLuint * ids
Definition: glcorearb.h:652
void setIgnoreUpdateScopeFlag(bool onoff)
Definition: CH_Manager.h:1723
bool(* CH_FloatVarEvalFunc)(fpreal &val, int varid, int thread)
Definition: CH_Manager.h:72
void setEvaluateTime(fpreal time, int thread)
Functions for obtaining and setting the current evaluation time.
Definition: CH_Manager.h:1465
int getGlobalStartFrame() const
Definition: CH_Manager.h:1212
fpreal getTolerance() const
Definition: CH_Manager.h:1226
fpreal getTime(fpreal sample) const
Definition: CH_Manager.h:1229
void setFilterTranslates(bool b)
Definition: CH_Manager.h:342
int getShowTicksFlag() const
Definition: CH_Manager.h:1319
CH_API void CHsortChannels(CH_ChannelList &channels)
ImageBuf OIIO_API channels(const ImageBuf &src, int nchannels, cspan< int > channelorder, cspan< float > channelvalues={}, cspan< std::string > newchannelnames={}, bool shuffle_channel_names=false, int nthreads=0)
CH_ScopedChannels & CHgetScopedChannels()
Definition: CH_Manager.h:2124
fpreal64 file_start
Definition: CH_Manager.h:104
GLenum src
Definition: glcorearb.h:1793
const char * getChanCreateKeyExpression() const
Definition: CH_Manager.h:583