GDS-Render v1.2.1
bounding-box.h
Go to the documentation of this file.
1/*
2 * GDSII-Converter
3 * Copyright (C) 2018 Mario Hüttel <mario.huettel@gmx.net>
4 *
5 * This file is part of GDSII-Converter.
6 *
7 * GDSII-Converter is free software: you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
10 *
11 * GDSII-Converter is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 *
16 * You should have received a copy of the GNU General Public License
17 * along with GDSII-Converter. If not, see <http://www.gnu.org/licenses/>.
18 */
19
31#ifndef _BOUNDING_BOX_H_
32#define _BOUNDING_BOX_H_
33
34#include <glib.h>
36#include <stdbool.h>
37
60 struct _vectors {
71};
72
73/*
74 * @brief Pointer to a function that takes any pointer and converts this object to a vector_2d struct
75 */
76typedef void (*conv_generic_to_vector_2d_t)(void *, struct vector_2d *);
77
84void bounding_box_calculate_from_polygon(GList *vertices, conv_generic_to_vector_2d_t conv_func, union bounding_box *box);
85
91void bounding_box_update_with_box(union bounding_box *destination, union bounding_box *update);
92
101
108void bounding_box_update_with_point(union bounding_box *destination, conv_generic_to_vector_2d_t conv_func, void *pt);
109
115void bounding_box_get_all_points(struct vector_2d *points, union bounding_box *box);
116
137void bounding_box_apply_transform(double scale, double rotation_deg, bool flip_at_x, union bounding_box *box);
138
149void bounding_box_update_with_path(GList *vertices, double thickness, conv_generic_to_vector_2d_t conv_func, union bounding_box *box);
150
151#endif /* _BOUNDING_BOX_H_ */
152
void bounding_box_prepare_empty(union bounding_box *box)
Prepare an empty bounding box.
Definition: bounding-box.c:86
void bounding_box_get_all_points(struct vector_2d *points, union bounding_box *box)
Return all four corner points of a bounding box.
Definition: bounding-box.c:192
void bounding_box_update_with_path(GList *vertices, double thickness, conv_generic_to_vector_2d_t conv_func, union bounding_box *box)
Calculate the bounding box of a path and update the given bounding box.
Definition: bounding-box.c:148
void(* conv_generic_to_vector_2d_t)(void *, struct vector_2d *)
Definition: bounding-box.h:76
void bounding_box_apply_transform(double scale, double rotation_deg, bool flip_at_x, union bounding_box *box)
Apply transformations onto bounding box.
Definition: bounding-box.c:207
void bounding_box_calculate_from_polygon(GList *vertices, conv_generic_to_vector_2d_t conv_func, union bounding_box *box)
Calculate bounding box of polygon.
Definition: bounding-box.c:40
void bounding_box_update_with_point(union bounding_box *destination, conv_generic_to_vector_2d_t conv_func, void *pt)
Update bounding box with a point.
Definition: bounding-box.c:174
void bounding_box_update_with_box(union bounding_box *destination, union bounding_box *update)
Update an exisitng bounding box with another one.
Definition: bounding-box.c:71
Location vectors of upper right and lower left bounding box points.
Definition: bounding-box.h:60
struct vector_2d upper_right
Upper right point of the bounding box.
Definition: bounding-box.h:64
struct vector_2d lower_left
Lower left point of the bounding box.
Definition: bounding-box.h:62
Union describing a bounding box.
Definition: bounding-box.h:55
struct bounding_box::_vectors vectors
struct vector_2d vector_array[2]
Array of vectors representing a bounding box.
Definition: bounding-box.h:70
Header for 2D Vector operations.