| 1 |
/* File: geometry_3dir.h; Copyright and License: see below */ |
| 2 |
|
| 3 |
#ifndef GEOMETRY_3DIR_H |
| 4 |
#define GEOMETRY_3DIR_H |
| 5 |
|
| 6 |
/* public file for the doxygen documentation: */ |
| 7 |
/*! |
| 8 |
* \file |
| 9 |
* \brief Defines a struct of 3 directions |
| 10 |
*/ |
| 11 |
|
| 12 |
#include "geometry/geometry_direction.h" |
| 13 |
|
| 14 |
/*! |
| 15 |
* \brief struct of 3 directions |
| 16 |
*/ |
| 17 |
struct geometry_3dir_struct { |
| 18 |
geometry_direction_t first; |
| 19 |
geometry_direction_t second; |
| 20 |
geometry_direction_t third; |
| 21 |
}; |
| 22 |
|
| 23 |
typedef struct geometry_3dir_struct geometry_3dir_t; |
| 24 |
|
| 25 |
/*! |
| 26 |
* \brief initializes a 3dir object for use as const |
| 27 |
* |
| 28 |
* \param first first direction |
| 29 |
* \param second second direction |
| 30 |
* \param third third direction |
| 31 |
* \return initialized geometry_3dir_t |
| 32 |
*/ |
| 33 |
static inline geometry_3dir_t geometry_3dir_new ( geometry_direction_t first, |
| 34 |
geometry_direction_t second, |
| 35 |
geometry_direction_t third |
| 36 |
); |
| 37 |
|
| 38 |
/*! |
| 39 |
* \brief checks if two geometry_3dir_t objects are equal |
| 40 |
* |
| 41 |
* \param this_ pointer to own object attributes |
| 42 |
* \param that pointer to other object attributes |
| 43 |
* \return true if both geometry_3dir_t are equal |
| 44 |
*/ |
| 45 |
static inline bool geometry_3dir_equals ( const geometry_3dir_t *this_, const geometry_3dir_t *that ); |
| 46 |
|
| 47 |
/*! |
| 48 |
* \brief gets first direction |
| 49 |
* |
| 50 |
* \param this_ pointer to own object attributes |
| 51 |
* \return the first direction |
| 52 |
*/ |
| 53 |
static inline geometry_direction_t geometry_3dir_get_first ( const geometry_3dir_t *this_ ); |
| 54 |
|
| 55 |
/*! |
| 56 |
* \brief gets second direction |
| 57 |
* |
| 58 |
* \param this_ pointer to own object attributes |
| 59 |
* \return the second direction |
| 60 |
*/ |
| 61 |
static inline geometry_direction_t geometry_3dir_get_second ( const geometry_3dir_t *this_ ); |
| 62 |
|
| 63 |
/*! |
| 64 |
* \brief gets third direction |
| 65 |
* |
| 66 |
* \param this_ pointer to own object attributes |
| 67 |
* \return the third direction |
| 68 |
*/ |
| 69 |
static inline geometry_direction_t geometry_3dir_get_third ( const geometry_3dir_t *this_ ); |
| 70 |
|
| 71 |
/*! |
| 72 |
* \brief checks if first direction is horizontal |
| 73 |
* |
| 74 |
* \param this_ pointer to own object attributes |
| 75 |
* \return true if the first direction is GEOMETRY_DIRECTION_LEFT or GEOMETRY_DIRECTION_RIGHT |
| 76 |
*/ |
| 77 |
static inline bool geometry_3dir_is_first_h ( const geometry_3dir_t *this_ ); |
| 78 |
|
| 79 |
/*! |
| 80 |
* \brief checks if first direction is vertical |
| 81 |
* |
| 82 |
* \param this_ pointer to own object attributes |
| 83 |
* \return true if the first direction is GEOMETRY_DIRECTION_UP or GEOMETRY_DIRECTION_DOWN |
| 84 |
*/ |
| 85 |
static inline bool geometry_3dir_is_first_v ( const geometry_3dir_t *this_ ); |
| 86 |
|
| 87 |
/*! |
| 88 |
* \brief checks if second direction is horizontal |
| 89 |
* |
| 90 |
* \param this_ pointer to own object attributes |
| 91 |
* \return true if the second direction is GEOMETRY_DIRECTION_LEFT or GEOMETRY_DIRECTION_RIGHT |
| 92 |
*/ |
| 93 |
static inline bool geometry_3dir_is_second_h ( const geometry_3dir_t *this_ ); |
| 94 |
|
| 95 |
/*! |
| 96 |
* \brief checks if second direction is vertical |
| 97 |
* |
| 98 |
* \param this_ pointer to own object attributes |
| 99 |
* \return true if the second direction is GEOMETRY_DIRECTION_UP or GEOMETRY_DIRECTION_DOWN |
| 100 |
*/ |
| 101 |
static inline bool geometry_3dir_is_second_v ( const geometry_3dir_t *this_ ); |
| 102 |
|
| 103 |
/*! |
| 104 |
* \brief checks if third direction is horizontal |
| 105 |
* |
| 106 |
* \param this_ pointer to own object attributes |
| 107 |
* \return true if the third direction is GEOMETRY_DIRECTION_LEFT or GEOMETRY_DIRECTION_RIGHT |
| 108 |
*/ |
| 109 |
static inline bool geometry_3dir_is_third_h ( const geometry_3dir_t *this_ ); |
| 110 |
|
| 111 |
/*! |
| 112 |
* \brief checks if third direction is vertical |
| 113 |
* |
| 114 |
* \param this_ pointer to own object attributes |
| 115 |
* \return true if the third direction is GEOMETRY_DIRECTION_UP or GEOMETRY_DIRECTION_DOWN |
| 116 |
*/ |
| 117 |
static inline bool geometry_3dir_is_third_v ( const geometry_3dir_t *this_ ); |
| 118 |
|
| 119 |
#include "geometry/geometry_3dir.inl" |
| 120 |
|
| 121 |
#endif /* GEOMETRY_3DIR_H */ |
| 122 |
|
| 123 |
|
| 124 |
/* |
| 125 |
Copyright 2021-2026 Andreas Warnke |
| 126 |
|
| 127 |
Licensed under the Apache License, Version 2.0 (the "License"); |
| 128 |
you may not use this file except in compliance with the License. |
| 129 |
You may obtain a copy of the License at |
| 130 |
|
| 131 |
http://www.apache.org/licenses/LICENSE-2.0 |
| 132 |
|
| 133 |
Unless required by applicable law or agreed to in writing, software |
| 134 |
distributed under the License is distributed on an "AS IS" BASIS, |
| 135 |
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 136 |
See the License for the specific language governing permissions and |
| 137 |
limitations under the License. |
| 138 |
*/ |