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