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