Radium Engine  1.5.0
HandleArray.hpp
1 #pragma once
2 
3 #include <Core/Animation/Pose.hpp>
4 #include <Core/RaCore.hpp>
5 #include <Core/Types.hpp>
6 
7 namespace Ra {
8 namespace Core {
9 namespace Animation {
10 
14 using Label = std::string;
15 
19 class RA_CORE_API HandleArray
20 {
21  public:
25  enum class SpaceType : bool { LOCAL, MODEL };
26  static_assert( std::is_same<bool, typename std::underlying_type<SpaceType>::type>::value,
27  "SpaceType is not a boolean" );
28  HandleArray();
29  explicit HandleArray( const uint n );
30  HandleArray( const HandleArray& handle ) = default;
31  HandleArray& operator=( const HandleArray& handle ) = default;
32 
33  virtual ~HandleArray();
34 
38  inline virtual uint size() const { return m_pose.size(); }
39 
43  virtual void clear();
44 
48  virtual const Pose& getPose( const SpaceType MODE ) const;
49 
55  virtual void setPose( const Pose& pose, const SpaceType MODE );
56 
60  virtual const Transform& getTransform( const uint i, const SpaceType MODE ) const;
61 
65  virtual void setTransform( const uint i, const Transform& T, const SpaceType MODE );
66 
70  inline Label getName() const { return m_name; }
71 
75  inline void setName( const Label& name ) { m_name = name; }
76 
80  inline Label getLabel( const uint i ) const;
81 
85  inline void setLabel( const uint i, const Label& text );
86 
90  LocalPose m_pose;
91 
92  protected:
96  Label m_name;
97 
101  std::vector<Label> m_label;
102 };
103 
104 inline Label HandleArray::getLabel( const uint i ) const {
105  CORE_ASSERT( ( i < size() ), "Index i out of bound" );
106  return m_label.at( i );
107 }
108 
109 inline void HandleArray::setLabel( const uint i, const Label& text ) {
110  CORE_ASSERT( ( i < size() ), "Index i out of bound" );
111  m_label[i] = text;
112 }
113 
114 } // namespace Animation
115 } // Namespace Core
116 } // Namespace Ra
void setName(const Label &name)
Definition: HandleArray.hpp:75
Label getLabel(const uint i) const
std::vector< Label > m_label
void setLabel(const uint i, const Label &text)
Definition: Cage.cpp:3