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