~ubuntu-branches/ubuntu/wily/opencollada/wily-proposed

« back to all changes in this revision

Viewing changes to COLLADAStreamWriter/include/COLLADASWLibraryAnimationClips.h

  • Committer: Package Import Robot
  • Author(s): Matteo F. Vescovi
  • Date: 2015-05-14 17:23:27 UTC
  • Revision ID: package-import@ubuntu.com-20150514172327-f862u8envms01fra
Tags: upstream-0.1.0~20140703.ddf8f47+dfsg1
ImportĀ upstreamĀ versionĀ 0.1.0~20140703.ddf8f47+dfsg1

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*
 
2
    Copyright (c) 2008-2009 NetAllied Systems GmbH
 
3
 
 
4
        This file is part of COLLADAStreamWriter.
 
5
        
 
6
    Licensed under the MIT Open Source License, 
 
7
    for details please see LICENSE file or the website
 
8
    http://www.opensource.org/licenses/mit-license.php
 
9
*/
 
10
 
 
11
#ifndef __COLLADASTREAMWRITER_LIBRARY_ANIMATION_CLIPS_H__
 
12
#define __COLLADASTREAMWRITER_LIBRARY_ANIMATION_CLIPS_H__
 
13
 
 
14
#include "COLLADASWPrerequisites.h"
 
15
#include "COLLADASWLibrary.h"
 
16
#include <vector>
 
17
 
 
18
namespace COLLADASW
 
19
{
 
20
    /** The list of animation instances. */
 
21
    typedef std::vector<String> AnimationInstances;
 
22
 
 
23
 
 
24
    class ColladaAnimationClip
 
25
    {
 
26
 
 
27
    public:
 
28
        ColladaAnimationClip ( const String& animationClipId = ElementWriter::EMPTY_STRING );
 
29
        ColladaAnimationClip ( const String& animationClipId, float& startTime, float& endTime );
 
30
        ColladaAnimationClip ( float& startTime, float& endTime );
 
31
 
 
32
        /** Returns a reference to then image id*/
 
33
        const String& getAnimationClipId() const
 
34
        {
 
35
            return mAnimationClipId;
 
36
        }
 
37
 
 
38
        /** Retrieves the start time marker position for this animation clip.
 
39
        When using the animation clip, all the animation curves will need
 
40
        to be synchronized in order for the animation to start at the start time.
 
41
        @return The start time marker position, in seconds. */
 
42
        float getStartTime() const
 
43
        {
 
44
            return mStartTime;
 
45
        }
 
46
 
 
47
        /** Sets the start time marker position for this animation clip.
 
48
        @param startTime The new start time marker position. */
 
49
        void setStartTime ( float startTime )
 
50
        {
 
51
            mStartTime = startTime;
 
52
        }
 
53
 
 
54
        /** Retrieves the end time marker position for this animation clip.
 
55
        When using the animation clip, all the animation curves will need
 
56
        to be synchronized in order for the animation to complete at the end time.
 
57
        @return The end time marker position, in seconds. */
 
58
        float getEndTime() const
 
59
        {
 
60
            return mEndTime;
 
61
        }
 
62
 
 
63
        /** Sets the end time marker position for this animation clip.
 
64
        @param endTime The end time marker position. */
 
65
        void setEndTime ( float endTime )
 
66
        {
 
67
            mEndTime = endTime;
 
68
        }
 
69
 
 
70
        /** Adds an animation instance to the list of instantiated animations. */
 
71
        void setInstancedAnimation ( const String& animationId )
 
72
        {
 
73
            mInstancedAnimations.push_back ( animationId );
 
74
        }
 
75
 
 
76
        /** Returns the list with the instanced animations. */
 
77
        const AnimationInstances& getInstancedAnimations() const
 
78
        {
 
79
            return mInstancedAnimations;
 
80
        }
 
81
 
 
82
    private:
 
83
 
 
84
        /** The id of the current animation clip. */
 
85
        String mAnimationClipId;
 
86
 
 
87
        /** The start time of the current clip. */
 
88
        float mStartTime;
 
89
 
 
90
        /** The end time of the current clip. */
 
91
        float mEndTime;
 
92
 
 
93
        /** The list of animations, which use this clip. */
 
94
        AnimationInstances mInstancedAnimations;
 
95
    };
 
96
 
 
97
 
 
98
    /** Class to simply the creation of @a \<library_images\> and @a \<images\>'s*/
 
99
 
 
100
    class LibraryAnimationClips : public Library
 
101
    {
 
102
 
 
103
    public:
 
104
        LibraryAnimationClips ( StreamWriter* streamWriter );
 
105
 
 
106
    protected:
 
107
 
 
108
        /** Adds @a \<animation_clip\> element. If not already opened, it opens @a \<library_animation_clips\>*/
 
109
        void addAnimationClip ( const ColladaAnimationClip& animationClip );
 
110
 
 
111
    };
 
112
 
 
113
} //namespace COLLADASW
 
114
 
 
115
#endif //__COLLADASTREAMWRITER_LIBRARY_ANIMATION_CLIPS_H__