00001
00011
00012
00013 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
00014 #pragma once
00015 #endif
00016
00017 #ifndef __XSIFCURVE_H__
00018 #define __XSIFCURVE_H__
00019
00020 #include <xsi_animsource.h>
00021 #include <xsi_fcurvekey.h>
00022 #include <xsi_time.h>
00023 #include <xsi_value.h>
00024 #include <xsi_longarray.h>
00025 #include <xsi_doublearray.h>
00026
00027 namespace XSI {
00028
00029
00077
00078
00079 class SICPPSDKDECL FCurve : public AnimationSource
00080 {
00081 public:
00083 FCurve();
00084
00086 ~FCurve();
00087
00091 FCurve(const CRef& in_ref);
00092
00096 FCurve(const FCurve& in_obj);
00097
00102 bool IsA( siClassID in_ClassID) const;
00103
00107 siClassID GetClassID() const;
00108
00114 FCurve& operator=(const FCurve& in_obj);
00115
00121 FCurve& operator=(const CRef& in_ref);
00122
00126 CValue::DataType GetValueType() const;
00127
00131 siFCurveType GetFCurveType(void) const;
00132
00138 CStatus PutFCurveType(siFCurveType in_type);
00139
00143 bool GetLocked(void) const;
00144
00150 CStatus PutLocked(bool in_value);
00151
00166 bool GetDependsOnFrameRate(void) const;
00167
00184 CStatus PutDependsOnFrameRate(bool in_value);
00185
00189 CValue GetNoKeyValue(void) const;
00190
00196 CStatus PutNoKeyValue(const CValue& in_value);
00197
00203 siFCurveExtrapolation GetExtrapolation(void) const;
00204
00212 CStatus PutExtrapolation(siFCurveExtrapolation in_type);
00213
00219 siFCurveInterpolation GetInterpolation(void) const;
00220
00228 CStatus PutInterpolation(siFCurveInterpolation in_type);
00229
00233 CValue GetLowClamp(void) const;
00234
00240 CStatus PutLowClamp(const CValue& in_value);
00241
00245 CValue GetHighClamp(void) const;
00246
00252 CStatus PutHighClamp(const CValue& in_value);
00253
00258 CValue Eval(const CTime& in_frame) const;
00259
00264 CValue Eval(const double& in_frame) const;
00265
00269 CFCurveKeyRefArray GetKeys(void) const;
00270
00277 CFCurveKeyRefArray GetKeysBetween(const CTime&in_startframe = CTime(DBL_MAX,CTime::CUSTOM), const CTime &in_endframe = CTime(DBL_MAX,CTime::CUSTOM)) const;
00278
00283 bool GetSelected(void) const;
00284
00289 CFCurveKeyRefArray GetSelectedKeys() const;
00290
00298 CStatus SetKeys(
00299 const CTimeArray& in_timearray,
00300 const CValueArray& in_valuearray,
00301 bool in_keepexistingkeys = false );
00302
00324 CStatus SetKeys(
00325 const CTimeArray& in_timearray,
00326 const CDoubleArray& in_valuearray,
00327 const CLongArray& in_keyinterpolationarray,
00328 const CTimeArray& in_lefttanxarray = CTimeArray(),
00329 const CDoubleArray& in_lefttanyarray = CDoubleArray(),
00330 const CTimeArray& in_righttanxarray = CTimeArray(),
00331 const CDoubleArray& in_righttanyarray = CDoubleArray(),
00332 bool in_keepexistingkeys = false );
00333
00340 CStatus SetKeyTangents( const CDoubleArray& in_array );
00341
00345 bool GetSI3DStyle(void) const;
00346
00352 CStatus PutSI3DStyle(bool in_value);
00353
00373 LONG AddKey(
00374 const CTime& in_frame,
00375 const CValue& in_value,
00376 siFCurveKeyInterpolation in_interp = siDefaultKeyInterpolation,
00377 double in_ltx = DBL_MAX,
00378 double in_lty = DBL_MAX,
00379 double in_rtx = DBL_MAX,
00380 double in_rty = DBL_MAX,
00381 double in_tol = DBL_MAX,
00382 bool in_okl = false );
00383
00408 CStatus Resample(
00409 const CTime& in_startframe = CTime(DBL_MAX,CTime::CUSTOM),
00410 const CTime& in_endframe = CTime(DBL_MAX,CTime::CUSTOM),
00411 double in_step = 1,
00412 bool in_keepexistingkeys = false,
00413 bool in_overridekeylock = false );
00414
00443 CStatus Smooth( const CTime& in_start = CTime(DBL_MAX,CTime::CUSTOM),
00444 const CTime& in_end = CTime(DBL_MAX,CTime::CUSTOM),
00445 double in_dFilterSize=5,
00446 double in_dSamplingStep=1,
00447 siFCurveSmoothFilterType in_filterType=siFCurveAverageFilterType,
00448 double in_dGaussianVariance=1 );
00449
00471 CStatus Fit( const CTime& in_start = CTime(DBL_MAX,CTime::CUSTOM),
00472 const CTime& in_end = CTime(DBL_MAX,CTime::CUSTOM),
00473 double in_dFittingTolerance = 0.1);
00474
00530 CStatus Set( const FCurve& in_fcurve );
00531
00540 CStatus RemoveKey( const CTime& in_frame, double in_tolerance = DBL_MAX, bool in_overridekeylock = false );
00541
00550 CStatus RemoveKeyAtIndex( LONG in_index, bool in_overridekeylock = false );
00551
00562 CStatus RemoveKeysAtIndex( LONG in_index, LONG in_count, bool in_overridekeylock = false );
00563
00572 LONG RemoveKeys( const CTime& in_startframe = CTime(DBL_MAX,CTime::CUSTOM), const CTime& in_endframe = CTime(DBL_MAX,CTime::CUSTOM), bool in_overridekeylock = false );
00573
00579 bool KeyExists( const CTime& in_frame, double in_tolerance = DBL_MAX ) const;
00580
00587 FCurveKey GetKey( const CTime& in_frame, double in_tolerance = DBL_MAX ) const;
00588
00595 LONG GetNumKeys( const CTime& in_startframe = CTime(DBL_MAX,CTime::CUSTOM), const CTime& in_endframe = CTime(DBL_MAX,CTime::CUSTOM) ) const;
00596
00602 FCurveKey GetKeyAtIndex( LONG in_index ) const;
00603
00610 LONG GetKeyIndex( const CTime& in_frame, double in_tolerance = DBL_MAX ) const;
00611
00617 CTime GetKeyTime( LONG in_index ) const;
00618
00624 CValue GetKeyValue( LONG in_index ) const;
00625
00636 CStatus SetKey( LONG in_index, const CTime& in_frame, const CValue& in_value, bool in_overridekeylock = false );
00637
00641 bool IsEditing(void) const;
00642
00652 CStatus BeginEdit(void);
00653
00662 CStatus EndEdit(void);
00663
00670 CStatus UndoEdit(void);
00671
00677 bool GetMute(void) const;
00678
00686 CStatus PutMute(bool in_value);
00687
00695 CStatus Offset( const CTime& in_frameOffset, const CValue& in_valueOffset );
00696
00706 CStatus OffsetKeys( const CFCurveKeyRefArray& in_Keys, const CTime& in_frameOffset, const CValue& in_valueOffset );
00707
00719 CStatus Scale( double in_frameFactor, double in_valueFactor, const CTime& in_frameAnchor, const CValue& in_valueAnchor );
00720
00733 CStatus ScaleKeys( const CFCurveKeyRefArray& in_Keys, double in_frameFactor, double in_valueFactor, const CTime& in_frameAnchor, const CValue& in_valueAnchor, bool in_ripple = false );
00734
00743 CStatus ExtendCycle( LONG in_CyclesBefore, LONG in_CyclesAfter );
00744
00751 CStatus SnapToNearestFrame(void);
00752
00758 CStatus MakeRotationsContinuous(void);
00759
00765 CTime GetMinKeyFrame(void) const;
00766
00772 CTime GetMidKeyFrame(void) const;
00773
00779 CTime GetMaxKeyFrame(void) const;
00780
00786 CValue GetMinKeyValue(void) const;
00787
00793 CValue GetMidKeyValue(void) const;
00794
00800 CValue GetMaxKeyValue(void) const;
00801
00809 bool InsertKeyAtFrame(const CTime& in_frame);
00810
00811 private:
00812 FCurve * operator&() const;
00813 FCurve * operator&();
00814 };
00815
00816 };
00817
00818 #endif // __XSIFCURVE_H__