Visual Servoing Platform  version 3.6.1 under development (2024-11-15)
vpBound.h
1 /****************************************************************************
2  *
3  * ViSP, open source Visual Servoing Platform software.
4  * Copyright (C) 2005 - 2023 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License as published by
8  * the Free Software Foundation; either version 2 of the License, or
9  * (at your option) any later version.
10  * See the file LICENSE.txt at the root directory of this source
11  * distribution for additional information about the GNU GPL.
12  *
13  * For using ViSP with software that can not be combined with the GNU
14  * GPL, please contact Inria about acquiring a ViSP Professional
15  * Edition License.
16  *
17  * See https://visp.inria.fr for more information.
18  *
19  * This software was developed at:
20  * Inria Rennes - Bretagne Atlantique
21  * Campus Universitaire de Beaulieu
22  * 35042 Rennes Cedex
23  * France
24  *
25  * If you have questions regarding the use of this file, please contact
26  * Inria at visp@inria.fr
27  *
28  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
29  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
30  *
31  * Description:
32  * Le fichier "bound.h" contient les macros et le types
33  * utilises par le modele geometrique surfacique polygonale 3D.
34  *
35  * Authors:
36  * Jean-Luc CORRE
37  *
38 *****************************************************************************/
39 
40 #ifndef vpBound_H
41 #define vpBound_H
42 
43 #include <visp3/core/vpConfig.h>
44 
45 #ifndef DOXYGEN_SHOULD_SKIP_THIS
46 
47 #include "vpArit.h"
48 #include "vpMy.h"
49 #include <visp3/robot/vpWireFrameSimulatorTypes.h>
50 
51 #define START_ARG 0
52 #define NEXT_ARG 1
53 
54 #define BND_NULL (-1)
55 
56 #define BND_BLOCK 0
57 #define BND_CARDIOIDE 1
58 #define BND_CONE 2
59 #define BND_CYLINDER 3
60 #define BND_SPHERE 4
61 #define BND_TORUS 5
62 #define BND_WEDGE 6
63 
64 #define BND_F3 7
65 #define BND_F4 8
66 
67 #define BND_GRID 9
68 #define BND_PIPE 10
69 #define BND_SECTION 11
70 
71 #define BND_NBR 12
72 
73 #define BOUND_NBR 1024
74 #define FACE_NBR 6144 /* Tailles de tableaux */
75 #define VERTEX_NBR 16
76 #define POINT_NBR 6144
77 #ifdef face_normal
78 #define VECTOR_NBR 6144
79 #endif // face_normal
80 
81 BEGIN_VISP_NAMESPACE
82 #ifdef face_edge
83 typedef struct
84 {
85  Index v0, v1; /* extremites */
86  Index f0, f1; /* faces */
87 } Edge;
88 #endif // face_edge
89 
90 #ifdef face_edge
91 typedef struct
92 {
93  Index nbr; /* nombre d'aretes */
94  Edge *ptr; /* liste dynamique */
95 } Edge_list;
96 #endif // face_edge
97 
98 #ifdef face_normal
99 typedef struct
100 {
101  Index nbr; /* nombre de vecteurs */
102  Vector *ptr; /* liste dynamique */
103 } Vector_list;
104 #endif // face_normal
105 
106 typedef struct
107 {
108  float xmin, xmax; /* bornes sur l'axe x */
109  float ymin, ymax; /* bornes sur l'axe y */
110  float zmin, zmax; /* bornes sur l'axe z */
111 } Bounding_box;
112 
113 typedef struct
114 {
115  Index nbr; /* nombre de scenes */
116  Bound_scene *ptr; /* liste dynamique */
117 } Bound_scene_list;
118 
119 void free_Bound(Bound *bp);
120 void free_huge_Bound(Bound *bp);
121 void free_Bound_scene(Bound_scene *bsp);
122 void malloc_Bound(Bound *bp, Type type, int polygonal, Index fn, Index pn);
123 void malloc_huge_Bound(Bound *bp);
124 void malloc_Bound_scene(Bound_scene *bsp, const char *name, Index bn);
125 END_VISP_NAMESPACE
126 #endif
127 #endif