cubexx::face_t¶
-
struct
cubexx::face_t¶ Represents a face of a cube.
There are 6 faces in a cube. A face_t is 1:1 equivalent to a direction_t; they can be converted from one to the other via face_t::direction() and direction_t::face().
- See
- direction_t
Public Functions
-
face_t()¶ Default construct a “null” face.
-
const direction_t &
direction() const¶ Return the direction that is equivalent to this face.
-
const face_set_t &
adjacent_set() const¶ Return a face_set_t containing the 4 adjacent faces.
-
const corner_set_t &
corner_set() const¶ Return a corner_set_t containing the 4 corners on this face.
-
const edge_set_t &
edge_set() const¶ Return the 4 edges on this face.
-
const std::array<edge_t, 4> &
perpendicular_edges() const¶ Return the 4 (perpendicular) edges touching this face, but not directly on the face.
-
bool
is_adjacent(const corner_t &corner) const¶ Returns true if.
- Parameters
corner-is a corner adjacent to this face; otherwise returns false.
-
bool
is_adjacent(const face_t &other) const¶ Returns true if.
- Note
- that this will NOT return true for (*this).is_adjacent(*this).
- Parameters
other-is a face adjacent to this face; otherwise returns false.
-
bool
is_adjacent(const edge_t &edge) const¶ Returns true if.
- Parameters
edge-is an edge adjacent to this face; otherwise returns false.
-
std::uint_fast8_t
index() const¶ Retrieve a numeric 0-based index for the face, for use in indexing when storing in an array, or for comparison when storing in a container requiring comparison.
The index will be less than SIZE(). The “null” face has no index, and it is illegal to call index() on it.
- See
- get(std::uint_fast8_t idx)