Action.h

00001 //***************************************************************************************
00002 //
00003 // File supervisor: Crosswalk team
00004 //
00005 // Copyright 2008 Autodesk, Inc.  All rights reserved.
00006 // Use of this software is subject to the terms of the Autodesk license agreement
00007 // provided at the time of installation or download, or which otherwise accompanies
00008 // this software in either electronic or hard copy form.
00009 //
00010 //***************************************************************************************
00011 
00012 #ifndef _ACTION_H
00013 #define _ACTION_H
00014 
00015 #include "Template.h"
00016 
00017 class CSLActionFCurve;
00018 class CSLStaticValue;
00019 class CSLXSIShapeReference;
00020 
00034 class XSIEXPORT CSLAction
00035     : public CSLTemplate
00036 {
00037 public:
00043     CSLAction(CSLScene* in_pScene, CSLModel *in_pModel, CdotXSITemplate* in_pTemplate);
00044 
00047     virtual ~CSLAction();
00048 
00050     enum EActionType
00051     {
00052         SI_AT_FCURVE,           
00053         SI_AT_STATICVALUE,      
00054         SI_AT_EXPRESSION,       
00055         SI_AT_CLUSTERKEY,       
00056         SI_AT_CONSTRAINT,       
00057         SI_AT_COMPOUND,         
00058         SI_AT_SHAPECOMPOUND,    
00059         SI_AT_NONE,             
00060     };
00061 
00065     virtual SI_Error Synchronize();
00066 
00070     CSLTemplate::ETemplateType Type(){ return CSLTemplate::XSI_ACTION; }
00071 
00075     EActionType GetActionType();
00076 
00080     SI_Void  SetActionType( EActionType in_Type );
00081 
00085     virtual SI_Float GetEndTime();
00086 
00090     virtual SI_Void SetEndTime( SI_Float in_fTime );
00091 
00095     virtual SI_Float GetStartTime();
00096 
00100     virtual SI_Void SetStartTime( SI_Float in_fTime );
00101 
00102     // Animation functionality //////////////////////////////////////////////////
00103 
00109     SI_Error RemoveAnimation( SI_Int in_nIndex );
00110 
00116     SI_Error RemoveAnimation( CSLActionFCurve *io_pToRemove );
00117 
00121     CSLActionFCurve** GetAnimationList();
00122 
00126     SI_Int GetAnimationCount();
00127 
00131     virtual CSLActionFCurve* AddAnimation();
00132 
00137     virtual CSLActionFCurve* AddAnimation( EFCurveInterpolationType in_InterpolationType );
00138 
00142     SI_Error ClearAnimations();
00143 
00148     CSLActionFCurve* ConnectAnimation(CSLActionFCurve* in_pNewAnimation);
00149 
00150     // Static Values functionality //////////////////////////////////////////////////
00151 
00157     SI_Error RemoveStaticValue( SI_Int in_nIndex );
00158 
00164     SI_Error RemoveStaticValue( CSLStaticValue *io_pToRemove );
00165 
00169     CSLStaticValue** GetStaticValueList();
00170 
00174     SI_Int GetStaticValueCount();
00175 
00179     CSLStaticValue* AddStaticValue();
00180 
00184     SI_Error ClearStaticValues();
00185 
00190     CSLStaticValue* ConnectStaticValue(CSLStaticValue* in_pNewStaticValue);
00191 
00192     CSLFloatProxy*  GetStartTimeProxy() {return &m_StartTime;};
00193     CSLFloatProxy*  GetEndTimeProxy() {return &m_EndTime;};
00194     CSLEnumProxy<EActionType, SI_AT_NONE>* GetActionTypeProxy() { return &m_ActionType;};
00195 
00199     CSLXSIShapeReference* AddXSIShapeReference();
00200 
00204     CSLXSIShapeReference* GetXSIShapeReference();
00205 
00209     SI_Error ClearXSIShapeReference();
00210 
00215     CSLXSIShapeReference* ConnectXSIShapeReference(CSLXSIShapeReference* in_pNewXSIShape);
00216 
00217 private:
00218     CSLFloatProxy m_StartTime;
00219     CSLFloatProxy m_EndTime;
00220     CSLEnumProxy<EActionType, SI_AT_NONE> m_ActionType;
00221     CSIBCArray<CSLActionFCurve*> m_Animations;
00222     CSIBCArray<CSLStaticValue*> m_StaticValues;
00223     CSLXSIShapeReference *m_pXSIShapeReference;
00224 };
00225 #endif