GPU-Accelerated Coverage  0.1.0
Compute coverage tours for known environment with articulated objects on GPU
Animation.h
1 /*
2  * Copyright (c) 2018, Stefan Osswald
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  *
8  * * Redistributions of source code must retain the above copyright notice, this
9  * list of conditions and the following disclaimer.
10  *
11  * * Redistributions in binary form must reproduce the above copyright notice,
12  * this list of conditions and the following disclaimer in the documentation
13  * and/or other materials provided with the distribution.
14  *
15  * * Neither the name of the copyright holder nor the names of its
16  * contributors may be used to endorse or promote products derived from
17  * this software without specific prior written permission.
18  *
19  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20  * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21  * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
22  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
23  * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
24  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
25  * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
26  * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
27  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
28  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
29  */
30 
31 #ifndef INCLUDE_ARTICULATION_ANIMATION_H_
32 #define INCLUDE_ARTICULATION_ANIMATION_H_
33 
34 #include <assimp/scene.h>
35 #include <vector>
36 
37 namespace gpu_coverage {
38 
39 // Forward declarations
40 class Scene;
41 class Node;
42 class Channel;
43 
49 class Animation {
50 public:
57  Animation(Scene * const scene, const aiAnimation * const animation, const size_t id);
58 
62  virtual ~Animation();
63 
64  typedef std::vector<Channel *> Channels;
65 
70  void toDot(FILE *dot);
71 
76  const size_t& getId() const {
77  return id;
78  }
79 
87  const std::string& getName() const {
88  return name;
89  }
90 
95  inline const size_t& getStartFrame() const {
96  return startFrame;
97  }
98 
103  inline const size_t& getEndFrame() const {
104  return endFrame;
105  }
106 
111  inline const size_t& getNumFrames() const {
112  return numFrames;
113  }
114 
119  inline const Channels& getChannels() const {
120  return channels;
121  }
122 
127  inline const double& getDuration() const {
128  return duration;
129  }
130 
131 protected:
132  const size_t id;
133  const std::string name;
134  const double duration;
135  size_t startFrame;
136  size_t endFrame;
137  size_t numFrames;
138  Channels channels;
139 };
140 
141 }
142 
143 #endif /* INCLUDE_ARTICULATION_ANIMATION_H_ */
const double & getDuration() const
Duration of this animation in seconds.
Definition: Animation.h:127
const size_t & getId() const
Returns the unique ID of this animation.
Definition: Animation.h:76
Scene graph corresponding to Assimp&#39;s aiScene.
Definition: Scene.h:59
const size_t & getEndFrame() const
Frame number where this animation ends.
Definition: Animation.h:103
const size_t & getStartFrame() const
Frame number where this animation starts.
Definition: Animation.h:95
Definition: AbstractCamera.h:41
const Channels & getChannels() const
Vector of Channel pointers that this animation influences.
Definition: Animation.h:119
Channels channels
Channels manipulated by this animation.
Definition: Animation.h:138
void toDot(FILE *dot)
Write Graphviz Dot node representing this animation to file for debugging.
virtual ~Animation()
Destructor.
Animation(Scene *const scene, const aiAnimation *const animation, const size_t id)
Constructor.
const size_t & getNumFrames() const
Duration of this animation in frames.
Definition: Animation.h:111
size_t startFrame
Start frame of the animation.
Definition: Animation.h:135
const std::string name
Name of this animation, see getName().
Definition: Animation.h:133
const std::string & getName() const
Returns the name of this animation for logging.
Definition: Animation.h:87
const size_t id
Unique ID, see getId().
Definition: Animation.h:132
size_t endFrame
End frame of the animation.
Definition: Animation.h:136
const double duration
Duration of the animation in seconds.
Definition: Animation.h:134
size_t numFrames
Number of frames of the animation.
Definition: Animation.h:137
Represents the animation of a scene object.
Definition: Animation.h:49