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_ChannelRef.h"
17 #include "CH_EvalContextFwd.h"
18 #include "CH_ExprLanguage.h"
19 #include "CH_KeyState.h"
20 #include "CH_Types.h"
21 
22 #include <DEP/DEP_ContextOptions.h>
23 #include <UT/UT_Assert.h>
24 #include <UT/UT_Color.h>
25 #include <UT/UT_IntArray.h>
26 #include <UT/UT_Map.h>
27 #include <UT/UT_NonCopyable.h>
28 #include <UT/UT_Set.h>
29 #include <UT/UT_String.h>
30 #include <UT/UT_StringMap.h>
31 #include <UT/UT_StringArray.h>
32 #include <UT/UT_SuperInterval.h>
33 #include <UT/UT_Thread.h>
35 #include <UT/UT_TBBSpinLock.h>
36 #include <UT/UT_ValArray.h>
37 #include <SYS/SYS_Floor.h>
38 #include <SYS/SYS_Hash.h>
39 #include <SYS/SYS_Inline.h>
40 #include <SYS/SYS_Math.h>
41 #include <SYS/SYS_Types.h>
42 #include <iosfwd>
43 
44 class CH_Channel;
45 class CH_ChannelRef;
46 class CH_Collection;
47 class CH_ExprDefine;
48 class CH_Group;
49 class CH_LocalVariable;
50 class CH_Manager;
51 class chParamData;
52 class CH_ScopedChannels;
53 class CH_ScriptAccessManager;
54 class CH_Segment;
55 class CH_TimeGroup;
56 class DEP_MicroNode;
57 class UT_WorkBuffer;
58 
59 typedef bool (*CH_StringVarEvalFunc)(UT_String &val, int varid, int thread);
60 typedef bool (*CH_FloatVarEvalFunc)(fpreal &val, int varid, int thread);
61 typedef bool (*CH_IntVarEvalFunc)(int &val, int varid, int thread);
62 
64 {
65 public:
67  virtual UT_Color getChannelColor(const CH_Channel *channel) = 0;
68  virtual UT_Color getChannelColor(const CH_ChannelRef &channel_ref) = 0;
69 };
70 
72 {
73 public:
74  virtual ~CH_ChannelChanged(){}
75  virtual void changed() = 0;
76 };
77 
79 {
80 public:
81  virtual ~CH_FilterChanged(){}
82  virtual void changed(int type, void* fsc) = 0;
83  virtual void removed(void* fsc) = 0;
84 };
85 
87 {
88 public:
95 };
96 
97 
98 // CH_ScopedChannels holds the scope/display/layer/pinned flags
99 // for all the channels.
100 // The CH_Manager holds a list of scoped channels and we refer to that list
101 // as the Global Scoped Channels.
102 // The Animation Editor can pin its state to create and act on a disconnected
103 // list of channels.
105 {
106 public:
107  CH_ScopedChannels( CH_Manager *mgr, bool global=false );
108  virtual ~CH_ScopedChannels();
109 
110 
111  // these next two methods can be used to manipulate channel scope state
112  // using the full path of the channel. The correct behaviour will take
113  // place if the channel doesn't yet exist and so forth.
114  bool scopeChannelInternal(const CH_Channel *chp, bool on_off);
115  bool scopeChannelInternal(const CH_ChannelRef &chref, bool on_off);
116  void scopeChannel(const CH_ChannelRef &chref, bool on_off);
117  void scopeChannel(const char *full_chan_path, bool on_off);
118  void unscopeChannelsWithNodeId(int node_id, bool force=false);
119 
120  // this function should only be used by CH_Channel, CH_Collection, and here
121  void scopeChanged( unsigned flags, bool propagate=true );
122 
123  // these functions can be used by anyone
124  bool isChannelScoped(CH_Channel *chp) const;
125  bool isChannelScoped(const char *full_chan_path) const;
126  bool isChannelScoped(const CH_ChannelRef &chref) const;
127 
128  //
129  // Displayed Channels (within the scoped channels)
130  //
131  bool isChannelDisplayed(CH_Channel *chp) const;
132  bool isChannelDisplayed( const CH_ChannelRef &chref ) const;
133  bool isChannelDisplayed( const char *full_chan_path ) const;
134  void clearDisplayedChannels( bool propagate = true );
135  void displayAllScopedChannels( bool propagate = true );
136  void displaySelectedScopedChannels( bool propagate = true );
137 
138  void displayChannel( const CH_ChannelRef &chref,
139  bool propagate = true );
140  void displayChannel( const char *full_chan_path,
141  bool propagate = true );
142  void undisplayChannel( const CH_ChannelRef &chref,
143  bool propagate = true );
144  void undisplayChannel( const char *full_chan_path,
145  bool propagate = true );
146  void undisplayChannelsWithNodeId(int node_id, bool force=false);
147  //
148  // Selected Channels (within the scoped channels)
149  //
150  bool isChannelSelected( const CH_ChannelRef &chref ) const;
151  bool isChannelSelected( const char *full_chan_path ) const;
152  void clearSelectedChannels( bool propagate = true );
153  void selectAllScopedChannels(bool propagate = true );
154 
155  void selectChannel( const CH_ChannelRef &chref,
156  bool propagate = true );
157  void selectChannel( const char *full_chan_path,
158  bool propagate = true );
159  void deselectChannel( const CH_ChannelRef &chref,
160  bool propagate = true );
161  void deselectChannel( const char *full_chan_path,
162  bool propagate = true );
163 
164  //
165  // Pinned Channels (within the scoped channels)
166  //
167  void togglePinAllScopedChannels();
168  void togglePinScopedChannels( const CH_ChannelRefList &chanrefs );
169  void pinAllScopedChannels( bool propagate = true );
170  void unpinAllScopedChannels( bool propagate = true );
171  void pinSelectedChannels( bool propagate = true,
172  int operateOn = CH_SELECTED );
173  void unpinSelectedChannels( bool propagate = true,
174  int operateOn = CH_SELECTED );
175  void pinChannels( const CH_ChannelRefList &chanrefs,
176  bool propagate = true );
177  void unpinChannels( const CH_ChannelRefList &chanrefs,
178  bool propagate = true );
179  void pinChannel( const CH_ChannelRef &ref,
180  bool propagate = true );
181  void unpinChannel( const CH_ChannelRef &ref,
182  bool propagate = true );
183  void unpinChannelsWithNodeId(int node_id, bool force=false);
184  void clearPinnedChannels( bool propagate = true );
185 
186  //
187  // Scopped Layers
188  //
189  void clearLayerScope();
190  bool isLayerScoped(CH_Channel *chp) const;
191  bool isLayerScoped(const char *full_chan_path) const;
192  bool isLayerScoped(const CH_ChannelRef &chref) const;
193  void scopeLayer(const CH_ChannelRef &chref, bool on_off);
194  void scopeLayer(const char *full_chan_path, bool on_off);
195  bool scopeLayerInternal(CH_Channel *chp, bool on_off);
196  bool scopeLayerInternal(const CH_ChannelRef &chref, bool on_off);
197 
198  //
199  // Selected Layers (within the scoped layers)
200  //
201  bool isLayerSelected(const CH_ChannelRef &chref) const;
202  bool isLayerSelected(const char *full_chan_path) const;
203  void clearSelectedLayers(bool propagate = true);
204  void selectAllScopedLayers(bool propagate = true);
205 
206  void selectLayer(const CH_ChannelRef &chref, bool propagate=true);
207  void selectLayer(const char *full_chan_path, bool propagate=true);
208  void deselectLayer(const CH_ChannelRef &chref, bool propagate=true);
209  void deselectLayer(const char *full_chan_path, bool propagate=true);
210 
211  //
212  // Pinned Layers (within the scoped layers)
213  //
214  void togglePinAllScopedLayers();
215  void togglePinScopedLayers( const CH_ChannelRefList& chanrefs );
216  void pinAllScopedLayers( bool propagate = true );
217  void unpinAllScopedLayers( bool propagate = true );
218  void pinSelectedLayers( bool propagate = true,
219  int operateOn = CH_LAYER_SELECTED );
220  void unpinSelectedLayers( bool propagate = true,
221  int operateOn = CH_LAYER_SELECTED );
222  void pinLayer( const CH_ChannelRef& ref,
223  bool propagate = true );
224  void unpinLayer( const CH_ChannelRef& ref,
225  bool propagate = true );
226  void pinLayers( const CH_ChannelRefList& chanrefs,
227  bool propagate = true );
228  void unpinLayers( const CH_ChannelRefList& chanrefs,
229  bool propagate = true );
230  void clearPinnedLayers( bool propagate = true );
231 
232  //
233  // Displayed Layers (within the scoped layers)
234  bool isLayerDisplayed(CH_Channel *chp) const;
235  bool isLayerDisplayed( const CH_ChannelRef &chref ) const;
236  bool isLayerDisplayed( const char *full_chan_path ) const;
237  void clearDisplayedLayers( bool propagate = true );
238  void displayAllScopedLayers( bool propagate = true );
239  void displaySelectedScopedLayers( bool propagate = true );
240 
241  void displayLayer( const CH_ChannelRef &chref,
242  bool propagate = true );
243  void displayLayer( const char *full_chan_path,
244  bool propagate = true );
245  void undisplayLayer( const CH_ChannelRef &chref,
246  bool propagate = true );
247  void undisplayLayer( const char *full_chan_path,
248  bool propagate = true );
249 
250  // Graph Selected flag
251  bool isGraphSelected(CH_Channel *chp) const;
252  bool isGraphSelected( const CH_ChannelRef &chref ) const;
253  bool isGraphSelected( const char *full_chan_path ) const;
254  void clearGraphSelected( bool propagate = true );
255  void selectGraph( const CH_ChannelRef &chref,
256  bool propagate = true );
257  void selectGraph( const char *full_chan_path,
258  bool propagate = true );
259  void deselectGraph( const CH_ChannelRef &chref,
260  bool propagate = true );
261  void deselectGraph( const char *full_chan_path,
262  bool propagate = true );
263 
264  //
265  // Generic channel flag manipulation methods
266  //
267  void setChannelFlags( const CH_ChannelRef &chref,
268  unsigned flags,
269  bool on_off,
270  bool propagate = true );
271  unsigned getChannelFlags( const CH_ChannelRef &chref ) const;
272 
273  //
274  // Scoping functions
275  //
276  void clearChannelScope( bool clear_all_tables=false);
277 
278  // Returns scoped channels only (not scoped parameters)
279  void getScopedChannels(CH_ChannelList &channels, bool sorted=false);
280 
281  // Returns count of scoped channels AND scoped parameters
282  int getNumScopedChanRefs();
283 
284  // Returns count of scoped channels AND scoped parameters filtered or not
285  int getNumScopedChanRefs(bool filtered);
286 
287  // mask corresponds to flags in CH_ScopeMasks. Use 0 for mask to mean all
288  // scoped channel refs.
289  // Returns scoped channel AND scoped parameter refs
290  void getScopedChanRefs(CH_ChannelRefList &chanrefs,
291  unsigned mask = 0,
292  bool sorted=false) const;
293  void getSelectedScopedChanRefs(CH_ChannelRefList &chanrefs,
294  bool sorted=false, int operateOn=CH_SELECTED);
295 
296  void getScopedChannelsKeyFrames( UT_IntArray &frames,
297  int minframe, int maxframe);
298 
299  bool hasScopedChannels();
300 
302  { return myKeepChannelSelection; }
304  { myKeepChannelSelection = b;}
305 
307  {
308  FilterChannels = 0,
309  FilterAnimationLayers = 1,
310  };
311  enum
312  {
313  NumFilterType = 2,
314  };
315 
316  void setEnableFilter( FilterType filter_type, bool b)
317  { myEnableFilter[filter_type] = b; }
318  bool getEnableFilter( FilterType filter_type ) const
319  { return myEnableFilter[filter_type]; }
320 
321  void setFilter( FilterType filter_type, const UT_StringHolder &f)
322  { myFilter[filter_type] = f;}
323  const UT_StringHolder& getFilter(FilterType filter_type) const
324  { return myFilter[filter_type]; }
325 
326  void setFilterTranslates( bool b)
327  { myFilterTranlates = b;}
328  bool getFilterTranslates() const
329  { return myFilterTranlates; }
330 
331  void setFilterRotates( bool b)
332  { myFilterRotates = b;}
333  bool getFilterRotates() const
334  { return myFilterRotates; }
335 
336  void setFilterScales( bool b)
337  { myFilterScales = b;}
338  bool getFilterScales() const
339  { return myFilterScales; }
340 
341  void setFilterParmLabels( FilterType filter_type, bool b)
342  { myFilterParmLabels[filter_type] = b;}
343  bool getFilterParmLabels(FilterType filter_type ) const
344  { return myFilterParmLabels[filter_type]; }
345 
346  void setFilterFullNames( FilterType filter_type, bool b)
347  { myFilterFullNames[filter_type] = b;}
348  bool getFilterFullNames(FilterType filter_type) const
349  { return myFilterFullNames[filter_type]; }
350 
351  void setFilterDirty(FilterType filter_type);
352 
353 
354  void addDependentFilter(CH_FilterChanged *f);
355  void removeDependentFilter(CH_FilterChanged *f);
356  void triggerDependentFilters(int type);
357 
358  bool hasFilter() const;
359 private:
360  friend class CH_Manager;
361 
362  // Filtering functions
363  void filterChannels(CH_ChannelList &chns, FilterType filter_type) const;
364  void filterChannelRefs(CH_ChannelRefList &refs, FilterType filter_type) const;
365  void setupFilter(UT_String &ret, UT_StringArray &filter_tokens, FilterType filter_type) const;
366  bool filterChannelRef( const CH_ChannelRef &chref, FilterType filter_type, const UT_String &prefilter, const UT_StringArray &filter_tokens ) const;
367 
368  CH_ChannelRefTable myTable;
369  CH_ChannelRefTable myTableDisplayed;
370  CH_ChannelList mySorted;
371  bool myIsSorted;
372  bool myKeepChannelSelection;
373  mutable int myNumScopedChannels;
374  mutable int myTotalScopedChannels; // Unfiltered
375 
376  // Filter for Channels and Animation Layers
377  CH_ChannelList myFiltered[NumFilterType];
378  UT_StringHolder myFilter[NumFilterType];
379  bool myEnableFilter[NumFilterType];
380  bool myFilterParmLabels[NumFilterType];
381  bool myFilterFullNames[NumFilterType];
382  bool myIsFiltered[NumFilterType];
383  bool myFilterTranlates;
384  bool myFilterRotates;
385  bool myFilterScales;
386  bool myIsGlobal;
387 
388  CH_Manager *myManager;
389 
390  UT_Array<CH_FilterChanged*> myDependentFilters;
391 };
392 
394 {
395 public:
396  typedef enum {
397  //CH_ON_COLLISION_FAIL,
401  CH_ON_COLLISION_ASSERT
402  } CollisionBehaviour;
403 
404  typedef enum {
405  CH_EXPANSION_TYPE_EXPRESSION = 1,
406  CH_EXPANSION_TYPE_VARIABLE = 1 << 1,
407  CH_EXPANSION_TYPE_TILDE = 1 << 2,
408  CH_EXPANSION_TYPE_DEFAULT = CH_EXPANSION_TYPE_EXPRESSION |
409  CH_EXPANSION_TYPE_VARIABLE |
410  CH_EXPANSION_TYPE_TILDE,
411  } ExpansionType;
412 
413  typedef enum {
417  } SlopeMode;
418 
419  typedef CollisionBehaviour (*CBCallback)( CH_Group *source,
420  CH_Group *target );
421 
422  CH_Manager(int initTheExpressionLibrary = 1);
423  virtual ~CH_Manager();
424 
425  /// @private
426  /// Called just before the CH_Manger will be deleted
427  virtual void aboutToDelete();
428 
429  // The following method is used to set the context to this manager.
431  {
432  UT_ASSERT( theManager );
433  return theManager;
434  }
435  static bool getContextExists() { return (bool)theManager; }
436  virtual void setContext();
437 
438  int condenseCommon(UT_String &path);
439 
440  void resetPlayback();
441 
442  void resetChannelOptions();
443  bool loadChannelOptions( const char *filename );
444  bool saveChannelOptions( const char *filename );
445 
446  void setDefaultExpression(const char *s)
447  {
448  if( s && *s )
449  myDefaultExpression.harden( s );
450  }
451  const char *getDefaultExpression() const
452  { return (const char *)myDefaultExpression; }
453  void setDefaultRotationExpression(const char *s)
454  {
455  if (s)
456  myDefaultRotationExpression.harden(s);
457  }
458  const char *getDefaultRotationExpression() const
459  { return (const char *)myDefaultRotationExpression;}
461  { myAutoSlope = m; }
463  { return myAutoSlope; }
465  { myDefaultSlope = slope; }
467  { return myDefaultSlope; }
468  void setAutoSplit(bool onoff)
469  { myAutoSplit = onoff; }
470  bool getAutoSplit() const
471  { return myAutoSplit; }
472  void setDefaultSplitExpression(const char *expr)
473  { myDefaultSplitExpression.harden(
474  expr ? expr : "" ); }
475  const char *getDefaultSplitExpression() const
476  { return (const char *)myDefaultSplitExpression; }
477 
478  void setHoldLastKey(bool onoff)
479  { myHoldLastKey = onoff; }
480  int getHoldLastKey() const
481  { return myHoldLastKey; }
482  const char *getChanCreateKeyExpression() const
483  { return (const char *)myChanCreateKeyExpression; }
484  void setChanCreateKeyExpression(const char *s)
485  { myChanCreateKeyExpression.harden(s ? s : ""); }
487  { return myAlwaysCommitKey; }
488  void setAlwaysCommitKeyChange( bool onoff )
489  { myAlwaysCommitKey = onoff; }
490 
491  // Scoping functions
492  // Deprecated and moved to CH_ScopedChannels
493  // With H16, we introduced the ability to lock animation editor scoped
494  // channels. The embedded animation layers and scoped channel listers can
495  // take a copy of CH_ScopedChannels and acts independtly of the global
496  // list. ChgetScopedChannels() returns the list of globally scoped
497  // channels.
498  SYS_DEPRECATED(16.0)
499  void clearChannelScope();
500 
501  // Returns scoped channels only (not scoped parameters)
502  SYS_DEPRECATED(16.0)
503  void getScopedChannels(CH_ChannelList &channels, bool sorted=false);
504 
505  // Returns count of scoped channels AND scoped parameters
506  SYS_DEPRECATED(16.0)
507  int getNumScopedChanRefs()
508  { return myScopedChannels.getNumScopedChanRefs(); }
509 
510  // mask corresponds to flags in CH_ScopeMasks. Use 0 for mask to mean all
511  // scoped channel refs.
512  // Returns scoped channel AND scoped parameter refs
513  SYS_DEPRECATED(16.0)
514  void getScopedChanRefs(CH_ChannelRefList &chanrefs,
515  unsigned mask = 0,
516  bool sorted=false) const;
517  SYS_DEPRECATED(16.0)
518  void getSelectedScopedChanRefs(CH_ChannelRefList &chanrefs,
519  bool sorted=false, int operateOn=CH_SELECTED);
520 
521  // utility functions for getting keyframe numbers:
522  // they return array of keyframes in the or scoped channes
523  // between minframe and maxframe, indexed relative to the start index
524  // The frames are unique and sorted in a ascending order.
525  SYS_DEPRECATED(16.0)
526  void getScopedChannelsKeyFrames( UT_IntArray &frames,
527  int minframe, int maxframe);
528 
529  // Useful method to group multiple scope change event notifications
530  // together.
531  void blockModifyScope(int on_off);
532 
533  // these next two methods can be used to manipulate channel scope state
534  // using the full path of the channel. The correct behaviour will take
535  // place if the channel doesn't yet exist and so forth.
536  SYS_DEPRECATED(16.0)
537  void scopeChannel(const CH_ChannelRef &chref, bool on_off);
538  SYS_DEPRECATED(16.0)
539  void scopeChannel(const char *full_chan_path, bool on_off);
540  SYS_DEPRECATED(16.0)
541  bool scopeChannelInternal(const CH_Channel *chp, bool on_off);
542  SYS_DEPRECATED(16.0)
543  bool scopeChannelInternal(const CH_ChannelRef &chref, bool on_off);
544 
545  virtual void getChannelsWithNodeId(CH_ChannelList &chans, int node_id) const;
546 
547  // this function should only be used by CH_Channel, CH_Collection, and here
548  SYS_DEPRECATED(16.0)
549  void scopeChanged( unsigned flags, bool propagate=true );
550 
551  // these functions can be used by anyone
552  SYS_DEPRECATED(16.0)
553  bool isChannelScoped(CH_Channel *chp) const;
554  SYS_DEPRECATED(16.0)
555  bool isChannelScoped(const char *full_chan_path) const;
556  SYS_DEPRECATED(16.0)
557  bool isChannelScoped(const CH_ChannelRef &chref) const;
558 
559  //
560  // Pending Channels
561  //
562  void clearPendingChannels();
563  void getPendingChannels(CH_ChannelList &channels) const;
564  bool hasPendingChannels() const;
565 
566  // addPendingChannel is intended to be used by CH_Channel/CH_Collection!
567  void addPendingChannel( CH_Channel *chp );
568  void removePendingChannel( CH_Channel *chp );
569 
570  //
571  // Displayed Channels (within the scoped channels)
572  //
573  SYS_DEPRECATED(16.0)
574  bool isChannelDisplayed(CH_Channel *chp) const;
575  SYS_DEPRECATED(16.0)
576  bool isChannelDisplayed( const CH_ChannelRef &chref ) const;
577  SYS_DEPRECATED(16.0)
578  bool isChannelDisplayed( const char *full_chan_path ) const;
579  SYS_DEPRECATED(16.0)
580  void clearDisplayedChannels( bool propagate = true );
581  SYS_DEPRECATED(16.0)
582  void displayAllScopedChannels( bool propagate = true );
583  SYS_DEPRECATED(16.0)
584  void displaySelectedScopedChannels( bool propagate = true );
585 
586  SYS_DEPRECATED(16.0)
587  void displayChannel( const CH_ChannelRef &chref,
588  bool propagate = true );
589  SYS_DEPRECATED(16.0)
590  void displayChannel( const char *full_chan_path,
591  bool propagate = true );
592  SYS_DEPRECATED(16.0)
593  void undisplayChannel( const CH_ChannelRef &chref,
594  bool propagate = true );
595  SYS_DEPRECATED(16.0)
596  void undisplayChannel( const char *full_chan_path,
597  bool propagate = true );
598 
599  //
600  // Selected Channels (within the scoped channels)
601  //
602  SYS_DEPRECATED(16.0)
603  bool isChannelSelected( const CH_ChannelRef &chref ) const;
604  SYS_DEPRECATED(16.0)
605  bool isChannelSelected( const char *full_chan_path ) const;
606  SYS_DEPRECATED(16.0)
607  void clearSelectedChannels( bool propagate = true );
608  SYS_DEPRECATED(16.0)
609  void selectAllScopedChannels(bool propagate = true );
610 
611  SYS_DEPRECATED(16.0)
612  void selectChannel( const CH_ChannelRef &chref,
613  bool propagate = true );
614  SYS_DEPRECATED(16.0)
615  void selectChannel( const char *full_chan_path,
616  bool propagate = true );
617  SYS_DEPRECATED(16.0)
618  void deselectChannel( const CH_ChannelRef &chref,
619  bool propagate = true );
620  SYS_DEPRECATED(16.0)
621  void deselectChannel( const char *full_chan_path,
622  bool propagate = true );
623 
624  //
625  // Pinned Channels (within the scoped channels)
626  //
627  SYS_DEPRECATED(16.0)
628  void togglePinAllScopedChannels();
629  SYS_DEPRECATED(16.0)
630  void togglePinScopedChannels( const CH_ChannelRefList &chanrefs );
631  SYS_DEPRECATED(16.0)
632  void pinAllScopedChannels( bool propagate = true );
633  SYS_DEPRECATED(16.0)
634  void unpinAllScopedChannels( bool propagate = true );
635  SYS_DEPRECATED(16.0)
636  void pinSelectedChannels( bool propagate = true,
637  int operateOn = CH_SELECTED );
638  SYS_DEPRECATED(16.0)
639  void unpinSelectedChannels( bool propagate = true,
640  int operateOn = CH_SELECTED );
641  SYS_DEPRECATED(16.0)
642  void pinChannels( const CH_ChannelRefList &chanrefs,
643  bool propagate = true );
644  SYS_DEPRECATED(16.0)
645  void unpinChannels( const CH_ChannelRefList &chanrefs,
646  bool propagate = true );
647  //
648  // Scopped Layers
649  //
650  SYS_DEPRECATED(16.0)
651  void clearLayerScope();
652  SYS_DEPRECATED(16.0)
653  bool isLayerScoped(CH_Channel *chp) const;
654  SYS_DEPRECATED(16.0)
655  bool isLayerScoped(const char *full_chan_path) const;
656  SYS_DEPRECATED(16.0)
657  bool isLayerScoped(const CH_ChannelRef &chref) const;
658  SYS_DEPRECATED(16.0)
659  void scopeLayer(const CH_ChannelRef &chref, bool on_off);
660  SYS_DEPRECATED(16.0)
661  void scopeLayer(const char *full_chan_path, bool on_off);
662  SYS_DEPRECATED(16.0)
663  bool scopeLayerInternal(CH_Channel *chp, bool on_off);
664  SYS_DEPRECATED(16.0)
665  bool scopeLayerInternal(const CH_ChannelRef &chref, bool on_off);
666 
667  //
668  // Selected Layers (within the scoped layers)
669  //
670  SYS_DEPRECATED(16.0)
671  bool isLayerSelected( const CH_ChannelRef &chref ) const;
672  SYS_DEPRECATED(16.0)
673  bool isLayerSelected( const char *full_chan_path ) const;
674  SYS_DEPRECATED(16.0)
675  void clearSelectedLayers( bool propagate = true );
676  SYS_DEPRECATED(16.0)
677  void selectAllScopedLayers(bool propagate = true );
678 
679  SYS_DEPRECATED(16.0)
680  void selectLayer( const CH_ChannelRef &chref, bool propagate = true );
681  SYS_DEPRECATED(16.0)
682  void selectLayer( const char *full_chan_path, bool propagate = true );
683  SYS_DEPRECATED(16.0)
684  void deselectLayer( const CH_ChannelRef &chref, bool propagate = true );
685  SYS_DEPRECATED(16.0)
686  void deselectLayer( const char *full_chan_path, bool propagate = true );
687 
688  //
689  // Pinned Layers (within the scoped layers)
690  //
691  SYS_DEPRECATED(16.0)
692  void togglePinAllScopedLayers();
693  SYS_DEPRECATED(16.0)
694  void togglePinScopedLayers( const CH_ChannelRefList &chanrefs );
695  SYS_DEPRECATED(16.0)
696  void pinAllScopedLayers( bool propagate = true );
697  SYS_DEPRECATED(16.0)
698  void unpinAllScopedLayers( bool propagate = true );
699  SYS_DEPRECATED(16.0)
700  void pinSelectedLayers( bool propagate = true, int operateOn = CH_LAYER_SELECTED );
701  SYS_DEPRECATED(16.0)
702  void unpinSelectedLayers( bool propagate = true, int operateOn = CH_LAYER_SELECTED );
703  SYS_DEPRECATED(16.0)
704  void pinLayers( const CH_ChannelRefList &chanrefs, bool propagate = true );
705  SYS_DEPRECATED(16.0)
706  void unpinLayers( const CH_ChannelRefList &chanrefs, bool propagate = true );
707 
708  //
709  // Displayed Layers (within the scoped layers)
710  SYS_DEPRECATED(16.0)
711  bool isLayerDisplayed(CH_Channel *chp) const;
712  SYS_DEPRECATED(16.0)
713  bool isLayerDisplayed( const CH_ChannelRef &chref ) const;
714  SYS_DEPRECATED(16.0)
715  bool isLayerDisplayed( const char *full_chan_path ) const;
716  SYS_DEPRECATED(16.0)
717  void clearDisplayedLayers( bool propagate = true );
718  SYS_DEPRECATED(16.0)
719  void displayAllScopedLayers( bool propagate = true );
720  SYS_DEPRECATED(16.0)
721  void displaySelectedScopedLayers( bool propagate = true );
722 
723  SYS_DEPRECATED(16.0)
724  void displayLayer( const CH_ChannelRef &chref,
725  bool propagate = true );
726  SYS_DEPRECATED(16.0)
727  void displayLayer( const char *full_chan_path,
728  bool propagate = true );
729  SYS_DEPRECATED(16.0)
730  void undisplayLayer( const CH_ChannelRef &chref,
731  bool propagate = true );
732  SYS_DEPRECATED(16.0)
733  void undisplayLayer( const char *full_chan_path,
734  bool propagate = true );
735  // Generic channel flag manipulation methods
736  SYS_DEPRECATED(16.0)
737  void setChannelFlags( const CH_ChannelRef &chref,
738  unsigned flags,
739  bool on_off,
740  bool propagate = true );
741  SYS_DEPRECATED(16.0)
742  unsigned getChannelFlags( const CH_ChannelRef &chref ) const;
743 
744  // Expand a string given a specific channel set (for locals). It's
745  // possible that the channel collection can be null, meaning local
746  // variables won't be picked up. The input string is expected to be an
747  // unexpanded string value using the old improper expression syntax. The
748  // method returns a mask with CH_EXPRTIME set if the string uses time
749  // dependent variables.
750  int expandString(const char *string, UT_String &expanded,
751  fpreal time, CH_Collection *local = 0,
752  int thread = 0,
753  int expansion_type = CH_EXPANSION_TYPE_DEFAULT,
755  context_options_stack = nullptr,
756  DEP_ContextOptionsReadHandle context_options =
758 
759  void buildStringOpDependencies( const char *str, void *ref_id,
760  CH_Collection *locals, int thread );
761 
762  /// Return true if the variable exists in the given string. The variable
763  /// may be in the form @c "$NAME" or "NAME". If @c expand_expressions is
764  /// true, any back-tick expressions will be expanded and the result scanned
765  /// for the variable.
766  bool scanForVariableInString(const char *variable,
767  const char *string) const;
768  bool changeStringOpRef( UT_String &str,
769  const char *new_fullpath,
770  const char *old_fullpath,
771  const char *old_cwd,
772  const char *chan_name,
773  const char *old_chan_name,
774  CH_Collection *locals,
775  int thread );
776 
777  // These functions evaluate expressions that have been specified using the
778  // old proper expression syntax.
779  fpreal evaluate(const char *expr, fpreal now,
780  CH_Collection *local=0, int *frame_dep=0,
781  int thread = 0,
784  context_options_stack = nullptr,
785  DEP_ContextOptionsReadHandle context_options =
786  DEP_ContextOptionsReadHandle());
787  int evaluateString(const char *expr, UT_String &result,
788  fpreal now, CH_Collection *local=0,
789  int thread = 0,
790  CH_ExprLanguage language = CH_OLD_EXPR_LANGUAGE,
792  context_options_stack = nullptr,
793  DEP_ContextOptionsReadHandle context_options =
794  DEP_ContextOptionsReadHandle());
795 
796  // Issue an expression evaluation error. 'err' is an index used for
797  // ev_GetErrorText(). NOTE: This will call ev_SetErrNo(EV_NOERROR, thread)!
798  static void evaluationError(int err, int thread, const char *path);
799 
800  // Global parameter management
801 
802  // This function tells us if we are in the process of setting a global
803  // param value. This is useful for differentiating between real node
804  // change events, and apparent node changes caused by setting a global
805  // param.
806  // If add_dependencies is set, the currently evaluating operator will have
807  // dependencies added for the global parameter. Disable this if you're
808  // just getting values for push/pop of values.
809  bool getIsSettingGlobalParam() const
810  { return (mySettingGlobalParam > 0); }
811  void getGlobalParamF(const char *token, CH_Collection *scope,
812  fpreal &result, fpreal def, int thread,
813  bool add_dependencies /*=true*/);
814  void getGlobalParamS(const char *token, CH_Collection *scope,
815  UT_String &result, const char *def,
816  int thread, bool add_dependencies /*=true*/);
817 
818  /// The AnyScope variants will start at the given scope and work upwards
819  /// until a global parameter is found. If none is found, they will
820  /// act like getGlobalParamF on the root scope.
821  void getGlobalParamAnyScopeF(const char *token, CH_Collection *scope,
822  fpreal &result, fpreal def, int thread,
823  bool add_dependencies /*=true*/);
824  void getGlobalParamAnyScopeS(const char *token, CH_Collection *scope,
825  UT_String &result, const char *def,
826  int thread, bool add_dependencies /*=true*/);
827 
828  int setGlobalFloatParam(const char *token,
829  fpreal val,
830  CH_Collection *&owner);
831  int setGlobalStringParam(const char *token,
832  const char *strval,
833  CH_Collection *&owner);
834 
835  int removeGlobalParamOwner(CH_Collection *owner);
836  void dumpGlobalParams(std::ostream &out) const;
837 
838  // The optional dependents set, if specified, will be populated with
839  // a set of the dependent CH_Collection(s).
840  void dirtyOrphanGlobalParamDependents(const char *token,
841  CH_Collection *scope,
842  bool recurse,
843  UT_Set<CH_Collection *> *dependents);
844 
845  // Like global params, simulation guide parameters need a flag so we
846  // know not to destroy interests and extra inputs when they are changed.
848  { return (mySettingGuideParam > 0); }
849 
850  static CH_KeyState getKeyState(fpreal gtime,
851  const CH_ChannelList &channels,
852  bool loose=false);
853 
854  // Channel Group Management
855  CH_Group *getTopGroup() const;
856  CH_Group *findGroup(const char *const_path, bool create = false,
857  CH_Group *head=0);
858  void findGroups( CH_GroupList &groups,
859  const char *pattern, bool minimal );
860  void findChannelsFromGroups( CH_ChannelList &channels,
861  const char *pattern );
862  void findChanRefsFromGroups( CH_ChannelRefList &chanrefs,
863  const char *pattern );
864  static bool makeGroupPathValid( UT_String &path );
865  static bool makeGroupNameValid( UT_String &path );
866 
867  CH_GroupList getSelectedGroups();
868  CH_Group *getCurrentGroup();
869  void updateGroupSelection(const CH_GroupList &groups,
870  void *by,
871  bool propagate = true);
872  void updateGroupSelectionFromScoped(void *by,
873  bool propagate = true);
874  void updateCurrentGroup(CH_Group *group,
875  void *by,
876  bool propagate = true);
877  void enforceLeafOnlyChannels(CH_Group *group,
878  const char *name="new_group");
879 
880  // RMB Group functions
881  CH_Group *createGroup(const char *const_path,
882  bool doRename = true, CH_Group *head=0);
883  void renameGroup(CH_Group *group, const char *newname);
884  void deleteGroup(CH_Group *group);
885 
886  // RMB Group* functions
887  void extractGroup( CH_Group *group, CollisionBehaviour cb );
888  CH_Group *collapseGroups( CH_GroupList const& groups,
889  const char *name );
890  void collapseChildren( CH_Group *parent );
891 
892  // TODO merge selected
893 
894  // Group -> Group functions
895  void copyIntoGroup( CH_Group *source, CH_Group *target,
896  CollisionBehaviour cb,
897  const char *new_name = 0 );
898  void moveIntoGroup( CH_Group *source, CH_Group *target,
899  CollisionBehaviour cb,
900  const char *new_name = 0 );
901  void addToGroup( CH_Group *source, CH_Group *target,
902  CollisionBehaviour cb );
903  void mergeWithGroup( CH_Group *source, CH_Group *target,
904  CollisionBehaviour cb );
905  // TODO remove shared channels?
906  // TODO replace group?
907 
908  // Channels -> Group functions implemented via G -> G
909  void channelCreated( const CH_Channel *chp );
910  void channelDeleted( const CH_Channel *chp );
911 
912  // save, load functions
913  void saveGroup(CH_Group *g, std::ostream &os, int binary);
914  CH_Group *loadGroup(UT_IStream &is);
915 
916 
917  // Returns true if there exists a situation in which the string can
918  // be expanded. Returns false if there is nothing in the string that
919  // indicates that it could be expanded.
920  static bool couldExpandString(const char *str);
921 
922  // Gets/Sets the default expression language.
924  { return myDefaultExprLanguage; }
926  { myDefaultExprLanguage = language; }
927 
928  // Checks if the given scoped channels list is the global one
930  { return p == &myScopedChannels; }
931 
932  // Access the global scoped channels
934  { return myScopedChannels; }
936  { return myScopedChannels; }
937 
938  // Time Group Management
939  void timeGroupsChanged();
940  void addTimeGroup(CH_TimeGroup *group,
941  bool doRename=true,
942  bool force=false);
943  void destroyTimeGroup(const CH_TimeGroup *group);
944  void destroyTimeGroup(int i);
945  void renameTimeGroup(CH_TimeGroup *group,
946  const char *newname,
947  bool force=false);
948  int getNTimeGroups() const {return myTimeGroups.entries();}
949  CH_TimeGroup *getTimeGroup(int i) { return myTimeGroups(i); }
950  const CH_TimeGroup *getTimeGroup(int i) const { return myTimeGroups(i); }
951  CH_TimeGroup *getTimeGroup(const char *name);
952  const CH_TimeGroup *getTimeGroup(const char *name) const;
953  int getTimeGroupIdx( const char *name ) const;
954 
955  /// Utility function to make a floating point number "nice" - i.e. only /
956  /// use N decimal places. Should only be used for frames/samples
957  /// (not time).
958  ///
959  /// Note that @c digits does @b not specify precision. It specifies
960  /// precision of decimals. The integer portion will be left at full
961  /// precision. For example: @code
962  /// niceNumber(12345.2, 1) == 12345;
963  /// niceNumber(1.23452e-14, 3) == 1.23e-14;
964  /// @endcode
965  /// Note that 6 digits is enough to hold a single precision float.
966  static fpreal niceNumber(fpreal num, int digits=6)
967  { return SYSniceNumber(num, digits); }
968 
969  // Utility function to find a frame separation that is an intelligent
970  // multiple/subdivision of the current frame rate, close to the
971  // initialSep parameter.
972  int niceFrameSeparation(fpreal initialSep,
973  int minimumSep = 1) const;
974 
975  // Stretching collections will stretch every channel of every collection
976  // based on the old time passed to us.
977  // The channels will be stretched to fit the new time
978  void stretchCollections(CH_Collection *from, fpreal ostart,
979  fpreal oend);
980 
981  static fpreal getDefaultFPS();
982  static fpreal getDefaultLength(fpreal fps);
983  static fpreal getDefaultLengthFrames(fpreal fps);
984  static int getDefaultChopMotionSamples();
985 
986  fpreal getNumSamples() const { return mySampleCount; }
987  void setRawNumSamples(int n);
988  fpreal getSamplesPerSec() const { return myFPS; }
989  void setSamplesPerSec(fpreal fps);
990  fpreal getSecsPerSample() const { return 1.0 / myFPS; }
991  void setRawSamplesPerSec(fpreal fps);
992  int getChopMotionSamples() const { return myChopMotionSamples; }
993  void setChopMotionSamples(int n);
994 
995  fpreal getGlobalStart() const { return myStart; }
996  fpreal getGlobalEnd() const { return myEnd; }
998  { return getFrame( myStart ); }
999  int getGlobalEndFrame() const
1000  { return getFrame( myEnd ); }
1001 
1002  void setGlobalTime(fpreal start, fpreal end);
1003 
1004  void setRawInterpolation(int state) { myRawInterpFlag = state; }
1005  int getRawInterpolation() { return myRawInterpFlag; }
1006 
1007  // CONVERSION
1008  fpreal getTolerance() const { return myTimeTolerance; }
1009  // sample -> time
1010  fpreal getTime(fpreal sample) const
1011  {
1012  return ((sample-1.0)/myFPS);
1013  }
1014  // time -> sample (for calculation)
1016  {
1017  return t*myFPS+1.0;
1018  }
1019  // time -> sample (for display)
1021  {
1022  return niceNumber(getSampleRaw(t));
1023  }
1024  // time -> sample (integer)
1025  int getFrame(fpreal t) const
1026  {
1027  return (int)SYSfloor(getSampleRaw(t+getTolerance()));
1028  }
1029  // sample-delta -> time-delta
1030  fpreal getTimeDelta(fpreal sample_delta) const
1031  {
1032  return sample_delta/myFPS;
1033  }
1034  // time-delta -> sample-delta
1035  fpreal getSampleDelta(fpreal time_delta) const
1036  {
1037  return time_delta*myFPS;
1038  }
1039  // time -> time (snapped to an integer frame)
1041  {
1042  return getTime( SYSrint( getSampleRaw(t) ) );
1043  }
1044 
1045  // frame -> frame (snapped to an integer frame)
1047  {
1048  return SYSrint(frame);
1049  }
1050  // say you have a key at frame 0.6 (base_time) and you are moving it with
1051  // snap to frame on, so you want to snap the amount you move the key so
1052  // that the key lands on the nearest frame. In this example, time_delta
1053  // would be rounded to numbers like: -1.6, -0.6, 0.4, 1.4. This function
1054  // does this. Note that the parameters and return value are in time not
1055  // frames as they were in the example.
1056  fpreal getSnapToFrameDelta(fpreal base_time, fpreal time_delta) const;
1057  // time -> bool (true if time is at an integer frame boundary)
1058  bool getIsAtFrame(fpreal t) const
1059  {
1060  fpreal snaptime;
1061 
1062  snaptime = getSnapToFrameTime( t );
1063  return SYSisEqual(t, snaptime, getTolerance());
1064  }
1065 
1066  // Get code in buf
1067  void getTimeCode(char *buf, fpreal t);
1068  // Return time from buf
1069  int setTimeCode(const char *buf, fpreal &t);
1070 
1071  void setTimeCodeOffset(fpreal t) { myTimeCodeOffset = t; }
1072  fpreal getTimeCodeOffset(fpreal ) const { return myTimeCodeOffset; }
1073 
1074  int getIntegerFrameFlag() const { return myIntegerFrames; }
1075  void setIntegerFrameFlag(int flag) { myIntegerFrames = flag; }
1076 
1077  int getRestrictRangeFlag() const { return myRestrictRange; }
1078  void setRestrictRangeFlag(int flag) { myRestrictRange = flag; }
1079 
1080  int getShowRangeFlag() const { return myShowRange; }
1081  void setShowRangeFlag(int flag) { myShowRange = flag; }
1082 
1083  int getShowTicksFlag() const { return myShowTicks; }
1084  void setShowTicksFlag(int flag) { myShowTicks = flag; }
1085 
1086  int getShowAudioFlag() const { return myShowAudio; }
1087  void setShowAudioFlag(int flag) { myShowAudio = flag; }
1088 
1089  int getShowKeysFlag() const { return myShowKeys; }
1090  void setShowKeysFlag(int flag) { myShowKeys = flag; }
1091 
1092  int getShowSimCacheFlag() const { return myShowSimCache; }
1093  void setShowSimCacheFlag(int flag) { myShowSimCache = flag; }
1094 
1095  fpreal getAudioLevel() const { return myAudioLevel; }
1096  void setAudioLevel(fpreal lvl) { myAudioLevel = lvl; }
1097 
1098  fpreal getUnitLength() const { return myUnitLength; }
1099  void setUnitLength(fpreal unitlength){ myUnitLength = unitlength; }
1100  fpreal getUnitMass() const { return myUnitMass; }
1101  void setUnitMass(fpreal unitmass) { myUnitMass = unitmass; }
1102  void parseUnitsString(const char *units,
1103  fpreal &distexp,
1104  fpreal &massexp) const;
1105  fpreal scaleToMKS(const char *fromunits) const;
1106  fpreal scaleFromMKS(const char *tounits) const;
1107 
1108  int getRealTimeFlag() const { return myRealTimePlay; }
1109  void setRealTimeFlag(int flag) { myRealTimePlay = flag; }
1110  fpreal getRealTimeFactor() const { return myRealTimeFactor; }
1111  void setRealTimeFactor(fpreal f) { myRealTimeFactor = f; }
1112  bool getRealTimeDisableSkip() const { return myRealTimeDisableSkip; }
1113  void setRealTimeDisableSkip(bool b) { myRealTimeDisableSkip = b; }
1114  fpreal getSampleStep() const { return mySampleStep; }
1115  void setSampleStep(fpreal s) { mySampleStep = s; }
1116 
1118  {
1119  start = myRangeStart;
1120  end = myRangeEnd;
1121  }
1123  {
1124  if (start > end) { myRangeEnd = start; myRangeStart = end; }
1125  else { myRangeEnd = end; myRangeStart = start; }
1126  }
1127 
1128  int getHoldFlag() const { return myHoldFlag; }
1129  void setHoldFlag( int flag ) { myHoldFlag = flag; }
1130 
1131  // I/O methods
1132  int saveChannels(const char *filename, bool binary, bool compiled,
1133  const CH_ChannelList &channels,
1134  bool displayed = false) const;
1135  int loadChannels(const char *filename,
1136  const char *src_pattern,
1137  const char *dest_pattern,
1138  bool use_range,
1139  const fpreal *tstart,
1140  const fpreal *tend,
1141  CH_CollectionList &parents,
1142  bool delete_keys = false,
1143  CH_ChannelRefList *displayed_parms = NULL);
1144  static bool readCHNFileHeader(UT_IStream &is, bool quiet,
1145  fpreal32 &version, int &binary,
1146  bool &is_fp64,
1147  fpreal64 &tstart, fpreal64 &tend);
1148  static bool skipCHNFileHeaderForCollection(UT_IStream &is, bool &is_fp64);
1149  static bool getFileType( const char *filename, int &raw, int &binary );
1150  static bool printFileInfo(std::ostream &os, const char *filename,
1151  CH_Collection *load_coll,
1152  bool print_segments=true );
1153 
1154  // Expression glue. Only call this if you know what you're really doing.
1155  void addExpressionDefine(CH_ExprDefine *def);
1156 
1157  // The following method should only be called by CH_Collection, so please
1158  // don't mess me up.
1160  {
1161  // We use thread-local storage for the eval
1162  // collection. This isn't because two
1163  // different collections can be evaluating
1164  // paramaters in different threads at the same
1165  // time, though it would be nice for that to be
1166  // possible one day. Instead, it's so that if
1167  // Houdini is evaluating a parameter at the
1168  // same time as a python script is running code
1169  // that checks for the currently evaluating
1170  // parameter (so it can add the appropriate
1171  // parm interests), that we don't add parm
1172  // interests when we shouldn't.
1173  evalContext(thread).myCollection = g;
1174  // Reset the other members to avoid stale ptrs
1175  evalContext(thread).myChannel = 0;
1176  evalContext(thread).mySegment = 0;
1177  evalContext(thread).myChannelName = 0;
1178  }
1179  // TODO: Make getEvalCollection() return a const pointer
1181  {
1182  // We use thread-local storage the eval
1183  // collection.
1184  //
1185  // If this is the first time this thread has
1186  // accessed the pointer it will be null.
1187  // That's exactly the behaviour we want.
1188  return evalContext(thread).myCollection;
1189  }
1190 
1191  // The CH_Manager needs a pointer to the channel collection for the
1192  // OP_Director. This is used to trigger events when channel and time
1193  // groups are modified.
1195  { myRootCollection = root; }
1197  { return myRootCollection; }
1198 
1199  virtual CH_ScriptAccessManager *getAccessManager(int /*thread*/)
1200  { return 0; }
1201 
1202  inline const CH_EvalContext &
1203  evalContext(int thread) const
1204  { return myEvalContext.getValueForThread(thread); }
1205 
1206  inline CH_EvalContext &
1208  { return myEvalContext.getValueForThread(thread); }
1209 
1210  inline const CH_Channel *getEvalChannel(int thread) const
1211  { return evalContext(thread).myChannel; }
1212  inline const CH_Segment *getEvalSegment(int thread) const
1213  { return evalContext(thread).mySegment; }
1214  inline const char *getEvalChannelName(int thread) const
1215  { return evalContext(thread).myChannelName; }
1216  inline const DEP_ContextOptionsStack *
1218  { return evalContext(thread).myContextOptionsStack; }
1221  { return evalContext(thread).myContextOptions; }
1222 
1223  /// Functions for obtaining and setting the current evaluation time
1224  // @{
1225  inline fpreal getEvaluateTime(int thread) const
1226  { return evalContext(thread).myTime; }
1227  inline void setEvaluateTime(fpreal time, int thread)
1228  { evalContext(thread).myTime = time; }
1229  // @}
1230 
1231  /// The following function only remains for backwards compatibility of
1232  /// HDK users. Calls to this function should be replaced with one of the
1233  /// following forms:
1234  /// getEvaluateTime(context.getThread()) -> inside cooking code path
1235  /// getEvaluateTime(thread) -> in expression functions
1236  /// CHgetEvalTime() -> else without thread variable
1237  SYS_DEPRECATED(11.1) fpreal getEvaluateTime() const
1238  { return getEvaluateTime(SYSgetSTID()); }
1239 
1240  //
1241  // These methods are usually only used by CH_Collection to evaluate
1242  // variables belonging to me...
1243  CH_LocalVariable *getLocalVariableTable() const;
1244  bool getVariableValue(UT_String &str, int i,
1245  int thread) const;
1246  bool getVariableValue(fpreal &val, int i,
1247  int thread) const;
1248 
1249  // Should only be called if the variable has flagged as CH_VARIABLE_INTVAL
1250  bool getVariableValue(int &val, int i, int thread) const;
1251 
1252  // getVariableString should really be protected, but can't do it.
1253  virtual bool getVariableString(const char *name,
1254  UT_String &value,
1255  int &timeDepend,
1256  int thread);
1257 
1258  // Function for adding new global variables with the HDK.
1259  int addVariable(const CH_LocalVariable &var,
1260  CH_StringVarEvalFunc strfunc,
1261  CH_FloatVarEvalFunc floatfunc,
1262  CH_IntVarEvalFunc intfunc) const;
1263 
1264  static void lookupVariable(const char *name, UT_String &val,
1265  int thread);
1266  static void lookupVariableNoThread(const char *name,
1267  UT_String &val);
1268  static void lookupExpression(const char *name, UT_String &val,
1269  int thread);
1270  static void lookupExpressionNoThread(const char *name,
1271  UT_String &val);
1272 
1273  // This should only be called by CH_Collection
1274  void removeParamDependency(CH_Collection *coll);
1275 
1276  /// Use this method to translate a channel reference to a channel pointer.
1277  /// May return NULL if the channel reference does not reference a valid
1278  /// channel.
1279  virtual CH_Channel *getChRefChannel(const CH_ChannelRef &r) const;
1280 
1281  /// Use this method to determine if the owner of the channel reference
1282  /// is exposed or not.
1283  virtual bool isOwnerExposed(const CH_ChannelRef &r) const;
1284 
1285  /// Use this method to build a channel reference from a channel pointer.
1286  virtual bool buildChanRef(CH_ChannelRef &r,
1287  const CH_Channel *chp) const;
1288 
1289  /// Use this method to build a channel reference from a channel path.
1290  virtual bool buildChanRef(CH_ChannelRef &r,
1291  const char *path) const;
1292 
1293  bool buildChannelRefs( CH_ChannelRefList &reflist,
1294  const CH_ChannelList &chlist );
1295 
1296  bool buildChannelRefs( CH_ChannelRefList &reflist,
1297  const UT_StringArray &chlist );
1298 
1299  /// Returns 0 if r1 and r2 are equal, returns -1 if r1 < r2 and
1300  /// returns 1 if r1 > r2.
1301  virtual int compareChanRefs(const CH_ChannelRef &r1,
1302  const CH_ChannelRef &r2) const;
1303 
1304  /// Returns 0 if r1 and r2 are equal, returns -1 if r1 < r2 and
1305  /// returns 1 if r1 > r2.
1306  virtual int compareLayerRefs(const CH_ChannelRef &r1,
1307  const CH_ChannelRef &r2) const;
1308 
1309  /// Use this method to get the full path of the channel referenced by r.
1310  virtual void getChanRefPath(const CH_ChannelRef &r,
1311  UT_String &path,
1312  bool use_alias=false) const;
1313 
1314  void changeReferencesToNodeId(int old_id, int new_id);
1315 
1316  /// This method will remove all references that this manager knows about
1317  /// channels belonging to node 'node_id'. After this method, scoped
1318  /// channels belonging to node_id will be removed, as will such channels
1319  /// in channel groups.
1320  void removeReferencesToNodeId(int node_id);
1321 
1322  void displayScope() const;
1323 
1324  // Find ChannelRef export location
1325  // Channel CHOP nodes have inputs that match directly to the exported
1326  // tracks. Given a Channel CHOP value param and index, find the export
1327  // location in the scene and return its ChannelRef If the input 'r' channel
1328  // ref is from a CHOP Channel Node, return the corresponding export in
1329  // 'out_export'.
1330  // Returns true if a valid Export was found
1331  virtual bool resolveChanRefExport(const CH_ChannelRef& r,
1332  CH_ChannelRef& out_export );
1333 
1334  /// Auto-Key all Tuples is a preference to key tuples together.
1335  bool getAutoKeyTuples() const
1336  { return myAutoKeyTuples; }
1337  void setAutoKeyTuples(bool b)
1338  { myAutoKeyTuples=b; }
1339 
1340  /// Auto-Scope when Creating Channel is a preference to set the auto-scope
1341  /// flag when creating a channel.
1343  { return mySetAutoScopeOnChannelCreate; }
1345  { mySetAutoScopeOnChannelCreate=b; }
1346 
1347  /// Include all the Animated Channels when building the scoped parameter
1348  /// list from selection
1350  { return myAutoScopeIncludeAnimated; }
1352  { myAutoScopeIncludeAnimated=b; }
1353 
1354  ///
1356  { return myFollowScopedChannelReferences; }
1358  { myFollowScopedChannelReferences=b; }
1359 
1360 
1361  //
1362  // Animation functions.
1363  //
1364  fpreal evalBezierFunc(int thread);
1365  fpreal evalConstantFunc(int thread);
1366  fpreal evalCubicFunc(int thread);
1367  fpreal evalCycleFunc(fpreal start_frame, fpreal end_frame,
1368  int thread);
1369  fpreal evalCycletFunc(fpreal start_frame, fpreal end_frame,
1370  int thread);
1371  fpreal evalCycleOffsetFunc(
1372  fpreal start_frame, fpreal end_frame, int thread);
1373  fpreal evalCycleOffsettFunc(
1374  fpreal start_frame, fpreal end_frame, int thread);
1375  fpreal evalEaseFunc(int thread);
1376  fpreal evalEaseinFunc(int thread);
1377  fpreal evalEaseinpFunc(fpreal ease_speed, int thread);
1378  fpreal evalEaseoutFunc(int thread);
1379  fpreal evalEaseoutpFunc(fpreal ease_speed, int thread);
1380  fpreal evalEasepFunc(fpreal ease_speed, int thread);
1381  fpreal evalLinearFunc(int thread);
1382  fpreal evalMatchFunc(int thread);
1383  fpreal evalMatchinFunc(int thread);
1384  fpreal evalMatchoutFunc(int thread);
1385  fpreal evalQcubicFunc(int thread);
1386  fpreal evalQlinearFunc(int thread);
1387  fpreal evalQuinticFunc(int thread);
1388  fpreal evalRepeatFunc(fpreal start_frame, fpreal end_frame,
1389  int thread);
1390  fpreal evalRepeattFunc(fpreal start_frame, fpreal end_frame,
1391  int thread);
1392  fpreal evalSplineFunc(int thread);
1393  fpreal evalVmatchFunc(int thread);
1394  fpreal evalVmatchinFunc(int thread);
1395  fpreal evalVmatchoutFunc(int thread);
1396 
1397  /// Include all the Child nodes when building the scoped parameter list
1398  /// from selection
1400  { return myAutoScopeIncludeChild; }
1402  { myAutoScopeIncludeChild=b; }
1403 
1404  /// Include all the Constraints nodes when building the scoped parameter
1405  /// list from selection
1407  { return myAutoScopeIncludeConstraints; }
1409  { myAutoScopeIncludeConstraints=b; }
1410 
1411  // Functions for accessing and controlling the default context option
1412  // values. These values are used by all OP_Context objects unless a
1413  // value is explicitly overridden on that context object. These functions
1414  // also manage the associated micro nodes and send notifications as
1415  // appropriate.
1417  { return myDefaultContextOptions; }
1418  DEP_MicroNode &getDefaultContextOptionMicroNode(
1419  const UT_StringHolder &opt);
1420  void setDefaultContextOption(
1421  const UT_StringHolder &opt,
1422  const UT_StringHolder &value);
1423  void setDefaultContextOption(
1424  const UT_StringHolder &opt,
1425  fpreal64 value);
1426  const UT_StringHolder &getDefaultContextOptionUiConfig(
1427  const UT_StringHolder &opt) const;
1428  void setDefaultContextOptionUiConfig(
1429  const UT_StringHolder &opt,
1430  const UT_StringHolder &ui_config);
1431  void removeDefaultContextOption(
1432  const UT_StringHolder &opt);
1433  void clearDefaultContextOptions();
1434  bool saveDefaultContextOptions(std::ostream &os) const;
1435  bool loadDefaultContextOptions(UT_IStream &is);
1436 
1437  void setChannelColorManager( CH_ChannelColorManager *mgr );
1438  CH_ChannelColorManager *channelColorManager();
1439 
1440  void setChannelChanged( CH_ChannelChanged *mgr );
1441  CH_ChannelChanged *getChannelChanged();
1442  void triggerChannelChanged();
1443 
1444  virtual bool getChannelAutoSelect(const CH_ChannelRef &chref) const
1445  { return true; }
1446 
1447  // Resolve channel labels and node path without exposing OP_Node*
1448  virtual bool getChRefLabelForUI(const CH_ChannelRef &r, UT_String &ret) const;
1449  virtual bool getChRefAlias(const CH_ChannelRef &r, UT_String &ret) const;
1450  virtual bool getChRefNodePath(const CH_ChannelRef &r, UT_String &ret) const;
1451 protected:
1452  void initExpressionLibrary();
1453 
1454  // Since this is possibly a base class, the library glue initialization has
1455  // to be done after the construction
1456  void initLibraryGlue();
1457 
1458 private:
1459  friend CH_ScopedChannels;
1460 
1461  void internalScopeChanged(unsigned flags,
1462  bool propagate=true );
1463 
1464  void handleGroupCollision(CH_Group *new_group,
1465  CH_Group *existing,
1466  CollisionBehaviour cb );
1467 
1468  void destroyContents();
1469  int internalSetGlobalParam(const char *token,
1470  fpreal val, const char *strval,
1471  CH_Collection *&owner);
1472  int setSingleGlobalParam(const char *token,
1473  fpreal val, const char *strvel,
1474  CH_Collection *&owner, CH_Collection *scope);
1475  void internalDirtyOrphanGlobalParamDependents(
1476  const char *token, CH_Collection *scope,
1477  UT_Set<CH_Collection *> *dependents);
1478  void stretchCollection(CH_Collection *grp,
1479  fpreal os, fpreal ns, fpreal stretch);
1480  void propagateDefaultContextOptionDirtied(
1481  const UT_StringHolder &opt);
1482 
1483  static char *chExprExpander(const char *str, int thread);
1484 
1485  class chParamKey
1486  {
1487  public:
1488  chParamKey(const UT_StringRef &token, CH_Collection *scope);
1489  bool operator==(const chParamKey &key) const;
1490  bool operator!=(const chParamKey &key) const
1491  { return !operator==(key); }
1492  SYS_HashType hash() const;
1493  const char *getToken() const
1494  { return myToken; }
1495  CH_Collection *getScope() const
1496  { return myScope; }
1497 
1498  struct Hasher
1499  {
1500  SYS_HashType operator()(const chParamKey &key) const
1501  { return key.hash(); }
1502  };
1503  private:
1504  UT_StringRef myToken;
1505  CH_Collection *myScope;
1506  };
1507 
1509 
1510  // Default Context Options for cooking nodes.
1511  DEP_ContextOptionsHandle myDefaultContextOptions;
1512  UT_StringMap<DEP_MicroNode *> myDefaultContextOptionMicroNodes;
1513  UT_TBBSpinLock myDefaultContextOptionMicroNodesLock;
1514  UT_StringMap<UT_StringHolder> myDefaultContextOptionUIs;
1515 
1516  CH_Group *myTopGroup;
1517  UT_StringArray mySelectedGroupPaths;
1518  UT_String myCurrentGroupPath;
1519  UT_ValArray<CH_TimeGroup *> myTimeGroups;
1520  CH_Collection *myRootCollection;
1521  fpreal mySampleCount;
1522  fpreal myFPS;
1523  fpreal myStart, myEnd;
1524 
1525  fpreal myRangeStart;
1526  fpreal myRangeEnd;
1527  fpreal myRealTimeFactor;
1528  fpreal mySampleStep;
1529  fpreal myTimeTolerance;
1530  fpreal myTimeCodeOffset;
1531 
1532  chParamData *findGlobalParam(const char *token,
1533  CH_Collection *scope);
1534  chParamData *findOrCreateGlobalParam(
1535  const char *token, CH_Collection *scope,
1536  fpreal fval, const char *sval);
1538  chParamData *myLastGlobalParam;
1539  int mySettingGlobalParam;
1540 
1541  int mySettingGuideParam;
1542 
1543  int myChopMotionSamples;
1544 
1545  unsigned myGroupsSorted:1,
1546  myIntegerFrames:1,
1547  myRealTimePlay:1,
1548  myRealTimeDisableSkip:1,
1549  myHoldFlag:1,
1550  myRestrictRange:1,
1551  myShowRange:1,
1552  myShowTicks:1,
1553  myShowAudio:1,
1554  myShowKeys:1,
1555  myShowSimCache:1,
1556  myAutoKeyTuples:1,
1557  mySetAutoScopeOnChannelCreate:1,
1558  myAutoScopeIncludeAnimated:1,
1559  myFollowScopedChannelReferences:1,
1560  myAutoScopeIncludeChild:1,
1561  myAutoScopeIncludeConstraints:1;
1562 
1563 
1564  short myRawInterpFlag;
1565 
1566  UT_String myDefaultExpression;
1567  UT_String myDefaultRotationExpression;
1568  bool myAutoSplit;
1569  UT_String myDefaultSplitExpression;
1570  SlopeMode myAutoSlope;
1571  fpreal myDefaultSlope;
1572  bool myHoldLastKey;
1573  // auto-commit value change when we are on a keyframe
1574  bool myAlwaysCommitKey;
1575  UT_String myChanCreateKeyExpression;
1576  fpreal myAudioLevel;
1577  fpreal myUnitLength;
1578  fpreal myUnitMass;
1579 
1580  CH_ScopedChannels myScopedChannels;
1581  UT_Array<CH_ScopedChannels*> myPinnedScopedChannels;
1582 
1583  UT_Set<CH_Channel *> myPendingChannelsTable;
1584 
1585  CH_ExprLanguage myDefaultExprLanguage;
1586 
1587  int myBlockModifyScope;
1588  unsigned myPendingScopeChange;
1589  bool myPendingChannelChanged;
1590 
1591  CH_ChannelColorManager *myChannelColorsManager;
1592  CH_ChannelChanged *myChannelChanged;
1593 
1594  static CH_Manager *theManager;
1595 
1598 };
1599 
1600 /// Push & restore the evaluation time (and optionally a channel collection)
1602 {
1603 public:
1605  int thread,
1606  fpreal time,
1607  CH_Collection *ch = nullptr,
1608  const DEP_ContextOptionsStack *context_options_stack = nullptr,
1609  DEP_ContextOptionsReadHandle context_options =
1611  : myContext(chman.evalContext(thread))
1612  , myCollection(nullptr)
1613  , myPopCollection(false)
1614  , myPopContextOptions(false)
1615  {
1616  myTime = myContext.myTime;
1617  myContext.myTime = time;
1618  if (ch)
1619  {
1620  myPopCollection = true;
1621  myCollection = myContext.myCollection;
1622  myContext.myCollection = ch;
1623  }
1624  if (!context_options.isNull())
1625  {
1626  myPopContextOptions = true;
1627  myContextOptionsStack = myContext.myContextOptionsStack;
1628  myContext.myContextOptionsStack = context_options_stack;
1629  myContextOptions = myContext.myContextOptions;
1630  myContext.myContextOptions = context_options;
1631  }
1632  }
1633 
1635  {
1636  myContext.myTime = myTime;
1637  if (myPopCollection)
1638  myContext.myCollection = myCollection;
1639  if (myPopContextOptions)
1640  {
1641  myContext.myContextOptionsStack = myContextOptionsStack;
1642  myContext.myContextOptions = myContextOptions;
1643  }
1644  }
1645 
1646 private:
1647  CH_EvalContext &myContext;
1648  CH_Collection *myCollection;
1649  const DEP_ContextOptionsStack *myContextOptionsStack;
1650  DEP_ContextOptionsReadHandle myContextOptions;
1651  fpreal myTime;
1652  bool myPopCollection;
1653  bool myPopContextOptions;
1654 
1655  friend class CH_Manager;
1656 };
1657 
1658 /// Push & restore a channel collection only. If the given collection is NULL,
1659 /// then the eval context is not modified.
1661 {
1662 public:
1663  CH_AutoEvalCollection(int thread, CH_Collection *collection = NULL)
1664  : myContext(CH_Manager::getContext()->evalContext(thread))
1665  {
1666  myCollection = myContext.myCollection;
1667  if (collection)
1668  myContext.myCollection = collection;
1669  }
1671  {
1672  return myContext.myCollection;
1673  }
1674  void set(CH_Collection *collection)
1675  {
1676  UT_ASSERT(collection);
1677  myContext.myCollection = collection;
1678  }
1680  {
1681  myContext.myCollection = myCollection;
1682  }
1683 
1684 private:
1685  CH_EvalContext &myContext;
1686  CH_Collection *myCollection;
1687 };
1688 
1689 // Small utility class to set the active layer contribution and reset it
1690 // The animation layer value and weight comes from CHOP_Layer extra tracks.
1691 // The active_layer_value and active_layer_weight tracks are used correctly
1692 // reapply values on the active layer channels.
1694 {
1695 public:
1698 
1699  // set the layer contribution for the lifespan of the object.
1700  void set(fpreal layer_value, fpreal layer_weight);
1701 
1702  // Apply the active layer contribution to input
1703  void apply(fpreal& v);
1704 
1705 private:
1706  bool myReset;
1707 };
1708 
1711 CH_API void CHsortChannelPaths( UT_StringArray &channel_paths );
1713 
1715  CH_CollectionList &collections );
1716 
1717 inline
1719 {
1720  return CH_Manager::getContext();
1721 }
1722 
1723 inline
1725 {
1727 }
1728 
1730 {
1732 }
1733 
1735 {
1736  return CH_Manager::getContext()->getEvaluateTime(thread);
1737 }
1738 
1739 CH_API extern fpreal CHgetTimeFromFrame(fpreal frame);
1740 CH_API extern int CHgetFrameFromTime(fpreal time);
1742 CH_API extern void CHbuildRange(int start, int end, UT_SuperIntervalR &r);
1743 
1744 /// The CHoutputChannelList functions output a formatted string
1745 /// representing the given channels. One version of the function takes a
1746 /// list of channels while the other takes a string array of full paths
1747 /// to channels. The given arrays may be modified (they might need sorting).
1748 CH_API extern void CHoutputChannelList(UT_WorkBuffer &info,
1750 CH_API extern void CHoutputChannelList(UT_WorkBuffer &info,
1751  UT_StringArray &channel_paths);
1752 
1753 CH_API extern void CHdisplayFlags( unsigned flags, std::ostream &s );
1754 
1755 #endif
fpreal getSampleDelta(fpreal time_delta) const
Definition: CH_Manager.h:1035
GLdouble s
Definition: glew.h:1390
fpreal getRealTimeFactor() const
Definition: CH_Manager.h:1110
CH_API void CHsortChannelRefs(CH_ChannelRefList &channels)
DEP_ContextOptionsHandle getDefaultContextOptions() const
Definition: CH_Manager.h:1416
Definition: UT_Set.h:58
GT_API const UT_StringHolder filename
bool getAutoScopeIncludeConstraints() const
Definition: CH_Manager.h:1406
const char * getEvalChannelName(int thread) const
Definition: CH_Manager.h:1214
fpreal getSnapToFrameTime(fpreal t) const
Definition: CH_Manager.h:1040
fpreal getSecsPerSample() const
Definition: CH_Manager.h:990
GLenum GLint ref
Definition: glew.h:1845
CH_API fpreal CHgetTimeFromFrame(fpreal frame)
#define SYS_DEPRECATED(__V__)
GLuint const GLchar * name
Definition: glew.h:1814
void setAutoScopeOnChannelCreate(bool b)
Definition: CH_Manager.h:1344
CH_API fpreal CHgetSampleFromTime(fpreal time)
virtual ~CH_ChannelColorManager()
Definition: CH_Manager.h:66
void setAutoScopeIncludeChild(bool b)
Definition: CH_Manager.h:1401
CH_ExprLanguage
const DEP_ContextOptionsStack * getEvalChannelContextOptionsStack(int thread) const
Definition: CH_Manager.h:1217
void setAutoScopeIncludeConstraints(bool b)
Definition: CH_Manager.h:1408
fpreal getUnitLength() const
Definition: CH_Manager.h:1098
GT_API const UT_StringHolder time
GLenum target
Definition: glew.h:2865
bool(* CH_StringVarEvalFunc)(UT_String &val, int varid, int thread)
Definition: CH_Manager.h:59
void setHoldFlag(int flag)
Definition: CH_Manager.h:1129
void setSampleStep(fpreal s)
Definition: CH_Manager.h:1115
GLuint const GLfloat * val
Definition: glew.h:2794
void setShowAudioFlag(int flag)
Definition: CH_Manager.h:1087
bool(* CH_IntVarEvalFunc)(int &val, int varid, int thread)
Definition: CH_Manager.h:61
GLenum GLsizei GLsizei GLsizei GLsizei GLbitfield flags
Definition: glew.h:2864
void setShowRangeFlag(int flag)
Definition: CH_Manager.h:1081
void setKeepChannelListSelection(bool b)
Definition: CH_Manager.h:303
bool getAutoScopeOnChannelCreate() const
Definition: CH_Manager.h:1342
void setFilterParmLabels(FilterType filter_type, bool b)
Definition: CH_Manager.h:341
void setFilterScales(bool b)
Definition: CH_Manager.h:336
void setSampleRange(fpreal start, fpreal end)
Definition: CH_Manager.h:1122
fpreal getSampleRaw(fpreal t) const
Definition: CH_Manager.h:1015
fpreal64 file_end
Definition: CH_Manager.h:93
const CH_TimeGroup * getTimeGroup(int i) const
Definition: CH_Manager.h:950
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:1046
GLsizei GLsizei GLchar * source
Definition: glew.h:1832
void setEvalCollection(CH_Collection *g, int thread)
Definition: CH_Manager.h:1159
int getShowSimCacheFlag() const
Definition: CH_Manager.h:1092
CH_KeyState
Definition: CH_KeyState.h:15
CH_API void CHsortChannelPaths(UT_StringArray &channel_paths)
CH_API void CHoutputChannelList(UT_WorkBuffer &info, CH_ChannelList &channels)
const GLdouble * m
Definition: glew.h:9124
bool getAutoScopeIncludeChild() const
Definition: CH_Manager.h:1399
Selectively extract and filter point data using a custom filter operator.
CH_API void CHbuildRange(int start, int end, UT_SuperIntervalR &r)
fpreal getTimeDelta(fpreal sample_delta) const
Definition: CH_Manager.h:1030
fpreal getTimeCodeOffset(fpreal) const
Definition: CH_Manager.h:1072
const GLdouble * v
Definition: glew.h:1391
bool getFilterParmLabels(FilterType filter_type) const
Definition: CH_Manager.h:343
bool getIsSettingGuideParam() const
Definition: CH_Manager.h:847
int getRealTimeFlag() const
Definition: CH_Manager.h:1108
GLenum GLint GLuint mask
Definition: glew.h:1845
void setEnableFilter(FilterType filter_type, bool b)
Definition: CH_Manager.h:316
fpreal64 load_end
Definition: CH_Manager.h:91
SYS_API fpreal64 SYSniceNumber(fpreal64 num, int digits=6)
void setShowSimCacheFlag(int flag)
Definition: CH_Manager.h:1093
GLsizei GLuint * groups
Definition: glew.h:2744
const CH_EvalContext & evalContext(int thread) const
Definition: CH_Manager.h:1203
int getHoldLastKey() const
Definition: CH_Manager.h:480
void setAutoScopeIncludeAnimated(bool b)
Definition: CH_Manager.h:1351
int getShowKeysFlag() const
Definition: CH_Manager.h:1089
fpreal getUnitMass() const
Definition: CH_Manager.h:1100
static bool getContextExists()
Definition: CH_Manager.h:435
void setUnitMass(fpreal unitmass)
Definition: CH_Manager.h:1101
bool getRealTimeDisableSkip() const
Definition: CH_Manager.h:1112
SlopeMode getAutoSlope() const
Definition: CH_Manager.h:462
void setChanCreateKeyExpression(const char *s)
Definition: CH_Manager.h:484
void setFollowScopedChannelReferences(bool b)
Definition: CH_Manager.h:1357
bool getFilterFullNames(FilterType filter_type) const
Definition: CH_Manager.h:348
int getGlobalEndFrame() const
Definition: CH_Manager.h:999
bool operator==(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:137
bool getFollowScopedChannelReferences() const
Definition: CH_Manager.h:1355
int getNTimeGroups() const
Definition: CH_Manager.h:948
void setDefaultSplitExpression(const char *expr)
Definition: CH_Manager.h:472
void getSampleRange(fpreal &start, fpreal &end)
Definition: CH_Manager.h:1117
int getFrame(fpreal t) const
Definition: CH_Manager.h:1025
fpreal getSampleStep() const
Definition: CH_Manager.h:1114
bool getFilterTranslates() const
Definition: CH_Manager.h:328
CH_API void CHsortLayerRefs(CH_ChannelRefList &channels)
bool getAutoScopeIncludeAnimated() const
Definition: CH_Manager.h:1349
int getRawInterpolation()
Definition: CH_Manager.h:1005
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:1604
bool getFilterScales() const
Definition: CH_Manager.h:338
CH_Manager * CHgetManager()
Definition: CH_Manager.h:1718
fpreal getGlobalStart() const
Definition: CH_Manager.h:995
GLclampf f
Definition: glew.h:3499
fpreal getSample(fpreal t) const
Definition: CH_Manager.h:1020
const UT_StringHolder & getFilter(FilterType filter_type) const
Definition: CH_Manager.h:323
int getIntegerFrameFlag() const
Definition: CH_Manager.h:1074
const CH_Segment * getEvalSegment(int thread) const
Definition: CH_Manager.h:1212
bool getAutoKeyTuples() const
Auto-Key all Tuples is a preference to key tuples together.
Definition: CH_Manager.h:1335
bool getEnableFilter(FilterType filter_type) const
Definition: CH_Manager.h:318
DEP_ContextOptionsReadHandle getEvalChannelContextOptions(int thread) const
Definition: CH_Manager.h:1220
void setRootCollection(CH_Collection *root)
Definition: CH_Manager.h:1194
fpreal getSamplesPerSec() const
Definition: CH_Manager.h:988
void setIntegerFrameFlag(int flag)
Definition: CH_Manager.h:1075
const GLuint GLenum const void * binary
Definition: glew.h:3502
void setShowTicksFlag(int flag)
Definition: CH_Manager.h:1084
int getRestrictRangeFlag() const
Definition: CH_Manager.h:1077
double fpreal64
Definition: SYS_Types.h:196
void setDefaultSlope(fpreal slope)
Definition: CH_Manager.h:464
GLuint GLuint end
Definition: glew.h:1253
void
Definition: png.h:1083
void setShowKeysFlag(int flag)
Definition: CH_Manager.h:1090
CH_EvalContext & evalContext(int thread)
Definition: CH_Manager.h:1207
CH_API void CHchannelsToCollections(CH_ChannelList const &channels, CH_CollectionList &collections)
const CH_Channel * getEvalChannel(int thread) const
Definition: CH_Manager.h:1210
GLsizei n
Definition: glew.h:4040
fpreal64 load_start
Definition: CH_Manager.h:90
void setRawInterpolation(int state)
Definition: CH_Manager.h:1004
CH_API void CHdisplayFlags(unsigned flags, std::ostream &s)
void setDefaultExpression(const char *s)
Definition: CH_Manager.h:446
fpreal getGlobalEnd() const
Definition: CH_Manager.h:996
void setDefaultExprLanguage(CH_ExprLanguage language)
Definition: CH_Manager.h:925
*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
SYS_API fpreal32 SYSfloor(fpreal32 val)
fpreal CHgetEvalTime()
Definition: CH_Manager.h:1729
fpreal getAudioLevel() const
Definition: CH_Manager.h:1095
CH_Collection * collection() const
Definition: CH_Manager.h:1670
CH_API int CHgetFrameFromTime(fpreal time)
void setAudioLevel(fpreal lvl)
Definition: CH_Manager.h:1096
CH_ExprLanguage getDefaultExprLanguage()
Definition: CH_Manager.h:923
void setAutoSlope(SlopeMode m)
Definition: CH_Manager.h:460
GLuint GLuint GLsizei GLenum type
Definition: glew.h:1253
void setFilterFullNames(FilterType filter_type, bool b)
Definition: CH_Manager.h:346
fpreal32 SYSrint(fpreal32 val)
Definition: SYS_Floor.h:163
virtual ~CH_FilterChanged()
Definition: CH_Manager.h:81
fpreal getDefaultSlope() const
Definition: CH_Manager.h:466
static CH_Manager * getContext()
Definition: CH_Manager.h:430
GLuint start
Definition: glew.h:1253
int getShowAudioFlag() const
Definition: CH_Manager.h:1086
bool getIsAtFrame(fpreal t) const
Definition: CH_Manager.h:1058
int getShowRangeFlag() const
Definition: CH_Manager.h:1080
const char * getDefaultExpression() const
Definition: CH_Manager.h:451
GT_API const UT_StringHolder version
void setDefaultRotationExpression(const char *s)
Definition: CH_Manager.h:453
CH_AutoEvalCollection(int thread, CH_Collection *collection=NULL)
Definition: CH_Manager.h:1663
GLsizei const GLchar *const * path
Definition: glew.h:6461
const CH_ScopedChannels & getGlobalScopedChannels() const
Definition: CH_Manager.h:935
void setRealTimeDisableSkip(bool b)
Definition: CH_Manager.h:1113
bool full_replace
Definition: CH_Manager.h:94
GLdouble GLdouble GLdouble b
Definition: glew.h:9122
GLfloat GLfloat p
Definition: glew.h:16321
fpreal getEvaluateTime(int thread) const
Functions for obtaining and setting the current evaluation time.
Definition: CH_Manager.h:1225
CH_Collection * getEvalCollection(int thread) const
Definition: CH_Manager.h:1180
void setUnitLength(fpreal unitlength)
Definition: CH_Manager.h:1099
double fpreal
Definition: SYS_Types.h:276
bool getFilterRotates() const
Definition: CH_Manager.h:333
UT_COWReadHandle< DEP_ContextOptions > DEP_ContextOptionsReadHandle
void setRealTimeFactor(fpreal f)
Definition: CH_Manager.h:1111
void setAutoKeyTuples(bool b)
Definition: CH_Manager.h:1337
Push & restore the evaluation time (and optionally a channel collection)
Definition: CH_Manager.h:1601
SYS_API int SYSgetSTID()
int getChopMotionSamples() const
Definition: CH_Manager.h:992
CH_ScopedChannels & getGlobalScopedChannels()
Definition: CH_Manager.h:933
GLuint num
Definition: glew.h:2690
const char * getDefaultRotationExpression() const
Definition: CH_Manager.h:458
virtual ~CH_ChannelChanged()
Definition: CH_Manager.h:74
#define CH_API
Definition: CH_API.h:10
SYS_HashType operator()(const chParamKey &key) const
Definition: CH_Manager.h:1500
void setAlwaysCommitKeyChange(bool onoff)
Definition: CH_Manager.h:488
bool getAutoSplit() const
Definition: CH_Manager.h:470
void setHoldLastKey(bool onoff)
Definition: CH_Manager.h:478
GLdouble GLdouble GLdouble r
Definition: glew.h:1406
fpreal getNumSamples() const
Definition: CH_Manager.h:986
void setFilterRotates(bool b)
Definition: CH_Manager.h:331
virtual CH_ScriptAccessManager * getAccessManager(int)
Definition: CH_Manager.h:1199
void setTimeCodeOffset(fpreal t)
Definition: CH_Manager.h:1071
bool use_load_range
Definition: CH_Manager.h:89
bool getAlwaysCommitKeyChange() const
Definition: CH_Manager.h:486
void set(CH_Collection *collection)
Definition: CH_Manager.h:1674
GLuint64EXT * result
Definition: glew.h:14007
virtual bool getChannelAutoSelect(const CH_ChannelRef &chref) const
Definition: CH_Manager.h:1444
CH_TimeGroup * getTimeGroup(int i)
Definition: CH_Manager.h:949
CH_Collection * getRootCollection() const
Definition: CH_Manager.h:1196
bool getKeepChannelListSelection() const
Definition: CH_Manager.h:301
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:135
bool operator!=(const BaseDimensions< T > &a, const BaseDimensions< Y > &b)
Definition: Dimensions.h:165
#define const
Definition: zconf.h:214
GLubyte * pattern
Definition: glew.h:5711
static fpreal niceNumber(fpreal num, int digits=6)
Definition: CH_Manager.h:966
int getHoldFlag() const
Definition: CH_Manager.h:1128
void setAutoSplit(bool onoff)
Definition: CH_Manager.h:468
void setFilterTranslates(bool b)
Definition: CH_Manager.h:326
GLenum GLuint GLsizei const GLchar * buf
Definition: glew.h:2580
GLenum GLenum variable
Definition: glew.h:13879
const char * getDefaultSplitExpression() const
Definition: CH_Manager.h:475
void setRealTimeFlag(int flag)
Definition: CH_Manager.h:1109
GLsizei const GLfloat * value
Definition: glew.h:1849
bool(* CH_FloatVarEvalFunc)(fpreal &val, int varid, int thread)
Definition: CH_Manager.h:60
void setEvaluateTime(fpreal time, int thread)
Functions for obtaining and setting the current evaluation time.
Definition: CH_Manager.h:1227
float fpreal32
Definition: SYS_Types.h:195
int getGlobalStartFrame() const
Definition: CH_Manager.h:997
GLdouble GLdouble t
Definition: glew.h:1398
fpreal getTolerance() const
Definition: CH_Manager.h:1008
fpreal getTime(fpreal sample) const
Definition: CH_Manager.h:1010
void setRestrictRangeFlag(int flag)
Definition: CH_Manager.h:1078
GLfloat units
Definition: glew.h:10289
void setFilter(FilterType filter_type, const UT_StringHolder &f)
Definition: CH_Manager.h:321
int getShowTicksFlag() const
Definition: CH_Manager.h:1083
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:1724
GLboolean GLuint group
Definition: glew.h:2745
GLboolean GLboolean g
Definition: glew.h:9477
fpreal64 file_start
Definition: CH_Manager.h:92
const char * getChanCreateKeyExpression() const
Definition: CH_Manager.h:482
bool isGlobalScopedChannels(CH_ScopedChannels *p)
Definition: CH_Manager.h:929