ActiveLib
Loading...
Searching...
No Matches
Anchor2D.h
1
6#ifndef ACTIVE_GEOMETRY_ANCHOR_2D
7#define ACTIVE_GEOMETRY_ANCHOR_2D
8
9#include "Active/Utility/String.h"
10
12
14 typedef enum {
15 leftX = 0,
16 centreX,
17 rightX
18 } OrdinalX;
19
21 typedef enum {
22 frontY = 0,
23 halfY,
24 backY
25 } OrdinalY;
26
28 typedef enum {
29 bottomZ = 0,
30 middleZ,
31 topZ
32 } OrdinalZ;
33
35 enum class Anchor2D {
36 leftFront = (frontY * 3) + leftX,
37 centreFront = (frontY * 3) + centreX,
38 rightFront = (frontY * 3) + rightX,
39 leftHalf = (halfY * 3) + leftX,
40 centreHalf = (halfY * 3) + centreX,
41 rightHalf = (halfY * 3) + rightX,
42 leftBack = (backY * 3) + leftX,
43 centreBack = (backY * 3) + centreX,
44 rightBack = (backY * 3) + rightX
45 };
46
52 std::optional<Anchor2D> toAnchor2D(const utility::String& text);
59
60}
61
62#endif //ACTIVE_GEOMETRY_ANCHOR_2D
A Unicode-aware string class.
Definition String.h:51
Definition Anchor2D.h:11
OrdinalZ
Ordinals in the Z axis.
Definition Anchor2D.h:28
OrdinalX
Ordinals in the X axis.
Definition Anchor2D.h:14
utility::String fromAnchor2D(Anchor2D anchor)
Definition Anchor2D.cpp:51
Anchor2D
Anchor positions in 2D.
Definition Anchor2D.h:35
OrdinalY
Ordinals in the Y axis.
Definition Anchor2D.h:21
std::optional< Anchor2D > toAnchor2D(const utility::String &text)
Definition Anchor2D.cpp:36