ViSP  2.8.0
vpView.h
1 /****************************************************************************
2  *
3  * $Id: vpView.h 4056 2013-01-05 13:04:42Z fspindle $
4  *
5  * This file is part of the ViSP software.
6  * Copyright (C) 2005 - 2013 by INRIA. All rights reserved.
7  *
8  * This software is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU General Public License
10  * ("GPL") version 2 as published by the Free Software Foundation.
11  * See the file LICENSE.txt at the root directory of this source
12  * distribution for additional information about the GNU GPL.
13  *
14  * For using ViSP with software that can not be combined with the GNU
15  * GPL, please contact INRIA about acquiring a ViSP Professional
16  * Edition License.
17  *
18  * See http://www.irisa.fr/lagadic/visp/visp.html for more information.
19  *
20  * This software was developed at:
21  * INRIA Rennes - Bretagne Atlantique
22  * Campus Universitaire de Beaulieu
23  * 35042 Rennes Cedex
24  * France
25  * http://www.irisa.fr/lagadic
26  *
27  * If you have questions regarding the use of this file, please contact
28  * INRIA at visp@inria.fr
29  *
30  * This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
31  * WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
32  *
33  *
34  * Description:
35  * Le module "view.h" contient les Macros et les types
36  * des parametres de visualisation et de transformation 3D.
37  *
38  * Authors:
39  * Jean-Luc CORRE
40  *
41  *****************************************************************************/
42 
43 #ifndef vpView_H
44 #define vpView_H
45 
46 #include <visp/vpConfig.h>
47 
48 #ifndef DOXYGEN_SHOULD_SKIP_THIS
49 
50 /*
51  * Macros de numerotation des 6 plans de decoupage :
52  * - Les 6 plans de clipping definissent le volume canonique
53  * de la pyramide de vision dans lequel la scene est visible.
54  * - les 6 plans ont pour equations :
55  * Plan dessus : W = Y
56  * Plan dessous : -W = Y
57  * Plan droit : W = X
58  * Plan gauche : -W = X
59  * Plan arriere : W = Z
60  * Plan avant : W = 0
61  */
62 #define PLANE_ABOVE 0
63 #define PLANE_BELOW 1
64 #define PLANE_RIGHT 2
65 #define PLANE_LEFT 3
66 #define PLANE_BACK 4
67 #define PLANE_FRONT 5
68 #define PLANE_NBR 6
69 
70 /*
71  * Macros de positionnement des points 4D :
72  * Le positionnement d'un point 4D dans l'espace de l'observateur virtuel
73  * se fait par rapport aux 6 plans de decoupage.
74  * A chaque point 4D on associe 6 bits, un par plan de decoupage.
75  */
76 #define IS_INSIDE 0x00
77 #define IS_ABOVE 0x01
78 #define IS_BELOW 0x02
79 #define IS_RIGHT 0x04
80 #define IS_LEFT 0x08
81 #define IS_BACK 0x10
82 #define IS_FRONT 0x20
83 
84 #define vpDEFAULT_REMOVE IS_INSIDE
85 
86 #define PARALLEL 0
87 #define PERSPECTIVE 1
88 
89 #define vpDEFAULT_EYE { 0.0, 0.0, 1.0 }
90 #define vpDEFAULT_TARGET { 0.0, 0.0, 0.0 }
91 #define vpDEFAULT_FOCAL 1.0
92 #define vpDEFAULT_ANGLE 45.0
93 #define vpDEFAULT_TWIST 0.0
94 #define vpDEFAULT_SPEED 0.0
95 #define vpDEFAULT_CAMERA { vpDEFAULT_EYE, vpDEFAULT_TARGET,\
96  vpDEFAULT_FOCAL,vpDEFAULT_ANGLE, vpDEFAULT_TWIST,\
97  vpDEFAULT_SPEED }
98 
99 #define vpDEFAULT_COP { 0.0, 0.0, 1.0 }
100 #define vpDEFAULT_VRP { 0.0, 0.0, 0.0 }
101 #define vpDEFAULT_VPN { 0.0, 0.0,-1.0 }
102 #define vpDEFAULT_VUP { 0.0, 1.0, 0.0 }
103 #define vpDEFAULT_VWD {-1.0, 1.0,-1.0, 1.0 }
104 #define vpDEFAULT_DEPTH { 0.0, 1.0 }
105 #define vpDEFAULT_TYPE PERSPECTIVE
106 
107 #define vpDEFAULT_VIEW { vpDEFAULT_TYPE,\
108  vpDEFAULT_COP, vpDEFAULT_VRP,\
109  vpDEFAULT_VPN, vpDEFAULT_VUP,\
110  vpDEFAULT_VWD, vpDEFAULT_DEPTH }
111 
112 #define vpDEFAULT_WC { 1.0, 0.0, 0.0, 0.0,\
113  0.0, 1.0, 0.0, 0.0,\
114  0.0, 0.0, 1.0, 0.0,\
115  0.0, 0.0, 0.0, 1.0 }
116 
117 
118 /*
119  * CAMERA PARAMETERS
120  * _________________
121  *
122  * La structure "Camera_parameters" definit les parametres de la camera.
123  * eye Position de l'oeil ou de la camera.
124  * target Position de la cible ou du point visee dans la scene.
125  * focal Distance eye-target
126  * angle Angle d'ouverture en degres.
127  * twist Angle de rotation sur l'axe de visee (eye,target) en degres.
128  * speed Vitesse sur l'axe de visee (eye,target).
129  */
130 typedef struct {
131  Point3f eye; /* position de l'observateur */
132  Point3f target; /* point vise */
133  float focal; /* focale de la camera */
134  float angle; /* angle d'ouverture */
135  float twist; /* rotation sur l'axe de visee */
136  float speed; /* vitesse sur l'axe de visee */
137 } Camera_parameters;
138 
139 typedef struct {
140  float umin,umax; /* bords gauche et droit */
141  float vmin,vmax; /* bords inferieur et superieur */
142 } View_window;
143 
144 typedef struct {
145  float front; /* plan avant ("hither") */
146  float back; /* plan arriere ("yon") */
147 } View_depth;
148 
149 typedef struct {
150  Type type; /* type de la projection */
151  Point3f cop; /* centre de projection */
152  Point3f vrp; /* point de reference de visee */
153  Vector vpn; /* vecteur nomal au plan */
154  Vector vup; /* vecteur indiquant le "haut" */
155  View_window vwd; /* fenetre de projection */
156  View_depth depth; /* profondeurs de decoupages */
157 } View_parameters;
158 
159 #endif
160 #endif
161