HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CH_Channel.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: Channel Library (C++)
7  *
8  * COMMENTS: Definition of a channel
9  *
10  */
11 
12 #ifndef __CH_Channel_h__
13 #define __CH_Channel_h__
14 
15 #include "CH_API.h"
16 #include "CH_Collection.h"
17 #include "CH_ExprLanguage.h"
18 #include "CH_EventManager.h"
19 #include "CH_Manager.h"
20 #include "CH_Segment.h"
21 #include "CH_Types.h"
22 
23 #include <UT/UT_Array.h>
24 #include <UT/UT_Assert.h>
25 #include <UT/UT_IntArray.h>
26 #include <UT/UT_Interval.h>
27 #include <UT/UT_String.h>
28 #include <UT/UT_StringHolder.h>
29 #include <UT/UT_SuperInterval.h>
30 #include <UT/UT_Swap.h>
31 #include <UT/UT_ValArray.h>
32 #include <UT/UT_VectorTypes.h>
33 
34 #include <SYS/SYS_Inline.h>
35 #include <SYS/SYS_Math.h>
36 #include <SYS/SYS_Types.h>
37 #include <iosfwd>
38 #include <stddef.h>
39 
40 
41 class UT_IStream;
42 
43 
44 CH_API extern char
46 
47 typedef enum {
48  CH_CHANNEL_DEFAULT, // Channel is default value beyond defined range
49  CH_CHANNEL_HOLD, // Channel is start/end value before/after
50  CH_CHANNEL_CYCLE, // Channel wraps to defined range
51  CH_CHANNEL_EXTEND, // Channel function continues outside start/end
52  CH_CHANNEL_SLOPE, // Channel extends at start/end slope
53  CH_CHANNEL_CYCLEOFF, // Channel warps tot defined range and offsets.
54  CH_CHANNEL_OSCILLATE, // Channel warps tot defined range and offsets.
57 
58 
59 // NB: This enum only has 8 bits.
60 // Do not change these values as they get saved.
61 typedef enum {
65  CH_CACHE_ENABLED = 0x04, // no longer used!
66  CH_CHANNEL_SPARE = 0x08, // no longer used!
68 
69  CH_CHANNEL_PENDING = 0x20, // only used for saving/loading
70  CH_CHANNEL_PENDINGHOLD = 0x40, // no longer used!
71 
73 
74  // We save/load CH_CHANNEL_PENDING via myPending
75  //CH_CHANNEL_SAVE_MASK = CH_CHANNEL_PENDING,
76 
77  CH_CHANNEL_FLAG_MASK = 0xFF // sentinel: we've only got 8 bits
79 
80 // Enum for the CH_Channel::getKey and getFullKey methods
81 typedef enum {
82  CH_GETKEY_EXTEND_NONE, // Don't extend the channel cycle.
83  CH_GETKEY_EXTEND_DEFAULT, // Extend the channel extrapolation, and returns keys in the middle.
84  CH_GETKEY_EXTEND_BOUNDARY, // Extend the channel extrapolation, but give a hint that the key is the last or the first.
86 
87 
89 {
90 public:
92  bool myVValid[ CH_NUM_VALUES ];
93  bool myVTied[ CH_NUM_VALUES ];
94  bool myVAuto[ CH_NUM_VALUES ];
95 };
96 
98 {
99 public:
103 
104  CH_Key() { clear(); }
105 
106  void display() const;
107 
108  void clear();
109 
110  // direction is one of -1, 0, 1
111  // -1 = tie using left value
112  // 0 = tie averaging both
113  // 1 = tie using right value
114  void tie( int direction, CH_ValueTypes t );
115 
116  void tie( int direction );
117 
118  void setAuto( CH_ValueTypes t );
119 
120  void set( CH_ValueTypes t, fpreal value );
121  bool isSet( CH_ValueTypes t ) const;
122 
123  void complete();
124 
125  void get( CH_Segment *left_seg, CH_Segment *right_seg,
126  bool accel_ratio = true );
127 
128  void put( CH_Segment *left_seg, CH_Segment *right_seg,
129  bool accel_ratio = true ) const;
130 
131  void stretch( fpreal xscale, fpreal yscale, bool accel_ratio );
132 
133  void changeAccelsToRatios( fpreal left_seg_len, fpreal right_seg_len );
134 
135  void reverse();
136 
137  void opscript( std::ostream &os, bool use_time,
138  bool only_valid=true ) const;
139 
140  bool verify( bool check_tied_slopes=true ) const;
141 };
142 
143 class CH_API CH_FullKey: public CH_Key
144 {
145 public:
149 
151  {
152  myUseExpression = false;
153  myExprLanguage = CH_OLD_EXPR_LANGUAGE;
154  }
155 
156  CH_FullKey( CH_FullKey const& other );
157  CH_FullKey &operator=( CH_FullKey const& other );
158 
159  void display() const;
160 };
161 
163 {
164 public:
168 
170  {
171  myUseRevExpression = false;
172  myRevExprLanguage = CH_OLD_EXPR_LANGUAGE;
173  }
174 
175  CH_ReversibleKey( CH_ReversibleKey const& other );
177 
178  void display() const;
179 
180  void stretch( fpreal xscale, fpreal yscale, bool accel_ratio );
181 
182  void reverse();
183 };
184 
185 //
186 // Iterator for going through .chn and .bchn files,
187 // channel by channel, until the end of channels for current collection is
188 // reached. The iterator can be restarted by calling begin() again.
189 //
191 {
192 // After using begin or nextChannel, the position in the stream
193 // will be proper for using CH_Channel::load or CH_Collection::loadChannelRange
194 public:
196  bool begin(UT_StringHolder &name, const UT_StringHolder *path=NULL);
197  bool end() { return noMoreChannels; }
198  bool nextChannel(UT_StringHolder &name);
199  int getLastError() { return lastError; }
200 
201 private:
202  UT_IStream *curr_is;
203  UT_StringRef curr_coll;
204  int is_binary;
205  int lastError;
206  bool noMoreChannels;
207 };
208 
209 
211 {
212 public:
213  typedef enum
214  {
218  SNAP_REPLACE_DOUBLE
219  } SnapType;
220 
222  fpreal default_value = 0,
223  const char *default_string = 0);
224  CH_Channel(CH_Collection *dad, const CH_Channel &from);
225  ~CH_Channel();
226 
227  void initializeFirstSegment(const char *expr,
228  CH_ExprLanguage language);
229 
230  // Initialize parents of mySegments and myDisableSegments to this
231  void initializeSegmentParents();
232 
233  // UTILITIES
234  void clear();
235  void swap( CH_Channel &other );
236 
237  const UT_StringHolder &getName(void) const { return myName; }
238  const UT_StringHolder &getAlias(void) const
239  {
240  if (myAlias.isstring())
241  return myAlias;
242  else
243  return myName;
244  }
245 
247  {
248  getCollection()->getFullPath(this, path);
249  }
251  {
252  getCollection()->getFullPath(this, path);
253  }
254 
255  // Used only by CH_Collection
256  void setName(const UT_StringHolder &s) { myName = s; }
257  void setAlias(const UT_StringHolder &s) { myAlias = s; }
258 
259  CH_Manager *getManager() const { return myParent->getManager(); }
260 
262  { return getManager()->getTolerance(); }
263 
264  // This returns if the channel is time dependent without evaluating
265  // the channel.
266  bool isTimeDependent() const;
267 
268  // These return if the channel is time dependent and will catch more cases
269  // than isTimeDependent() by evaluating the channel.
270  bool isTimeDependentSlow(int thread) const;
271  bool isStringTimeDependentSlow(int thread) const;
272 
273  bool hasNonIntegerKeys() const;
274  bool isDataDependent(fpreal gtime) const;
275 
276  // are we using a zero-length segment to represent one key?
277  bool hasOnlyOneSegment() const;
278 
279  bool isRotationChannel() const;
280 
281  // KEYS
282  bool getSurroundingSegs( fpreal gtime,
283  CH_Segment *&left, CH_Segment *&right ) const;
284 
285  CH_Segment *getSegmentAfterKey( fpreal gtime ) const;
286 
287  // isAtKey returns true if the channel is considered modifiable at
288  // the given time. This means there's either no segment there or the
289  // segment is constant or there's a timemark there (segment start|end).
290  bool isAtKey(fpreal gtime) const;
291 
292  // isAtHardKey returns true only if there's a timemark (segment start
293  // or end) at the given time.
294  bool isAtHardKey(fpreal gtime) const;
295  bool isAtHardKeyframe(int frame) const;
296 
297  fpreal findKey(fpreal gtime, fpreal direction) const;
298  int findKeyframe(int frame, int direction) const;
299 
302 
303  /// Return an iterator for keys within the given interval. If ascending is
304  /// false, then the iterator is initialized at the end of the range
305  /// instead of at the beginning of the range.
306  /// @{
307  IntervalIter intervalIter(
308  const UT_SuperIntervalR & range,
309  const bool ascending=true) const;
310  ConstIntervalIter constIntervalIter(
311  const UT_SuperIntervalR & range,
312  const bool ascending=true) const;
313  /// @}
314 
315  // sample functions evaluate the channel to find values
316  // getKey functions only evaluate if the time is not already at a hard key
317  void sampleValueSlope( CH_Segment *seg, fpreal gtime,
318  int thread, fpreal &v, fpreal &s );
319  bool sampleVSA( CH_Segment *seg, fpreal gtime, int thread,
320  fpreal &v, fpreal &s, fpreal a[2] );
321  void sampleKey( CH_Segment *seg, fpreal gtime, int thread,
322  CH_Key &key );
323  bool getKey( fpreal gtime, CH_Key &key,
324  bool accel_ratios = true,
326  bool getFullKey( fpreal gtime, CH_FullKey &key,
327  bool reverse = false,
328  bool accel_ratios = true,
330  bool getReversibleKey( fpreal gtime, CH_ReversibleKey &key );
331 
332  void putKey( fpreal gtime, CH_Key const& key,
333  bool accel_ratios = true );
334  void putFullKey( fpreal gtime, CH_FullKey const& key,
335  bool accel_ratios = true );
336 
337  void transferKey(fpreal to_time,
338  CH_Channel *from_chp, fpreal from_time);
339 
340  void applyPendingToKey( CH_Key &key, fpreal gtime );
341  void applyDefaultSlopeToKey( CH_Key &key );
342 
343  /// Insert key at given time
344  void insertKeyFrame(fpreal global_t, bool use_auto_slope_pref=true);
345 
346  /// Delete key at given time
347  void destroyKeyFrame(fpreal global_t);
348 
349  /// Move key from old time to new time. Requires that a key exists at
350  /// old_gtime and that there is no key at new_gtime.
351  void moveKeyFrame( fpreal old_gtime, fpreal new_gtime );
352 
353  void saveKeyFrameForUndo( fpreal global_t );
354 
355  // this function is a bit confusing
356  // Sets the in/out values for a segment to the val at a time specified
357  //The method returns 0 if it was successfull,
358  // -1 if there was no key at the time specified
359  // set_pending = if true,the pending value is set to val, unless commit_keys
360  // is true, and gtime falls on a key frame.
361  // commit_keys = if true and gtime falls on a key frame, the keyed value
362  // for that frame is set to val, pending is cleared if
363  // set_pending is true
364  int setKeyValue(fpreal val, fpreal gtime,
365  bool set_pending = false,
366  bool commit_keys = true,
367  bool propagate = true);
368  int setKeyString(const UT_String &str, fpreal gtime,
369  bool set_pending = false,
370  bool commit_keys = true,
371  bool propagate = true);
372  int setKeyString(const UT_String &str, fpreal gtime,
373  CH_ExprLanguage language,
374  bool set_pending = false,
375  bool commit_keys = true,
376  bool propagate = true);
377  void holdValue( fpreal gtime, int thread );
378 
379  // utility functions for getting keyframe numbers:
380  // they return array of keyframes in the channel
381  // the frames are unique and sorted in a ascending order.
382  void getKeyFrames( UT_SuperIntervalR const& range,
383  UT_IntArray &frames,
384  bool error_frames_only );
385 
386  /// Similar to the above, but gets times of all keys in the channel
387  /// in the specified range.
388  void getKeyTimes( UT_SuperIntervalR const& range,
389  UT_FprealArray &times,
390  bool error_frames_only );
391 
392  // the frames are unique and sorted in a descending order.
393  void getDisabledFrames(UT_IntArray &frames,
394  int minframe, int maxframe);
395 
396  // EXPRESSIONS
397  CH_Segment *getExpressionSegment( fpreal gtime ) const;
398  const char *getExpression( fpreal gtime ) const;
399  bool changeExpression( fpreal gtime,
400  const char *expr,
401  CH_ExprLanguage language,
402  bool convert_accels );
403  CH_ExprLanguage getCollectionExprLanguage() const;
404  CH_ExprLanguage getExprLanguageAtTime(fpreal time) const;
405  void setExprLanguage(CH_ExprLanguage language);
406  void setExprLanguageAtTime(CH_ExprLanguage language,
407  fpreal time);
408 
409  // If we were to ask for the value of the channel as a string at a
410  // particular time, this function returns what the meaning of that string
411  // would be (either a literal or expression in some language).
412  CH_StringMeaning getStringMeaning(fpreal time) const;
413 
414  // MULTI-SEGMENT MANIPULATION
415  void clearSegments();
416 
417  /// Delete keys in given range
418  void deleteKeys( UT_SuperIntervalR const& range );
419 
420  /// Delete keys at the given key indices.
421  /// @note Must be sorted in ascending order!
422  void deleteKeys(const UT_IntArray &ascending_sorted_key_indices);
423 
424  void moveFrames(const UT_IntArray &frames, int amount);
425 
426  bool copyRangeOverwritesKeys(const CH_Channel &src,
427  UT_SuperIntervalR const& range,
428  UT_IntervalR const& to_range);
429  bool copyRangeOverwritesFrames(const CH_Channel &src,
430  UT_SuperIntervalR const& range,
431  UT_IntervalR const& to_range);
432  bool copyRangeOverwrites(const CH_Channel &src,
433  UT_SuperIntervalR const& range,
434  UT_IntervalR const& to_range);
435 
436  void copyRange(const CH_Channel &src,
437  UT_SuperIntervalR const& range,
438  UT_IntervalR const& to_range);
439 
440  void copyRangeFrames(const CH_Channel &src,
441  UT_SuperIntervalR const& range,
442  UT_IntervalR const& to_range,
443  const UT_IntArray * frames = NULL);
444 
445  void deleteRangeFrames(UT_SuperIntervalR const& range,
446  const UT_IntArray * frames = NULL);
447 
448  // copyContents copies everything except name and parent
449  void copyContents(const CH_Channel &from);
450  void swapContents( CH_Channel &other );
451  // TODO remove this function:
452  // copy a range of keys. Assumes that we already have keys in the src
453  // channel at those times
454  // another way to do this is: (once we pass UT_SuperIntervalR by value)
455  // ch.clear();
456  // ch.copyRange( src, UT_SuperIntervalR( start, end ), 0.0f );
457  void copyRange(const CH_Channel &src,
458  fpreal global_start, fpreal global_end);
459 
460  // if os is provided, a verbose description of what's happening is printed
461  void snapKeysInRange( const UT_SuperIntervalR &range,
462  SnapType type=SNAP_SNAP,
463  std::ostream *os=0 );
464 
465  // ENTIRE CHANNEL MANIPULATION
466  void scroll (fpreal newStart, bool update = true);
467  void stretch(fpreal newStart, fpreal newEnd);
468  void reverse(fpreal gstart=0, fpreal gend=0, bool whole_chan = true);
469  // scroll on the y axis (returns success)
470  bool increaseKeyValues( fpreal delta );
471 
472  // DISABLING
473  bool isAllDisabled() const;
474  bool isAllEnabled() const;
475  bool isDisabled(fpreal gtime) const;
476  void disableAll(fpreal gtime);
477  void enableAll();
478  void disable(fpreal gstart, fpreal gend);
479  void enable(fpreal gstart, fpreal gend);
480 
481  // PENDING METHODS
483  bool isPending() const
484  { return myPending; }
485  bool isPending(fpreal gtime) const;
486  bool isPendingLocal(fpreal ltime) const;
487  void clearPending();
488  void updatePending( fpreal gtime );
490  { return globalTime(myPendingEvalTime); }
492  bool isPendingHold() const
493  { return myPendingHold; }
494  void setPendingHold( bool state );
495 
496  // SAVE and LOAD
497  void save(std::ostream &os, int binary, bool compiled) const;
498  template <typename FPREAL_TYPE>
499  bool load(UT_IStream &is);
500  void display() const;
501  void displayAsKeys() const;
502 
503  void setDefaultValue(fpreal dv) { myDefValue = dv; }
504  fpreal getDefaultValue() const { return myDefValue; }
505 
507  { myDefString = dv; }
508  const UT_StringHolder &
509  getDefaultString() const { return myDefString; }
510 
511  void setChannelLeftType(CH_ChannelBehavior t);
512  void setChannelRightType(CH_ChannelBehavior t);
513  CH_ChannelBehavior getChannelLeftType(void) const { return myLeftType; }
514  CH_ChannelBehavior getChannelRightType(void) const { return myRightType; }
515 
516  static const char *getChannelTypeName(CH_ChannelBehavior type);
517 
518  void setCollection(CH_Collection *chp){ myParent = chp; }
519  const CH_Collection *getCollection() const { return myParent; }
520  CH_Collection *getCollection() { return myParent; }
521 
522  void setIsTemporary( bool temp ) { myIsTemporary = temp; }
523  bool isTemporary() const { return myIsTemporary; }
524 
525  // FLAGS
526  void setChangeActive(int state)
527  {
528  if( state ) myFlags |= CH_CHANNEL_ACTIVE;
529  else myFlags &= ~CH_CHANNEL_ACTIVE;
530  }
531  bool isChangeActive() const
532  { return (myFlags & CH_CHANNEL_ACTIVE) ? 1 : 0; }
533 
534 
535  bool getLocked() const
536  { return ((myFlags & CH_CHANNEL_LOCKED) != 0); }
537  void setLocked(bool f);
538 
539  int getChanged() const
540  { return (myFlags & CH_CHANNEL_MODIFIED) ? 1 : 0; }
541  void setChanged(bool on,
543  void dirtyExprCache();
544 
545  int canAccess(uint mask) const
546  {
547  if( myParent )
548  return myParent->canAccessChannel(mask, this);
549  else
550  return 1;
551  }
552 
553  // map collection time to channel time...
554  inline fpreal localTime(fpreal t) const { return (t-myStart); }
555 
556  // map channel time to global time...
557  inline fpreal globalTime(fpreal t) const { return t + myStart; }
558 
559  // Returns collection global time...
560  fpreal getStart() const { return myStart; }
561  fpreal getEnd() const { return myStart + myLength;}
562  fpreal getLength() const { return myLength; }
563 
564  // Used to reset the local variables:
565  void unresolveLocalVars(int thread);
566 
567  // Op dependencies
568  void buildOpDependencies(void *ref_id, int thread);
569  void changeOpRef(const char *new_fullpath,
570  const char *old_fullpath,
571  const char *old_cwd,
572  const char *chan_name,
573  const char *old_chan_name,
574  int thread);
575 
576  // Enable or disable value caching in expression segments...
577  void cook(int state);
578 
579  // Load values as keys. Returns the number of samples actually loaded.
580  int setRawValues(fpreal from, fpreal to, fpreal *vals, int nsamples);
581  int setRawValues(fpreal *times, fpreal *vals, int n);
582 
583  // Channel Scope Flag
584  void setScope(bool on_off);
585  bool isScoped() const { return myScope; }
586 
587  // Does this channel have any segments with editable components (eg. value,
588  // slope, acceleration, etc.)?
589  bool isEditable();
590 
591  // Query methods. Used only by CH_Collection
592  fpreal evaluate(fpreal t, bool no_disabling, int thread);
593  void evaluate(fpreal from, fpreal to, fpreal *vals, int nsamples,
594  bool no_disabling, bool use_cache, int thread);
595  fpreal evaluateSegment(CH_Segment *eval, fpreal localtime,
596  bool extend, int thread);
597  void evaluateString(UT_String &result, fpreal t, int thread);
598  void evaluateStringSegment(UT_String &result, CH_Segment *eval,
599  fpreal localtime, bool extend,
600  int thread);
601 
602  int findString(const char *str, bool fullword,
603  bool usewildcards) const;
604  int changeString(const char *from, const char *to,
605  bool fullword, bool update /*= true*/,
606  int thread);
607 
608  //
609  // Methods used only in the channel library glue
610  //
611  static inline fpreal getGlueIV(int thread);
612  static inline void getGlueTime(
613  fpreal &t, fpreal &t0, fpreal &t1,
614  fpreal &v0, fpreal &v1, int thread);
615  static inline void getGlueSlope(
616  fpreal *m0, fpreal *m1,
617  fpreal *a0, fpreal *a1, int thread);
618 
619 // Used only by CH_Collection
620  inline const CH_Segment *getEvaluationSegment(int thread) const
621  {
622  return getManager()->evalContext(thread).segment();
623  }
624  inline CH_Segment *getEvaluationSegment(int thread)
625  {
626  return getManager()->evalContext(thread).segment();
627  }
628  const CH_Segment *getPrevEvaluationSegment(int thread) const;
629  CH_Segment *getPrevEvaluationSegment(int thread);
630  const CH_Segment *getNextEvaluationSegment(int thread) const;
631  CH_Segment *getNextEvaluationSegment(int thread);
632 
633  fpreal getInTime(int thread) const;
634  fpreal getOutTime(int thread) const;
635  fpreal getPrevInTime(int thread) const;
636  fpreal getNextOutTime(int thread) const;
637 
638  // This method will attempt to match the channel name with the pattern,
639  // searching as many parents as necessary regardless of the cwd
640  // eg. tx will match true with tx xform1/tx geo1/xform1/tx
641 
642  int match(const char *pattern) const;
643 
644 
645  // sets all keys to be 'value', and zeros all slopes & accels.
646  void setConstantValue(fpreal value);
647 
648  // sets the data and keys so that the channel approximates the
649  // raw data of samples within given error using cubic interpolation
650  // INPUTS:
651  // data - an array of pairs (time, value) to be fitted.
652  // n_pts - number of elements in data array
653  // error2 - the error to which the channel should approximate data
654  // delete_old_segments - if true, all old segments are cleared before
655  // new ones are generated from data. If false, the segments
656  // that fit the data replace old segments (thus, some
657  // old segments that are outside of the data range will
658  // remain unchanged)
659  // OUTPUTS:
660  // The clip will approximate the curve sampled by data.
661  // The clip will have its start time equal to
662  // the time component of the first pair in the data array,
663  // and the end time equal to the time of the last pair.
664  // RETURNS:
665  // True on success, false if failed.
666  bool fitToPointData( UT_Vector2R *data, int n_pts,
667  bool preserveExtrema,
668  fpreal error2 = 0.01f,
669  bool delete_old_segments = false);
670 
671  // refits the channel data (or portion of it) with cubic interpolation
672  // within given error tolerance. Inserts new keys, etc.
673  // delete_old_segments - if true, all segments are deleted before
674  // refitted range is inserted. Otherwise, old segments outside of the
675  // refitted range are not affected.
676  void refit( fpreal tolerance, bool preserveExtrema );
677  void refit( fpreal tolerance, bool preserveExtrema,
678  fpreal from_gtime, fpreal to_gtime,
679  bool delete_old_segments);
680 
681  // SEGMENT MANAGEMENT
682  bool isEmpty() const;
683  int getNSegments() const;
684  int getNKeys() const;
685  int getNKeysBefore( fpreal gtime ) const;
686  int getNKeysBeforeOrAt( fpreal gtime ) const;
687 
688  fpreal getKeyTime( unsigned idx ) const;
689 
690  unsigned getSegmentIdx(fpreal local_time) const;
691  CH_Segment *getSegment(unsigned idx) const;
692  CH_Segment *getSegment(fpreal local_time) const;
693 
694  CH_Segment *getNextSegment(unsigned idx) const; // Depends on behavior
695  CH_Segment *getPrevSegment(unsigned idx) const; // Depends on behavior
696 
698  {
699  // empty means no keys in the channel if user delete them
700  // all
701  UT_ASSERT_P( isEmpty() || myEndSegment );
702  return isEmpty()
703  ? 0 : getSegment( (unsigned)0 );
704  }
706  {
707  // empty means no keys in the channel if user delete them
708  // all
709  UT_ASSERT_P( isEmpty() || myEndSegment );
710 
711  // old behaviour maintained (ie. don't use end segment)
712  return isEmpty()
713  ? 0 : getSegment( (unsigned)mySegments.entries()-1 );
714  }
715 
716  int64 getMemoryUsage(bool inclusive) const;
717 
718  // The first method takes global time, the second, segment local time.
719  void changeSegLength (CH_Segment *seg, fpreal gtime,
721  bool adjust_and_update = true);
722 
723  bool getHaveCompiledExpressions() const;
724 
725  bool verify();
726  bool verify(bool verify_tied_values);
727 
728  // Snapshots or buffer curves.
729  // Create a deep copy of the channel data for fast modifications and revert workflow.
730  // It's more intuitive than to have to do multiple undo to get back to the previous
731  // keyframes.
732  void saveSnapshot();
733  void undoSnapshot(CH_Channel *previous, bool previousSnapshotCleared);
734  bool loadSnapshot();
735  bool swapSnapshot();
736  bool clearSnapshot();
737  CH_Channel* getSnapshotChannel();
738 
739 
740  void smoothAutoSlopes( CH_Segment *seg=NULL );
741 
742 
743  // Layer Scope Flag
744  void setLayerScope(bool on_off);
745  bool isLayerScoped() const { return myLayerScope; }
746 
747  // Set an array pointer to capture the copyRange actions
748  void setCaptureCopiedKeys( UT_Array<fpreal> *capture_array );
749 
750  // chkey version of putFullKey() doesn't do the same validations as putFullKey()
751  void putChFullKey( fpreal gtime, CH_FullKey const& key, bool accel_ratios = true );
752 private:
753  CH_Channel( CH_Channel const& other ); // unimplemented
754 
755  void ensureEndSegmentCreated();
756  void updateEndSegment();
757  void destroyEndSegment();
758 
759  bool isTwoSegChannelTimeDep() const;
760 
761  // TODO: Remove this. It's abysmally slow, doing a binary search each time
762  bool nextTimeInRange(UT_SuperIntervalR const& range,
763  fpreal &t, bool first) const;
764 
765  class BatchModifyScope;
766  friend class CH_Channel::BatchModifyScope;
767 
768  void moveKeyInternal(fpreal old_gtime, fpreal new_gtime,
769  BatchModifyScope &scope);
770  void splitSegment(fpreal gtime, bool accel_ratio = true);
771  void destroyKeyInternal(unsigned seg_i, BatchModifyScope &scope);
772 
773  // cuts out a portion of a channel. Returns an index at which the cut began
774  int cutOut( fpreal from_gtime, fpreal to_gtime );
775 
776  CH_Segment *appendSegment(CH_Segment *seg);
777 
778  // remove and delete the segment
779  void deleteSegment(unsigned idx);
780 
781  int getNDisableSegments(void) const
782  { return myDisableSegments.entries(); }
783  CH_Segment *getDisableSegment(unsigned idx) const
784  {
785  return (idx < myDisableSegments.entries()) ?
786  myDisableSegments(idx) : 0;
787  }
788 
789  CH_Segment *getDisableSegmentForLocalTime(fpreal local_time) const;
790  CH_Segment *getPrevDisableSegment(CH_Segment *) const;
791  CH_Segment *getNextDisableSegment(CH_Segment *) const;
792 
793  int getDisableSegmentIndex(fpreal ltime, bool closest_prev) const;
794 
795  CH_Segment *getFirstDisableSegment() const
796  {
797  return (myDisableSegments.entries() > 0) ?
798  myDisableSegments(0) : 0;
799  }
800  CH_Segment *getLastDisableSegment() const
801  {
802  return (myDisableSegments.entries() > 0)
803  ? myDisableSegments(myDisableSegments.entries()-1)
804  : 0;
805  }
806  CH_Segment *appendDisableSegment(CH_Segment *seg);
807 
808  CH_Segment *insertDisableSegment(CH_Segment *seg);
809  CH_Segment *insertDisableSegment(CH_Segment *seg, int idx);
810  CH_Segment *insertDisableSegment(CH_Segment *seg, CH_Segment *before);
811 
812  // Remove but don't delete
813  void removeDisableSegment(CH_Segment *seg);
814  void removeDisableSegment(int idx);
815 
816  void deleteDisableSegment(CH_Segment *);
817  void deleteDisableSegment(int idx);
818 
819  void setPending( bool on_off, fpreal ltime );
820  void updatePendingStateToManager();
821 
822  void deNormalize(fpreal scale);
823 
824  int isCooking() const
825  {
826  return (myFlags & CH_CHANNEL_COOKING) != 0;
827  }
828  void setCooking(bool on_off)
829  {
830  if (on_off) myFlags |= CH_CHANNEL_COOKING;
831  else myFlags &= ~CH_CHANNEL_COOKING;
832  }
833 
834  void adjustSegments(int begin_i, int end_i,
835  CH_CHANGE_TYPE event_type);
836 
837  // Get Segment methods that can return disabled segments.
838  CH_Segment *getFirstSegment(bool no_disabling ) const;
839  CH_Segment *getLastSegment(bool no_disabling ) const;
840  CH_Segment *getEndSegment(bool no_disabling ) const;
841  CH_Segment *getSegment(bool no_disabling, fpreal ltime ) const;
842 
843  enum chGetOrSampleReturn
844  {
845  Sampled, Get, FirstLast
846  };
847  chGetOrSampleReturn getOrSampleKey( fpreal ltime, CH_Key &key, bool accel_ratio, int thread );
848 
849  CH_Collection *myParent; // Who I belong to
850  UT_StringHolder myName;
851  UT_StringHolder myAlias;
852 
853  CH_ChannelBehavior myLeftType; // Type of channel
854  CH_ChannelBehavior myRightType; // Type of channel
855  CH_Segment *myEndSegment;
856 
857  fpreal myDefValue; // Default/Pending value
858  fpreal myStart; // Start time of channel
859  fpreal myLength; // Kept for efficiency (local)
860 
861  UT_StringHolder myDefString; // Default/Pending string value
862 
863  UT_ValArray<CH_Segment *> mySegments; // Array of segments
864  UT_ValArray<CH_Segment *> myDisableSegments;
865 
866  fpreal myPendingEvalTime;
867  CH_Channel *mySnapshot;
868  UT_Array<fpreal> *myCaptureCopiedKeys;
869 
870  unsigned char myFlags;
871  bool myPending;
872  bool myPendingHold;
873  bool myScope;
874  bool myLayerScope;
875  bool myIsTemporary;
876  bool myDoingChKey;
877  bool mySnapshotCleared;
878 
879 };
880 
882 
883 inline CH_Segment *
884 CH_Channel::getSegment(unsigned idx) const
885 {
886  if( idx<mySegments.entries() )
887  return mySegments(idx);
888  if( idx==(unsigned)-1 || idx==mySegments.entries() )
889  {
890  UT_ASSERT(myEndSegment || mySegments.entries() == 0);
891  return myEndSegment;
892  }
893  UT_ASSERT( false );
894  return NULL;
895 }
896 
897 inline int
899 {
900  return myEndSegment ? 1 + mySegments.entries() : 0;
901 }
902 
903 inline bool
905 {
906  return mySegments.isEmpty() && !myEndSegment;
907 }
908 
909 inline int
911 {
912  return getNSegments();
913 }
914 
915 inline fpreal
916 CH_Channel::getKeyTime( unsigned idx ) const
917 {
918  CH_Segment *segp;
919  if( idx == mySegments.entries() )
920  {
921  segp = myEndSegment;
922  UT_ASSERT( segp );
923  return globalTime( segp->getStart() );
924  }
925  segp = getSegment( idx );
926  UT_ASSERT( segp );
927  return globalTime( segp->getStart() );
928 }
929 
930 inline bool
932 {
933  return getNSegments() == 1;
934 }
935 
936 inline bool
938 {
939  // NB: This is actually slightly weaker than PRM_Float::isRotationParm()
940  return myName == "rx" || myName == "ry" || myName == "rz";
941 }
942 
943 
944 /// Const iterator over an interval
946 {
947 public:
949  : myChannel(NULL)
950  , myI(-1)
951  , myTol(0.0)
952  {
953  }
954 
956  {
957  ++myI;
958  return *this;
959  }
961  {
962  --myI;
963  return *this;
964  }
965 
966  bool atEnd() const
967  {
968  if (myI >= myChannel->getNSegments())
969  return true;
970  fpreal lt = localTime();
971  return !(myRange.myMaxInclusive ?
972  SYSisLessOrEqual(lt, myRange.max, myTol)
973  : SYSisLess(lt, myRange.max, myTol));
974  }
975  bool atPre() const
976  {
977  if (myI < 0)
978  return true;
979  fpreal lt = localTime();
980  return !(myRange.myMinInclusive ?
981  SYSisGreaterOrEqual(lt, myRange.min, myTol)
982  : SYSisGreater(lt, myRange.min, myTol));
983  }
984 
985  unsigned index() const
986  {
987  return (unsigned)myI;
988  }
989 
990  const CH_Segment &segment() const
991  {
992  return *(myChannel->getSegment((unsigned)myI));
993  }
994 
995  // Local time at start of segment
997  {
998  return myChannel->getSegment((unsigned)myI)->getStart();
999  }
1000 
1001  fpreal operator*() const { return myChannel->globalTime(localTime()); }
1002 
1003 protected:
1005  const CH_Channel &ch, const UT_SuperIntervalR &range,
1006  const bool ascending)
1007  : myChannel(&ch)
1008  , myRange(range)
1009  , myTol(ch.getTolerance())
1010  {
1011  myRange.min = ch.localTime(myRange.min);
1012  myRange.max = ch.localTime(myRange.max);
1013  UT_ASSERT(myRange.min <= myRange.max);
1014  if (ascending)
1015  {
1016  // If myRange.min is less than the first segment's start time, then
1017  // the first segment is returned by getSegmentIdx().
1018  myI = ch.getSegmentIdx(myRange.min);
1019  CH_Segment *seg = ch.getSegment((unsigned)myI);
1020  if (seg)
1021  {
1022  fpreal lt = seg->getStart();
1023  if (range.myMinInclusive)
1024  {
1025  if (SYSisLess(lt, myRange.min, myTol))
1026  ++myI;
1027  }
1028  else
1029  {
1030  if (SYSisLessOrEqual(lt, myRange.min, myTol))
1031  ++myI;
1032  }
1033  }
1034  else
1035  {
1036  myI = ch.getNSegments();
1037  }
1038  UT_ASSERT(atEnd() || myRange.contains(localTime(), myTol));
1039  }
1040  else // descending
1041  {
1042  myI = ch.getSegmentIdx(myRange.max);
1043  CH_Segment *seg = ch.getSegment((unsigned)myI);
1044  if (seg)
1045  {
1046  fpreal lt = seg->getStart();
1047  if (range.myMaxInclusive)
1048  {
1049  if (SYSisGreater(lt, myRange.max, myTol))
1050  --myI;
1051  }
1052  else
1053  {
1054  if (SYSisGreaterOrEqual(lt, myRange.max, myTol))
1055  --myI;
1056  }
1057  }
1058  else
1059  {
1060  myI = -1;
1061  }
1062  UT_ASSERT(atPre() || myRange.contains(localTime(), myTol));
1063  }
1064  }
1065 
1066 private:
1067  const CH_Channel * myChannel;
1068  UT_SuperIntervalR myRange;
1069  int myI;
1070  fpreal myTol;
1071 
1072  friend class CH_Channel;
1073 };
1074 
1075 /// Iterator over an interval
1077 {
1078 public:
1080  : ConstIntervalIter()
1081  {
1082  }
1083 
1085  {
1086  return const_cast<CH_Segment &>(ConstIntervalIter::segment());
1087  }
1088 
1090  {
1092  return *this;
1093  }
1095  {
1097  return *this;
1098  }
1099 
1100 protected:
1102  const CH_Channel &ch, const UT_SuperIntervalR &range, bool reverse)
1103  : ConstIntervalIter(ch, range, reverse)
1104  {
1105  }
1106 
1107 private:
1108 
1109  friend class CH_Channel;
1110 };
1111 
1114  const UT_SuperIntervalR & range, const bool ascending) const
1115 {
1116  return IntervalIter(*this, range, ascending);
1117 }
1120  const UT_SuperIntervalR & range, const bool ascending) const
1121 {
1122  return ConstIntervalIter(*this, range, ascending);
1123 }
1124 
1125 /// This function stretches the modifies the given slope and accel values
1126 /// according to the given factors. If the accel value is given as a ratio,
1127 /// then accel_ratio should be true.
1128 CH_API extern void
1129 CHstretchSlopeAccel(fpreal xscale, fpreal yscale, fpreal &slope, fpreal &accel,
1130  bool accel_ratio);
1131 
1132 // this will move attempted_dt towards accepted_dt so that:
1133 // keys[i]+attempted_dt does not land on another key
1134 // attempted_dt stays on the same side of accepted_dt as it started
1135 // (so that if you're moving one way, they don't snap backwards before
1136 // where they started)
1137 // if snap_to_frame, attempted_dt+base_time will land on a frame
1138 CH_API extern void
1139 CHfindMoveKeysDelta( const CH_Channel *chp, bool snap_to_frame, fpreal base_time,
1140  const UT_FprealArray &orig_keys,
1141  fpreal accepted_dt, fpreal &attempted_dt );
1142 
1143 CH_API extern void
1144 CHmoveKeysWithDelta( CH_Channel *chp, const UT_FprealArray &orig_keys,
1145  fpreal old_accepted_dt, fpreal new_accepted_dt );
1146 
1147 ///////////////////////////////////////////////////////////////////////////////
1148 //
1149 // Inline Implementations
1150 //
1151 
1152 /*static*/ inline fpreal
1154 {
1155  const CH_EvalContext & ctx = CHgetManager()->evalContext(thread);
1156  const CH_Channel * eval_channel = ctx.channel();
1157  const CH_Segment * segp = ctx.segment();
1158 
1159  if (segp)
1160  {
1161  if (eval_channel->isPending(ctx.time()))
1162  return eval_channel->getDefaultValue();
1163  else
1164  return segp->getInValue();
1165  }
1166 
1167  return 0.0f;
1168 }
1169 
1170 /*static*/ inline void
1172  fpreal &v0, fpreal &v1, int thread)
1173 {
1174  CH_Manager & mgr = *CHgetManager();
1175  CH_EvalContext & ctx = mgr.evalContext(thread);
1176  const CH_Channel * eval_channel = ctx.channel();
1177  const CH_Segment * segp = ctx.segment();
1178 
1179  if (eval_channel)
1180  {
1181  t = eval_channel->localTime(ctx.time());
1182  if (segp)
1183  {
1184  t0 = segp->getStart();
1185  t1 = segp->getEnd();
1186  if( eval_channel->isPendingLocal(t) )
1187  {
1188  v0 = v1 = eval_channel->getDefaultValue();
1189  t0 = t1 = t;
1190  }
1191  else
1192  {
1193  v0 = segp->getInValue();
1194  v1 = segp->getOutValue();
1195  if( segp->isEndSegment() )
1196  {
1197  // Since our segment length is zero, we want fake it so
1198  // that it uses either the in or out values because most
1199  // existing expression functions will take the average of
1200  // them when encountering a zero length segement.
1201  // NB: the in/out values are swapped on end segments.
1202  if (SYSisGreaterOrEqual(t, t0, mgr.getTolerance()))
1203  v1 = v0;
1204  else
1205  v0 = v1;
1206  }
1207  }
1208  }
1209  else
1210  {
1211  t0 = eval_channel->getStart();
1212  t1 = eval_channel->getEnd();
1213  v0 = v1 = 0;
1214  }
1215  }
1216  else
1217  {
1218  t = 0.0f;
1219  t0 = 0.0f;
1220  t1 = 0.0f;
1221  v0 = 0.0f;
1222  v1 = 0.0f;
1223  }
1224 }
1225 
1226 /*static*/ inline void
1228  int thread)
1229 {
1230  CH_EvalContext & ctx = CHgetManager()->evalContext(thread);
1231  const CH_Segment * segp = ctx.segment();
1232 
1233  if (segp)
1234  {
1235  if (m0) *m0 = segp->getInSlope();
1236  if (m1) *m1 = segp->getOutSlope();
1237  if (a0) *a0 = segp->getInAccel();
1238  if (a1) *a1 = segp->getOutAccel();
1239  }
1240  else
1241  {
1242  if (m0) *m0 = 0.0f;
1243  if (m1) *m1 = 0.0f;
1244  if (a0) *a0 = 0.0f;
1245  if (a1) *a1 = 0.0f;
1246  }
1247 }
1248 
1249 // this returns if the channel is time dependent without evaluating
1250 // the channel
1251 inline bool
1253 {
1254  const int nsegs = getNSegments();
1255 
1256  if (nsegs == 0)
1257  return false;
1258 
1259  if (nsegs == 1)
1260  return getSegment(0U)->isTimeDependent();
1261 
1262  if (nsegs == 2)
1263  return isTwoSegChannelTimeDep();
1264 
1265  // Else, assume time dependent when more than 1 segment
1266  UT_ASSERT_P(nsegs > 1);
1267  return true;
1268 }
1269 
1270 #endif // __CH_Channel_h__
Iterator over an interval.
Definition: CH_Channel.h:1076
GLint first
Definition: glcorearb.h:404
CH_ExprLanguage myRevExprLanguage
Definition: CH_Channel.h:167
fpreal localTime(fpreal t) const
Definition: CH_Channel.h:554
unsigned getSegmentIdx(fpreal local_time) const
bool myUseExpression
Definition: CH_Channel.h:146
GLenum GLint * range
Definition: glcorearb.h:1924
bool myUseRevExpression
Definition: CH_Channel.h:165
CH_ChannelBehavior getChannelLeftType(void) const
Definition: CH_Channel.h:513
CH_API void CHfindMoveKeysDelta(const CH_Channel *chp, bool snap_to_frame, fpreal base_time, const UT_FprealArray &orig_keys, fpreal accepted_dt, fpreal &attempted_dt)
static void getGlueTime(fpreal &t, fpreal &t0, fpreal &t1, fpreal &v0, fpreal &v1, int thread)
Definition: CH_Channel.h:1171
const UT_StringHolder & getDefaultString() const
Definition: CH_Channel.h:509
CH_Segment * getEvaluationSegment(int thread)
Definition: CH_Channel.h:624
bool isEndSegment() const
Definition: CH_Segment.h:279
CH_ExprLanguage
IntervalIter intervalIter(const UT_SuperIntervalR &range, const bool ascending=true) const
Definition: CH_Channel.h:1113
GLint left
Definition: glcorearb.h:2004
CH_Key()
Definition: CH_Channel.h:104
Const iterator over an interval.
Definition: CH_Channel.h:945
CH_StringMeaning
GT_API const UT_StringHolder time
const GLdouble * v
Definition: glcorearb.h:836
IMF_EXPORT IMATH_NAMESPACE::V3f direction(const IMATH_NAMESPACE::Box2i &dataWindow, const IMATH_NAMESPACE::V2f &pixelPosition)
CH_ChannelFlag
Definition: CH_Channel.h:61
fpreal globalTime(fpreal t) const
Definition: CH_Channel.h:557
const GLuint GLenum const void * binary
Definition: glcorearb.h:1923
void getFullPath(UT_StringHolder &path) const
Definition: CH_Channel.h:250
bool isRotationChannel() const
Definition: CH_Channel.h:937
GLsizei const GLchar *const * path
Definition: glcorearb.h:3340
bool myEvaluatedSlopes
Definition: CH_Channel.h:101
const CH_Segment * segment() const
bool isTemporary() const
Definition: CH_Channel.h:523
bool isEmpty() const
Definition: CH_Channel.h:904
GLboolean GLboolean GLboolean GLboolean a
Definition: glcorearb.h:1221
fpreal getEnd() const
Definition: CH_Channel.h:561
void setIsTemporary(bool temp)
Definition: CH_Channel.h:522
GLint GLuint mask
Definition: glcorearb.h:123
CH_FullKey & operator=(CH_FullKey const &other)
CH_GetKeyExtend
Definition: CH_Channel.h:81
const CH_Segment & segment() const
Definition: CH_Channel.h:990
CH_Segment & segment() const
Definition: CH_Channel.h:1084
2D Vector class.
Definition: UT_Vector2.h:138
unsigned index() const
Definition: CH_Channel.h:985
bool isLayerScoped() const
Definition: CH_Channel.h:745
const CH_EvalContext & evalContext(int thread) const
Definition: CH_Manager.h:1194
bool isChangeActive() const
Definition: CH_Channel.h:531
class CH_API IntervalIter
Definition: CH_Channel.h:301
bool hasOnlyOneSegment() const
Definition: CH_Channel.h:931
bool isTimeDependent() const
Definition: CH_Segment.h:464
int canAccess(uint mask) const
Definition: CH_Channel.h:545
static fpreal getGlueIV(int thread)
Definition: CH_Channel.h:1153
fpreal getOutValue(void) const
Definition: CH_Segment.h:284
IntervalIter & operator--()
Definition: CH_Channel.h:1094
bool isPendingLocal(fpreal ltime) const
long long int64
Definition: SYS_Types.h:107
fpreal getDefaultValue() const
Definition: CH_Channel.h:504
GA_API const UT_StringHolder scale
class CH_API ConstIntervalIter
Definition: CH_Channel.h:300
const UT_StringHolder & getAlias(void) const
Definition: CH_Channel.h:238
ConstIntervalIter constIntervalIter(const UT_SuperIntervalR &range, const bool ascending=true) const
Definition: CH_Channel.h:1119
GLdouble n
Definition: glcorearb.h:2007
ConstIntervalIter & operator--()
Definition: CH_Channel.h:960
GLfloat f
Definition: glcorearb.h:1925
fpreal getEnd(void) const
Definition: CH_Segment.h:321
UT_String myRevExpression
Definition: CH_Channel.h:166
CH_ChannelBehavior
Definition: CH_Channel.h:47
CH_CHANGE_TYPE
CH_Manager * CHgetManager()
Definition: CH_Manager.h:1705
ConstIntervalIter & operator++()
Definition: CH_Channel.h:955
void setCollection(CH_Collection *chp)
Definition: CH_Channel.h:518
const CH_Segment * getEvaluationSegment(int thread) const
Definition: CH_Channel.h:620
CH_ChannelBehavior getChannelRightType(void) const
Definition: CH_Channel.h:514
fpreal getLength() const
Definition: CH_Channel.h:562
#define UT_ASSERT_P(ZZ)
Definition: UT_Assert.h:125
bool getLocked() const
Definition: CH_Channel.h:535
UT_String myExpression
Definition: CH_Channel.h:147
void display() const
#define SYS_FORCE_INLINE
Definition: SYS_Inline.h:45
fpreal getKeyTime(unsigned idx) const
Definition: CH_Channel.h:916
fpreal myTimeValue
Definition: CH_Channel.h:100
void setDefaultValue(fpreal dv)
Definition: CH_Channel.h:503
bool isScoped() const
Definition: CH_Channel.h:585
const UT_StringHolder & getName(void) const
Definition: CH_Channel.h:237
IntervalIter(const CH_Channel &ch, const UT_SuperIntervalR &range, bool reverse)
Definition: CH_Channel.h:1101
CH_Segment * getLastSegment() const
Definition: CH_Channel.h:705
GLboolean * data
Definition: glcorearb.h:130
GLuint const GLchar * name
Definition: glcorearb.h:785
CH_Segment * getSegment(unsigned idx) const
Definition: CH_Channel.h:884
fpreal getStart(void) const
Definition: CH_Segment.h:320
unsigned int uint
Definition: SYS_Types.h:40
void reverse(fpreal gstart=0, fpreal gend=0, bool whole_chan=true)
void setName(const UT_StringHolder &s)
Definition: CH_Channel.h:256
GLfloat v0
Definition: glcorearb.h:815
IntervalIter & operator++()
Definition: CH_Channel.h:1089
void setChangeActive(int state)
Definition: CH_Channel.h:526
exint entries() const
Alias of size(). size() is preferred.
Definition: UT_Array.h:453
SYS_FORCE_INLINE bool isPending() const
Definition: CH_Channel.h:483
fpreal getInValue(void) const
Definition: CH_Segment.h:283
CH_Collection * getCollection()
Definition: CH_Channel.h:520
CH_ExprLanguage myExprLanguage
Definition: CH_Channel.h:148
GLsizei const GLfloat * value
Definition: glcorearb.h:823
double fpreal
Definition: SYS_Types.h:270
fpreal getStart() const
Definition: CH_Channel.h:560
fpreal getInSlope(void) const
Definition: CH_Segment.h:285
CH_API void CHmoveKeysWithDelta(CH_Channel *chp, const UT_FprealArray &orig_keys, fpreal old_accepted_dt, fpreal new_accepted_dt)
void stretch(fpreal xscale, fpreal yscale, bool accel_ratio)
CH_ValueTypes
Definition: CH_Types.h:73
int getNSegments() const
Definition: CH_Channel.h:898
void reverse()
CH_Segment * getFirstSegment() const
Definition: CH_Channel.h:697
fpreal getOutSlope(void) const
Definition: CH_Segment.h:286
CH_Manager * getManager() const
Definition: CH_Channel.h:259
#define CH_API
Definition: CH_API.h:10
CH_API void CHstretchSlopeAccel(fpreal xscale, fpreal yscale, fpreal &slope, fpreal &accel, bool accel_ratio)
void setAlias(const UT_StringHolder &s)
Definition: CH_Channel.h:257
void display() const
const CH_Collection * getCollection() const
Definition: CH_Channel.h:519
GLfloat GLfloat v1
Definition: glcorearb.h:816
GLuint GLfloat * val
Definition: glcorearb.h:1607
bool isTimeDependent() const
Definition: CH_Channel.h:1252
void setDefaultString(const UT_StringHolder &dv)
Definition: CH_Channel.h:506
int getChanged() const
Definition: CH_Channel.h:539
fpreal getPendingEvalTime() const
Definition: CH_Channel.h:489
CH_SegmentScale
Definition: CH_Types.h:67
#define UT_SWAPPER_CLASS(T)
Definition: UT_Swap.h:60
fpreal getTolerance() const
Definition: CH_Channel.h:261
GLint GLint GLsizei GLint GLenum GLenum type
Definition: glcorearb.h:107
void swap(TfErrorTransport &l, TfErrorTransport &r)
#define UT_ASSERT(ZZ)
Definition: UT_Assert.h:126
int getNKeys() const
Definition: CH_Channel.h:910
void getFullPath(UT_String &path) const
Definition: CH_Channel.h:246
CH_API char CHvalueNames[2][CH_NUM_VALUES]
static void getGlueSlope(fpreal *m0, fpreal *m1, fpreal *a0, fpreal *a1, int thread)
Definition: CH_Channel.h:1227
ConstIntervalIter(const CH_Channel &ch, const UT_SuperIntervalR &range, const bool ascending)
Definition: CH_Channel.h:1004
fpreal getInAccel(void) const
Definition: CH_Segment.h:287
SYS_FORCE_INLINE bool isPendingHold() const
Definition: CH_Channel.h:492
bool contains(T arg, T tol=T(SYS_FTOLERANCE)) const
fpreal getTolerance() const
Definition: CH_Manager.h:999
fpreal time() const
fpreal getOutAccel(void) const
Definition: CH_Segment.h:288
const CH_Channel * channel() const
bool isEmpty() const
Returns true iff there are no occupied elements in the array.
Definition: UT_Array.h:455
GLenum src
Definition: glcorearb.h:1792