Rumba C++ SDK
KeySet.h
Go to the documentation of this file.
1 /*
2 
3  *
4  ***
5  *****
6  ********************* Mercenaries Engineering SARL
7  ***************** Copyright (C) 2018
8  *************
9  ********* http://www.mercenaries-engineering.com
10  ***********
11  **** ****
12  ** **
13 
14 */
15 #pragma once
16 
17 #include "Value.h"
18 #include <map>
19 
20  namespace maquina
21  {
23  class MAQUINA_EXPORT KeySet : public Value
24  {
25  public:
27  struct KeyStatus
28  {
29  public:
30  KeyStatus():_in_reachable_object(false), _in_selected_object(false), _in_hovered_object(false), _selected(false) {}
31 
32  bool operator==(KeyStatus other) const noexcept
33  {
34  return _in_reachable_object == other.in_reachable_object() && _in_selected_object == other.in_selected_object() && _in_hovered_object == other.in_hovered_object() && _selected == other.selected();
35  }
36  bool operator!=(KeyStatus other) const noexcept
37  {
38  return _in_reachable_object != other.in_reachable_object() || _in_selected_object != other.in_selected_object() || _in_hovered_object != other.in_hovered_object() || _selected != other.selected();
39  }
40 
41  void set_in_reachable_object(bool in_reachable_object) { _in_reachable_object = in_reachable_object;}
42  void set_in_selected_object(bool in_selected_object) { _in_selected_object = in_selected_object;}
43  void set_in_hovered_object(bool in_hovered_object) { _in_hovered_object = in_hovered_object;}
44  void set_selected(bool selected) {_selected=selected;}
45 
46  bool in_reachable_object() const { return _in_reachable_object;}
47  bool in_selected_object() const {return _in_selected_object; }
48  bool in_hovered_object() const {return _in_hovered_object; }
49  bool selected() const {return _selected; }
50 
51  private:
52  bool _in_reachable_object;
53  bool _in_selected_object;
54  bool _in_hovered_object;
55  bool _selected;
56  };
57 
58  KeySet();
59 
61 
62  KeySet(const Value &v);
63  KeySet(std::map<float, KeyStatus> &&s);
64 
66  const std::map<float, KeyStatus>& keys() const;
67  std::map<float, KeyStatus>& keys();
68 
69  int curve_count();
70 
72  static const KeySet default_value;
73 
74 
75 
77  KeySet(std::shared_ptr<Impl> impl) { _impl=impl; }
78  };
79  }
KeyStatus()
Definition: KeySet.h:30
A set of keyframes.
Definition: KeySet.h:23
static const KeySet default_value
The default value.
Definition: KeySet.h:72
void set_in_reachable_object(bool in_reachable_object)
Definition: KeySet.h:41
bool operator==(KeyStatus other) const noexcept
Definition: KeySet.h:32
This version of the SDK is unstable, i-e, it may change with no warning.
Definition: AddCurveAction.h:20
bool in_reachable_object() const
Definition: KeySet.h:46
bool in_hovered_object() const
Definition: KeySet.h:48
bool selected() const
Definition: KeySet.h:49
void set_in_hovered_object(bool in_hovered_object)
Definition: KeySet.h:43
#define MAQUINA_EXPORT
Definition: Export.h:31
void set_selected(bool selected)
Definition: KeySet.h:44
bool in_selected_object() const
Definition: KeySet.h:47
bool operator!=(KeyStatus other) const noexcept
Definition: KeySet.h:36
Status of a Key, being part of a selected, hovered object or selected by itself.
Definition: KeySet.h:27
void set_in_selected_object(bool in_selected_object)
Definition: KeySet.h:42
Base class of all Rumba values.
Definition: Value.h:34