Pipeline graphique
 Tout Structures de données Espaces de nommage Fichiers Fonctions Variables Définitions de type Énumérations Valeurs énumérées Macros
definition.h
Aller à la documentation de ce fichier.
1 /*
2  * File: definition.h
3  * Author: quartz
4  *
5  * Created on 27 octobre 2014, 22:41
6  */
7 
8 #ifndef DEFINITION_H
9 #define DEFINITION_H
10 #include <vector>
11 #include <utility>
12 #include <string>
13 #include <thread>
14 #include <mutex>
15 #include "libMath.h"
16 #include "modelloader/PlyLoader.h"
17 #include "modelloader/ReadMesh.h"
18 
19 
20 struct point
21 {
22  int x;
23  int y;
24  inline void print(){std::cout << "x : " << x << " y : " << y ;}
25 };
27 {
31  void print()
32  {
33  std::cout << "Print Facette: " << std::endl;
34  std::cout << "Sommet 1 :" << std::endl;
35  som1.print();
36  std::cout << "Sommet 2 :" << std::endl;
37  som2.print();
38  std::cout << "Sommet 3 :" << std::endl;
39  som3.print();
40  }
41 };
42 
43 
44 namespace defColor {
45  // color
46  struct color
47  {
48  unsigned char r,g,b,a;
49  inline void print(){std::cout << "r : " << r << " g : " << g << " b : " << b << " a : " << a << std::endl;}
50  };
51 
52 
53  const color
54  black={0x00,0x00,0x00,0xff}, cyan ={0x00,0xff,0xff,0xff},
55  red ={0xff,0x00,0x00,0xff}, magenta={0xff,0x00,0xff,0xff},
56  green={0x00,0xff,0x00,0xff}, yellow ={0xff,0xff,0xff,0xff},
57  blue ={0x00,0x00,0xff,0xff}, white ={0xff,0xff,0xff,0xff};
58 }
59 
60  struct rgb {
61  unsigned char r,g,b;
62 
63  inline bool operator==(const rgb &v) { if(r == v.r && g == v.g && b == v.b) return true; else return false; }
64  inline void set(unsigned char t){r=g=b=t;}
65  rgb(){r=g=b=0;}
66  rgb(unsigned char t){r=g=b=t;}
67  rgb(unsigned char r, unsigned char g ,unsigned char b){this->r = r;this->g=g ;this->b=b;}
68  inline void print(){std::cout << "r : " << r << " g : " << g << " b : " << b << std::endl;}
69 
70  };
71 
72 
73 
74 struct Sommet {
77 
81 
84 
86  float u,v;
88  float intensiter;
89 
91  {
92  pos.x = point.x;pos.y = point.y;pos.z = point.z;pos.w = 1.f;
93  norm.x = point.nx;norm.y = point.ny;norm.z = point.nz;
94  col.x = point.r;col.y = point.g;col.z = point.b;
95  u = point.u;v = point.v;
96  return *this;
97  }
98  inline Sommet & operator=(const Sommet & point)
99  {
100  pos = point.pos;
101  pos_originel.x = point.pos.x;
102  pos_originel.y = point.pos.y;
103  pos_originel.z = point.pos.z;
104  norm = point.norm;
105  col = point.col;
106  u = point.u;v = point.v;
107  return *this;
108  }
109  inline Sommet & operator=(const Mesh::VERTEX & point)
110  {
111  pos.x = point.P.x;pos.y = point.P.y;pos.z = point.P.z;pos.w = 1.f;
112  norm.x = point.N.x;norm.y = point.N.y;norm.z = point.N.z;
113  return *this;
114  }
115  inline void set(float x, float y, float z) { pos.x=x; pos.y=y; pos.z=z; pos.w = 1.f;}
116  void print()
117  {
118  std::cout << "Print Sommet: " << std::endl;
119  std::cout << "Position :" << std::endl;
120  pos.print();
121  std::cout << "Position Originel :" << std::endl;
122  pos_originel.print();
123  std::cout << "Normale :" << std::endl;
124  norm.print();
125  std::cout << "Intensiter :" << intensiter << std::endl;
126  }
127 
128 } ;
129 
130 struct pixelIN
131 {
135  inline void print()
136  {
137  std::cout << "Print PixelIN: " << std::endl;
138  std::cout << "Position: " << std::endl;
139  P.print();
140  }
141 };
142 
143 struct pixelOUT
144 {
146  inline void print()
147  {
148  std::cout << "Print PixelOUT: " << std::endl;
149  std::cout << "Couleur: " << std::endl;
150  col.print();
151  }
152 };
153 #endif /* DEFINITION_H */
154 
void print()
fixe la valeur du vecteur
Definition: definition.h:116
Math::vecteur3d norm
Normale au sommet.
Definition: definition.h:80
Sommet & operator=(const Sommet &point)
Definition: definition.h:98
void print()
Definition: libMath.h:27
const color white
Definition: definition.h:57
float v
Definition: definition.h:86
void print()
Definition: libMath.h:126
Definition: pgm.h:5
const color cyan
Definition: definition.h:54
Math::vecteur3d col
Couleur au sommet.
Definition: definition.h:83
Math::vecteur3d pos_originel
Definition: definition.h:78
unsigned char r
Definition: definition.h:61
point som2
Definition: definition.h:29
VECTOR N
Definition: ReadMesh.h:42
rgb(unsigned char r, unsigned char g, unsigned char b)
Definition: definition.h:67
unsigned char b
Definition: definition.h:48
unsigned char a
Definition: definition.h:48
int x
Definition: definition.h:22
unsigned char r
Definition: definition.h:48
VECTOR P
Definition: ReadMesh.h:42
structure pour les vecteurs 4D (de taille 4 = 3D + composante w).
Definition: libMath.h:95
const color red
Definition: definition.h:55
void print()
Definition: libMath.h:74
Sommet * sommet
Definition: definition.h:134
structure pour les vecteurs 3D (de taille 3).
Definition: libMath.h:21
float y
Definition: ReadMesh.h:29
point som3
Definition: definition.h:30
void set(unsigned char t)
Definition: definition.h:64
Sommet & operator=(const Ply::POINT_PLY &point)
Definition: definition.h:90
structure de sommet (position+normale)
Definition: ReadMesh.h:42
rgb(unsigned char t)
Definition: definition.h:66
void set(float x, float y, float z)
Definition: definition.h:115
bool operator==(const rgb &v)
Definition: definition.h:63
void print()
Definition: definition.h:68
const color green
Definition: definition.h:56
Sommet & operator=(const Mesh::VERTEX &point)
Definition: definition.h:109
const color black
Definition: definition.h:54
unsigned char g
Definition: definition.h:48
const color blue
Definition: definition.h:57
unsigned char g
Definition: definition.h:61
void print()
Definition: definition.h:31
float z
Definition: ReadMesh.h:29
void print()
Definition: definition.h:135
FaceteEcran * facette
Definition: definition.h:133
const color magenta
Definition: definition.h:55
Math::coord2d P
Definition: definition.h:132
Math::vecteur4d pos
Coordonnées du sommet.
Definition: definition.h:76
point som1
Definition: definition.h:28
unsigned char b
Definition: definition.h:61
const color yellow
Definition: definition.h:56
void print()
Definition: definition.h:146
void print()
Definition: definition.h:24
structure utilis�e pour lire un fichier au format PLY
Definition: PlyLoader.h:13
float intensiter
Couleur au sommet.
Definition: definition.h:88
float x
Definition: ReadMesh.h:29
int y
Definition: definition.h:23
Definition: definition.h:60
float u
Coordonnées de texture (pas de modéle disponible)
Definition: definition.h:86
rgb()
Definition: definition.h:65