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