# 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 #pragma warning(disable:4251)
    00025
    00026 namespace XSI {
    00027
    00028 class FCurve;
    00029 class Expression ;
    00030 class Parameter;
    00031 class Model;
    00032 class X3DObject;
    00033
    00034 //*****************************************************************************
    00068 //*****************************************************************************
    00069 class SICPPSDKDECL CParameterRefArray : public CRefArray
    00070 {
    00071     public:
    00072
    00074     CParameterRefArray();
    00075
    00079     CParameterRefArray( const CParameterRefArray& );
    00080
    00082     ~CParameterRefArray();
    00083
    00088     CParameterRefArray& operator=( const CParameterRefArray& in_refArray );
    00089
    00098     CRef GetItem( const CString& in_scriptname ) const;
    00099
    00106     void Add( const CRef& in_item );
    00107
    00114     void RemoveItem( const CString& in_scriptname );
    00115
    00141     CRefArray PlotAnimation(
    00142         double                  in_startFrame=DBL_MAX,
    00143         double                  in_stopFrame=DBL_MAX,
    00144         double                  in_stepFrame=1,
    00145         siFCurveType            in_fcurveTypeToPlot=siStandardFCurve,
    00146         siFCurveInterpolation   in_interpolation=siCubicInterpolation,
    00147         bool                    in_bFitValues=false,
    00148         double                  in_fitTolerance=0.01,
    00149         bool                    in_bProcessRotation=false,
    00150         bool                    in_bDisplayProgressBar=true );
    00151
    00161     CValue GetValue( const CString& in_scriptname, double in_time=DBL_MAX ) const;
    00162
    00174     CValue GetValue( LONG in_index, double in_time=DBL_MAX ) const;
    00175
    00194     CStatus PutValue( const CString& in_scriptname, const CValue& in_val, double in_time=DBL_MAX );
    00195
    00214     CStatus PutValue( LONG in_index, const CValue& in_val, double in_time=DBL_MAX );
    00215
    00216     private:
    00217     void* m_pIndices;
    00218 };
    00219
    00220 //*****************************************************************************
    00245 //*****************************************************************************
    00246
    00247 class SICPPSDKDECL Parameter : public SIObject
    00248 {
    00249 public:
    00251     Parameter();
    00252
    00254     ~Parameter();
    00255
    00259     Parameter(const CRef& in_ref);
    00260
    00264     Parameter(const Parameter& in_obj);
    00265
    00271     bool IsA( siClassID in_ClassID) const;
    00272
    00276     siClassID GetClassID() const;
    00277
    00282     Parameter& operator=(const Parameter& in_obj);
    00283
    00289     Parameter& operator=(const CRef& in_ref);
    00290
    00294     LONG GetCapabilities() const;
    00295
    00305     CStatus PutCapabilityFlag( siCapabilities in_flag, bool in_bEnable ) ;
    00306
    00307
    00311     bool GetMarked() const;
    00312
    00336     CStatus PutMarked( bool in_bVal );
    00337
    00353     CParameterRefArray& GetParameters() const;
    00354
    00361     Parameter GetParameter( const CString& in_scriptname ) const;
    00362
    00369     CValue GetValue(double in_time=DBL_MAX) const;
    00370
    00389     CStatus PutValue(const CValue& in_val, double in_time=DBL_MAX );
    00390
    00394     CString GetScriptName() const;
    00395
    00400     CString GetDescription() const;
    00401
    00408     CValue::DataType GetValueType() const;
    00409
    00415     CValue GetMin() const;
    00416
    00422     CValue GetMax() const;
    00423
    00436     CValue GetSuggestedMin() const;
    00437
    00450     CValue GetSuggestedMax() const;
    00451
    00456     CValue GetDefault() const;
    00457
    00463     CRef GetSource() const;
    00464
    00473     CRefArray GetSources() const;
    00474
    00475
    00485     CStatus PutSource( const CRef& in_source );
    00486
    00493     CStatus AddFCurve
    00494     (
    00495         siFCurveType        in_Type,
    00496         FCurve&             io_FCurve
    00497     );
    00498
    00499
    00506     Expression AddExpression
    00507     (
    00508         CString&        in_ExpressionDefinition
    00509     );
    00510
    00511
    00523     CStatus ConnectFromPreset
    00524     (
    00525         const CString&  in_strName,
    00526         const CString&  in_strFamily,
    00527         CRef&           io_prevSource,
    00528         CRef&           io_source
    00529     );
    00530
    00545     CStatus ConnectFromPreset
    00546     (
    00547         const CString&  in_strName,
    00548         const CString&  in_strFamily,
    00549         const CString&  in_strSourceName,
    00550         CRef&           io_prevSource,
    00551         CRef&           io_source
    00552     );
    00553
    00564     CStatus ConnectFromFile
    00565     (
    00566         const CString&  in_strName,
    00567         CRef&           io_prevSource,
    00568         CRef&           io_source
    00569     );
    00570
    00584     CStatus ConnectFromFile
    00585     (
    00586         const CString&  in_strName,
    00587         const CString&  in_strSourceName,
    00588         CRef&           io_prevSource,
    00589         CRef&           io_source
    00590     );
    00591
    00601     CStatus ConnectFromProgID
    00602     (
    00603         const CString&  in_strName,
    00604         CRef&           io_prevSource,
    00605         CRef&           io_source
    00606     );
    00607
    00620     CStatus ConnectFromProgID
    00621     (
    00622         const CString&  in_strName,
    00623         const CString&  in_strSourceName,
    00624         CRef&           io_prevSource,
    00625         CRef&           io_source
    00626     );
    00627
    00635     CStatus Connect
    00636     (
    00637         const CRef& in_source,
    00638         CRef&       io_prevSource
    00639     );
    00640
    00646     CStatus Disconnect();
    00647
    00653     CStatus Disconnect( CRef& io_prevSource );
    00654
    00672     CStatus PutParameterValue
    00673     (
    00674         const CString&  in_scriptname,
    00675         bool            in_val,
    00676         double          in_time = DBL_MAX
    00677     );
    00678
    00681     CStatus PutParameterValue
    00682     (
    00683         const CString&  in_scriptname,
    00684         double          in_val,
    00685         double          in_time = DBL_MAX
    00686     );
    00687
    00690     CStatus PutParameterValue
    00691     (
    00692         const CString&  in_scriptname,
    00693         float           in_val,
    00694         double          in_time = DBL_MAX
    00695     );
    00698     CStatus PutParameterValue
    00699     (
    00700         const CString&  in_scriptname,
    00701         short           in_val,
    00702         double          in_time = DBL_MAX
    00703     );
    00704
    00707     CStatus PutParameterValue
    00708     (
    00709         const CString&  in_scriptname,
    00710         LONG            in_val,
    00711         double          in_time = DBL_MAX
    00712     );
    00713
    00718     CStatus PutParameterValue
    00719     (
    00720         const CString&  in_scriptname,
    00721         LLONG           in_val,
    00722         double          in_time = DBL_MAX
    00723     );
    00724
    00725
    00728     CStatus PutParameterValue
    00729     (
    00730         const CString&  in_scriptname,
    00731         const CValue&   in_val,
    00732         double          in_time = DBL_MAX
    00733     );
    00734
    00737     CStatus PutParameterValue
    00738     (
    00739         const CString&  in_scriptname,
    00740         const CRef&     in_val,
    00741         double          in_time = DBL_MAX
    00742     );
    00743
    00746     CStatus PutParameterValue
    00747     (
    00748         const CString&  in_scriptname,
    00749         const CString&  in_val,
    00750         double          in_time = DBL_MAX
    00751     );
    00752
    00764     CValue GetParameterValue
    00765     (
    00766         const CString& in_name,
    00767         double in_time=DBL_MAX
    00768     ) const;
    00769
    00798     bool IsAnimated
    00799     (
    00800         siSourceType in_sourceType = siAnySource
    00801     ) const;
    00802
    00832     CRefArray GetAnimatedParameters(
    00833         siSourceType in_sourceType = siAnySource) const;
    00834
    00840     siLockType GetLockType();
    00846     siLockLevel GetLockLevel();
    00852     bool IsLocked();
    00853
    00859     CStatus SetLock(siLockLevel  in_level=siLockLevelAll);
    00860
    00867     CStatus UnSetLock(siLockLevel in_level=siLockLevelAll, const CString&in_password=CString() );
    00868
    00880     siTags GetTags();
    00881
    00895     CStatus PutTags( siTags in_eVal );
    00896
    00917     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 );
    00918
    00940     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 );
    00941
    00953     CRef AddCustomOp( const CString& in_type, const CRefArray& in_inputs = CRefArray(), const CString& in_name=L"", CStatus* io_pst = 0 );
    00954
    00960     X3DObject GetParent3DObject() const;
    00961
    00968     Model GetModel() const;
    00969
    00985     bool HasInstanceValue() const;
    00986
    01008     bool IsSupportedInstanceValue(const CRef& in_obj, const CValue& in_val ) const;
    01009
    01027     CValue GetInstanceValue(const CRef& in_obj, bool in_bindtobject = false ) const;
    01028
    01057     CStatus PutInstanceValue(const CRef& in_obj, const CValue& in_val, bool in_bindtovalidate = false);
    01058
    01105     Parameter GetOverridingObject() const;
    01106
    01164     Parameter GetOverridenObject() const;
    01165
    01187     CValue GetOriginalValue(double in_time=DBL_MAX) const;
    01188
    01189     protected:
    01190     mutable CParameterRefArray m_paramArray;
    01191
    01192     private:
    01193     Parameter * operator&() const;
    01194     Parameter * operator&();
    01195 };
    01196
    01197 };
    01198 #endif // __XSIPARAMETER_H__