00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __CH_Channel_h__
00021 #define __CH_Channel_h__
00022
00023 #include "CH_API.h"
00024 #include <iostream.h>
00025 #include <UT/UT_Algorithm.h>
00026 #include <UT/UT_Defines.h>
00027 #include <UT/UT_IntArray.h>
00028 #include <UT/UT_PtrArray.h>
00029 #include <UT/UT_String.h>
00030 #include <UT/UT_SuperInterval.h>
00031 #include <UT/UT_IStream.h>
00032 #include "CH_Collection.h"
00033
00034 class UT_Vector2;
00035 class UT_FloatArray;
00036
00037 typedef enum {
00038 CH_VALUE = 0,
00039 CH_SLOPE,
00040 CH_ACCEL,
00041 CH_NUM_VALUES
00042 } CH_ValueTypes;
00043
00044 CH_API extern char
00045 CHvalueNames[2][CH_NUM_VALUES];
00046
00047 typedef enum {
00048 CH_CHANNEL_DEFAULT,
00049 CH_CHANNEL_HOLD,
00050 CH_CHANNEL_CYCLE,
00051 CH_CHANNEL_EXTEND,
00052 CH_CHANNEL_SLOPE
00053 } CH_ChannelBehavior;
00054 UT_SWAPPER_SIMPLE(CH_ChannelBehavior);
00055
00056
00057
00058
00059
00060
00061
00062 typedef enum {
00063 CH_SCALE_ANY,
00064 CH_SCALE_START,
00065 CH_SCALE_END
00066 } CH_SegmentScale;
00067
00068
00069
00070 typedef enum {
00071 CH_CHANNEL_NONE = 0x00,
00072 CH_CHANNEL_MODIFIED = 0x01,
00073 CH_CHANNEL_COOKING = 0x02,
00074 CH_CACHE_ENABLED = 0x04,
00075 CH_CHANNEL_SPARE = 0x08,
00076 CH_CHANNEL_ACTIVE = 0x10,
00077
00078 CH_CHANNEL_PENDING = 0x20,
00079 CH_CHANNEL_PENDINGHOLD = 0x40,
00080
00081 CH_CHANNEL_LOCKED = 0x80,
00082
00083
00084 CH_CHANNEL_SAVE_MASK = CH_CHANNEL_PENDING,
00085
00086 CH_CHANNEL_FLAG_MASK = 0xFF
00087 } CH_ChannelFlag;
00088
00089
00090 class CH_Segment;
00091 class CH_Manager;
00092 class CH_SegmentRef;
00093
00094
00095 class CH_API CH_HalfKey
00096 {
00097 public:
00098 float myV[ CH_NUM_VALUES ];
00099 bool myVValid[ CH_NUM_VALUES ];
00100 bool myVTied[ CH_NUM_VALUES ];
00101 };
00102 UT_SWAPPER_SIMPLE(CH_HalfKey);
00103
00104 class CH_API CH_Key
00105 {
00106 public:
00107 float myTimeValue;
00108 bool myEvaluatedSlopes;
00109 CH_HalfKey k[2];
00110
00111 CH_Key() { clear(); }
00112
00113 void display() const;
00114
00115 void clear();
00116
00117
00118
00119
00120
00121 void tie( int direction, CH_ValueTypes t );
00122
00123 void tie( int direction );
00124
00125 void set( CH_ValueTypes t, float value );
00126 bool isSet( CH_ValueTypes t );
00127
00128 void complete();
00129
00130 void get( CH_Segment *left_seg, CH_Segment *right_seg,
00131 bool accel_ratio = true );
00132
00133 void put( CH_Segment *left_seg, CH_Segment *right_seg,
00134 bool accel_ratio = true ) const;
00135
00136 void stretch( float xscale, float yscale, bool accel_ratio );
00137
00138 void changeAccelsToRatios( float left_seg_len, float right_seg_len );
00139
00140 void reverse();
00141
00142 void opscript( ostream &os, bool use_time,
00143 bool only_valid=true ) const;
00144 };
00145
00146 class CH_API CH_FullKey: public CH_Key
00147 {
00148 public:
00149 bool myUseExpression;
00150 UT_String myExpression;
00151 CH_ExprLanguage myExprLanguage;
00152
00153 CH_FullKey()
00154 {
00155 myUseExpression = false;
00156 myExprLanguage = CH_OLD_EXPR_LANGUAGE;
00157 }
00158
00159 CH_FullKey( CH_FullKey const& other );
00160 CH_FullKey &operator=( CH_FullKey const& other );
00161
00162 void display() const;
00163 };
00164
00165 class CH_API CH_ReversibleKey: public CH_FullKey
00166 {
00167 public:
00168 bool myUseRevExpression;
00169 UT_String myRevExpression;
00170 CH_ExprLanguage myRevExprLanguage;
00171
00172 CH_ReversibleKey()
00173 {
00174 myUseRevExpression = false;
00175 myRevExprLanguage = CH_OLD_EXPR_LANGUAGE;
00176 }
00177
00178 CH_ReversibleKey( CH_ReversibleKey const& other );
00179 CH_ReversibleKey &operator=( CH_ReversibleKey const& other );
00180
00181 void display() const;
00182
00183 void stretch( float xscale, float yscale, bool accel_ratio );
00184
00185 void reverse();
00186 };
00187
00188
00189
00190
00191
00192
00193 class CH_API CH_ChannelIterator
00194 {
00195
00196
00197 public:
00198 CH_ChannelIterator(UT_IStream &is, int binary);
00199 bool begin(UT_String &name, const UT_String *path=NULL);
00200 bool end() { return noMoreChannels; }
00201 bool nextChannel(UT_String &name);
00202 int getLastError() { return lastError; }
00203
00204 private:
00205 UT_IStream *curr_is;
00206 UT_String curr_coll;
00207 int is_binary;
00208 int lastError;
00209 bool noMoreChannels;
00210 };
00211
00212 class CH_API CH_Channel
00213 {
00214 public:
00215 typedef enum
00216 {
00217 SNAP_SNAP,
00218 SNAP_SNAP_AND_DELETE,
00219 SNAP_REPLACE,
00220 SNAP_REPLACE_DOUBLE
00221 } SnapType;
00222
00223 CH_Channel(CH_Collection *dad, const char *name, float default_value = 0,
00224 const char *default_string = 0);
00225 CH_Channel(CH_Collection *dad, const CH_Channel &from);
00226 ~CH_Channel();
00227
00228 void initializeFirstSegment(const char *expr,
00229 CH_ExprLanguage language);
00230
00231
00232 void initializeSegmentParents();
00233
00234
00235 void clear();
00236 void swap( CH_Channel &other );
00237
00238 const UT_String &getName(void) const { return myName; }
00239 const UT_String &getAlias(void) const;
00240 void getFullPath( UT_String &path ) const;
00241
00242
00243 void setName(const char *s) { myName.harden(s); }
00244 void setAlias(const char *s) { myAlias.harden(s); }
00245
00246 CH_Manager *getManager() const { return myParent->getManager(); }
00247
00248 float getTolerance() const
00249 { return getManager()->getTolerance(); }
00250
00251
00252
00253 bool isTimeDependent() const;
00254
00255
00256
00257 bool isTimeDependentSlow(int thread) const;
00258 bool isStringTimeDependentSlow(int thread) const;
00259
00260 bool hasNonIntegerKeys() const;
00261 bool isDataDependent(float gtime) const;
00262
00263
00264 bool hasOnlyOneSegment() const;
00265
00266 bool isRotationChannel() const;
00267
00268
00269 bool getSurroundingSegs( float gtime,
00270 CH_Segment *&left, CH_Segment *&right ) const;
00271
00272 CH_Segment *getSegmentAfterKey( float gtime ) const;
00273
00274
00275
00276
00277 bool isAtKey(float gtime) const;
00278
00279
00280
00281 bool isAtHardKey(float gtime) const;
00282 bool isAtHardKeyframe(int frame) const;
00283
00284 float findKey(float gtime, float direction) const;
00285 int findKeyframe(int frame, int direction) const;
00286
00287
00288 bool nextTimeInRange( UT_SuperInterval const& range,
00289 float &t, bool first ) const;
00290
00291
00292
00293 void sampleValueSlope( CH_Segment *seg, float gtime,
00294 int thread, float &v, float &s );
00295 bool sampleVSA( CH_Segment *seg, float gtime, int thread,
00296 float &v, float &s, float a[2] );
00297 void sampleKey( CH_Segment *seg, float gtime, int thread,
00298 CH_Key &key );
00299 bool getKey( float gtime, CH_Key &key,
00300 bool accel_ratios = true );
00301 bool getFullKey( float gtime, CH_FullKey &key,
00302 bool reverse = false,
00303 bool accel_ratios = true );
00304 bool getReversibleKey( float gtime, CH_ReversibleKey &key );
00305
00306 void putKey( float gtime, CH_Key const& key,
00307 bool accel_ratios = true );
00308 void putFullKey( float gtime, CH_FullKey const& key,
00309 bool accel_ratios = true );
00310
00311 void transferKey(float to_time,
00312 CH_Channel *from_chp, float from_time);
00313
00314 void applyPendingToKey( CH_Key &key, float gtime );
00315 void applyAutoSlopeToKey( CH_Key &key );
00316
00317
00318
00319
00320 void insertKeyFrame(float global_t);
00321 void destroyKeyFrame(float global_t);
00322 void moveKeyFrame( float old_gtime, float new_gtime );
00323
00324 void saveKeyFrameForUndo( float global_t );
00325
00326
00327
00328
00329
00330
00331
00332
00333
00334
00335 int setKeyValue(float val, float gtime,
00336 bool set_pending = false,
00337 bool commit_keys = true,
00338 bool propagate = true);
00339 int setKeyString(const UT_String &str, float gtime,
00340 bool set_pending = false,
00341 bool commit_keys = true,
00342 bool propagate = true);
00343 int setKeyString(const UT_String &str, float gtime,
00344 CH_ExprLanguage language,
00345 bool set_pending = false,
00346 bool commit_keys = true,
00347 bool propagate = true);
00348 void holdValue( float gtime, int thread );
00349
00350
00351
00352
00353 void getKeyFrames( UT_SuperInterval const& range,
00354 UT_IntArray &frames,
00355 bool error_frames_only );
00356
00357
00358
00359 void getKeyTimes( UT_SuperInterval const& range,
00360 UT_FloatArray ×,
00361 bool error_frames_only );
00362
00363
00364 void getDisabledFrames(UT_IntArray &frames,
00365 int minframe, int maxframe);
00366
00367
00368 CH_Segment *getExpressionSegment( float gtime ) const;
00369 const char *getExpression( float gtime ) const;
00370 bool changeExpression( float gtime,
00371 const char *expr,
00372 CH_ExprLanguage language,
00373 bool convert_accels );
00374 CH_ExprLanguage getCollectionExprLanguage() const;
00375 CH_ExprLanguage getExprLanguageAtTime(float time) const;
00376 void setExprLanguage(CH_ExprLanguage language);
00377 void setExprLanguageAtTime(CH_ExprLanguage language,
00378 float time);
00379
00380
00381
00382
00383 CH_StringMeaning getStringMeaning(float time) const;
00384
00385
00386 void clearSegments();
00387
00388 void deleteKeys( UT_SuperInterval const& range );
00389
00390 bool copyRangeOverwritesKeys(const CH_Channel &src,
00391 UT_SuperInterval const& range,
00392 UT_Interval const& to_range);
00393 bool copyRangeOverwritesFrames(const CH_Channel &src,
00394 UT_SuperInterval const& range,
00395 UT_Interval const& to_range);
00396 bool copyRangeOverwrites(const CH_Channel &src,
00397 UT_SuperInterval const& range,
00398 UT_Interval const& to_range);
00399
00400 void copyRange(const CH_Channel &src,
00401 UT_SuperInterval const& range,
00402 UT_Interval const& to_range);
00403
00404
00405 void copyContents(const CH_Channel &from);
00406 void swapContents( CH_Channel &other );
00407
00408
00409
00410
00411
00412
00413 void copyRange(const CH_Channel &src,
00414 float global_start, float global_end);
00415
00416
00417 void snapKeysInRange( const UT_SuperInterval &range,
00418 SnapType type=SNAP_SNAP, ostream *os=0 );
00419
00420
00421 void scroll (float newStart, bool update = true);
00422 void stretch(float newStart, float newEnd);
00423 void reverse(float gstart=0, float gend=0, bool whole_chan = true);
00424
00425 bool increaseKeyValues( float delta );
00426
00427
00428 bool isAllDisabled() const;
00429 bool isAllEnabled() const;
00430 bool isDisabled(float gtime) const;
00431 void disableAll(float gtime);
00432 void enableAll();
00433 void disable(float gstart, float gend);
00434 void enable(float gstart, float gend);
00435
00436
00437 int isPending() const
00438 { return (myFlags & CH_CHANNEL_PENDING) ? 1 : 0; }
00439 int isPending(float gtime) const;
00440 int isPendingLocal(float ltime) const;
00441 void clearPending();
00442 void updatePending( float gtime );
00443 float getPendingEvalTime() const
00444 { return globalTime(myPendingEvalTime); }
00445 int isPendingHold() const
00446 { return (myFlags & CH_CHANNEL_PENDINGHOLD) ? 1 : 0; }
00447 void setPendingHold( int state );
00448
00449
00450 void save(ostream &os, int binary, bool compiled) const;
00451 bool load(UT_IStream &is);
00452 void display() const;
00453 void displayAsKeys() const;
00454
00455 void setDefaultValue(float dv) { myDefValue = dv; }
00456 float getDefaultValue() const { return myDefValue; }
00457
00458 void setDefaultString(const UT_String &dv)
00459 { myDefString.harden(dv); }
00460 UT_String getDefaultString() const { return myDefString; }
00461
00462 void setChannelLeftType(CH_ChannelBehavior t);
00463 void setChannelRightType(CH_ChannelBehavior t);
00464 CH_ChannelBehavior getChannelLeftType(void) const { return myLeftType; }
00465 CH_ChannelBehavior getChannelRightType(void) const { return myRightType; }
00466
00467 static const char *getChannelTypeName(CH_ChannelBehavior type);
00468
00469 void setCollection(CH_Collection *chp){ myParent = chp; }
00470 const CH_Collection *getCollection() const { return myParent; }
00471 CH_Collection *getCollection() { return myParent; }
00472
00473 void setIsTemporary( bool temp ) { myIsTemporary = temp; }
00474 bool isTemporary() const { return myIsTemporary; }
00475
00476
00477 void setChangeActive(int state)
00478 {
00479 if( state ) myFlags |= CH_CHANNEL_ACTIVE;
00480 else myFlags &= ~CH_CHANNEL_ACTIVE;
00481 }
00482 bool isChangeActive() const
00483 { return (myFlags & CH_CHANNEL_ACTIVE) ? 1 : 0; }
00484
00485
00486 bool getLocked() const
00487 { return ((myFlags & CH_CHANNEL_LOCKED) != 0); }
00488 void setLocked(bool f);
00489
00490 int getChanged() const
00491 { return (myFlags & CH_CHANNEL_MODIFIED) ? 1 : 0; }
00492 void setChanged(bool on,
00493 CH_CHANGE_TYPE type = CH_CHANNEL_CHANGED);
00494 void dirtyExprCache();
00495
00496
00497 int isCacheEnabled() const
00498 { return (myFlags & CH_CACHE_ENABLED) ? 1 : 0; }
00499 void setCacheEnable(bool on_off)
00500 {
00501 if (on_off) myFlags |= CH_CACHE_ENABLED;
00502 else myFlags &= ~CH_CACHE_ENABLED;
00503 }
00504 int canAccess(uint mask) const
00505 {
00506 return myParent->canAccessChannel(mask, this);
00507 }
00508
00509
00510 float localTime(float t) const { return (t-myStart); }
00511
00512
00513 float globalTime(float t) const { return t + myStart; }
00514
00515
00516 float getStart() const { return myStart; }
00517 float getEnd() const { return myStart + myLength;}
00518 float getLength() const { return myLength; }
00519
00520
00521 void unresolveLocalVars(int thread);
00522
00523
00524 void buildOpDependencies(void *ref_id, int thread);
00525 void changeOpRef(const char *new_fullpath,
00526 const char *old_fullpath,
00527 const char *old_cwd,
00528 const char *chan_name,
00529 const char *old_chan_name,
00530 int thread);
00531
00532
00533 void cook(int state);
00534
00535
00536 int setRawValues(float from, float to, float *vals, int nsamples);
00537
00538
00539 void setScope(bool on_off);
00540 bool isScoped() const { return myScope; }
00541
00542
00543
00544 bool isEditable();
00545
00546
00547 float evaluate(float t, bool no_disabling, int thread);
00548 void evaluate(float from, float to, float *vals, int nsamples,
00549 bool no_disabling, bool use_cache, int thread);
00550 float evaluateSegment(CH_Segment *eval, float localtime,
00551 bool extend, int thread);
00552 void evaluateString(UT_String &result, float t, int thread);
00553 void evaluateStringSegment(UT_String &result, CH_Segment *eval,
00554 float localtime, bool extend,
00555 int thread);
00556
00557 int findString(const char *str, bool fullword,
00558 bool usewildcards) const;
00559 int changeString(const char *from, const char *to,
00560 bool fullword, bool update ,
00561 int thread);
00562
00563
00564 const CH_Segment *getEvaluationSegment(int thread) const
00565 {
00566 return myEvalData.getValueForThread(thread)
00567 .myEvalSegment;
00568 }
00569 CH_Segment *getEvaluationSegment(int thread)
00570 {
00571 return myEvalData.getValueForThread(thread)
00572 .myEvalSegment;
00573 }
00574 const CH_Segment *getPrevEvaluationSegment(int thread) const;
00575 CH_Segment *getPrevEvaluationSegment(int thread);
00576 const CH_Segment *getNextEvaluationSegment(int thread) const;
00577 CH_Segment *getNextEvaluationSegment(int thread);
00578 float getLocalTime(int thread) const
00579 {
00580 return myEvalData.getValueForThread(thread)
00581 .myEvalTime;
00582 }
00583 float getInTime(int thread) const;
00584 float getOutTime(int thread) const;
00585 float getPrevInTime(int thread) const;
00586 float getNextOutTime(int thread) const;
00587
00588
00589 void setEvalTime(float localtime, int thread);
00590
00591
00592
00593
00594
00595
00596 int match(const char *pattern) const;
00597
00598
00599
00600 void setConstantValue(float value);
00601
00602
00603
00604
00605
00606
00607
00608
00609
00610
00611
00612
00613
00614
00615
00616
00617
00618
00619
00620 bool fitToPointData( UT_Vector2 *data, int n_pts,
00621 bool preserveExtrema,
00622 float error2 = 0.01f,
00623 bool delete_old_segments = false);
00624
00625
00626
00627
00628
00629
00630 void refit( float tolerance, bool preserveExtrema );
00631 void refit( float tolerance, bool preserveExtrema,
00632 float from_gtime, float to_gtime,
00633 bool delete_old_segments);
00634
00635
00636 bool isEmpty() const;
00637 int getNSegments() const;
00638 int getNKeys() const;
00639 int getNKeysBefore( float gtime ) const;
00640 int getNKeysBeforeOrAt( float gtime ) const;
00641
00642 float getKeyTime( unsigned idx ) const;
00643
00644 unsigned getSegmentIdx(float local_time) const;
00645 CH_Segment *getSegment(unsigned idx) const;
00646 CH_Segment *getSegment(float local_time) const;
00647
00648 CH_Segment *getNextSegment(unsigned idx) const;
00649 CH_Segment *getPrevSegment(unsigned idx) const;
00650
00651 CH_Segment *getPrevSegment(CH_Segment *) const;
00652 CH_Segment *getNextSegment(CH_Segment *) const;
00653
00654 CH_Segment *getFirstSegment() const
00655 {
00656
00657
00658 UT_ASSERT_P( isEmpty() || myEndSegment );
00659 return isEmpty()
00660 ? 0 : getSegment( (unsigned)0 );
00661 }
00662 CH_Segment *getLastSegment() const
00663 {
00664
00665
00666 UT_ASSERT_P( isEmpty() || myEndSegment );
00667
00668
00669 return isEmpty()
00670 ? 0 : getSegment( (unsigned)mySegments.entries()-1 );
00671 }
00672
00673 int64 getMemUsage(bool onlythis) const;
00674
00675
00676 void changeSegLength (CH_Segment *seg, float gtime,
00677 CH_SegmentScale how = CH_SCALE_ANY,
00678 bool update = true);
00679
00680 private:
00681 CH_Channel( CH_Channel const& other );
00682
00683 void ensureEndSegmentCreated();
00684 void updateEndSegment();
00685 void destroyEndSegment();
00686
00687 void moveKeyInternal( float old_gtime, float new_gtime );
00688 void splitSegment(float gtime, bool accel_ratio = true);
00689
00690
00691 int cutOut( float from_gtime, float to_gtime );
00692
00693 void changeSegLocalLength(CH_Segment *seg, float ltime,
00694 CH_SegmentScale how = CH_SCALE_ANY,
00695 bool update = true);
00696
00697 CH_Segment *appendSegment(CH_Segment *seg);
00698 CH_Segment *insertSegment(CH_Segment *seg, unsigned idx);
00699
00700
00701 void removeSegment(CH_Segment *seg);
00702 void removeSegment(unsigned idx);
00703
00704 void deleteSegment(CH_Segment *);
00705 void deleteSegment(unsigned idx);
00706
00707 int getNDisableSegments(void) const
00708 { return myDisableSegments.entries(); }
00709 CH_Segment *getDisableSegment(unsigned idx) const
00710 {
00711 return (idx < myDisableSegments.entries()) ?
00712 myDisableSegments(idx) : 0;
00713 }
00714
00715 CH_Segment *getDisableSegment(float local_time) const;
00716 CH_Segment *getPrevDisableSegment(CH_Segment *) const;
00717 CH_Segment *getNextDisableSegment(CH_Segment *) const;
00718
00719 int getDisableSegmentIndex(float ltime, bool closest_prev) const;
00720
00721 CH_Segment *getFirstDisableSegment() const
00722 {
00723 return (myDisableSegments.entries() > 0) ?
00724 myDisableSegments(0) : 0;
00725 }
00726 CH_Segment *getLastDisableSegment() const
00727 {
00728 return (myDisableSegments.entries() > 0)
00729 ? myDisableSegments(myDisableSegments.entries()-1)
00730 : 0;
00731 }
00732 CH_Segment *appendDisableSegment(CH_Segment *seg);
00733
00734 CH_Segment *insertDisableSegment(CH_Segment *seg);
00735 CH_Segment *insertDisableSegment(CH_Segment *seg, int idx);
00736 CH_Segment *insertDisableSegment(CH_Segment *seg, CH_Segment *before);
00737
00738
00739 void removeDisableSegment(CH_Segment *seg);
00740 void removeDisableSegment(int idx);
00741
00742 void deleteDisableSegment(CH_Segment *);
00743 void deleteDisableSegment(int idx);
00744
00745 void setPending( bool on_off, float ltime );
00746 void updatePendingStateToManager();
00747
00748 void deNormalize(float scale);
00749
00750 int isCooking() const
00751 {
00752 return (myFlags & CH_CHANNEL_COOKING) != 0;
00753 }
00754 void setCooking(bool on_off)
00755 {
00756 if (on_off) myFlags |= CH_CHANNEL_COOKING;
00757 else myFlags &= ~CH_CHANNEL_COOKING;
00758 }
00759
00760 void adjustSegmentTimes(bool update = true);
00761 void cook(CH_Segment *, int state);
00762
00763 CH_Collection *myParent;
00764 UT_String myName;
00765 UT_String myAlias;
00766
00767 CH_ChannelBehavior myLeftType;
00768 CH_ChannelBehavior myRightType;
00769 CH_Segment *myEndSegment;
00770
00771 float myDefValue;
00772 float myStart;
00773 float myLength;
00774
00775 UT_String myDefString;
00776
00777 UT_PtrArray<CH_Segment *> mySegments;
00778 UT_PtrArray<CH_Segment *> myDisableSegments;
00779
00780 bool myScope;
00781 bool myIsTemporary;
00782 unsigned char myFlags;
00783
00784
00785 float myPendingEvalTime;
00786
00787 class EvalData
00788 {
00789 public:
00790 EvalData() : myEvalTime(0.0f), myEvalSegment(0)
00791 { }
00792
00793 void set(float ltime, CH_Segment *seg)
00794 {
00795 myEvalTime = ltime;
00796 myEvalSegment = seg;
00797 }
00798
00799 void set(float ltime, CH_Segment *seg,
00800 float &old_ltime, CH_Segment *&old_seg)
00801 {
00802 old_ltime = myEvalTime;
00803 old_seg = myEvalSegment;
00804 set(ltime, seg);
00805 }
00806
00807 float myEvalTime;
00808 CH_Segment *myEvalSegment;
00809 };
00810
00811 UT_ThreadSpecificValue<EvalData> myEvalData;
00812 };
00813
00814 inline void
00815 UTswap(CH_Channel &x, CH_Channel &y)
00816 {
00817 x.swap(y);
00818 }
00819
00820
00821
00822
00823 CH_API extern void
00824 CHstretchSlopeAccel(float xscale, float yscale, float &slope, float &accel,
00825 bool accel_ratio);
00826
00827
00828
00829
00830
00831
00832
00833 CH_API extern void
00834 CHfindMoveKeysDelta( const CH_Channel *chp, bool snap_to_frame, float base_time,
00835 const UT_FloatArray &orig_keys,
00836 float accepted_dt, float &attempted_dt );
00837
00838 CH_API extern void
00839 CHmoveKeysWithDelta( CH_Channel *chp, const UT_FloatArray &orig_keys,
00840 float old_accepted_dt, float new_accepted_dt );
00841
00842 #endif