Debian Codegraph @

pencil/include/geometry/geometry_grid.h

raw
1 /* File: geometry_grid.h; Copyright and License: see below */
2
3 #ifndef GEOMETRY_GRID_H
4 #define GEOMETRY_GRID_H
5
6 /* public file for the doxygen documentation: */
7 /*!
8 * \file
9 * \brief Maps 1/2 dimensional order-values to 1/2 dimensional locations
10 */
11
12 #include "geometry/geometry_non_linear_scale.h"
13
14 /*!
15 * \brief list of possible kinds of geometry_grid_t
16 */
17 enum geometry_grid_kind_enum {
18 GEOMETRY_GRID_KIND_0, /*!< no dimension exists */
19 GEOMETRY_GRID_KIND_X, /*!< only x dimension exists */
20 GEOMETRY_GRID_KIND_Y, /*!< only y dimension exists */
21 GEOMETRY_GRID_KIND_XY, /*!< x/y dimensions exists */
22 };
23
24 typedef enum geometry_grid_kind_enum geometry_grid_kind_t;
25
26 /*!
27 * \brief attributes of a grid
28 */
29 struct geometry_grid_struct {
30 geometry_grid_kind_t kind; /*!< number of dimensions */
31 geometry_non_linear_scale_t x_scale; /*!< mapping of order values to locations in x dimension */
32 geometry_non_linear_scale_t y_scale; /*!< mapping of order values to locations in y dimension */
33 };
34
35 typedef struct geometry_grid_struct geometry_grid_t;
36
37 /*!
38 * \brief initializes the geometry_grid_t struct
39 *
40 * \param this_ pointer to own object attributes
41 * \param kind lnumber of dimensions
42 */
43 static inline void geometry_grid_init ( geometry_grid_t *this_, geometry_grid_kind_t kind );
44
45 /*!
46 * \brief re-initializes the geometry_grid_t struct
47 *
48 * \param this_ pointer to own object attributes
49 * \param kind number of dimensions
50 */
51 static inline void geometry_grid_reinit ( geometry_grid_t *this_, geometry_grid_kind_t kind );
52
53 /*!
54 * \brief destroys the geometry_grid_t struct
55 *
56 * \param this_ pointer to own object attributes
57 */
58 static inline void geometry_grid_destroy ( geometry_grid_t *this_ );
59
60 /*!
61 * \brief prints the geometry_grid_t struct to the trace output
62 *
63 * \param this_ pointer to own object attributes
64 */
65 static inline void geometry_grid_trace ( const geometry_grid_t *this_ );
66
67 /*!
68 * \brief gets the kind of geometry_grid_t
69 *
70 * \param this_ pointer to own object attributes
71 * \return number of dimensions
72 */
73 static inline geometry_grid_kind_t geometry_grid_get_kind ( const geometry_grid_t *this_ );
74
75 /*!
76 * \brief gets a scale for one dimension
77 *
78 * \param this_ pointer to own object attributes
79 * \return mapping of order values to locations in x dimension
80 */
81 static inline geometry_non_linear_scale_t * geometry_grid_get_x_scale_ptr ( geometry_grid_t *this_ );
82
83 /*!
84 * \brief gets a scale for one dimension
85 *
86 * \param this_ pointer to own object attributes
87 * \return mapping of order values to locations in x dimension
88 */
89 static inline const geometry_non_linear_scale_t * geometry_grid_get_x_scale_const ( const geometry_grid_t *this_ );
90
91 /*!
92 * \brief gets a scale for one dimension
93 *
94 * \param this_ pointer to own object attributes
95 * \return mapping of order values to locations in y dimension
96 */
97 static inline geometry_non_linear_scale_t * geometry_grid_get_y_scale_ptr ( geometry_grid_t *this_ );
98
99 /*!
100 * \brief gets a scale for one dimension
101 *
102 * \param this_ pointer to own object attributes
103 * \return mapping of order values to locations in y dimension
104 */
105 static inline const geometry_non_linear_scale_t * geometry_grid_get_y_scale_const ( const geometry_grid_t *this_ );
106
107 #include "geometry/geometry_grid.inl"
108
109 #endif /* GEOMETRY_GRID_H */
110
111
112 /*
113 Copyright 2024-2026 Andreas Warnke
114
115 Licensed under the Apache License, Version 2.0 (the "License");
116 you may not use this file except in compliance with the License.
117 You may obtain a copy of the License at
118
119 http://www.apache.org/licenses/LICENSE-2.0
120
121 Unless required by applicable law or agreed to in writing, software
122 distributed under the License is distributed on an "AS IS" BASIS,
123 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
124 See the License for the specific language governing permissions and
125 limitations under the License.
126 */