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_doublearray.h>
    00023 #include <xsi_status.h>
    00024
    00025 #ifdef _MSC_VER
    00026 #pragma warning(disable:4251)
    00027 #endif
    00028
    00029 namespace XSI {
    00030
    00031 class CDoubleArray;
    00032 class CLongArray;
    00033 class FCurve;
    00034 class Expression ;
    00035 class Parameter;
    00036 class Model;
    00037 class X3DObject;
    00038
    00039 //*****************************************************************************
    00069 //*****************************************************************************
    00070 class SICPPSDKDECL CParameterRefArray : public CRefArray
    00071 {
    00072     public:
    00073
    00075     CParameterRefArray();
    00076
    00080     CParameterRefArray( const CParameterRefArray& );
    00081
    00083     ~CParameterRefArray();
    00084
    00089     CParameterRefArray& operator=( const CParameterRefArray& in_refArray );
    00090
    00099     CRef GetItem( const CString& in_scriptname ) const;
    00100
    00107     void Add( const CRef& in_item );
    00108
    00115     void RemoveItem( const CString& in_scriptname );
    00116
    00142     CRefArray PlotAnimation(
    00143         double                  in_startFrame=DBL_MAX,
    00144         double                  in_stopFrame=DBL_MAX,
    00145         double                  in_stepFrame=1,
    00146         siFCurveType            in_fcurveTypeToPlot=siStandardFCurve,
    00147         siFCurveInterpolation   in_interpolation=siCubicInterpolation,
    00148         bool                    in_bFitValues=false,
    00149         double                  in_fitTolerance=0.01,
    00150         bool                    in_bProcessRotation=false,
    00151         bool                    in_bDisplayProgressBar=true );
    00152
    00249     CStatus PlotAnimation(
    00250         double                  in_startFrame,
    00251         double                  in_stopFrame,
    00252         double                  in_stepFrame,
    00253         bool                    in_bProcessRotation,
    00254         bool                    in_bDisplayProgressBar,
    00255         CLongArray&             out_startParamValuesIndicesArray,
    00256         CDoubleArray&           out_plottedFramesArray,
    00257         CDoubleArray&           out_plottedValuesArray
    00258         );
    00259
    00285     CRefArray PlotAnimation(
    00286         double                  in_startFrame,
    00287         double                  in_stepFrame,
    00288         const CDoubleArray&     in_frameset,
    00289         siFCurveType            in_fcurveTypeToPlot=siStandardFCurve,
    00290         siFCurveInterpolation   in_interpolation=siCubicInterpolation,
    00291         bool                    in_bFitValues=false,
    00292         double                  in_fitTolerance=0.01,
    00293         bool                    in_bProcessRotation=false,
    00294         bool                    in_bDisplayProgressBar=true );
    00295
    00320     CStatus PlotAnimation(
    00321         double                  in_startFrame,
    00322         double                  in_stepFrame,
    00323         const CDoubleArray&     in_frameset,
    00324         bool                    in_bProcessRotation,
    00325         bool                    in_bDisplayProgressBar,
    00326         CLongArray&             out_startParamValuesIndicesArray,
    00327         CDoubleArray&           out_plottedFramesArray,
    00328         CDoubleArray&           out_plottedValuesArray
    00329         );
    00330
    00340     CValue GetValue( const CString& in_scriptname, double in_time=DBL_MAX ) const;
    00341
    00353     CValue GetValue( LONG in_index, double in_time=DBL_MAX ) const;
    00354
    00373     CStatus PutValue( const CString& in_scriptname, const CValue& in_val, double in_time=DBL_MAX );
    00374
    00393     CStatus PutValue( LONG in_index, const CValue& in_val, double in_time=DBL_MAX );
    00394
    00395     private:
    00396     void* m_pIndices;
    00397 };
    00398
    00399 //*****************************************************************************
    00428 //*****************************************************************************
    00429
    00430 class SICPPSDKDECL Parameter : public SIObject
    00431 {
    00432 public:
    00434     Parameter();
    00435
    00437     ~Parameter();
    00438
    00442     Parameter(const CRef& in_ref);
    00443
    00447     Parameter(const Parameter& in_obj);
    00448
    00454     bool IsA( siClassID in_ClassID) const;
    00455
    00459     siClassID GetClassID() const;
    00460
    00465     Parameter& operator=(const Parameter& in_obj);
    00466
    00472     Parameter& operator=(const CRef& in_ref);
    00473
    00477     LONG GetCapabilities() const;
    00478
    00488     CStatus PutCapabilityFlag( siCapabilities in_flag, bool in_bEnable ) ;
    00489
    00490
    00494     bool GetMarked() const;
    00495
    00519     CStatus PutMarked( bool in_bVal );
    00520
    00536     CParameterRefArray& GetParameters() const;
    00537
    00544     Parameter GetParameter( const CString& in_scriptname ) const;
    00545
    00552     CValue GetValue(double in_time=DBL_MAX) const;
    00553
    00572     CStatus PutValue(const CValue& in_val, double in_time=DBL_MAX );
    00573
    00577     CString GetScriptName() const;
    00578
    00583     CString GetDescription() const;
    00584
    00591     CValue::DataType GetValueType() const;
    00592
    00598     CValue GetMin() const;
    00599
    00605     CValue GetMax() const;
    00606
    00619     CValue GetSuggestedMin() const;
    00620
    00633     CValue GetSuggestedMax() const;
    00634
    00639     CValue GetDefault() const;
    00640
    00646     CRef GetSource() const;
    00647
    00656     CRefArray GetSources() const;
    00657
    00658
    00668     CStatus PutSource( const CRef& in_source );
    00669
    00676     CStatus AddFCurve
    00677     (
    00678         siFCurveType        in_Type,
    00679         FCurve&             io_FCurve
    00680     );
    00681
    00682
    00689     Expression AddExpression
    00690     (
    00691         CString&        in_ExpressionDefinition
    00692     );
    00693
    00694
    00706     CStatus ConnectFromPreset
    00707     (
    00708         const CString&  in_strName,
    00709         const CString&  in_strFamily,
    00710         CRef&           io_prevSource,
    00711         CRef&           io_source
    00712     );
    00713
    00728     CStatus ConnectFromPreset
    00729     (
    00730         const CString&  in_strName,
    00731         const CString&  in_strFamily,
    00732         const CString&  in_strSourceName,
    00733         CRef&           io_prevSource,
    00734         CRef&           io_source
    00735     );
    00736
    00747     CStatus ConnectFromFile
    00748     (
    00749         const CString&  in_strName,
    00750         CRef&           io_prevSource,
    00751         CRef&           io_source
    00752     );
    00753
    00767     CStatus ConnectFromFile
    00768     (
    00769         const CString&  in_strName,
    00770         const CString&  in_strSourceName,
    00771         CRef&           io_prevSource,
    00772         CRef&           io_source
    00773     );
    00774
    00784     CStatus ConnectFromProgID
    00785     (
    00786         const CString&  in_strName,
    00787         CRef&           io_prevSource,
    00788         CRef&           io_source
    00789     );
    00790
    00803     CStatus ConnectFromProgID
    00804     (
    00805         const CString&  in_strName,
    00806         const CString&  in_strSourceName,
    00807         CRef&           io_prevSource,
    00808         CRef&           io_source
    00809     );
    00810
    00818     CStatus Connect
    00819     (
    00820         const CRef& in_source,
    00821         CRef&       io_prevSource
    00822     );
    00823
    00829     CStatus Disconnect();
    00830
    00836     CStatus Disconnect( CRef& io_prevSource );
    00837
    00855     CStatus PutParameterValue
    00856     (
    00857         const CString&  in_scriptname,
    00858         bool            in_val,
    00859         double          in_time = DBL_MAX
    00860     );
    00861
    00864     CStatus PutParameterValue
    00865     (
    00866         const CString&  in_scriptname,
    00867         double          in_val,
    00868         double          in_time = DBL_MAX
    00869     );
    00870
    00873     CStatus PutParameterValue
    00874     (
    00875         const CString&  in_scriptname,
    00876         float           in_val,
    00877         double          in_time = DBL_MAX
    00878     );
    00881     CStatus PutParameterValue
    00882     (
    00883         const CString&  in_scriptname,
    00884         short           in_val,
    00885         double          in_time = DBL_MAX
    00886     );
    00887
    00890     CStatus PutParameterValue
    00891     (
    00892         const CString&  in_scriptname,
    00893         LONG            in_val,
    00894         double          in_time = DBL_MAX
    00895     );
    00896
    00901     CStatus PutParameterValue
    00902     (
    00903         const CString&  in_scriptname,
    00904         LLONG           in_val,
    00905         double          in_time = DBL_MAX
    00906     );
    00907
    00908
    00911     CStatus PutParameterValue
    00912     (
    00913         const CString&  in_scriptname,
    00914         const CValue&   in_val,
    00915         double          in_time = DBL_MAX
    00916     );
    00917
    00920     CStatus PutParameterValue
    00921     (
    00922         const CString&  in_scriptname,
    00923         const CRef&     in_val,
    00924         double          in_time = DBL_MAX
    00925     );
    00926
    00929     CStatus PutParameterValue
    00930     (
    00931         const CString&  in_scriptname,
    00932         const CString&  in_val,
    00933         double          in_time = DBL_MAX
    00934     );
    00935
    00947     CValue GetParameterValue
    00948     (
    00949         const CString& in_name,
    00950         double in_time=DBL_MAX
    00951     ) const;
    00952
    00981     bool IsAnimated
    00982     (
    00983         siSourceType in_sourceType = siAnySource
    00984     ) const;
    00985
    01015     CRefArray GetAnimatedParameters(
    01016         siSourceType in_sourceType = siAnySource) const;
    01017
    01023     siLockType GetLockType();
    01029     siLockLevel GetLockLevel();
    01035     bool IsLocked();
    01036
    01042     CStatus SetLock(siLockLevel  in_level=siLockLevelAll);
    01043
    01050     CStatus UnSetLock(siLockLevel in_level=siLockLevelAll, const CString&in_password=CString() );
    01051
    01063     siTags GetTags();
    01064
    01078     CStatus PutTags( siTags in_eVal );
    01079
    01100     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 );
    01101
    01123     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 );
    01124
    01136     CRef AddCustomOp( const CString& in_type, const CRefArray& in_inputs = CRefArray(), const CString& in_name=L"", CStatus* io_pst = 0 );
    01137
    01143     X3DObject GetParent3DObject() const;
    01144
    01151     Model GetModel() const;
    01152
    01168     bool HasInstanceValue() const;
    01169
    01191     bool IsSupportedInstanceValue(const CRef& in_obj, const CValue& in_val ) const;
    01192
    01210     CValue GetInstanceValue(const CRef& in_obj, bool in_bindtobject = false ) const;
    01211
    01240     CStatus PutInstanceValue(const CRef& in_obj, const CValue& in_val, bool in_bindtovalidate = false);
    01241
    01288     Parameter GetOverridingObject() const;
    01289
    01347     Parameter GetOverridenObject() const;
    01348
    01370     CValue GetOriginalValue(double in_time=DBL_MAX) const;
    01371
    01372     protected:
    01373     mutable CParameterRefArray m_paramArray;
    01374
    01375     private:
    01376     Parameter * operator&() const;
    01377     Parameter * operator&();
    01378 };
    01379
    01380 };
    01381 #endif // __XSIPARAMETER_H__