fbdata.h

Go to the documentation of this file.
00001 #ifndef __FBDATA_H__
fbdata.h
00002 #define __FBDATA_H__
00003 /**************************************************************************
00004  Copyright (c) 1994 - 2009 Autodesk, Inc. and/or its licensors.
00005  All Rights Reserved.
00006  
00007  The coded instructions, statements, computer programs, and/or related 
00008  material (collectively the "Data") in these files contain unpublished 
00009  information proprietary to Autodesk, Inc. and/or its licensors, which is 
00010  protected by Canada and United States of America federal copyright law 
00011  and by international treaties.
00012  
00013  The Data may not be disclosed or distributed to third parties, in whole 
00014  or in part, without the prior written consent of Autodesk, Inc. 
00015  ("Autodesk").
00016  
00017  THE DATA IS PROVIDED "AS IS" AND WITHOUT WARRANTY.
00018  ALL WARRANTIES ARE EXPRESSLY EXCLUDED AND DISCLAIMED. AUTODESK MAKES NO 
00019  WARRANTY OF ANY KIND WITH RESPECT TO THE DATA, EXPRESS, IMPLIED OR 
00020  ARISING BY CUSTOM OR TRADE USAGE, AND DISCLAIMS ANY IMPLIED WARRANTIES 
00021  OF TITLE, NON-INFRINGEMENT, MERCHANTABILITY OR FITNESS FOR A PARTICULAR 
00022  PURPOSE OR USE. WITHOUT LIMITING THE FOREGOING, AUTODESK DOES NOT 
00023  WARRANT THAT THE OPERATION OF THE DATA WILL BE UNINTERRUPTED OR ERROR 
00024  FREE.
00025  
00026  IN NO EVENT SHALL AUTODESK, ITS AFFILIATES, PARENT COMPANIES, LICENSORS 
00027  OR SUPPLIERS ("AUTODESK GROUP") BE LIABLE FOR ANY LOSSES, DAMAGES OR 
00028  EXPENSES OF ANY KIND (INCLUDING WITHOUT LIMITATION PUNITIVE OR MULTIPLE 
00029  DAMAGES OR OTHER SPECIAL, DIRECT, INDIRECT, EXEMPLARY, INCIDENTAL, LOSS 
00030  OF PROFITS, REVENUE OR DATA, COST OF COVER OR CONSEQUENTIAL LOSSES OR 
00031  DAMAGES OF ANY KIND), HOWEVER CAUSED, AND REGARDLESS OF THE THEORY OF 
00032  LIABILITY, WHETHER DERIVED FROM CONTRACT, TORT (INCLUDING, BUT NOT 
00033  LIMITED TO, NEGLIGENCE), OR OTHERWISE, ARISING OUT OF OR RELATING TO THE 
00034  DATA OR ITS USE OR ANY OTHER PERFORMANCE, WHETHER OR NOT AUTODESK HAS 
00035  BEEN ADVISED OF THE POSSIBILITY OF SUCH LOSS OR DAMAGE.
00036  
00037 **************************************************************************/
00038 
00045 #include <kaydaradef.h>
00046 #ifndef FBSDK_DLL
00047 
00050     #define FBSDK_DLL K_DLLIMPORT
00051 #endif
00052 
00053 #include <fbsdk/fbcomponent.h>
00054 
00056 
00057 // Basic types
00058 #define ANIMATIONNODE_TYPE_NUMBER               "Number"
00059 #define ANIMATIONNODE_TYPE_TIME                 "Time"
00060 #define ANIMATIONNODE_TYPE_VECTOR               "Vector"
00061 #define ANIMATIONNODE_TYPE_VECTOR_4             "Vector4"
00062 #define ANIMATIONNODE_TYPE_OBJECT               "Object"
00063 #define ANIMATIONNODE_TYPE_REFERENCE            "Reference"
00064 #define ANIMATIONNODE_TYPE_EVENT                "Event"
00065 #define ANIMATIONNODE_TYPE_STRING               "String"
00066 
00067 // Types which are numbers
00068 #define ANIMATIONNODE_TYPE_ACTION               "Action"
00069 #define ANIMATIONNODE_TYPE_BOOL                 "Bool"
00070 #define ANIMATIONNODE_TYPE_ENUM                 "Enum"
00071 #define ANIMATIONNODE_TYPE_INTEGER              "Integer"
00072 #define ANIMATIONNODE_TYPE_OCCLUSION            "Occlusion"
00073 #define ANIMATIONNODE_TYPE_FIELDOFVIEWX         "FieldOfViewX"
00074 #define ANIMATIONNODE_TYPE_FIELDOFVIEWY         "FieldOfViewY"
00075 #define ANIMATIONNODE_TYPE_OPTICALCENTERX       "OpticalCenterX"
00076 #define ANIMATIONNODE_TYPE_OPTICALCENTERY       "OpticalCenterY"
00077 #define ANIMATIONNODE_TYPE_IKREACHTRANSLATION   "IKReachTranslation"
00078 #define ANIMATIONNODE_TYPE_IKREACHROTATION      "IKReachRotation"
00079 
00080 // Types which are vectors (3 members)
00081 #define ANIMATIONNODE_TYPE_COLOR                "Color"
00082 #define ANIMATIONNODE_TYPE_LOCAL_TRANSLATION    "Lcl Translation"
00083 #define ANIMATIONNODE_TYPE_LOCAL_ROTATION       "Lcl Rotation"
00084 #define ANIMATIONNODE_TYPE_LOCAL_SCALING        "Lcl Scaling"
00085 #define ANIMATIONNODE_TYPE_TRANSLATION          "Translation"
00086 #define ANIMATIONNODE_TYPE_ROTATION             "Rotation"
00087 #define ANIMATIONNODE_TYPE_SCALING              "Scaling"
00088 
00089 // Types which are vectors (4 members)
00090 #define ANIMATIONNODE_TYPE_COLOR_RGBA           "ColorAndAlpha"
00091 
00093 
00094 K_FORWARD( IConnector );
00095 K_FORWARD( KFCurve );
00096 
00097 #ifdef FBSDKUseNamespace
00098     namespace FBSDKNamespace {
00099 #endif
00100 
00101 FB_FORWARD( FBEvaluateInfo );
00102         
00104 enum FBInterpolation    {   
00105     kFBInterpolationInvalid  = -1,  
00106     kFBInterpolationConstant = 0,   
00107     kFBInterpolationLinear,         
00108     kFBInterpolationCubic,          
00109     kFBInterpolationCount           
00110 };
00111 FB_DEFINE_ENUM( FBSDK_DLL, Interpolation ); 
00112 
00114 enum FBInterpolatorCurveType {
00115     kFBInterpolatorCurveLinearIn, 
00116     kFBInterpolatorCurveLinearOut, 
00117     kFBInterpolatorCurveSmoothIn, 
00118     kFBInterpolatorCurveSmoothOut, 
00119     kFBInterpolatorCurveSlowIn, 
00120     kFBInterpolatorCurveSlowOut, 
00121     kFBInterpolatorCurveFastIn, 
00122     kFBInterpolatorCurveFastOut, 
00123     kFBInterpolatorCurveLast 
00124 };
00125 
00129 enum FBTangentMode  {
00130     kFBTangentModeAuto,     
00131     kFBTangentModeTCB,      
00132     kFBTangentModeUser,     
00133     kFBTangentModeBreak     
00134 };
00135 FB_DEFINE_ENUM( FBSDK_DLL, TangentMode );
00136 
00140 enum FBTangentClampMode {
00141     kFBTangentClampModeNone,    
00142     kFBTangentClampModeClamped  
00143     //Add other clamping methods here...
00144 };
00145 FB_DEFINE_ENUM( FBSDK_DLL, TangentClampMode );
00146 
00150 enum FBTangentConstantMode {
00151     kFBTangentConstantModeNormal,   
00152     kFBTangentConstantModeNext      
00153 };
00154 FB_DEFINE_ENUM( FBSDK_DLL, TangentConstantMode );
00155  
00157 // FBFCurveKey
00159 FB_FORWARD( FBFCurve );
00160 __FB_FORWARD( FBFCurveKey );
00161 FB_FORWARD( FBPropertyListFCurveKey );
00162 
00164 class FBSDK_DLL FBFCurveKey
00165 {
00166 private:
00167     HDataFBFCurveKey mLocalPtr;
00168     void FBFCurveKeyInitProperties();
00170     void PropertyAdd( FBProperty* ) {};
00171 public:
00176     FBFCurveKey( HKFCurve pFCurve=NULL, int pKeyIndex=1 );
00177 
00181     FBFCurveKey( const FBFCurveKey &pFCurveKey );
00182 
00185     ~FBFCurveKey();
00186 
00192     bool operator==(const FBFCurveKey &pValue) const;
00193 
00194     // To convert the derivative values to degrees (as shown in Exact mode):
00195     //    degrees( atan( RightDerivative ))
00196     //    -1 * degrees( atan( LeftDerivative )) 
00197     //
00198     // To convert from the exact degree in Exact mode in the GUI to the corresponding
00199     // derivative:
00200     //    tan( radians( RightDerivative ))
00201     //    tan( radians( -1 * LeftDerivative ))
00202     FBPropertyFloat Value;              
00203     FBPropertyFloat LeftDerivative;     
00204     FBPropertyFloat RightDerivative;    
00205     FBPropertyFloat LeftTangentWeight;  
00206     FBPropertyFloat RightTangentWeight; 
00207     FBPropertyFloat LeftBezierTangent;  
00208     FBPropertyFloat RightBezierTangent; 
00209 
00210     // TCB
00211     FBPropertyFloat Tension;            
00212     FBPropertyFloat Continuity;         
00213     FBPropertyFloat Bias;               
00214     
00215     FBPropertyTime          Time;           
00216     FBPropertyInterpolation Interpolation;  
00217     FBPropertyTangentMode   TangentMode;    
00218     FBPropertyTangentClampMode      TangentClampMode;   
00219     FBPropertyBool          TangentBreak;   
00220     FBPropertyTangentConstantMode   TangentConstantMode;        
00221     
00222     friend class FBFCurve;
00223     friend class FBPropertyListFCurveKey;
00224 };
00225 
00227 // FBPropertyListFCurveKey
00229 FB_FORWARD( FBFCurveKey );
00230  
00232 class FBSDK_DLL FBPropertyListFCurveKey : public FBPropertyBaseList< FBFCurveKey >
00233 {
00234 private:
00240     virtual int  Add    ( FBFCurveKey pItem );
00241 
00247     virtual int  Remove ( FBFCurveKey pItem );
00248 
00249 public:
00250 
00254     virtual void RemoveAt( int pIndex );
00255 
00260     virtual FBFCurveKey operator[](int pIndex);
00261 
00265     virtual int  GetCount();
00266 };
00267 
00269 // FBFCurve
00271 __FB_FORWARD( FBFCurve);
00272 
00274 class FBSDK_DLL FBFCurve : public FBComponent {
00275     __FBClassDeclare( FBFCurve,FBComponent );
00276 public:
00280     FBFCurve(HIObject pObject=NULL);
00281 
00284     virtual void FBDelete() override;
00285 
00290     float   Evaluate(FBTime &pTime);
00291 
00295     void    EditBegin(int pKeyCount=-1);
00296 
00300     void    EditEnd(int pKeyCount=-1);
00301 
00303     void    EditClear();
00304 
00312     int KeyAdd( FBTime &pTime, double pValue );
00313 
00318     bool KeyRemove( int pIndex );
00319 
00329     bool KeyDelete(int pStartIndex , int pStopIndex);   
00330 
00338     bool KeyDelete(FBTime pStart = FBTime::MinusInfinity, FBTime pStop = FBTime::Infinity, bool pInclusive = false);
00339 
00345     void    KeyInsert( FBTime &pTime, FBInterpolation pInterpolation = kFBInterpolationCubic, FBTangentMode pTangentMode = kFBTangentModeAuto );
00346 
00354     void Replace( FBFCurve& pSource, FBTime pStart = FBTime::MinusInfinity, FBTime pStop = FBTime::Infinity, bool pUseExactGivenSpan = false, bool pKeyStartEndOnNoKey = true );
00355 
00359     static FBFCurve* CreateInterpolatorCurve( FBInterpolatorCurveType pCurveType );
00360 
00361     FBPropertyListFCurveKey Keys;       
00362 };
00363 
00364 FB_DEFINE_COMPONENT( FBSDK_DLL, FCurve );
00365 
00367 // FBPropertyListAnimationNode
00369 __FB_FORWARD( FBAnimationNode);
00370 __FB_FORWARD( FBPropertyListAnimationNode);
00371 FB_DEFINE_LIST( FBSDK_DLL, AnimationNode );
00372 
00374 class FBSDK_DLL FBPropertyListAnimationNode : public FBPropertyBaseList< HFBAnimationNode >
00375 {
00376 public:
00381     virtual int  Add    ( HFBAnimationNode pItem );
00386     virtual int  Remove ( HFBAnimationNode pItem );
00390     virtual void RemoveAt( int pIndex );
00395     virtual HFBAnimationNode operator[](int pIndex);
00399     virtual int  GetCount();
00405     HFBAnimationNode Find( FBBox *pOriginalOwner, char* pDataType );
00410     HFBAnimationNode Find( char *pNodeName );
00415     HFBAnimationNode FindByLabel( char *pNodeLabel );
00416 };
00417 
00418 FB_DEFINE_COMPONENT( FBSDK_DLL, AnimationNode   );
00420 // FBEventAnimationNode
00423 
00425 enum FBEventAnimationNodeType {
00426     kFBEventAnimationNodeDataChange,
00427     kFBEventAnimationNodeConstraintChange,
00428     kFBEventAnimationNodeNone
00429 };
00430 
00431 FB_DEFINE_ENUM( FBSDK_DLL, EventAnimationNodeType );
00432 
00433 __FB_FORWARD( FBEventAnimationNode );
00434 
00441 class FBSDK_DLL FBEventAnimationNode: public FBEvent
00442 {
00443 public:
00447     FBEventAnimationNode( HKEventBase pEvent );     
00448 
00449     FBPropertyEventAnimationNodeType        Type;   
00450 };
00451 
00453 // FBPropertyEventAnimationNode
00456 class FBSDK_DLL FBPropertyEventAnimationNode : public FBPropertyEvent
00457 {
00458   public:
00463     virtual void Add    ( HICallback pOwner, kICallbackHandler pHandler );
00464     virtual void Remove ( HICallback pOwner, kICallbackHandler pHandler );
00465 };
00473 typedef bool (* kFBDataHandler )(void* pBuffer,HFBEvaluateInfo pEvaluateInfo,HFBAnimationNode pAnimationNode,void* p1,void* p2);
00474 
00476 // FBAnimationNode
00479 FB_DEFINE_COMPONENT( FBSDK_DLL, AnimationNode );
00480 
00481 class FBSDK_DLL FBAnimationNode : public FBComponent
00482 {
00483     __FBClassDeclare( FBAnimationNode,FBComponent );
00484 public:
00489     FBAnimationNode(char *pName = NULL, HIObject pObject=NULL);
00490 
00495     void KeyAdd( FBTime &pTime, double *pData );
00496 
00500     void KeyAdd( double *pData );
00501 
00505     bool SetCandidate( double* Data );
00506 
00510     void SetBufferType( bool pGlobal );
00511 
00514     void KeyCandidate();
00515 
00518     int GetSizeOfData();
00519 
00523     int GetDataDoubleArrayCount();
00524 
00530     bool WriteData( double* Data,HFBEvaluateInfo pEvaluateInfo );
00531 
00537     bool ReadData( double* Data,HFBEvaluateInfo pEvaluateInfo );
00538 
00546     bool ReadData( double* Data );
00547 
00554     bool Evaluate( double* Data, FBTime pTime, bool pEvaluateCandidate = true );
00555 
00559     bool IsKey();
00560 
00563     void KeyRemove();
00564 
00568     HFBAnimationNode GetAnimationToRecord();
00569 
00573     HFBAnimationNode GetAnimationToPlay();
00574 
00578     FBTime ConvertGlobalToNodeTime(FBTime& pKeyTime);
00579     
00583     FBTime ConvertNodeToGlobalTime(FBTime& pKeyTime);
00584 
00585     FBPropertyString            Label;          
00586     FBPropertyString            UserName;       
00587     FBPropertykReference        Reference;      
00588     FBPropertyInt               KeyCount;       
00589     FBPropertyFCurve            FCurve;         
00590     FBPropertyBool              Live;           
00591     FBPropertyBool              RecordMode;     
00592     FBPropertyAnimationNode     Parent;         
00593     FBPropertyInterpolation     DefaultInterpolation;   
00594 
00595     FBPropertyListAnimationNode Nodes;          
00596 
00597     FBPropertyEventAnimationNode    OnChange;       
00598 
00599     friend class FBBox;
00600 };
00601 
00603 // FBAnimationLayer
00605 
00609 enum FBLayerMode    {
00610     kFBLayerModeInvalidIndex = -1,  
00611     kFBLayerModeAdditive = 0,       
00612     kFBLayerModeOverride,           
00613     kFBLayerModeOverridePassthrough 
00614 };
00615 FB_DEFINE_ENUM( FBSDK_DLL, LayerMode );
00616 
00620 enum FBLayerRotationMode    {
00621     kFBLayerRotationModeInvalidIndex = -1,      
00622     kFBLayerRotationModeEulerRotation = 0,  
00623     kFBLayerRotationModeQuaternionRotation  
00624 };
00625 FB_DEFINE_ENUM( FBSDK_DLL, LayerRotationMode );
00626 
00627 
00628 __FB_FORWARD( FBAnimationLayer );
00629 
00636 class FBSDK_DLL FBAnimationLayer : public FBComponent
00637 {
00638     //--- Open Reality declaration.
00639     __FBClassDeclare(FBAnimationLayer, FBComponent);
00640 public:
00641 
00647     FBAnimationLayer(char *pName, int pLayerID, HIObject pObject=NULL);
00648 
00651     virtual void FBDelete();
00652 
00653     FBPropertyBool              Solo;               
00654     FBPropertyBool              Mute;               
00655     FBPropertyBool              Lock;               
00656     FBPropertyAnimatableDouble  Weight;             
00657     FBPropertyLayerMode         LayerMode;          
00658     FBPropertyLayerRotationMode LayerRotationMode;  
00659 
00663     void    AddChildLayer( HFBAnimationLayer pAnimationLayer );
00664 
00669     FBAnimationLayer*   GetChildLayer( int pIndex );
00670 
00674     int     GetChildCount();
00675 
00682     void    GetCompleteChildHierarchy(FBArrayTemplate<FBAnimationLayer*>* pChildArray);
00683 
00687     void SetParentLayer(FBAnimationLayer* pParentLayer);
00688 
00692     FBAnimationLayer*   GetParentLayer();
00693 
00697     int GetLayerIndex();
00698 
00703     void SelectLayer(bool pValue, bool pExclusiveSelect);
00704 
00708     bool IsSelected();
00709 
00710 private:
00711     void FBAnimationLayerInitProperties();
00712 };
00713 
00714 
00715 __FB_FORWARD( FBTake);
00717 // FBPropertyListTake
00719 
00722 class FBSDK_DLL FBPropertyListTake : public FBPropertyListComponent
00723 {
00724 public:
00725     FBPropertyListTake();
00730     FBTake* operator[](int pIndex);
00731 };
00733 // FBTake
00735 
00763 class FBSDK_DLL FBTake : public FBComponent {
00764     __FBClassDeclare( FBTake,FBComponent );
00765 public:
00773     FBTake(char *pName, HIObject pObject=NULL);
00774 
00779     virtual void FBDelete();
00780 
00788     HFBTake CopyTake( char *pNewTakeName );
00789 
00794     void PlotAllTakesOnSelected(FBTime pPlotPeriod);
00797     void CreateNewLayer();    
00798 
00802     void RemoveLayer(int pLayerIndex);  
00803 
00808     FBAnimationLayer* GetLayer(int pLayerIndex);  
00809 
00814     FBAnimationLayer* GetLayerByName(char* pName);  
00815 
00819     void SetCurrentLayer(int pLayerIndex);
00820 
00824     int GetCurrentLayer();
00825 
00829     int GetLayerCount();
00830 
00834     bool MoveCurrentLayerUp();
00835 
00839     bool MoveCurrentLayerDown();
00840 
00843     void DuplicateSelectedLayers();
00844 
00849     void PlotTakeOnSelected(FBTime pPlotPeriod);
00850 
00855     void PlotAllTakesOnSelectedProperties(FBTime pPlotPeriod);
00856 
00861     void PlotTakeOnSelectedProperties(FBTime pPlotPeriod);
00862 
00866     void ClearAllProperties(bool pOnSelectedObjectsOnly);
00867 
00868     FBPropertyTimeSpan  ReferenceTimeSpan;      
00869     FBPropertyTimeSpan  LocalTimeSpan;          
00870     FBPropertyString    Comments;               
00871 };
00872 
00873 FB_DEFINE_COMPONENT( FBSDK_DLL, Take );
00874 
00875 #ifdef FBSDKUseNamespace
00876     }
00877 #endif
00878 
00879 #endif
00880 

Please send us your comments about this page.