xsi_parameter.h
Go to the documentation of this file.

    00001 //*****************************************************************************
    00011 //*****************************************************************************
    00012
    00013 #if (_MSC_VER > 1000) || defined(SGI_COMPILER)
    00014 #pragma once
    00015 #endif
    00016
    00017 #ifndef __XSIPARAMETER_H__
    00018 #define __XSIPARAMETER_H__
    00019
    00020 #include <xsi_siobject.h>
    00021 #include <xsi_value.h>
    00022 #include <xsi_status.h>
    00023
    00024 #ifdef _MSC_VER
    00025 #pragma warning(disable:4251)
    00026 #endif
    00027
    00028 namespace XSI {
    00029
    00030 class FCurve;
    00031 class Expression ;
    00032 class Parameter;
    00033 class Model;
    00034 class X3DObject;
    00035
    00036 //*****************************************************************************
    00066 //*****************************************************************************
    00067 class SICPPSDKDECL CParameterRefArray : public CRefArray
    00068 {
    00069     public:
    00070
    00072     CParameterRefArray();
    00073
    00077     CParameterRefArray( const CParameterRefArray& );
    00078
    00080     ~CParameterRefArray();
    00081
    00086     CParameterRefArray& operator=( const CParameterRefArray& in_refArray );
    00087
    00096     CRef GetItem( const CString& in_scriptname ) const;
    00097
    00104     void Add( const CRef& in_item );
    00105
    00112     void RemoveItem( const CString& in_scriptname );
    00113
    00139     CRefArray PlotAnimation(
    00140         double                  in_startFrame=DBL_MAX,
    00141         double                  in_stopFrame=DBL_MAX,
    00142         double                  in_stepFrame=1,
    00143         siFCurveType            in_fcurveTypeToPlot=siStandardFCurve,
    00144         siFCurveInterpolation   in_interpolation=siCubicInterpolation,
    00145         bool                    in_bFitValues=false,
    00146         double                  in_fitTolerance=0.01,
    00147         bool                    in_bProcessRotation=false,
    00148         bool                    in_bDisplayProgressBar=true );
    00149
    00159     CValue GetValue( const CString& in_scriptname, double in_time=DBL_MAX ) const;
    00160
    00172     CValue GetValue( LONG in_index, double in_time=DBL_MAX ) const;
    00173
    00192     CStatus PutValue( const CString& in_scriptname, const CValue& in_val, double in_time=DBL_MAX );
    00193
    00212     CStatus PutValue( LONG in_index, const CValue& in_val, double in_time=DBL_MAX );
    00213
    00214     private:
    00215     void* m_pIndices;
    00216 };
    00217
    00218 //*****************************************************************************
    00247 //*****************************************************************************
    00248
    00249 class SICPPSDKDECL Parameter : public SIObject
    00250 {
    00251 public:
    00253     Parameter();
    00254
    00256     ~Parameter();
    00257
    00261     Parameter(const CRef& in_ref);
    00262
    00266     Parameter(const Parameter& in_obj);
    00267
    00273     bool IsA( siClassID in_ClassID) const;
    00274
    00278     siClassID GetClassID() const;
    00279
    00284     Parameter& operator=(const Parameter& in_obj);
    00285
    00291     Parameter& operator=(const CRef& in_ref);
    00292
    00296     LONG GetCapabilities() const;
    00297
    00307     CStatus PutCapabilityFlag( siCapabilities in_flag, bool in_bEnable ) ;
    00308
    00309
    00313     bool GetMarked() const;
    00314
    00338     CStatus PutMarked( bool in_bVal );
    00339
    00355     CParameterRefArray& GetParameters() const;
    00356
    00363     Parameter GetParameter( const CString& in_scriptname ) const;
    00364
    00371     CValue GetValue(double in_time=DBL_MAX) const;
    00372
    00391     CStatus PutValue(const CValue& in_val, double in_time=DBL_MAX );
    00392
    00396     CString GetScriptName() const;
    00397
    00402     CString GetDescription() const;
    00403
    00410     CValue::DataType GetValueType() const;
    00411
    00417     CValue GetMin() const;
    00418
    00424     CValue GetMax() const;
    00425
    00438     CValue GetSuggestedMin() const;
    00439
    00452     CValue GetSuggestedMax() const;
    00453
    00458     CValue GetDefault() const;
    00459
    00465     CRef GetSource() const;
    00466
    00475     CRefArray GetSources() const;
    00476
    00477
    00487     CStatus PutSource( const CRef& in_source );
    00488
    00495     CStatus AddFCurve
    00496     (
    00497         siFCurveType        in_Type,
    00498         FCurve&             io_FCurve
    00499     );
    00500
    00501
    00508     Expression AddExpression
    00509     (
    00510         CString&        in_ExpressionDefinition
    00511     );
    00512
    00513
    00525     CStatus ConnectFromPreset
    00526     (
    00527         const CString&  in_strName,
    00528         const CString&  in_strFamily,
    00529         CRef&           io_prevSource,
    00530         CRef&           io_source
    00531     );
    00532
    00547     CStatus ConnectFromPreset
    00548     (
    00549         const CString&  in_strName,
    00550         const CString&  in_strFamily,
    00551         const CString&  in_strSourceName,
    00552         CRef&           io_prevSource,
    00553         CRef&           io_source
    00554     );
    00555
    00566     CStatus ConnectFromFile
    00567     (
    00568         const CString&  in_strName,
    00569         CRef&           io_prevSource,
    00570         CRef&           io_source
    00571     );
    00572
    00586     CStatus ConnectFromFile
    00587     (
    00588         const CString&  in_strName,
    00589         const CString&  in_strSourceName,
    00590         CRef&           io_prevSource,
    00591         CRef&           io_source
    00592     );
    00593
    00603     CStatus ConnectFromProgID
    00604     (
    00605         const CString&  in_strName,
    00606         CRef&           io_prevSource,
    00607         CRef&           io_source
    00608     );
    00609
    00622     CStatus ConnectFromProgID
    00623     (
    00624         const CString&  in_strName,
    00625         const CString&  in_strSourceName,
    00626         CRef&           io_prevSource,
    00627         CRef&           io_source
    00628     );
    00629
    00637     CStatus Connect
    00638     (
    00639         const CRef& in_source,
    00640         CRef&       io_prevSource
    00641     );
    00642
    00648     CStatus Disconnect();
    00649
    00655     CStatus Disconnect( CRef& io_prevSource );
    00656
    00674     CStatus PutParameterValue
    00675     (
    00676         const CString&  in_scriptname,
    00677         bool            in_val,
    00678         double          in_time = DBL_MAX
    00679     );
    00680
    00683     CStatus PutParameterValue
    00684     (
    00685         const CString&  in_scriptname,
    00686         double          in_val,
    00687         double          in_time = DBL_MAX
    00688     );
    00689
    00692     CStatus PutParameterValue
    00693     (
    00694         const CString&  in_scriptname,
    00695         float           in_val,
    00696         double          in_time = DBL_MAX
    00697     );
    00700     CStatus PutParameterValue
    00701     (
    00702         const CString&  in_scriptname,
    00703         short           in_val,
    00704         double          in_time = DBL_MAX
    00705     );
    00706
    00709     CStatus PutParameterValue
    00710     (
    00711         const CString&  in_scriptname,
    00712         LONG            in_val,
    00713         double          in_time = DBL_MAX
    00714     );
    00715
    00720     CStatus PutParameterValue
    00721     (
    00722         const CString&  in_scriptname,
    00723         LLONG           in_val,
    00724         double          in_time = DBL_MAX
    00725     );
    00726
    00727
    00730     CStatus PutParameterValue
    00731     (
    00732         const CString&  in_scriptname,
    00733         const CValue&   in_val,
    00734         double          in_time = DBL_MAX
    00735     );
    00736
    00739     CStatus PutParameterValue
    00740     (
    00741         const CString&  in_scriptname,
    00742         const CRef&     in_val,
    00743         double          in_time = DBL_MAX
    00744     );
    00745
    00748     CStatus PutParameterValue
    00749     (
    00750         const CString&  in_scriptname,
    00751         const CString&  in_val,
    00752         double          in_time = DBL_MAX
    00753     );
    00754
    00766     CValue GetParameterValue
    00767     (
    00768         const CString& in_name,
    00769         double in_time=DBL_MAX
    00770     ) const;
    00771
    00800     bool IsAnimated
    00801     (
    00802         siSourceType in_sourceType = siAnySource
    00803     ) const;
    00804
    00834     CRefArray GetAnimatedParameters(
    00835         siSourceType in_sourceType = siAnySource) const;
    00836
    00842     siLockType GetLockType();
    00848     siLockLevel GetLockLevel();
    00854     bool IsLocked();
    00855
    00861     CStatus SetLock(siLockLevel  in_level=siLockLevelAll);
    00862
    00869     CStatus UnSetLock(siLockLevel in_level=siLockLevelAll, const CString&in_password=CString() );
    00870
    00882     siTags GetTags();
    00883
    00897     CStatus PutTags( siTags in_eVal );
    00898
    00919     CRef AddScriptedOp( const CString& in_code=L"", const CRefArray& in_inputs = CRefArray(), const CString& in_name=L"", const CString& in_language=L"", CStatus* io_pst = 0 );
    00920
    00942     CRef AddScriptedOpFromFile( const CString& in_filename = L"", const CRefArray& in_inputs = CRefArray(), const CString& in_name = L"", const CString& in_language = L"", CStatus* io_pst = 0 );
    00943
    00955     CRef AddCustomOp( const CString& in_type, const CRefArray& in_inputs = CRefArray(), const CString& in_name=L"", CStatus* io_pst = 0 );
    00956
    00962     X3DObject GetParent3DObject() const;
    00963
    00970     Model GetModel() const;
    00971
    00987     bool HasInstanceValue() const;
    00988
    01010     bool IsSupportedInstanceValue(const CRef& in_obj, const CValue& in_val ) const;
    01011
    01029     CValue GetInstanceValue(const CRef& in_obj, bool in_bindtobject = false ) const;
    01030
    01059     CStatus PutInstanceValue(const CRef& in_obj, const CValue& in_val, bool in_bindtovalidate = false);
    01060
    01107     Parameter GetOverridingObject() const;
    01108
    01166     Parameter GetOverridenObject() const;
    01167
    01189     CValue GetOriginalValue(double in_time=DBL_MAX) const;
    01190
    01191     protected:
    01192     mutable CParameterRefArray m_paramArray;
    01193
    01194     private:
    01195     Parameter * operator&() const;
    01196     Parameter * operator&();
    01197 };
    01198
    01199 };
    01200 #endif // __XSIPARAMETER_H__