Ajout de l'ensemble du workspace.
[GPU.git] / WCudaMSE / API_Bilat_Image_GL / INC / common / Graphic2Ds.h
1 #ifndef GRAPHIC2DS_H
2 #define GRAPHIC2DS_H
3
4 #include "envGLImage.h"
5 #include "Panel_A.h"
6 #include "Font_A.h"
7 #include "Color3f.h"
8 #include "Primitives_A.h"
9
10 #include <string>
11 #include <queue>
12
13 using std::queue;
14 using std::string;
15
16 /*----------------------------------------------------------------------*\
17 |* Declaration *|
18 \*---------------------------------------------------------------------*/
19
20 /*--------------------------------------*\
21 |* Public *|
22 \*-------------------------------------*/
23
24 class CBI_GLIMAGE Graphic2Ds
25 {
26 public:
27
28 /*--------------------------------------*\
29 |* Constructor *|
30 \*-------------------------------------*/
31
32 Graphic2Ds(int width, int height);
33
34 /*--------------------------------------*\
35 |* Destructor *|
36 \*-------------------------------------*/
37
38 virtual ~Graphic2Ds();
39
40 /*--------------------------------------*\
41 |* Methodes *|
42 \*-------------------------------------*/
43
44 /*--------------*\
45 |* User *|
46 \*-------------*/
47
48 public:
49
50 void setColor(Colorf colorf);
51
52 void setColorRGB(float r01, float g01, float b01, float a01 = 1.0f);
53
54 void setColorHSB(float h01, float s01, float b01, float a01 = 1.0f);
55
56 void drawLigne(int x1, int y1, int x2, int y2);
57
58 void drawVerticalLigne(int x, int y, int height);
59
60 void drawHorizontalLigne(int x, int y, int width);
61
62 void drawWiredRect2D(int x, int y, int width, int height);
63
64 void drawRect2D(int x, int y, int width, int height);
65
66 void drawText(int x, int y, string texte, const Font_A* font);
67
68 void drawTitleTop(string texte, const Font_A* font);
69
70 void drawTitleMiddle(string texte, const Font_A* font);
71
72 void drawTitleBottom(string texte, const Font_A* font);
73
74 const Font_A* getFont(string fontname);
75
76 const Font_A* getFont(FontType type = HELVETICA_12);
77
78 int texteWidth(string texte, const Font_A* font);
79
80 int texteHeight(string texte, const Font_A* font);
81
82 /*--------------*\
83 |* Developer *|
84 \*--------------*/
85
86 unsigned int getSize();
87
88 bool isEmpty();
89
90 void reshape(int width, int height);
91
92 void startPainPrimitive(Panel_A &ptrPanel);
93
94 void drawPrimitive(Primitives_A* primitive);
95
96 Primitives_A* popPrimitive();
97
98 Colorf popColor();
99
100 /*--------------------------------------*\
101 |* Attributs *|
102 \*-------------------------------------*/
103 private:
104
105 // Inputs
106 int width;
107 int height;
108 Panel_A* ptrPanel;
109
110 // Tools
111 Colorf currentColor;
112 queue<Colorf> queueColors;
113 queue<Primitives_A*> queuePrimitives;
114
115 int frameWidth;
116 int frameHeight;
117 };
118
119 #endif
120
121 /*----------------------------------------------------------------------*\
122 |* End *|
123 \*---------------------------------------------------------------------*/
124