- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- File List
- File Members

# FCDocument/FCDAnimation.h

Go to the documentation of this file.

    00001 /*
    00002     Copyright (C) 2005-2007 Feeling Software Inc.
    00003     Portions of the code are:
    00004     Copyright (C) 2005-2007 Sony Computer Entertainment America
    00005
    00006     MIT License: http://www.opensource.org/licenses/mit-license.php
    00007 */
    00008 /*
    00009     Based on the FS Import classes:
    00010     Copyright (C) 2005-2006 Feeling Software Inc
    00011     Copyright (C) 2005-2006 Autodesk Media Entertainment
    00012     MIT License: http://www.opensource.org/licenses/mit-license.php
    00013 */
    00014
    00020 #ifndef _FCD_ANIMATION_H_
    00021 #define _FCD_ANIMATION_H_
    00022
    00023 #ifndef _FCD_ENTITY_H_
    00024 #include "FCDocument/FCDEntity.h"
    00025 #endif // _FCD_ENTITY_H_
    00026
    00027 class FCDocument;
    00028 class FCDAnimated;
    00029 class FCDAnimation;
    00030 class FCDAnimationChannel;
    00031 class FCDAnimationCurve;
    00032
    00033 typedef fm::pvector<FCDAnimationChannel> FCDAnimationChannelList;
    00034 typedef fm::pvector<FCDAnimationCurve> FCDAnimationCurveList;
    00048 class FCOLLADA_EXPORT FCDAnimation : public FCDEntity
    00049 {
    00050 private:
    00051     DeclareObjectType(FCDEntity);
    00052
    00053     // Animation hierarchy
    00054     FCDAnimation* parent;
    00055     DeclareParameterContainer(FCDAnimation, children, FC("Children"));
    00056
    00057     // Animation sources and channels
    00058     DeclareParameterContainer(FCDAnimationChannel, channels, FC("Channels"));
    00059
    00060 public:
    00067     FCDAnimation(FCDocument* document, FCDAnimation* parent = NULL);
    00068
    00070     virtual ~FCDAnimation();
    00071
    00075     virtual Type GetType() const { return ANIMATION; }
    00076
    00081     inline FCDAnimation* GetParent() { return parent; }
    00082     inline const FCDAnimation* GetParent() const { return parent; }
    00090     virtual FCDEntity* Clone(FCDEntity* clone = NULL, bool cloneChildren = false) const;
    00091
    00098     virtual FCDEntity* FindDaeId(const fm::string& daeId) { return const_cast<FCDEntity*>(const_cast<const FCDAnimation*>(this)->FindDaeId(daeId)); }
    00099     virtual const FCDEntity* FindDaeId(const fm::string& daeId) const;
    00104     inline size_t GetChildrenCount() const { return children.size(); }
    00105
    00111     inline FCDAnimation* GetChild(size_t index) { FUAssert(index < children.size(), return NULL); return children.at(index); }
    00112     inline const FCDAnimation* GetChild(size_t index) const { FUAssert(index < children.size(), return NULL); return children.at(index); }
    00116     FCDAnimation* AddChild();
    00117
    00121     inline void GetHierarchicalAssets(FCDAssetList& assets) { GetHierarchicalAssets(*(FCDAssetConstList*) &assets); }
    00122     virtual void GetHierarchicalAssets(FCDAssetConstList& assets) const;
    00128     void FindAnimationChannels(const fm::string& pointer, FCDAnimationChannelList& targetChannels);
    00129
    00132     size_t GetChannelCount() const { return channels.size(); }
    00133
    00138     FCDAnimationChannel* GetChannel(size_t index) { FUAssert(index < GetChannelCount(), return NULL); return channels.at(index); }
    00139     const FCDAnimationChannel* GetChannel(size_t index) const { FUAssert(index < GetChannelCount(), return NULL); return channels.at(index); }
    00144     DEPRECATED(3.0)
    00145     void GetChannels() const {}
    00146
    00149     FCDAnimationChannel* AddChannel();
    00150
    00154     void GetCurves(FCDAnimationCurveList& curves);
    00155 };
    00156
    00157 #endif // _FCD_ANIMATION_H_
    00158