Visual Servoing Platform  version 3.0.1
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
vpWireFrameSimulatorTypes.h
1 /****************************************************************************
2  *
3  * This file is part of the ViSP software.
4  * Copyright (C) 2005 - 2017 by Inria. All rights reserved.
5  *
6  * This software is free software; you can redistribute it and/or
7  * modify it under the terms of the GNU General Public License
8  * ("GPL") version 2 as published by the Free Software Foundation.
9  * See the file LICENSE.txt at the root directory of this source
10  * distribution for additional information about the GNU GPL.
11  *
12  * For using ViSP with software that can not be combined with the GNU
13  * GPL, please contact Inria about acquiring a ViSP Professional
14  * Edition License.
15  *
16  * See http://visp.inria.fr for more information.
17  *
18  * This software was developed at:
19  * Inria Rennes - Bretagne Atlantique
20  * Campus Universitaire de Beaulieu
21  * 35042 Rennes Cedex
22  * France
23  *
24  * If you have questions regarding the use of this file, please contact
25  * Inria at visp@inria.fr
26  *
27  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
28  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
29  *
30  * Description:
31  * Wire frame simulator
32  *
33  * Authors:
34  * Nicolas Melchior
35  *
36  *****************************************************************************/
37 
38 
39 #ifndef vpWireFrameSimulatorTypes_h
40 #define vpWireFrameSimulatorTypes_h
41 
42 #include <visp3/core/vpConfig.h>
43 
44 #ifndef DOXYGEN_SHOULD_SKIP_THIS
45 
46 typedef unsigned short Index;
47 typedef char Type;
48 /*
49  * MATRIX
50  * ______
51  *
52  * Matrice homogene ou non.
53  * | Rotation | 0 |
54  * Matrice non homogene = | 3x3 | 0 |
55  * |-------------| 0 |
56  * | Translation | 1 |
57  */
58 typedef float Matrix[4][4];
59 
60 #define DEFAULT_VSIZE 4
61 
62 /*
63  * Vertex_list :
64  * Pour optimiser l'allocation et la liberation memoire d'une liste de sommets:
65  * si (nbr > DEFAULT_VSIZE)
66  * | alors ptr est alloue et libere dynamiquement
67  * | sinon ptr = tbl
68  * fsi;
69  */
70 typedef struct {
71  Index nbr; /* nombre de sommets */
72  Index *ptr; /* liste dynamique */
73  Index tbl[DEFAULT_VSIZE];
74 } Vertex_list;
75 
76 typedef struct {
77  unsigned is_polygonal:1; /* face polygonale */
78  unsigned is_visible :1; /* face affichable */
79 #ifdef face_edge
80  Edge_list edge; /* liste d'aretes */
81 #endif //face_edge
82  Vertex_list vertex; /* liste de sommets */
83 #ifdef face_normal
84  Vector normal; /* vecteur normal */
85 #endif //face_normal
86 } Face;
87 
88 typedef struct {
89  Index nbr; /* nombre de faces */
90  Face *ptr; /* liste dynamique */
91 } Face_list;
92 
93 typedef struct {
94  float x, y, z;
95 } Point3f;
96 
97 typedef struct {
98  Index nbr; /* nombre de points */
99  Point3f *ptr; /* liste dynamique */
100 } Point3f_list;
101 
102 typedef struct {
103  unsigned is_display :1; /* surface affichable */
104  unsigned is_polygonal:1; /* surface polyedrique */
105  Type type; /* type de la primitive */
106 #ifdef face_edge
107  Edge_list edge; /* liste d'aretes */
108 #endif //face_edge
109  Face_list face; /* liste de faces */
110  Point3f_list point; /* points aux sommets */
111 #ifdef face_normal
112  Vector_list normal; /* normales aux sommets */
113 #endif //face_normal
114 } Bound;
115 
116 typedef struct {
117  Index nbr; /* nombre de surfaces */
118  Bound *ptr; /* liste dynamique */
119 } Bound_list;
120 
121 typedef struct {
122  char *name; /* nom de la scene */
123  Bound_list bound; /* liste de surfaces */
124 } Bound_scene;
125 
126 #endif
127 #endif