1 // SPDX-License-Identifier: GPL-2.0-or-later
2 /**
3 * Generic auxiliary routines for 3D axes
4 *
5 * Authors:
6 * Maximilian Albert <Anhalter42@gmx.de>
7 *
8 * Copyright (C) 2007 authors
9 *
10 * Released under GNU GPL v2+, read the file 'COPYING' for more information.
11 */
12
13 #include <glib.h>
14 #include "axis-manip.h"
15
16 namespace Proj {
17
18 Axis axes[4] = { X, Y, Z, W };
19
20 } // namespace Proj
21
22
23 namespace Box3D {
24
25 Axis axes[3] = { X, Y, Z };
26 Axis planes[3] = { XY, XZ, YZ };
27 FrontOrRear face_positions [2] = { FRONT, REAR };
28
29 std::pair <Axis, Axis>
get_remaining_axes(Axis axis)30 get_remaining_axes (Axis axis) {
31 if (!is_single_axis_direction (axis)) return std::make_pair (NONE, NONE);
32 Axis plane = orth_plane_or_axis (axis);
33 return std::make_pair (extract_first_axis_direction (plane), extract_second_axis_direction (plane));
34 }
35
string_from_axes(Box3D::Axis axis)36 Glib::ustring string_from_axes (Box3D::Axis axis) {
37 Glib::ustring result;
38 if (axis & Box3D::X) result += "X";
39 if (axis & Box3D::Y) result += "Y";
40 if (axis & Box3D::Z) result += "Z";
41 return result;
42 }
43
44 } // namespace Box3D
45
46 /*
47 Local Variables:
48 mode:c++
49 c-file-style:"stroustrup"
50 c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +))
51 indent-tabs-mode:nil
52 fill-column:99
53 End:
54 */
55 // vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8 :
56