11
11
12
12
namespace cycfi ::elements
13
13
{
14
- // //////////////////////////////////////////////////////////////////////////
15
- // Layer
16
- // //////////////////////////////////////////////////////////////////////////
14
+ /* *
15
+ * @class layer_element
16
+ *
17
+ * @brief
18
+ * A class which represents an element in a layer. The layer_element is
19
+ * a composite that allows groups of elements to be placed in the
20
+ * z-axis. Higher-level elements obscure or hide lower-level elements.
21
+ */
17
22
class layer_element : public composite_base
18
23
{
19
24
public:
@@ -32,8 +37,29 @@ namespace cycfi::elements
32
37
point _previous_size;
33
38
};
34
39
40
+ /* *
41
+ * @brief
42
+ * `layer_composite` is a composite with indeterminate (dynamic)
43
+ * number of elements
44
+ */
35
45
using layer_composite = vector_composite<layer_element>;
36
46
47
+ /* *
48
+ * @brief
49
+ * Create a layer from provided elements. The layer contains group of
50
+ * elements placed in z-axis. Higher-level elements obscure or hide
51
+ * lower-level elements.
52
+ *
53
+ * @tparam E
54
+ * Variadic template parameter for the types of the elements.
55
+ *
56
+ * @param elements
57
+ * The elements to be added to the layer (a parameter pack).
58
+ *
59
+ * @return
60
+ * A reverse layer composite of the provided elements (top-most element
61
+ * last).
62
+ */
37
63
template <typename ... E>
38
64
inline auto layer (E&&... elements)
39
65
{
@@ -45,9 +71,14 @@ namespace cycfi::elements
45
71
return r;
46
72
}
47
73
48
- // //////////////////////////////////////////////////////////////////////////
49
- // Deck
50
- // //////////////////////////////////////////////////////////////////////////
74
+ /* *
75
+ * @class deck_element
76
+ *
77
+ * @brief
78
+ * Represents an element in a deck, which inherits from the
79
+ * `layer_element` class. Elements are placed in the z-axis. Unlike
80
+ * layers, only the selected element is active (top-most by default).
81
+ */
51
82
class deck_element : public layer_element
52
83
{
53
84
public:
@@ -72,8 +103,28 @@ namespace cycfi::elements
72
103
std::size_t _selected_index;
73
104
};
74
105
106
+ /* *
107
+ * @brief
108
+ * `deck_composite` is a composite with indeterminate (dynamic)
109
+ * number of elements
110
+ */
75
111
using deck_composite = vector_composite<deck_element>;
76
112
113
+ /* *
114
+ * @brief
115
+ * Create a deck from provided elements. The deck contains a group of
116
+ * elements placed in z-axis. Unlike layers, only the selected element
117
+ * is active (top-most by default).
118
+ *
119
+ * @tparam E
120
+ * Variadic template parameter for the types of the elements.
121
+ *
122
+ * @param elements
123
+ * The elements to be added to the deck (a parameter pack).
124
+ *
125
+ * @return
126
+ * A deck composite of the provided elements.
127
+ */
77
128
template <typename ... E>
78
129
inline auto deck (E&&... elements)
79
130
{
0 commit comments